필터 지우기
필터 지우기

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

답변 (1개)

Mann Baidi
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!

카테고리

Help CenterFile Exchange에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by