Commit 478baf93 authored by goldstar616's avatar goldstar616 Committed by Alexander Alekhin

Merge pull request #981 from goldstar616:master

issue #980 resolves - Some module has a round error similar to #975.  (#981)

* round function changes to cvRound

Minor changes to fix lower visual studio version build errors.

* round function changes to cvRound

Minor changes to fix lower visual studio version build errors.

* round function changes to cvRound

Minor changes to fix lower visual studio version build errors.
parent f2c324a2
......@@ -566,7 +566,7 @@ OCRBeamSearchClassifierCNN::OCRBeamSearchClassifierCNN (const string& filename)
nr_feature = weights.rows;
nr_class = weights.cols;
patch_size = (int)round(sqrt((float)kernels.cols));
patch_size = cvRound(sqrt((float)kernels.cols));
window_size = 4*patch_size;
step_size = 4;
quad_size = 12;
......
......@@ -982,7 +982,7 @@ OCRHMMClassifierCNN::OCRHMMClassifierCNN (const string& filename)
nr_feature = weights.rows;
nr_class = weights.cols;
patch_size = (int)round(sqrt((float)kernels.cols));
patch_size = cvRound(sqrt((float)kernels.cols));
// algorithm internal parameters
window_size = 32;
num_quads = 25;
......
......@@ -182,10 +182,10 @@ void FastLineDetectorImpl::drawSegments(InputOutputArray _image, InputArray line
getAngle(seg);
double ang = (double)seg.angle;
Point2i p1;
p1.x = (int)round(seg.x2 - gap*cos(arrow_angle * CV_PI / 180.0 + ang));
p1.y = (int)round(seg.y2 - gap*sin(arrow_angle * CV_PI / 180.0 + ang));
p1.x = cvRound(seg.x2 - gap*cos(arrow_angle * CV_PI / 180.0 + ang));
p1.y = cvRound(seg.y2 - gap*sin(arrow_angle * CV_PI / 180.0 + ang));
pointInboardTest(_image.getMatRef(), p1);
line(_image.getMatRef(), Point((int)round(seg.x2), (int)round(seg.y2)), p1, Scalar(0,0,255), 1);
line(_image.getMatRef(), Point(cvRound(seg.x2), cvRound(seg.y2)), p1, Scalar(0,0,255), 1);
}
}
}
......@@ -717,14 +717,14 @@ void FastLineDetectorImpl::drawSegment(Mat& mat, const SEGMENT& seg, Scalar bgr,
double arrow_angle = 30.0;
Point2i p1;
p1.x = (int)round(seg.x2 - gap*cos(arrow_angle * CV_PI / 180.0 + ang));
p1.y = (int)round(seg.y2 - gap*sin(arrow_angle * CV_PI / 180.0 + ang));
p1.x = cvRound(seg.x2 - gap*cos(arrow_angle * CV_PI / 180.0 + ang));
p1.y = cvRound(seg.y2 - gap*sin(arrow_angle * CV_PI / 180.0 + ang));
pointInboardTest(mat, p1);
line(mat, Point((int)round(seg.x1), (int)round(seg.y1)),
Point((int)round(seg.x2), (int)round(seg.y2)), bgr, thickness, 1);
line(mat, Point(cvRound(seg.x1), cvRound(seg.y1)),
Point(cvRound(seg.x2), cvRound(seg.y2)), bgr, thickness, 1);
if(directed)
line(mat, Point((int)round(seg.x2), (int)round(seg.y2)), p1, bgr, thickness, 1);
line(mat, Point(cvRound(seg.x2), cvRound(seg.y2)), p1, bgr, thickness, 1);
}
} // namespace cv
} // namespace ximgproc
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment