Skip to content

Instantly share code, notes, and snippets.

@masazdream
Created February 15, 2014 10:08
Show Gist options
  • Select an option

  • Save masazdream/9017121 to your computer and use it in GitHub Desktop.

Select an option

Save masazdream/9017121 to your computer and use it in GitHub Desktop.
Houghsline取得用関数 dist用画像に検出した直線を描く
// Hough's lines
void HoughLines(Mat& src, Mat& hough_image, vector<Vec4i>& lines) {
HoughLinesP(src, lines, 1, CV_PI / 180, 50, 100, 5);
vector<Vec4i>::iterator it = lines.begin();
for (; it != lines.end(); ++it) {
Vec4i lin = *it;
line(hough_image, Point(lin[0], lin[1]), Point(lin[2], lin[3]),
Scalar(0, 0, 255), 2, 4);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment