Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

How to detect normal markers with ArUco module in OpenCV3.0

$
0
0
I want to detect a normal marker (Not an ArUco marker) using ArUco module in OpenCV3.0 . Below is the image for a normal marker. ![image description](/upfiles/1454333134414951.jpg) I have implemented the ArUco detection but not able to figure out how to make ArUco module to detect custom markers. aruco::DetectorParameters detectorParams; if (parser.has("dp")) { bool readOk = readDetectorParameters(parser.get("dp"), detectorParams); if (!readOk) { cerr << "Invalid detector parameters file" << endl; return 0; } } aruco::Dictionary dictionary = aruco::getPredefinedDictionary(aruco::PREDEFINED_DICTIONARY_NAME(dictionaryId)); Mat camMatrix, distCoeffs; if (estimatePose) { bool readOk = readCameraParameters(parser.get("c"), camMatrix, distCoeffs); if (!readOk) { cerr << "Invalid camera file" << endl; return 0; } } // detect markers and estimate pose aruco::detectMarkers(image, dictionary, corners, ids, detectorParams, rejected); if (estimatePose && ids.size() > 0) aruco::estimatePoseSingleMarkers(corners, markerLength, camMatrix, distCoeffs, rvecs, tvecs); // draw results image.copyTo(imageCopy); if (ids.size() > 0) { aruco::drawDetectedMarkers(imageCopy, corners, ids); if (estimatePose) { for (unsigned int i = 0; i < ids.size(); i++) aruco::drawAxis(imageCopy, camMatrix, distCoeffs, rvecs[i], tvecs[i], markerLength * 0.5f); } } if (showRejected && rejected.size() > 0) aruco::drawDetectedMarkers(imageCopy, rejected, noArray(), Scalar(100, 0, 255)); imshow("out", imageCopy); char key = (char)waitKey(waitTime); if (key == 27) break; }

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>