loading
 
Center of Gravity
Firdaus from Malaysia  [3 posts]
7 year
I'm a student from Malaysia, currently I'm studying the behaviour of the fish by using the roborealm software. One of the parameter that I used in this study is centre of gravity (COG) box size. Can i know how the roborealm software generate the data for COG box size, is there a specific formula used in generating this data.

Thank you
Steven Gentner from United States  [1446 posts] 7 year
Muhammad,

The box size is based on a percent coverage of pixels. The algorithm starts at the COG with a very small size (3x3) and calculates the percentage of on pixels within that box as compared to the number of on pixels in the image. If the percentage is less than desired, the box size is increased in all dimensions by 1 pixel (i.e. to 4x4) and the process repeats. Thus there isn't a formula specifically since the shape and location of all pixels is only examined on a need-to-do basis. Since the box is increased by 1 pixel in all directions you will end up with a square box.

Since with each box size increase you are only examining the new pixels along the border this is quite a fast calculation.

The formula to check if you are done is

continue while

desired percent - (on pixels within box / total on pixels in image) > 0

Make sense?

STeven.

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