Can someone explain why do I have a blue line drawn over my image while doing an ArUco Marker Detection using the drawDetectedMarkers() function?

asked 2017-12-05 16:04:29 -0600

SubMishMar gravatar image

updated 2017-12-05 19:31:08 -0600

image description

As can be seen in the image,some of the detected markers have a blue line associated with them. Can anyone kindly explain why is this so?

Thanks in advance.

Here is the relevant part of the code:

cv::Ptr<cv::aruco::Dictionary> dictionary =
cv::Mat image;
std::vector<int> ids;
std::vector<std::vector<cv::Point2f> > corners;

//Clock Variables
clock_t begin, end;
double dt;

cv::namedWindow("Image View");
cv::moveWindow("Image View", 20,20);
double c_y, c_x;
double mean_x, mean_y, d_fm_ctr;
while (true) 
 cap >> image; // videocapture is used to take images from a camera in Real Time
 begin = clock();
 c_y = (image.rows - 1)/2;
 c_x = (image.cols - 1)/2;
 cv::aruco::detectMarkers(image, dictionary, corners, ids);
 // if at least one marker detected
 if (ids.size() > 0)
    cv::aruco::drawDetectedMarkers(image, corners, ids);
 end = clock();
 dt = double(end - begin) / CLOCKS_PER_SEC;
 //std::cout << 1/dt << std::endl;
 cv::imshow("Image View", image);
 char key = (char) cv::waitKey(1);
 if (key == 27)

cv::destroyWindow("Image View");
return 0;


edit retag flag offensive close merge delete


Any chance you can post your code and input image?

sjhalayka gravatar imagesjhalayka ( 2017-12-05 17:19:13 -0600 )edit

os, opencv version ? reminds me of this

berak gravatar imageberak ( 2017-12-06 01:13:02 -0600 )edit

Its in principle one of your axis that is drawn incorrectly. First try the latest master branch, as @berak indicated, that might already solve it.

StevenPuttemans gravatar imageStevenPuttemans ( 2017-12-06 04:36:14 -0600 )edit