Download samples/cpp/tutorial_code/snippets/imgproc_HoughLinesP.cpp from tgollogly/test: direct link, hf CLI and curl.
- Browser
- Download file 784 Bytes
-
https://huggingface.co/tgollogly/test/resolve/main/samples/cpp/tutorial_code/snippets/imgproc_HoughLinesP.cpp
- Command line
-
hf download hf://tgollogly/test/samples/cpp/tutorial_code/snippets/imgproc_HoughLinesP.cpp
-
curl -L -o imgproc_HoughLinesP.cpp https://huggingface.co/tgollogly/test/resolve/main/samples/cpp/tutorial_code/snippets/imgproc_HoughLinesP.cpp
784 Bytes
| using namespace cv; | |
| using namespace std; | |
| int main(int argc, char** argv) | |
| { | |
| Mat src, dst, color_dst; | |
| if( argc != 2 || !(src=imread(argv[1], IMREAD_GRAYSCALE)).data) | |
| return -1; | |
| Canny( src, dst, 50, 200, 3 ); | |
| cvtColor( dst, color_dst, COLOR_GRAY2BGR ); | |
| vector<Vec4i> lines; | |
| HoughLinesP( dst, lines, 1, CV_PI/180, 80, 30, 10 ); | |
| for( size_t i = 0; i < lines.size(); i++ ) | |
| { | |
| line( color_dst, Point(lines[i][0], lines[i][1]), | |
| Point( lines[i][2], lines[i][3]), Scalar(0,0,255), 3, 8 ); | |
| } | |
| namedWindow( "Source", 1 ); | |
| imshow( "Source", src ); | |
| namedWindow( "Detected Lines", 1 ); | |
| imshow( "Detected Lines", color_dst ); | |
| waitKey(0); | |
| return 0; | |
| } | |