create charuco board

This commit is contained in:
ackimixs
2024-04-08 14:59:04 +02:00
parent 629836c2ef
commit 87a1490708
2 changed files with 21 additions and 1 deletions

View File

@@ -65,4 +65,13 @@ set(photo
add_executable(photo ${photo})
target_link_libraries( photo ${OpenCV_LIBS} )
target_link_libraries( photo ${OpenCV_LIBS} )
set(createCharucoBoard
${COMMON_SOURCES}
createCharucoBoard.cpp
)
add_executable(createCharucoBoard ${createCharucoBoard})
target_link_libraries( createCharucoBoard ${OpenCV_LIBS} )

11
createCharucoBoard.cpp Normal file
View File

@@ -0,0 +1,11 @@
#include <opencv2/opencv.hpp>
int main() {
cv::aruco::Dictionary dictionary = cv::aruco::getPredefinedDictionary(cv::aruco::DICT_4X4_50);
cv::aruco::CharucoBoard board(cv::Size(5, 7), 0.04f, 0.02f, dictionary);
cv::Mat boardImage;
board.generateImage(cv::Size(2480, 3508), boardImage, 10, 1);
cv::imwrite("BoardImage.jpg", boardImage);
return 0;
}