1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +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
@@ -1,4 +1,4 @@
File Input and Output using XML and YAML files {#tutorial_file_input_output_with_xml_yml}
File Input and Output using XML / YAML / JSON files {#tutorial_file_input_output_with_xml_yml}
==============================================
@tableofcontents
@@ -14,12 +14,12 @@ File Input and Output using XML and YAML files {#tutorial_file_input_output_with
Goal
----
You'll find answers for the following questions:
You'll find answers to the following questions:
- How to print and read text entries to a file and OpenCV using YAML or XML files?
- How to do the same for OpenCV data structures?
- How to do this for your data structures?
- Usage of OpenCV data structures such as @ref cv::FileStorage , @ref cv::FileNode or @ref
- How do you print and read text entries to a file in OpenCV using YAML, XML, or JSON files?
- How can you perform the same operations for OpenCV data structures?
- How can this be done for your custom data structures?
- How do you use OpenCV data structures, such as @ref cv::FileStorage , @ref cv::FileNode or @ref
cv::FileNodeIterator .
Source code
@@ -49,14 +49,14 @@ Here's a sample code of how to achieve all the stuff enumerated at the goal list
Explanation
-----------
Here we talk only about XML and YAML file inputs. Your output (and its respective input) file may
Here we talk only about XML, YAML and JSON file inputs. Your output (and its respective input) file may
have only one of these extensions and the structure coming from this. They are two kinds of data
structures you may serialize: *mappings* (like the STL map and the Python dictionary) and *element sequence* (like the STL
vector). The difference between these is that in a map every element has a unique name through what
you may access it. For sequences you need to go through them to query a specific item.
-# **XML/YAML File Open and Close.** Before you write any content to such file you need to open it
and at the end to close it. The XML/YAML data structure in OpenCV is @ref cv::FileStorage . To
-# **XML/YAML/JSON File Open and Close.** Before you write any content to such file you need to open it
and at the end to close it. The XML/YAML/JSON data structure in OpenCV is @ref cv::FileStorage . To
specify that this structure to which file binds on your hard drive you can use either its
constructor or the *open()* function of this:
@add_toggle_cpp