From 5bb37db9ca2ee49e24640431fdb24fee8c775799 Mon Sep 17 00:00:00 2001 From: Jules <16029431+jules-ai@users.noreply.github.com> Date: Fri, 24 Jan 2025 10:02:56 +0800 Subject: [PATCH] Fix incorrect division of two numbers by integer, should use double Change the division operation from integer type to double --- tools/cv/source/imgproc/draw.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/cv/source/imgproc/draw.cpp b/tools/cv/source/imgproc/draw.cpp index 87f8a6329..9628d47e0 100644 --- a/tools/cv/source/imgproc/draw.cpp +++ b/tools/cv/source/imgproc/draw.cpp @@ -614,8 +614,8 @@ static void EllipseEx(std::vector& regions, Size size, Point2l center, S for (unsigned int i = 0; i < _v.size(); ++i) { Point2l pt; - pt.x = (int64_t)std::round(_v[i].x / XY_ONE) << XY_SHIFT; - pt.y = (int64_t)std::round(_v[i].y / XY_ONE) << XY_SHIFT; + pt.x = (int64_t)std::round(_v[i].x / static_cast(XY_ONE)) << XY_SHIFT; + pt.y = (int64_t)std::round(_v[i].y / static_cast(XY_ONE)) << XY_SHIFT; pt.x += std::round(_v[i].x - pt.x); pt.y += std::round(_v[i].y - pt.y); if (pt != prevPt) {