【发布时间】: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