MATLAB: Gridded An Irregular Area With Matlab

Image Processing Toolbox

Dear All..
I have a problem with my final project about matlab. Those problem are : 1. How can i divide an irregular area into a small blocks (grid) ? Please, can anyone give me a code? Before, i built the irregular area by connected point to point coordinates of the X an Y axis. 2. That code can work when we input a size of the grid, so it's automatically generated by the size that we given. 3. Everyone, please help me. The date of my deadline already close enough.
here, i attach a map figure of irregular area that i mean above. i'm very thankful for your help.
sincerely, Allice Ellisa

Best Answer

Please plot your original image of the irregular regions, without the spots and axes, so we can try some things.
If you simply want gridlines overlaid on the image, you can do
grid on;
What do you want to do when you're near the edge of an irregular region and the 8 by 8 window would go outside the region? Do you just want a list of those pixels that do lie inside the region?