Canny( detected_edges, detected_edges, lowThreshold, lowThreshold*ratio, kernel_size );
where the arguments are:
detected_edges: Source image, grayscale
detected_edges: Output of the detector (can be the same as the input)
lowThreshold: The value entered by the user moving the Trackbar
highThreshold: Set in the program as three times the lower threshold (following Canny’s recommendation)
kernel_size: We defined it to be 3 (the size of the Sobel kernel to be used internally)
3条答案
按热度按时间b1uwtaje1#
我认为这应该采取的情况下,如果你张贴一些样本图像将是有用的,但我会尝试回答无论如何.这里是从OpenCV文档
我通常使用
highThreshold = 255 and lowThreshold = 255/3
ev7lccsx2#
正如Samer所说,这可以根据具体情况而定。这里有一些代码,它在opencv中使用了跟踪条,并在原始图像旁边显示canny图像,以便快速试验不同的阈值。
pod7payv3#
你可以使用这个方程,它是有用的,你可以应用蓝色来增强它。