title: OpenCV converting Canny edges to contours
body: <p>I have an OpenCV application fed from a webcam stream of an office interior (lot's of details) where I have to find an artificial marker. The marker is a black square on white background. I use Canny to find edges and cvFindContours for contouring, then approxPolyDP and co. for filtering and finding candidates, then use local histogram to filter further, bla bla bla...</p>
  
  <p>This works more or less, but not exactly how I want. FindContours always returns a closed loop, even if Canny creates a non-closed line. I get a contour walking on both sides of the line forming a loop. For closed edges on the Canny image (my marker), I get 2 contours, one on the inside, and an other on the outside. 
  I have to problems with this operation:</p>
  
  <ul>
  <li><p>I get 2 contours for each marker (not that serious)</p></li>
  <li><p>the most trivial filtering is not usable (reject non-closed contours) </p></li>
  </ul>
  
  <p><strong>So my question: is it possible to get non-closed contours for non-closed Canny edges?</strong> 
  Or what is the standard way to solve the above 2 issues?</p>
  
  <p>Canny is a very good tool, but I need a way convert the 2D b/w image, into something easily process-able. Something like connected components listing all pixels in walking order of the component. So I can filter for loops, and feed it into approxPolyDP.</p>
  
  <p>Update: I missed some important detail: the marker can be in any orientation (it's not front facing the camera, no right angles), in fact what I'm doing is 3D orientation estimation, based on the 2D projection of the marker.</p>