MATLAB: Grid through a center point

#grid #center point

I need do a grid that adaptes to my structure like the figure in attach. However i need establish a metric for the point in red that varies for different cases to stay always in the center of a bin, so I need construct the grid through the coordinates of this point. Can you help me?
Thanks.

Best Answer

I'm not sure what you're asking. Do you want that blue region to be like a solid region, and then find the centroid of it??? If so, use poly2mask(), activecontour(), bwconncomp(), and then regionprops().