less connected pixels should be removed from image
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Filza Ashraf
am 7 Feb. 2014
Beantwortet: Filza Ashraf
am 10 Feb. 2014
here is a image having an object disk and a text so check the connectivty of pixels if the area having less connectivity should be removed like in this image text has less connecctivity so i have to remove the text
0 Kommentare
Akzeptierte Antwort
Anand
am 7 Feb. 2014
Your definition of 'less connected' is not clear to me. However, if you want just the big round component, you can use regionprops to find the largest component and remove the smaller components using bwareaopen.
Here's an example:
% read image and convert to binary.
im = imread('http://www.mathworks.com/matlabcentral/answers/uploaded_files/7873/fake.png');
bw = logical(rgb2gray(im));
% use regionprops to find area of all components.
cc = regionprops(bw,'Area');
% find area of largest component.
maxarea = max([cc.Area]);
% use bwareaopen to remove smaller components.
out = bwareaopen(bw,maxarea);
Hope this helps!
0 Kommentare
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Image Filtering and Enhancement finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!