MATLAB Answers


How to fix a pivot element in a MASK to some particular entry in an Image and compute SubImages

Asked by xplore29 on 26 May 2013

I have a binary mxn matrix called Image. I have a pxq mask which has a pivot pixel as well. I want to apply this mask to the image in such a way that at each instance I get a pxq sub-image of the Image. I want to first fix the pivot pixel of the mask to some (i,j) location in image and then take out the portion of the image. The only job of mask is to take out the chunk of image and ignore the rest of the image.

for example

Image = [ 1 2 3 4 5; 6 7 8 9 10; 11 12 13 14 15; 16 17 18 19 20]

Mask = [1 2 3; 1 2 3]

Pivot element = Mask(2,2)

SubImage_1 = [1 2 3; 6 7 8] (pivot element is locked to Image(2,2))

SubImage_2 = [6 7;11 12;16 17] (pivot element is locked to Image(3,2) Mask is rotated by 90 and subimage_2 is stored)

Foe each (i,j) location in Image the orientation of mask of mask is known to us. How can I fix the pivot element to (i,j) location and do some binary operation to formulate SubImages.


Log in to comment.

0 Answers

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!