Borrar filtros
Borrar filtros

Connected Neighbourhood / Regional Maxima - Image Processing

3 visualizaciones (últimos 30 días)
Sriram
Sriram el 7 de Nov. de 2012
Hi there,
I am not able to understand how imregionalmax works for finding the regional maxima. Can anybody brief me.!! Mainly not clear about the connected neighbourhood.
Thanks for the time.

Respuestas (5)

Harshit
Harshit el 7 de Nov. de 2012
Hi Sriram, 8-Connected neighborhood means the pixels in left,right,up,down,left up, left down,up right and down right. It works by finding all the connected component of same intensity say the 3x3 matrix of 22. And then checking if these components have a connectivity with intensity value higher. Connectivity now means connectivity by a single element of the components.

Sriram
Sriram el 7 de Nov. de 2012
Check out for this.
Let the below matrix be the input
10 10 10 10 10
10 10 10 30 30
10 13 13 10 30
10 13 10 10 10
10 10 10 10 10
output from the matlab command - imregional max is
0 0 0 0 0
0 0 0 1 1
0 0 0 0 1
0 0 0 0 0
0 0 0 0 0
whereas according to MY theoretical understanding the output would be
0 0 0 0 0 since when element (3,2) which is 13 it will have neighb
0 0 0 1 1 10 10 10
0 1 0 0 1 10 <13> 13 which will be replace by 1
0 1 0 0 0 10 13 10
0 0 0 0 0 whereas for element (3,3)
10 10 30
13 <13> 10 which will be 0 since 30 at(1,3)
13 10 10
what went wrong on my understanding?

Andrei Bobrov
Andrei Bobrov el 7 de Nov. de 2012
x=[ 10 10 10 10 10
10 10 10 30 30
10 13 13 10 30
10 13 10 10 10
10 10 10 10 10]
imregionalmax(x,4)

Harshit
Harshit el 7 de Nov. de 2012
Hi Sriram, It won't be. You have to see the entire connected component. Look at 3rd column and 3rd row 13 it is connected to 2nd row and 4th column 30 in a 8-neighbor way. So 13 is connected to 30 and so it will become zero.
  4 comentarios
Harshit
Harshit el 8 de Nov. de 2012
You can look at the source of matlab function itself. It is the most optimized code. Else the logic will be for every pixel check its 8 neighbor. If any of them is bigger store it in a lut such that a(13,10)=1 which means intensity 13 and 10 are connected. In the second iteration just traverse the matrix and delete elements on the basis of lut.
Image Analyst
Image Analyst el 8 de Nov. de 2012
In this case, as with most m-files, the m-file for the function in the toolbox is merely a wrapper for a mex file that does the actual heavy lifting. So you can't see what it does internally. And for this case, it doesn't give a citation to a published article.

Iniciar sesión para comentar.


Image Analyst
Image Analyst el 7 de Nov. de 2012
Regarding your example: No, the 13's won't be a local max. There's a trail of pixels (equal or higher in values) that connect the 13's to a higher number (30), so none of the 13's will be a regional max. With 8 connected the trail can go up, down, left, right, or diagonally.

Categorías

Más información sobre Get Started with Image Processing Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by