1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-28 06:43:01 +04:00

Merge branch 4.x

This commit is contained in:
Alexander Smorkalov
2024-10-23 10:03:04 +03:00
66 changed files with 2346 additions and 937 deletions
@@ -8,14 +8,14 @@ using namespace std;
static void help(char** av)
{
cout << endl
<< av[0] << " shows the usage of the OpenCV serialization functionality." << endl
<< av[0] << " shows the usage of the OpenCV serialization functionality." << endl << endl
<< "usage: " << endl
<< av[0] << " outputfile.yml.gz" << endl
<< "The output file may be either XML (xml) or YAML (yml/yaml). You can even compress it by "
<< "specifying this in its extension like xml.gz yaml.gz etc... " << endl
<< av[0] << " [output file name] (default outputfile.yml.gz)" << endl << endl
<< "The output file may be XML (xml), YAML (yml/yaml), or JSON (json)." << endl
<< "You can even compress it by specifying this in its extension like xml.gz yaml.gz etc... " << endl
<< "With FileStorage you can serialize objects in OpenCV by using the << and >> operators" << endl
<< "For example: - create a class and have it serialized" << endl
<< " - use it to read and write matrices." << endl;
<< " - use it to read and write matrices." << endl << endl;
}
class MyData
@@ -68,13 +68,16 @@ static ostream& operator<<(ostream& out, const MyData& m)
int main(int ac, char** av)
{
string filename;
if (ac != 2)
{
help(av);
return 1;
filename = "outputfile.yml.gz";
}
else
filename = av[1];
string filename = av[1];
{ //write
//! [iomati]
Mat R = Mat_<uchar>::eye(3, 3),
@@ -118,7 +121,7 @@ int main(int ac, char** av)
//! [close]
fs.release(); // explicit close
//! [close]
cout << "Write Done." << endl;
cout << "Write operation to file:" << filename << " completed successfully." << endl;
}
{//read
@@ -78,6 +78,7 @@ int main()
tm.start();
// do something ...
tm.stop();
cout << "Last iteration: " << tm.getLastTimeSec() << endl;
}
cout << "Average time per iteration in seconds: " << tm.getAvgTimeSec() << endl;
cout << "Average FPS: " << tm.getFPS() << endl;