Closed
Conversation
functioning version with a default set of flags that works with the broken charuco boards
fixed small bug
asmorkalov
requested changes
Jun 8, 2023
Comment on lines
+145
to
+146
| # cv.drawChessboardCorners(vis, pattern_size, corners, found) | ||
| cv.aruco.drawDetectedCornersCharuco(vis, corners, charucoIds=_charucoIds) |
Contributor
There was a problem hiding this comment.
sample supports both chessboards and charuco boards. The change breaks the first one.
Comment on lines
+191
to
+202
| fov = 60 | ||
| focal_length = width / (2 * np.tan(fov * np.pi / 360)) | ||
| mtx = np.array([[focal_length, 0, w / 2], | ||
| [0, focal_length, h / 2], | ||
| [0, 0, 1]]) | ||
| dist = np.array([[0, 0, 0, 0, 0]], dtype=np.float32) | ||
| flags = cv2.CALIB_USE_INTRINSIC_GUESS + cv2.CALIB_FIX_K3 + cv2.CALIB_FIX_K4 + cv2.CALIB_FIX_K5 + cv2.CALIB_FIX_K6 | ||
| flags += cv2.CALIB_FIX_K2 | ||
| flags += cv2.CALIB_ZERO_TANGENT_DIST | ||
| flags += cv2.CALIB_FIX_PRINCIPAL_POINT | ||
| flags += cv2.CALIB_FIX_ASPECT_RATIO | ||
| rms, camera_matrix, dist_coefs, _rvecs, _tvecs = cv.calibrateCamera(obj_points, img_points, (w, h), mtx, dist, flags=flags) |
Contributor
There was a problem hiding this comment.
It's not relevant to the sample
| for (corners, pattern_points) in chessboards: | ||
| img_points.append(corners) | ||
| obj_points.append(pattern_points) | ||
| obj_points_tmp, img_points_tmp = matchImagePointsforcharuco(board, corners, _charucoIds) |
Contributor
There was a problem hiding this comment.
There is matchImagePoints method for it: https://docs.opencv.org/4.x/d4/db2/classcv_1_1aruco_1_1Board.html#a305c3c47c1f87562ed06de5c7e703e4f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.