Skip to content

Commit 971685c

Browse files
committed
Merge pull request #3347 from AleksandrPanov:wechat_fix_win_warnings
2 parents 2216d0c + 432cda8 commit 971685c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

modules/wechat_qrcode/test/test_qrcode.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,10 @@ TEST(Objdetect_QRCode_points_position, rotate45) {
304304
Mat image(800, 800, CV_8UC1);
305305
const int pixInBlob = 4;
306306
Size qrSize = Size((21+(params.version-1)*4)*pixInBlob,(21+(params.version-1)*4)*pixInBlob);
307-
Rect2f rec((image.cols - qrSize.width)/2, (image.rows - qrSize.height)/2, qrSize.width, qrSize.height);
307+
Rect2f rec(static_cast<float>((image.cols - qrSize.width)/2),
308+
static_cast<float>((image.rows - qrSize.height)/2),
309+
static_cast<float>(qrSize.width),
310+
static_cast<float>(qrSize.height));
308311
vector<float> goldCorners = {rec.x, rec.y,
309312
rec.x+rec.width, rec.y,
310313
rec.x+rec.width, rec.y+rec.height,
@@ -324,10 +327,10 @@ TEST(Objdetect_QRCode_points_position, rotate45) {
324327
warpAffine(image, image, rot, image.size());
325328
vector<float> rotateGoldCorners;
326329
for (int i = 0; i < static_cast<int>(goldCorners.size()); i+= 2) {
327-
rotateGoldCorners.push_back(rot.at<double>(0, 0) * goldCorners[i] +
328-
rot.at<double>(0, 1) * goldCorners[i+1] + rot.at<double>(0, 2));
329-
rotateGoldCorners.push_back(rot.at<double>(1, 0) * goldCorners[i] +
330-
rot.at<double>(1, 1) * goldCorners[i+1] + rot.at<double>(1, 2));
330+
rotateGoldCorners.push_back(static_cast<float>(rot.at<double>(0, 0) * goldCorners[i] +
331+
rot.at<double>(0, 1) * goldCorners[i+1] + rot.at<double>(0, 2)));
332+
rotateGoldCorners.push_back(static_cast<float>(rot.at<double>(1, 0) * goldCorners[i] +
333+
rot.at<double>(1, 1) * goldCorners[i+1] + rot.at<double>(1, 2)));
331334
}
332335
vector<Mat> points2;
333336
auto decoded_info2 = detector.detectAndDecode(image, points2);

0 commit comments

Comments
 (0)