c++ - OpenCV3.0: How to detect normal marker using ArUco library -
i implemented aruco module in opencv3.0 works fine while detecting aruco markers.
for aruco marker detection using image
but possible detect normal markers below image using aruco module?
here snippets of code:
aruco::detectorparameters detectorparams; if (parser.has("dp")) { bool readok = readdetectorparameters(parser.get<string>("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<string>("c"), cammatrix, distcoeffs); if (!readok) { cerr << "invalid camera file" << endl; return 0; } } // detect markers , 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) { (unsigned int = 0; < 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; }
how can make code detect normal markers?
in faq
should use predefined dictionary or generate own dictionary?
in general, easier use 1 of predefined dictionaries. however, if need bigger dictionary (in terms of number of markers or number of bits) should generate own dictionary. dictionary generation useful if want maximize inter-marker distance achieve better error correction during identification step.
i think case, want use isn't in standard aruco dictionary. dictionary class, need create 1 , fill correct data.
Comments
Post a Comment