how to find the neighbour pixel having maximum value?

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 comentarios

Jan
Jan el 23 de Sept. de 2013
This question is too vague to post a meaningful answer. It matters in which format the input data are available.
sheno39
sheno39 el 24 de Sept. de 2013
sir, i have the input image of 256x256 size. i want to find maximum neighboring pixel for each pixel in a 3x3.. (i.e) each pixel have 8 surrounding pixel, in that 8 pixel i have to find the pixel having maximum value. likewise i have to find for all pixels in the image..
kalai
kalai el 26 de Sept. de 2013
By using for loop, for every window arrange your pixels in an array, find the maximum one. And replace that in current pixel(center pixel of your window) position.
Instead of that you can use 'blockproc' MATLAB inbuilt function.
sheno39
sheno39 el 26 de Sept. de 2013
thank you. plz help me to code this.
Image Analyst
Image Analyst el 26 de Sept. de 2013
See attached demos below.
sheno39
sheno39 el 30 de Sept. de 2013
thank you sir.

Iniciar sesión para comentar.

 Respuesta aceptada

Image Analyst
Image Analyst el 23 de Sept. de 2013
out = imdilate(grayImage, true(3)); % In the IMage Processing Toolbox.

1 comentario

Image Analyst
Image Analyst el 24 de Sept. de 2013
Editada: Image Analyst el 24 de Sept. de 2013
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.

Iniciar sesión para comentar.

Más respuestas (0)

Preguntada:

el 23 de Sept. de 2013

Comentada:

el 30 de Sept. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by