Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

What's the best edge detection for solid color difference?

I am looking for ways to capture a marker-drawn empty shape on my camera. It is something like drawing a rectangle ( 2/3 the size of the card) on a blank postcard, with a marker of any color. I want to use openCV to "trace over" the exact lines when I switch on my camera. i.e. video capture.

What I have now is 1. cvtColor to gray. 2. bilateral filter(5, 100, 100) 3.Canny (lower: 50, max 255) 4. findContours 5. drawContours, onto my frame. While this is working for now, I am guessing there might be a better way since what I'm detecting is quite clear. A solid color against a white background. Is there a better way to detect and trace over my lines? P.S. The above fails when my marker is thinner. I hope it works with pencils

What's the best edge detection for solid color difference?

I am looking for ways to capture a marker-drawn empty shape on my camera. It is something like drawing a rectangle ( 2/3 the size of the card) on a blank postcard, with a marker of any color. I want to use openCV to "trace over" the exact lines when I switch on my camera. i.e. video capture.

What I have now is

1.
  1. cvtColor to gray. 2. gray
  2. bilateral filter(5, 100, 100) 3.Canny 100)
  3. Canny (lower: 50, max 255) 4. findContours 5. 255)
  4. findContours
  5. drawContours, onto my frame. frame.

While this is working for now, I am guessing there might be a better way since what I'm detecting is quite clear. A solid color against a white background. Is there a better way to detect and trace over my lines? P.S. The above fails when my marker is thinner. I hope it works with pencils