필터 지우기
필터 지우기

how to determine if an image has an object or empty

조회 수: 5 (최근 30일)
kaz
kaz 2016년 6월 5일
답변: Image Analyst 2016년 6월 16일
i want to do shape detection however i was wondering if i would able to make the system able to determine if the image has an object or its an empty image. if yes, which method should i use? thanks in advance
  댓글 수: 4
kaz
kaz 2016년 6월 16일
as it shows in the following figures, the first image has two objects detected, i want the system to define if the object was not detected as shown in image 2 so i can state conditions for it such as if the object 1 is not detected, then show (condition).
Walter Roberson
Walter Roberson 2016년 6월 16일
How should your code know if it is object 1 that is missing or object 2 that is missing? Are the objects always in the same place?
If you just want to know how many objects you have, then bwlabel() the thresholded image and look at the second output num of bwlabel()

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

답변 (2개)

Walter Roberson
Walter Roberson 2016년 6월 5일

Image Analyst
Image Analyst 2016년 6월 16일
Try this, like Walter said:
[~, numberOfObjects] = bwlabel(binaryImage);

Community Treasure Hunt

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

Start Hunting!

Translated by