Get the current image block (8x8) that contains a certain pixel (x,y)

In my MATLAB application I load an image. Let say we divide the image up in 8x8 blocks (8pixels by 8pixels = 64 pixel block).

I need to get the positions of all the pixels in the current block that contain a single given pixel position.

Hope my question is understandable, let me know if it isn't.
Who is Participating?
thehagmanConnect With a Mentor Commented:
Calculate x1 = x - (x%8) and y1 = y-(y%8), wher % is the modulo operator.
Then the containing 8x8 block is given by coordinates x1,...,x1+7 and y1,...,y1+7.
Interesting question....

Perhaps if this question is still open when I return this evening, I may look at it again.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.