I used the blob.corners()
method and got four corner points. Is there a way to get more corner points or additional edge pixels from a detected blob? I want to get six points.
Thanks in advance for your help!
Hi, we just store the corner points right now. When this algorithm was created it was developed to run on very little memory. So, we don’t store the contour of the blob.
There’s a perimeter counter in the code that maps out the blob: openmv/src/omv/imlib/blob.c at master · openmv/openmv
When that’s incremented, you have the x/y location of a point on the edge of the blob. From that, you can put x/y pixel locations into a list to get the contour if you want to modify our code. And, to be efficient, you could just store a 3-bit 8-way direction per pixel after the first point is located to have a compact contour representation. The wild-fire algorithm we use to track the blob visits all perimeter points in order.
Note that adding any code that does mallocs in the blob tracking loop though will slow it down. So, anything that involves tracking the contour will come with a speed hit.