@@ -607,14 +607,14 @@ void ERFilterNM::er_merge(ERStat *parent, ERStat *child)
607
607
608
608
// child region done, we can calculate 1st stage features from the incrementally computable descriptors
609
609
child->aspect_ratio = (float )(child->bbox [2 ]-child->bbox [0 ]+1 )/(child->bbox [3 ]-child->bbox [1 ]+1 );
610
- child->compactness = sqrt (child->area )/child->perimeter ;
610
+ child->compactness = sqrt (( float )( child->area ) )/child->perimeter ;
611
611
child->num_holes = (float )(1 -child->euler );
612
612
613
613
vector<int > m_crossings;
614
614
m_crossings.push_back (child->crossings ->at ((int )(child->bbox [3 ]-child->bbox [1 ]+1 )/6 ));
615
615
m_crossings.push_back (child->crossings ->at ((int )3 *(child->bbox [3 ]-child->bbox [1 ]+1 )/6 ));
616
616
m_crossings.push_back (child->crossings ->at ((int )5 *(child->bbox [3 ]-child->bbox [1 ]+1 )/6 ));
617
- sort (m_crossings.begin (), m_crossings.end ());
617
+ std:: sort (m_crossings.begin (), m_crossings.end ());
618
618
child->med_crossings = (float )m_crossings.at (1 );
619
619
620
620
// free unnecessary mem
@@ -784,8 +784,10 @@ ERStat* ERFilterNM::er_tree_filter ( cv::InputArray image, ERStat * stat, ERStat
784
784
if (p_next == (int )contour_poly.size ())
785
785
p_next = 0 ;
786
786
787
- double angle_next = atan2 ((contour_poly[p_next].y -contour_poly[p].y ),(contour_poly[p_next].x -contour_poly[p].x ));
788
- double angle_prev = atan2 ((contour_poly[p_prev].y -contour_poly[p].y ),(contour_poly[p_prev].x -contour_poly[p].x ));
787
+ double angle_next = atan2 ((double )(contour_poly[p_next].y -contour_poly[p].y ),
788
+ (double )(contour_poly[p_next].x -contour_poly[p].x ));
789
+ double angle_prev = atan2 ((double )(contour_poly[p_prev].y -contour_poly[p].y ),
790
+ (double )(contour_poly[p_prev].x -contour_poly[p].x ));
789
791
if ( angle_next < 0 )
790
792
angle_next = 2 .*CV_PI + angle_next;
791
793
@@ -813,12 +815,12 @@ ERStat* ERFilterNM::er_tree_filter ( cv::InputArray image, ERStat * stat, ERStat
813
815
814
816
vector<Point> hull;
815
817
cv::convexHull (contours[0 ], hull, false );
816
- hull_area = contourArea (hull);
818
+ hull_area = ( int ) contourArea (hull);
817
819
}
818
820
819
821
820
822
stat->hole_area_ratio = (float )holes_area / stat->area ;
821
- stat->convex_hull_ratio = (float )hull_area / contourArea (contours[0 ]);
823
+ stat->convex_hull_ratio = (float )hull_area / ( float ) contourArea (contours[0 ]);
822
824
stat->num_inflexion_points = (float )num_inflexion_points;
823
825
824
826
0 commit comments