how to find the neighbour pixel having maximum value?

조회 수: 5 (최근 30일)
sheno39
sheno39 2013년 9월 23일
댓글: sheno39 2013년 9월 30일
i have calculated the parzen density for an image. Now i have to find the maximum valued pixel of an image in the 3x3 matrix window
  댓글 수: 6
sheno39
sheno39 2013년 9월 30일
thank you sir.

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

채택된 답변

Image Analyst
Image Analyst 2013년 9월 23일
out = imdilate(grayImage, true(3)); % In the IMage Processing Toolbox.
  댓글 수: 1
Image Analyst
Image Analyst 2013년 9월 24일
편집: Image Analyst 2013년 9월 24일
Your original question said to look in the 3 by 3 window - all 9 pixels. But your latest comment says to look only to the 8 neighbors and don't include the central pixel. So in that case, you need to make a "hole" in the center of the structuring element:
out = imdilate(grayImage, [1,1,1;1,0,1;1,1,1]);
The above looks only at the 8 pixels on the outer border, and does not look at the 9th pixel in the very center.

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by