Improve HoughLine accuracy from edges

asked 2014-03-22 01:11:06 -0500

Luek gravatar image

In one of my steps to find the edges of a card I am using HoughLines to find the lines in the image. I get back quite skewed results, the lines are indeed based of the lines in the image but the accuracy of the lines is not as good as I would like.

To apply the transformation I am using the following code.

    vector<Vec2f> lines;
    HoughLines(outerBox, lines, 1, CV_PI/180, 270);

    for(int i=0;i<lines.size();i++)
        drawLine(lines[i], outerBox, CV_RGB(0,0,128));
    }![image description](http://)

When given this image:

image description

I get these results: (image too large sorry for link)


How can I Improve the accuracy of the transformation? I have played around with the values of the last parameter and can't find the sweet spot.

edit retag flag offensive close merge delete


I am just playing with this now trying to make a better corner detector and I am guessing you first have to increase the BlockSize, however I don't see a parameter for that.

GrumbleLion gravatar imageGrumbleLion ( 2014-03-22 11:00:12 -0500 )edit