Hi there, I want to detect an object which is so close (stick) to another object. can any one help me how I can do that

2 views (last 30 days)
In attached image, there are two objects so close to each other, how I can detect only one of them?

Answers (1)

Image Analyst
Image Analyst on 8 Apr 2014
Just draw a black line across the intersection to separate them. See attached demo.
  2 Comments
elham
elham on 9 Apr 2014
Thanks for your reply, but this not omitting the other object or it doesnt help to detect only one object...
Image Analyst
Image Analyst on 9 Apr 2014
No, you'll get measurements for both. If you want you can use ginput(1) to indicate which one to remove. Or just throw away the measurements you don't want. Like if you never want the blob on the left, just label the image and use ismember to remove it.
labeledImage = bwlabel(binaryImage);
blob2 = ismember(labeledImage, 2) > 0; % Only take blob 2 on the right.
measurements = regionprops(blob2, 'all');

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!