mirror of
https://github.com/modelec/detection_pot.git
synced 2026-03-19 22:10:38 +01:00
calibration
This commit is contained in:
@@ -183,6 +183,8 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
std::cout << "isok" << std::endl;
|
||||
|
||||
cv::namedWindow("Video",cv::WINDOW_NORMAL);
|
||||
|
||||
char key = 0;
|
||||
|
||||
while(key != 27) {
|
||||
@@ -197,15 +199,21 @@ int main(int argc, char *argv[]) {
|
||||
// detect markers
|
||||
aruco::detectMarkers(image, dictionary, corners, ids, detectorParams, rejected);
|
||||
|
||||
std::cout << "isok" << std::endl;
|
||||
|
||||
// refind strategy to detect more markers
|
||||
if(refindStrategy) aruco::refineDetectedMarkers(image, board, corners, ids, rejected);
|
||||
|
||||
std::cout << "isok" << std::endl;
|
||||
|
||||
// interpolate charuco corners
|
||||
Mat currentCharucoCorners, currentCharucoIds;
|
||||
if(ids.size() > 0)
|
||||
aruco::interpolateCornersCharuco(corners, ids, image, charucoboard, currentCharucoCorners,
|
||||
currentCharucoIds);
|
||||
|
||||
std::cout << "isok" << std::endl;
|
||||
|
||||
// draw results
|
||||
image.copyTo(imageCopy);
|
||||
if(ids.size() > 0) aruco::drawDetectedMarkers(imageCopy, corners);
|
||||
@@ -216,6 +224,8 @@ int main(int argc, char *argv[]) {
|
||||
putText(imageCopy, "Press 'c' to add current frame. 'ESC' to finish and calibrate",
|
||||
Point(10, 20), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(255, 0, 0), 2);
|
||||
|
||||
std::cout << "isok" << std::endl;
|
||||
|
||||
imshow("out", imageCopy);
|
||||
key = static_cast<char>(waitKey(waitTime));
|
||||
if(key == 'c' && ids.size() > 0) {
|
||||
@@ -320,6 +330,7 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
cam.stopVideo();
|
||||
cv::destroyWindow("Video");
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user