Why increase threshold in HoughLinesP sometime yeild some lines?

asked 2018-04-16 18:19:58 -0500

open_ranger gravatar image
void onTrackbarSlide_1(int pos,void*){
    threshold_1=pos;
    HoughLinesP(edges,lines,1,CV_PI/180,threshold_1,threshold_2,0);
    printf("Lines  rows: %4.1d\t cols: %4.1d\t  type: %4.1d\t channels: %4.1d\t\n",lines.rows,lines.cols,lines.type(),lines.channels());
    imageWork=imageResized.clone();
    drawLines(imageWork,lines);
    imshow("Result",imageWork);
}

void onTrackbarSlide_2(int pos,void*){
        threshold_2=pos;
        HoughLinesP(edges,lines,1,CV_PI/180,threshold_1,threshold_2,0);
        printf("Lines  rows: %4.1d\t cols: %4.1d\t  type: %4.1d\t channels: %4.1d\t\n",lines.rows,lines.cols,lines.type(),lines.channels());
        imageWork=imageResized.clone();
        drawLines(imageWork,lines);
        imshow("Result",imageWork);
}

image description

Look the result I got from the above code,as I increase the threshold the line number decrease for most of the time but some time it went up.What is the logic in that?

edit retag flag offensive close merge delete