Merge pull request #22147 from rogday:zoom_factor

Add zoom factor to interactive calibration tool

* add zoom factor

* address review comments
This commit is contained in:
rogday
2022-06-30 23:31:52 +03:00
committed by GitHub
parent 2a4926f417
commit b91f173680
6 changed files with 26 additions and 3 deletions
@@ -201,7 +201,16 @@ void CalibProcessor::showCaptureMessage(const cv::Mat& frame, const std::string
double textSize = VIDEO_TEXT_SIZE * frame.cols / (double) IMAGE_MAX_WIDTH;
cv::bitwise_not(frame, frame);
cv::putText(frame, message, textOrigin, 1, textSize, cv::Scalar(0,0,255), 2, cv::LINE_AA);
cv::imshow(mainWindowName, frame);
cv::Mat resized;
if (std::fabs(mZoom - 1.) > 0.001f)
{
cv::resize(frame, resized, cv::Size(), mZoom, mZoom);
}
else
{
resized = frame;
}
cv::imshow(mainWindowName, resized);
cv::waitKey(300);
}
@@ -267,6 +276,7 @@ CalibProcessor::CalibProcessor(cv::Ptr<calibrationData> data, captureParameters
mSquareSize = capParams.squareSize;
mTemplDist = capParams.templDst;
mSaveFrames = capParams.saveFrames;
mZoom = capParams.zoom;
switch(mBoardType)
{