How do I get windows of several feature points in an image, and return the intensity of all the pixels in that window?
2 次查看(过去 30 天)
显示 更早的评论
Hi! I have a image (2d double array) and a bunch of feature points (x and y coordinates, bule crosses in the image). Now I want to get 5-by-5 windows of those feature points in an image, and return the intensity of all the pixels in that window. I know "meshgrid" is a good function, but I failed. Is there any build-in function in matlab I can use or what should I do to meet the requirement? Thank you very much.
Say M*N is the size of the image, X1 and Y1 are the coordinates of the cross points
0 个评论
回答(1 个)
Mann Baidi
2023-9-11
Hi Yuhong,
I understand that you want to get the intensity of pixel of a 5x5 window size window at specific pixels. For this we can try out the following code:
value = I(y, x);
values = I(y-5:y+5, x-5:x+5);
The “values” will contain the intensity of the pixels in the window.
Hope this helps!
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!