1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge branch 4.x

This commit is contained in:
Alexander Alekhin
2021-06-04 11:51:43 +00:00
253 changed files with 13923 additions and 3300 deletions
+2 -2
View File
@@ -539,9 +539,9 @@ int main( int argc, char** argv )
if( mode == CAPTURING )
{
if(undistortImage)
msg = format( "%d/%d Undist", (int)imagePoints.size(), nframes );
msg = cv::format( "%d/%d Undist", (int)imagePoints.size(), nframes );
else
msg = format( "%d/%d", (int)imagePoints.size(), nframes );
msg = cv::format( "%d/%d", (int)imagePoints.size(), nframes );
}
putText( view, msg, textOrigin, 1, 1,
+2 -2
View File
@@ -137,7 +137,7 @@ static void evaluate_model(const vector<float>& predictions, const vector<Mat>&
err /= predictions.size();
cout << format("error: %.2f %%", err * 100) << endl;
cout << cv::format("error: %.2f %%", err * 100) << endl;
int confusion[10][10] = {};
@@ -151,7 +151,7 @@ static void evaluate_model(const vector<float>& predictions, const vector<Mat>&
{
for (int j = 0; j < 10; j++)
{
cout << format("%2d ", confusion[i][j]);
cout << cv::format("%2d ", confusion[i][j]);
}
cout << endl;
}
+1 -1
View File
@@ -491,7 +491,7 @@ int main(int argc, char** argv)
setMouseCallback("View", onMouse, 0);
bool boardFound = false;
string indexFilename = format("%s_index.yml", outprefix.c_str());
string indexFilename = cv::format("%s_index.yml", outprefix.c_str());
vector<string> capturedImgList;
vector<Rect> roiList;
+2 -2
View File
@@ -123,14 +123,14 @@ static void findSquares( const Mat& image, vector<vector<Point> >& squares )
int main(int argc, char** argv)
{
static const char* names[] = { "pic1.png", "pic2.png", "pic3.png",
const char* names[] = { "pic1.png", "pic2.png", "pic3.png",
"pic4.png", "pic5.png", "pic6.png", 0 };
help(argv[0]);
if( argc > 1)
{
names[0] = argv[1];
names[1] = "0";
names[1] = 0;
}
for( int i = 0; names[i] != 0; i++ )
@@ -40,7 +40,7 @@ public:
<< "Write_gridPoints" << writeGrid
<< "Write_outputFileName" << outputFileName
<< "Show_UndistortedImage" << showUndistorsed
<< "Show_UndistortedImage" << showUndistorted
<< "Input_FlipAroundHorizontalAxis" << flipVertical
<< "Input_Delay" << delay
@@ -63,7 +63,7 @@ public:
node["Calibrate_FixPrincipalPointAtTheCenter"] >> calibFixPrincipalPoint;
node["Calibrate_UseFisheyeModel"] >> useFisheye;
node["Input_FlipAroundHorizontalAxis"] >> flipVertical;
node["Show_UndistortedImage"] >> showUndistorsed;
node["Show_UndistortedImage"] >> showUndistorted;
node["Input"] >> input;
node["Input_Delay"] >> delay;
node["Fix_K1"] >> fixK1;
@@ -211,7 +211,7 @@ public:
bool calibFixPrincipalPoint; // Fix the principal point at the center
bool flipVertical; // Flip the captured images around the horizontal axis
string outputFileName; // The name of the file where to write
bool showUndistorsed; // Show undistorted images after calibration
bool showUndistorted; // Show undistorted images after calibration
string input; // The input ->
bool useFisheye; // use fisheye camera model for calibration
bool fixK1; // fix K1 distortion coefficient
@@ -402,10 +402,10 @@ int main(int argc, char* argv[])
if( mode == CAPTURING )
{
if(s.showUndistorsed)
msg = format( "%d/%d Undist", (int)imagePoints.size(), s.nrFrames );
if(s.showUndistorted)
msg = cv::format( "%d/%d Undist", (int)imagePoints.size(), s.nrFrames );
else
msg = format( "%d/%d", (int)imagePoints.size(), s.nrFrames );
msg = cv::format( "%d/%d", (int)imagePoints.size(), s.nrFrames );
}
putText( view, msg, textOrigin, 1, 1, mode == CALIBRATED ? GREEN : RED);
@@ -415,7 +415,7 @@ int main(int argc, char* argv[])
//! [output_text]
//------------------------- Video capture output undistorted ------------------------------
//! [output_undistorted]
if( mode == CALIBRATED && s.showUndistorsed )
if( mode == CALIBRATED && s.showUndistorted )
{
Mat temp = view.clone();
if (s.useFisheye)
@@ -438,7 +438,7 @@ int main(int argc, char* argv[])
break;
if( key == 'u' && mode == CALIBRATED )
s.showUndistorsed = !s.showUndistorsed;
s.showUndistorted = !s.showUndistorted;
if( s.inputCapture.isOpened() && key == 'g' )
{
@@ -450,7 +450,7 @@ int main(int argc, char* argv[])
// -----------------------Show the undistorted image for the image list ------------------------
//! [show_results]
if( s.inputType == Settings::IMAGE_LIST && s.showUndistorsed && !cameraMatrix.empty())
if( s.inputType == Settings::IMAGE_LIST && s.showUndistorted && !cameraMatrix.empty())
{
Mat view, rview, map1, map2;
@@ -361,7 +361,7 @@ int main(int argc, char *argv[])
frame_vis.copyTo(frameSave);
}
string saveFilename = format(string(saveDirectory + "/image_%04d.png").c_str(), frameCount);
string saveFilename = cv::format(string(saveDirectory + "/image_%04d.png").c_str(), frameCount);
imwrite(saveFilename, frameSave);
frameCount++;
}