|
|
|
@ -1604,7 +1604,7 @@ Mat dst, detected_edges;
|
|
|
|
|
int edgeThresh = 1;
|
|
|
|
|
int lowThreshold = 77;
|
|
|
|
|
int max_lowThreshold = 100;
|
|
|
|
|
int ratio = 3;
|
|
|
|
|
int thresholdRatio = 3;
|
|
|
|
|
int kernel_size = 3;
|
|
|
|
|
|
|
|
|
|
vector<Vec3f> circles;
|
|
|
|
@ -1625,8 +1625,8 @@ void CannyThreshold(int, void*)
|
|
|
|
|
blur(src_gray, detected_edges, Size(3, 3));
|
|
|
|
|
|
|
|
|
|
/// 运行Canny算子
|
|
|
|
|
Canny(detected_edges, detected_edges, lowThreshold, lowThreshold*ratio, kernel_size);
|
|
|
|
|
//printf("LowThresold : %d -- %d \n", lowThreshold, lowThreshold*ratio);
|
|
|
|
|
Canny(detected_edges, detected_edges, lowThreshold, lowThreshold*thresholdRatio, kernel_size);
|
|
|
|
|
//printf("LowThresold : %d -- %d \n", lowThreshold, lowThreshold*thresholdRatio);
|
|
|
|
|
/// 使用 Canny算子输出边缘作为掩码显示原图像,声明一个三通道图像,像素值全为0,用来将霍夫变换检测出的圆画在上面
|
|
|
|
|
dst = Scalar::all(0);
|
|
|
|
|
|
|
|
|
|