0

I've used Canny and findContour to detect my contours of drawn coloured lines. However, because of this, I am currently facing a problem of having lines being bounded. What I want is to overlay and detect the entire line.

This is what I have now: https://i.stack.imgur.com/o8i3s.jpg

I want the blue detection lines to cover the entire line that is being drawn. Not just the perimeter of the line drawn. How is this possible?

Jeru Luke
  • 20,118
  • 13
  • 80
  • 87
  • if you want to detect the lines which are only in blue then use the Opencv inrange() method.for reference https://stackoverflow.com/questions/48109650/how-to-detect-two-different-colors-using-cv2-inrange-in-python-opencv – MathanKumar Jun 23 '20 at 05:17
  • No, what's shown in the image is a red and black maze respectively, with drawContour() in blue. The contour drawn (in blue) only covers the perimeter of the pen-drawn lines. I want the entire pen-drawn lines to be in blue. – discombobulated Jun 24 '20 at 01:51

1 Answers1

0

The perimeter of pen-drawn line is highlighted with blue because you are using 1 as thickness in drawContours() function. To fill it with blue, set thickness = -1 in drawContours().

Refer this

Jeru Luke
  • 20,118
  • 13
  • 80
  • 87
Rahul Kedia
  • 1,400
  • 6
  • 18