Hello,
I'm doing the tutorial to get the moment. So as we have more than one area calculated, how can I display the total number of areas i.e. the max number of `i` to be printed in the console. This is the original code.
/// Get the moments
vector mu(contours.size() );
for( int i = 0; i < contours.size(); i++ ) {
mu[i] = moments( contours[i], false );}
what i have tried is by print out the `contours.size()` value like this and it return zero. Anyone can help on how i can get the number of max `i`?
vector mc( contours.size() );
for( int i = 0; i < contours.size(); i++ ) {
mc[i] = Point2f( mu[i].m10/mu[i].m00 , mu[i].m01/mu[i].m00 ); }
printf("max:%.2f\n", contours.size() );
↧