Merge pull request #27221 from shyama7004:docChanges

Minor changes in calib3d docs for clarity #27221

### 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:
Skreg 2025-04-21 23:45:37 +05:30 committed by GitHub
parent 29ef2a1da3
commit e37819c2ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 8 deletions

View File

@ -129,7 +129,7 @@ Explanation
-# **Find the pattern in the current input**
The formation of the equations I mentioned above aims
to finding major patterns in the input: in case of the chessboard this are corners of the
to finding major patterns in the input: in case of the chessboard these are corners of the
squares and for the circles, well, the circles themselves. ChArUco board is equivalent to
chessboard, but corners are matched by ArUco markers. The position of these will form the
result which will be written into the *pointBuf* vector.
@ -140,7 +140,7 @@ Explanation
of the patterns. cv::findChessboardCorners and cv::findCirclesGrid return a boolean variable
which states if the pattern was found in the input (we only need to take into account
those images where this is true!). `CharucoDetector::detectBoard` may detect partially visible
pattern and returns coordunates and ids of visible inner corners.
pattern and returns coordinates and ids of visible inner corners.
@note Board size and amount of matched points is different for chessboard, circles grid and ChArUco.
All chessboard related algorithm expects amount of inner corners as board width and height.

View File

@ -11,7 +11,7 @@ Create calibration pattern {#tutorial_camera_calibration_pattern}
| Compatibility | OpenCV >= 3.0 |
The goal of this tutorial is to learn how to create calibration pattern.
The goal of this tutorial is to learn how to create a calibration pattern.
You can find a chessboard pattern in https://github.com/opencv/opencv/blob/4.x/doc/pattern.png
@ -47,14 +47,14 @@ create a ChAruco board pattern in charuco_board.svg with 7 rows, 5 columns, squa
python gen_pattern.py -o charuco_board.svg --rows 7 --columns 5 -T charuco_board --square_size 30 --marker_size 15 -f DICT_5X5_100.json.gz
If you want to change unit use -u option (mm inches, px, m)
If you want to change the measurement units, use the -u option (e.g. mm, inches, px, m)
If you want to change page size use -w and -h options
If you want to change the page size, use the -w (width) and -h (height) options
If you want to use your own dictionary for ChAruco board your should write name of file with your dictionary. For example
If you want to use your own dictionary for the ChAruco board, specify the name of your dictionary file. For example
python gen_pattern.py -o charuco_board.svg --rows 7 --columns 5 -T charuco_board -f my_dictionary.json
You can generate your dictionary in my_dictionary.json file with number of markers 30 and markers size 5 bits by using opencv/samples/cpp/aruco_dict_utils.cpp.
You can generate your dictionary in the file my_dictionary.json with 30 markers and a marker size of 5 bits using the utility provided in opencv/samples/cpp/aruco_dict_utils.cpp.
bin/example_cpp_aruco_dict_utils.exe my_dict.json -nMarkers=30 -markerSize=5

View File

@ -63,4 +63,9 @@ image.
opencv/samples/cpp/calibration.cpp, function computeReprojectionErrors).
Question: how would you calculate distance from the camera origin to any one of the corners?
Answer: As our image lies in a 3D space, firstly we would calculate the relative camera pose. This would give us 3D to 2D correspondences. Next, we can apply a simple L2 norm to calculate distance between any point (end point for corners).
Answer: After obtaining the camera pose using solvePnP, the rotation (rvec) and translation (tvec) vectors define the transformation between the world (chessboard) coordinates and the camera coordinate system. To calculate the distance from the cameras origin to any chessboard corner, first transform the 3D point from the chessboard coordinate system to the camera coordinate system (if not already done) and then compute its Euclidean distance using the L2 norm, for example:
// assuming 'point' is the 3D position of a chessboard corner in the camera coordinate system
double distance = norm(point);
This is equivalent to applying the L2 norm on the 3D points coordinates (x, y, z).