1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Merge pull request #26753 from shyama7004:RotatedMarkers

Fix rotated aruco marker board generation #26753

### Issue : [25884](https://github.com/opencv/opencv/issues/25884)
### 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
- [x] 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-01-13 13:21:03 +05:30
committed by GitHub
parent d6f60d4ab8
commit 08a88816ed
2 changed files with 53 additions and 1 deletions
+7 -1
View File
@@ -115,7 +115,13 @@ void Board::Impl::generateImage(Size outSize, OutputArray img, int marginSize, i
}
// get marker
Size dst_sz(outCorners[2] - outCorners[0]); // assuming CCW order
Point2f vecWidth = outCorners[1] - outCorners[0];
float width = (float)cv::norm(vecWidth);
Point2f vecHeight = outCorners[2] - outCorners[0];
float height = (float)cv::norm(vecHeight);
Size dst_sz(cvRound(width), cvRound(height));
dst_sz.width = dst_sz.height = std::min(dst_sz.width, dst_sz.height); //marker should be square
dictionary.generateImageMarker(ids[m], dst_sz.width, marker, borderBits);