Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Improve HoughLine accuracy from edges

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)

Image

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.