I want to use the detectMarkers
function for detection ArUco Markers. I am using Emgu to write the code in c#. I get multiple errors when I use the function. I am following the example in this link https://docs.opencv.org/3.4/d5/dae/tutorial_aruco_detection.html. This is my code:
Dictionary.PredefinedDictionaryName name = new Dictionary.PredefinedDictionaryName();
Dictionary Dict = new Dictionary(name);
VectorOfVectorOfPointF Corners = new VectorOfVectorOfPointF();
VectorOfInt Ids = new VectorOfInt();
DetectorParameters Parameters = new DetectorParameters();
//If I uncomment this I get rid of some errors but new errors arise
/*
Parameters.AdaptiveThreshWinSizeMin = 5;
Parameters.AdaptiveThreshWinSizeMax = 21;
Parameters.AdaptiveThreshWinSizeStep = 4;
*/
VectorOfVectorOfPointF Rejected = new VectorOfVectorOfPointF();
ArucoInvoke.DetectMarkers(imgOriginal, Dict, Corners, Ids, Parameters, Rejected);
The error with the three lines commented is
CvException: OpenCV: params->adaptiveThreshWinSizeMin >= 3 && params->adaptiveThreshWinSizeMax >= 3
With the three lines uncommented it gives another error
OpenCV: minPerimeterRate > 0 && maxPerimeterRate > 0 && accuracyRate > 0 && minCornerDistanceRate >= 0 && minDistanceToBorder >= 0
Is it that I need to set all kinds of default values for DetectorParameters
? As far as I see in the documentation there are already default values for the DetectorParameters
. Are those default values not okay or is there another reason why I get these errors?
Help would really be appreciated!