How to distinguish flat and non flat regions of an image?
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
harpreet
el 2 de Mayo de 2015
Hello, I need to distinguish flat (regions having almost same pixel values e.g.sky,grass ) and non-flat regions of an image. I don't have any idea. Kindly suggest some ideas (any algorithm or some commands) how can i do the same in MATLAB.
0 comentarios
Respuesta aceptada
Image Analyst
el 2 de Mayo de 2015
You can use stdfilt() or entropyfilt(). For example
% Get an image where the value is the std dev of a local neighborhood.
filteredImage = stdfilt(grayImage);
% Find pixels where the local standard deviation is 0
flatRegions = filteredImage == 0;
You can get relatively flat regions by using <= instead of ==
flatRegions = filteredImage <= 4; % Or whatever number you want.
0 comentarios
Más respuestas (1)
harpreet
el 3 de Mayo de 2015
Editada: harpreet
el 3 de Mayo de 2015
2 comentarios
Image Analyst
el 3 de Mayo de 2015
Please attach the original image, not a screenshot.
What is the "flat" region? Is it all the white area? Or the red pixels inside the red discs? Or both?
And why did your algorithm give giant black squares around the red discs? I can't figure that out.
Ver también
Categorías
Más información sobre Read, Write, and Modify Image en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

