Advertisement

基于cv2的霍夫变换Opencv源码及其详细注释

阅读量:

终于鼓起勇气研读了Hough变换的相关代码, 之前自己还无奈地表示曾编写过一种椭圆中心检测算法 =_=! 不过最终发现两者原理大致相同

static void HoughLinesStandard( const Mat& imgRef, float rhoValue, float thetaValue,
int thresholdCount, std::vector& linesArray,
int maxLineCount, double minThetaAngle,
double maxThetaAngle )
{
int iIndex = 0;
int jIndex = 0;
float inverseRho = 1 / rhoValue;
}

CV_Assert( img.type() == CV_8UC1 ); //检测输入的是否为 单通道 8-bit图像

固定 unsigned char 类型的指针 image 赋值为 img 对象的 ptr。
将 img 对象属性 step 转换为整数赋值给变量 step。
变量 width 被赋值为 img 对象的 columns 数量。
变量 height 被赋值为 img 对象的 rows 数量。

当max Theta小于m

全部评论 (0)

还没有任何评论哟~