how to determine if an image has an object or empty
Mostrar comentarios más antiguos
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 comentarios
Image Analyst
el 5 de Jun. de 2016
Please attach one image of each type, and tell us what you consider to be "an object" in the image.
John D'Errico
el 5 de Jun. de 2016
The issue of course is that only you know if something is of interest.
For example, suppose I take a picture where one pixel represents what I care about, with the rest of the image a flat field. Yes, the "object" is something really tiny.
Seeing the existence of an object is entirely in your definition of what is an object.
kaz
el 16 de Jun. de 2016
Walter Roberson
el 16 de Jun. de 2016
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()
Respuestas (2)
Image Analyst
el 16 de Jun. de 2016
Try this, like Walter said:
[~, numberOfObjects] = bwlabel(binaryImage);
Categorías
Más información sobre Graphics Object Properties en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!