mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
Add namespace specifier for format()
This commit is contained in:
parent
29fb4f98b1
commit
5105a937d1
@ -56,7 +56,7 @@ using namespace std;
|
|||||||
|
|
||||||
static string getTestCaseName(const string& picture_name, double minDist, double edgeThreshold, double accumThreshold, int minRadius, int maxRadius)
|
static string getTestCaseName(const string& picture_name, double minDist, double edgeThreshold, double accumThreshold, int minRadius, int maxRadius)
|
||||||
{
|
{
|
||||||
string results_name = format("circles_%s_%.0f_%.0f_%.0f_%d_%d",
|
string results_name = cv::format("circles_%s_%.0f_%.0f_%.0f_%d_%d",
|
||||||
picture_name.c_str(), minDist, edgeThreshold, accumThreshold, minRadius, maxRadius);
|
picture_name.c_str(), minDist, edgeThreshold, accumThreshold, minRadius, maxRadius);
|
||||||
string temp(results_name);
|
string temp(results_name);
|
||||||
size_t pos = temp.find_first_of("\\/.");
|
size_t pos = temp.find_first_of("\\/.");
|
||||||
|
@ -538,9 +538,9 @@ int main( int argc, char** argv )
|
|||||||
if( mode == CAPTURING )
|
if( mode == CAPTURING )
|
||||||
{
|
{
|
||||||
if(undistortImage)
|
if(undistortImage)
|
||||||
msg = format( "%d/%d Undist", (int)imagePoints.size(), nframes );
|
msg = cv::format( "%d/%d Undist", (int)imagePoints.size(), nframes );
|
||||||
else
|
else
|
||||||
msg = format( "%d/%d", (int)imagePoints.size(), nframes );
|
msg = cv::format( "%d/%d", (int)imagePoints.size(), nframes );
|
||||||
}
|
}
|
||||||
|
|
||||||
putText( view, msg, textOrigin, 1, 1,
|
putText( view, msg, textOrigin, 1, 1,
|
||||||
|
@ -137,7 +137,7 @@ static void evaluate_model(const vector<float>& predictions, const vector<Mat>&
|
|||||||
|
|
||||||
err /= predictions.size();
|
err /= predictions.size();
|
||||||
|
|
||||||
cout << format("error: %.2f %%", err * 100) << endl;
|
cout << cv::format("error: %.2f %%", err * 100) << endl;
|
||||||
|
|
||||||
int confusion[10][10] = {};
|
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++)
|
for (int j = 0; j < 10; j++)
|
||||||
{
|
{
|
||||||
cout << format("%2d ", confusion[i][j]);
|
cout << cv::format("%2d ", confusion[i][j]);
|
||||||
}
|
}
|
||||||
cout << endl;
|
cout << endl;
|
||||||
}
|
}
|
||||||
|
@ -490,7 +490,7 @@ int main(int argc, char** argv)
|
|||||||
setMouseCallback("View", onMouse, 0);
|
setMouseCallback("View", onMouse, 0);
|
||||||
bool boardFound = false;
|
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<string> capturedImgList;
|
||||||
vector<Rect> roiList;
|
vector<Rect> roiList;
|
||||||
|
@ -402,9 +402,9 @@ int main(int argc, char* argv[])
|
|||||||
if( mode == CAPTURING )
|
if( mode == CAPTURING )
|
||||||
{
|
{
|
||||||
if(s.showUndistorsed)
|
if(s.showUndistorsed)
|
||||||
msg = format( "%d/%d Undist", (int)imagePoints.size(), s.nrFrames );
|
msg = cv::format( "%d/%d Undist", (int)imagePoints.size(), s.nrFrames );
|
||||||
else
|
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);
|
putText( view, msg, textOrigin, 1, 1, mode == CALIBRATED ? GREEN : RED);
|
||||||
|
@ -361,7 +361,7 @@ int main(int argc, char *argv[])
|
|||||||
frame_vis.copyTo(frameSave);
|
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);
|
imwrite(saveFilename, frameSave);
|
||||||
frameCount++;
|
frameCount++;
|
||||||
}
|
}
|
||||||
|
@ -206,7 +206,7 @@ void detectAndDraw( UMat& img, Mat& canvas, CascadeClassifier& cascade,
|
|||||||
double alpha = nframes > 50 ? 0.01 : 1./nframes;
|
double alpha = nframes > 50 ? 0.01 : 1./nframes;
|
||||||
avgfps = avgfps*(1-alpha) + fps*alpha;
|
avgfps = avgfps*(1-alpha) + fps*alpha;
|
||||||
|
|
||||||
putText(canvas, format("OpenCL: %s, fps: %.1f", ocl::useOpenCL() ? "ON" : "OFF", avgfps), Point(50, 30),
|
putText(canvas, cv::format("OpenCL: %s, fps: %.1f", ocl::useOpenCL() ? "ON" : "OFF", avgfps), Point(50, 30),
|
||||||
FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0,255,0), 2);
|
FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0,255,0), 2);
|
||||||
|
|
||||||
for ( size_t i = 0; i < faces.size(); i++ )
|
for ( size_t i = 0; i < faces.size(); i++ )
|
||||||
|
Loading…
Reference in New Issue
Block a user