How to distinguish flat and non flat regions of an image?
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
harpreet
am 2 Mai 2015
Bearbeitet: harpreet
am 3 Mai 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 Kommentare
Akzeptierte Antwort
Image Analyst
am 2 Mai 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 Kommentare
Weitere Antworten (1)
harpreet
am 3 Mai 2015
Bearbeitet: harpreet
am 3 Mai 2015
2 Kommentare
Image Analyst
am 3 Mai 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.
Siehe auch
Kategorien
Mehr zu Read, Write, and Modify Image finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

