HoughLines(imgCan, lines, 1, CV_PI / 180, 200, 0, 0);
Point pt1, pt2;
for (size_t i = 0; i < lines.size(); i++)
{
float rho = lines[i][0];
float theta = lines[i][1];
double a = cos(theta), b = sin(theta);
double x0 = a * rho, y0 = b * rho;
pt1.x = cvRound(x0 + 1000 * (-b));
pt1.y = cvRound(y0 + 1000 * (a));
pt2.x = cvRound(x0 - 1000 * (-b));
pt2.y = cvRound(y0 - 1000 * (a));
line(imgHough, pt1, pt2, Scalar(0, 0, 255), 3, LINE_AA);
}
10-11
682
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)