1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-25 21:33:04 +04:00

Merge pull request #26260 from sturkmen72:upd_doc_4_x

Update Documentation #26260

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
Suleyman TURKMEN
2024-10-09 09:09:51 +03:00
committed by GitHub
parent cefde84a76
commit e72efd0d32
16 changed files with 139 additions and 325 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