object recognition using morphological filters

조회 수: 9 (최근 30일)
Remi MOrre
Remi MOrre 2021년 1월 3일
댓글: Image Analyst 2021년 1월 5일
Somehow I have to detect the rectangular components at the bottom right of the image:
The result should look something like this:
I though opening by reconstructing is a good start then I have no clue what to do.
Any help is appreciated
  댓글 수: 2
KALYAN ACHARJYA
KALYAN ACHARJYA 2021년 1월 3일
More specific please, if you want help, then you need to make it easy to be helped.
Remi MOrre
Remi MOrre 2021년 1월 3일
I have to detect the objects just like shown in image b

댓글을 달려면 로그인하십시오.

답변 (1개)

Image Analyst
Image Analyst 2021년 1월 3일
Why not just subtract with imabsdiff()?
diffImage = imabsdiff(image1, image2);
bigDifferences = diffImage > 5; % Or whatever.
% Get rid of blobs less than 3 pixels in area
bigDifferences = bwareaopen(bigDifferences, 3); % This is a morphological operation
imshow(bigDifferences, []);
  댓글 수: 8
Remi MOrre
Remi MOrre 2021년 1월 5일
편집: Remi MOrre 2021년 1월 5일
Ok thanks man you were very helpful. by the way I was able to detect the objects by applyaing erosion followed by thresholding fowllowed by opening the image.
Image Analyst
Image Analyst 2021년 1월 5일
Yes, like I said, if your definition of an object is something bright, you can find it by thresholding. You can find a full demo in my Image Segmentation Tutorial in my File Exchange.
An erosion does a local minimum operation, so that will make things darker and shrink the bright blobs, possibly making the smaller blobs disappear so that only larger bright blobs remain. Then you thresholded which gave you a binary image of those larger bright blobs. An opening is an erosion followed by a dilation so that makes the binary blobs smaller and then enlarges them again to their original size, roughly. What it does is to smooth out the black parts of the image by getting rid of the small blobs and snipping off any "tendrils" or "peninsulas" that may poke out of the bright blobs. It may potentially separate blobs into more blobs so you may want to call bwareaopen() or bwareafilt() after that. I'm not sure the erosion at the very beginning is really necessary, but whatever -- as long as it works and you're happy with the result.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by