2D majority filer in MATLAB?
Mostrar comentarios más antiguos
Hello,
Is there a 2D majority filter in MATLAB?
With ordfilt2 minimum, maximum, median etc. filters can be implemented, but not majority. Is there another command with that functionality?
Here 'majority filter' means replacing each element of a matrix by the most frequently occurring element in a set of neighbors of that element.
Regards, Elena
1 comentario
Elena Ranguelova
el 24 de Feb. de 2017
Respuestas (3)
Sailesh Sidhwani
el 22 de Mayo de 2019
Editada: Sailesh Sidhwani
el 22 de Mayo de 2019
There is no direct function for mode filtering, you can use the colfilt instead:
out = colfilt(img, [5 5], 'sliding', @mode) ;
Sailesh Sidhwani
el 25 de Nov. de 2020
0 votos
A new 'modefilt' function for 2D and 3D data was added to Image Processing Toolbox in R2020a:
Both 'colfilt' and 'nlfilter' are generic sliding window functions and can be used to perform mode filtering but the expectation is that 'modefilt' to be faster than both of these functions and also work on 3D grayscale data.
rgr478
el 7 de Jul. de 2021
0 votos
bwmorph(image,'majority')
Categorías
Más información sobre Image Filtering en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!