how to remove objects close to image border
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Abdul Hamzah
am 28 Jan. 2017
Kommentiert: Image Analyst
am 30 Jan. 2017
hello everyone, i have a problem related with image processing. btw, i have an image like this :

but i want to remove the object closest to the image border ( in this case, the closest one is on the right of the border)
do you know how to do that? thx before.
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 28 Jan. 2017
Sorry - I was sleeping, hence the delay on my part.
Simply crop the image with imcrop(), then call imclearborder(), then pad with padarray():
margin = 50; % Whatever
croppedImage = imcrop(binaryImage, [margin, margin, columns - 2 * margin, rows - 2 * margin]);
binaryImage = imclearborder(croppedImage);
binaryImage = logical(padarray(binaryImage, margin));
2 Kommentare
Image Analyst
am 30 Jan. 2017
No. It will remove any object, no matter what size, if it enters the margin. If you want size based filtering, see bwareafilt() or bwareaopen().
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Deep Learning Toolbox 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!