Skip to content

Commit

Permalink
Merge pull request #3347 from AleksandrPanov:wechat_fix_win_warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Sep 6, 2022
2 parents 2216d0c + 432cda8 commit 971685c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions modules/wechat_qrcode/test/test_qrcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,10 @@ TEST(Objdetect_QRCode_points_position, rotate45) {
Mat image(800, 800, CV_8UC1);
const int pixInBlob = 4;
Size qrSize = Size((21+(params.version-1)*4)*pixInBlob,(21+(params.version-1)*4)*pixInBlob);
Rect2f rec((image.cols - qrSize.width)/2, (image.rows - qrSize.height)/2, qrSize.width, qrSize.height);
Rect2f rec(static_cast<float>((image.cols - qrSize.width)/2),
static_cast<float>((image.rows - qrSize.height)/2),
static_cast<float>(qrSize.width),
static_cast<float>(qrSize.height));
vector<float> goldCorners = {rec.x, rec.y,
rec.x+rec.width, rec.y,
rec.x+rec.width, rec.y+rec.height,
Expand All @@ -324,10 +327,10 @@ TEST(Objdetect_QRCode_points_position, rotate45) {
warpAffine(image, image, rot, image.size());
vector<float> rotateGoldCorners;
for (int i = 0; i < static_cast<int>(goldCorners.size()); i+= 2) {
rotateGoldCorners.push_back(rot.at<double>(0, 0) * goldCorners[i] +
rot.at<double>(0, 1) * goldCorners[i+1] + rot.at<double>(0, 2));
rotateGoldCorners.push_back(rot.at<double>(1, 0) * goldCorners[i] +
rot.at<double>(1, 1) * goldCorners[i+1] + rot.at<double>(1, 2));
rotateGoldCorners.push_back(static_cast<float>(rot.at<double>(0, 0) * goldCorners[i] +
rot.at<double>(0, 1) * goldCorners[i+1] + rot.at<double>(0, 2)));
rotateGoldCorners.push_back(static_cast<float>(rot.at<double>(1, 0) * goldCorners[i] +
rot.at<double>(1, 1) * goldCorners[i+1] + rot.at<double>(1, 2)));
}
vector<Mat> points2;
auto decoded_info2 = detector.detectAndDecode(image, points2);
Expand Down

0 comments on commit 971685c

Please sign in to comment.