fix cast warnings

pull/3347/head
AleksandrPanov 3 years ago
parent 2216d0c6d3
commit 432cda8370
  1. 13
      modules/wechat_qrcode/test/test_qrcode.cpp

@ -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,
@ -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);

Loading…
Cancel
Save