blocksub = sub2blocksub(bim,pixelsub)
converts the pixel subscripts in pixelsub to the block subscripts
identifying the block containing the specified pixel.
blocksub = sub2blocksub(bim,pixelsub,'Level',L)
additionally specifies the resolution level to use in a multiresolution image. By default,
Level is 1.
Create a small sample image as a 5-by-7 matrix of zeros. Here is an illustration of the small sample image, with the pixel coordinates of the four corners provided.
Create a blocked image from the sample image, specifying a 2-by-2 block size. To create this blocked image, use blockedImage in write mode.
Here is an illustration of the blocked image overlaid on the original image. It is divided into 2-by-2 blocks. In the diagram, each block contains its block coordinates.
To determine which block contains a particular pixel, convert the pixel subscripts into block subscripts by using the sub2blocksub function. By default, if the image is a multiresolution image, then sub2blocksub uses pixel coordinates from coarsest level, although you can specify any level. Since the sample image has only one resolution level, sub2blocksub converts level 1.
Subscripts of the block that contains the pixel, returned as a
K-by-N integer-valued matrix, for an
N-dimensional blocked image. K is the number of
coordinates.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.