MATLAB: For each X point in the attached image, I want to generate an image patch by 25×25 square window, with the annotated coordinates as the center. Would you please help me? thanks very much

digital image processingfundus imageimage analysisimage processingimage segmentation

Please let me know if you need more explanation.

Best Answer

Try this:
for k = 1 : length(x)
thisx = round(x(k));
thisy = round(y(k));
thisPatch = imcrop(rgbImage, [thisx-12, thisy-12, 25, 25]);
% Now do something with thisPatch....
end
You need to take care to clip row and column to the edge of the image in case your 25x25 window would go outside the image. I didn't do that part for you.