Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

it detects many lines, so you need a vector<Vec4f> , like:

  Ptr<LineSegmentDetector> det = createLineSegmentDetector();
  vector<Vec4i> lines;
  det->detect(img_1, lines);
  for (size_t i=0; i<lines.size(); i++) {
      Vec4i v = lines[i];
      Point from(v[0], v[1]);
      Point to(v[2], v[3]);
  }