loading
 
Area of region
Padraig from Ireland  [9 posts]
3 years
I'm try to use RR to calculate the area of two round, but not exactly circular, regions in an image. By using edge dection (as shown in the attached image) followed by circles I can reliably find the target regions; however the radius reported by circles is limited to integer values so I cannot accurately compute an area for the region usign that value.
I have also tried to use Blob detection with Geometric Statistics (both pre and post edge detection/circle) but it is not as good at discriminating the target region (it also seems to be very processing intensive).
Is there an good method to get the area of a region given that I can use circle to find the centre of the target?    

 
Steven Gentner from United States  [1370 posts] 3 years
Given that they are not perfectly circular, you may want to calculate the area directly based on number of pixels. This will at least give you a reasonably accurate number. If you need additional accuracy you'd have to increase the camera resolution.

If you post the source image and the current robofile configuration that you are using we can help further.

STeven.
Padraig from Ireland  [9 posts] 3 years
Area based upon number of pixels is exactly what I would like to do, and should be accurate enough for my purposes. Is there an easy way to get this data?
I have attached a zip file with a typical sample camera image along with both my robo and cscript file.
Padraig
RoboRealm.zip
Steven Gentner from United States  [1370 posts] 3 years
Padrig,

Try the attached with the latest version of RR (just updated).

Instead of using circles, you connect the points after the edge extraction and then remove everything else that is not a circular object. Then using the Geo stats module gets you arrays of the area, cog, etc. The attached file has the updated vision code but the same C code that would have to be updated.

Note that since you are not assuming the object to be completely circular the area should be much more accurate.

STeven.
program.robo
Padraig from Ireland  [9 posts] 3 years
Steven,
Thank you, the new version seems to work very well.
Padraig

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index