The area of the contour from sxcv.arrowhead is not the same as the number pixels in it set to 255. Why is this?
OpenCV uses Green's formula (a contour integral, for people who do maths) to compute areas in cv2.contourArea. To be honest, I think it would be better if they somply counted the number of pixels wholly within a region.
What is the rectangularity of a region which is twice as long as it is wide?
about 1
- negative
- about one-half
- about 2
The rectangularity of a rectangular region should be about unity irrespective of its width and height.
Which of the following tasks would region-based processing be useful for?
Region-based processing is based around finding shapes and using measures of them to characterize different classes of region. The only task listed above in which there is a definite shape is distinguishing man-made objects such as buildings from objects in the natural world, such as trees.
Which of the following expressions works out the rectangularity of a region having a bounting box of width $W$, height $H$ and area $A$?
- $HA/W$
- $HAW$
$WH/A$
- $WA/H$
The rectangularity is the ratio of the area of the bounding box to the area of the actual shape.
Which of the following expressions is circularity?
- $C/A^2$
- $A^2/C$
$C^2/A$
- $C*2A$
Circularity is conventionally measured as $C^2/A$.
On what basis does sxcv.largest_contour work?
This routine should have been written to reeturn the contour that encloses the largest area.
If you compute the ratio between the height and width of a bounding box, which of the following would it be most useful for?
Although this aspect raio measure could conceivably be used for identifying broken biscuits, it would be most useful for distinguishing betwee square ones (where the aspect ratio is about unity) from rectangular ones.
What is the area of the image from sxcv.arrowhead?
You mean you didn't work this out and keep a record of it? ;-)
Why is circularity calculated using the forumla $C^2/A$?
The particular formula for circularity makes it independent of radius: $C = 2\pi r$ and $A = \pi r^2$ so the $r$s cancel.
Which of the following CANNOT be returned by calling an OpenCV routine with a contour?
- the best-fit line
- the minimum enclosing circle
- the best-fitting ellipse
the concave hull
OpenCV routine compute all of these but the contave hull. It can compute convex hull though.