diff --git a/doc/tutorials/calib3d/camera_calibration/camera_calibration.markdown b/doc/tutorials/calib3d/camera_calibration/camera_calibration.markdown index 4f899f94ba..0126829f48 100644 --- a/doc/tutorials/calib3d/camera_calibration/camera_calibration.markdown +++ b/doc/tutorials/calib3d/camera_calibration/camera_calibration.markdown @@ -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. diff --git a/doc/tutorials/calib3d/camera_calibration_pattern/camera_calibration_pattern.markdown b/doc/tutorials/calib3d/camera_calibration_pattern/camera_calibration_pattern.markdown index 54b0c0e1cd..7b5a92b417 100644 --- a/doc/tutorials/calib3d/camera_calibration_pattern/camera_calibration_pattern.markdown +++ b/doc/tutorials/calib3d/camera_calibration_pattern/camera_calibration_pattern.markdown @@ -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 diff --git a/doc/tutorials/calib3d/camera_calibration_square_chess/camera_calibration_square_chess.markdown b/doc/tutorials/calib3d/camera_calibration_square_chess/camera_calibration_square_chess.markdown index b278bb87ac..ddd7dbae79 100644 --- a/doc/tutorials/calib3d/camera_calibration_square_chess/camera_calibration_square_chess.markdown +++ b/doc/tutorials/calib3d/camera_calibration_square_chess/camera_calibration_square_chess.markdown @@ -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 camera’s 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 point’s coordinates (x, y, z). \ No newline at end of file