Ask Your Question

Revision history [back]

I recommend using Probabilistic Hough Transform - void HoughLinesP(InputArray image, OutputArray lines, double rho, double theta, int threshold, double minLineLength=0, double maxLineGap=0 )

vector<Vec2f> lines;
HoughLinesP(dst, lines, 1, CV_PI/180,33 ,1, 1 );

Now, lines contains the end points of the line segments detected by the Probabilistic Hough transform. If you want to know the length of the line segment (in pixels), you can calculate the distance between its end points.

What berak means to say is that since cracks are detected as lines by Hough Transform, if you get lines.size() = 0 (i.e. the lines vector is empty), no cracks were found.