Find surrounding and outer pixels

조회 수: 6 (최근 30일)
Ciara
Ciara 2014년 4월 4일
댓글: sensation 2017년 2월 7일
Hi,
I have used a 16x16 window to scan an entire image in matlab. The value of the largest pixel is stored as well as its position on the image.
I need to find the pixels surrounding the largest pixels and check if they are as bright as it. I also need to find the outer pixels and check if they are darker than the largest pixel.
Could anyone tell me how to find the surrounding pixels and the outer pixels?
Thanks.

답변 (1개)

Image Analyst
Image Analyst 2014년 4월 4일
What do you mean by largest pixel? All pixels are the same size, aren't they? Do you mean brightest? You can find the brightest pixel in a neighborhood in two ways, depending on exactly how you define brightest: imregionalmax() and imdilate(). You can cast that image to double and subtract it from the original image to see how a pixel differs from the neighborhood.
  댓글 수: 6
Image Analyst
Image Analyst 2014년 4월 7일
Did this answer your question Ciara?
sensation
sensation 2017년 2월 7일
Hi,
I thanks for this info. I was using part of your code to find the 3x3 neireast matrix.
And now I am tryying to find the neareast number and its id betweeen two different size arrays?
for instance, I have an array: A: 540x1 values; and another array B, 540 X 4860 consisted of 540 blocks (each one represented by 3x3 matrix-so 9X540=4860).
What I want to do is to search through each of these 9 area block numbers, compare it with single number from B and retrieve that area.
A: 45 etc X 540
B: 5 6 9
4 15 16
21 55 2
etc X 540 blocks like this;
result: would be 55 and id=8 since the counting in my code goes like:
234
516
789
for instance if I give some fix row and col: eg row=15 and col=12 I get a good result with:
[value,index]=min(abs(neighbors_area(:)-100));
but when I want to do for the whole data set, there is an error that matrix sizes doesnt match.
Any clue?
Thanks

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by