Skip to content

Commit 9fbff00

Browse files
committed
fixed compilation errors and warnings on builds 3298 and 4384
1 parent 6adba09 commit 9fbff00

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

modules/objdetect/src/erfilter.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -607,14 +607,14 @@ void ERFilterNM::er_merge(ERStat *parent, ERStat *child)
607607

608608
// child region done, we can calculate 1st stage features from the incrementally computable descriptors
609609
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;
611611
child->num_holes = (float)(1-child->euler);
612612

613613
vector<int> m_crossings;
614614
m_crossings.push_back(child->crossings->at((int)(child->bbox[3]-child->bbox[1]+1)/6));
615615
m_crossings.push_back(child->crossings->at((int)3*(child->bbox[3]-child->bbox[1]+1)/6));
616616
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());
618618
child->med_crossings = (float)m_crossings.at(1);
619619

620620
// free unnecessary mem
@@ -784,8 +784,10 @@ ERStat* ERFilterNM::er_tree_filter ( cv::InputArray image, ERStat * stat, ERStat
784784
if (p_next == (int)contour_poly.size())
785785
p_next = 0;
786786

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));
789791
if ( angle_next < 0 )
790792
angle_next = 2.*CV_PI + angle_next;
791793

@@ -813,12 +815,12 @@ ERStat* ERFilterNM::er_tree_filter ( cv::InputArray image, ERStat * stat, ERStat
813815

814816
vector<Point> hull;
815817
cv::convexHull(contours[0], hull, false);
816-
hull_area = contourArea(hull);
818+
hull_area = (int)contourArea(hull);
817819
}
818820

819821

820822
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]);
822824
stat->num_inflexion_points = (float)num_inflexion_points;
823825

824826

0 commit comments

Comments
 (0)