【问题标题】:Question about hough transform probabilistic关于霍夫变换概率的问题
【发布时间】:2019-05-15 06:17:14
【问题描述】:

我正在实现一个霍夫变换概率算法。

我了解了算法的概念,但有一点我不明白。

下面的代码来自OpenCV,我理解其余的行,但是为什么他们将numrho设置为((width * height)*2 + 1) / rho而不是从(0,0)到(宽度,高度)?

int i, j;
float irho = 1 / rho;

CV_Assert( img.type() == CV_8UC1 );

const uchar* image = img.ptr();
int step = (int)img.step;
int width = img.cols;
int height = img.rows;


int numangle = cvRound((max_theta - min_theta) / theta);
int numrho = cvRound(((width + height) * 2 + 1) / rho);

这是关于算法的问题,没有错误信息可以放

【问题讨论】:

    标签: c++ opencv transform probability


    【解决方案1】:

    rho 和 theta 是离散化步骤,您可以将它们设置为您喜欢的任何值。

    "(width + height) * 2" 是要离散化的周长(别名:图像的“周长”)

    【讨论】:

    • 我很感激,我现在​​明白了
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-20
    • 1970-01-01
    • 2021-07-17
    • 2011-05-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多