提供以下代码(被要求删除链接).但我想知道它是如何工作的.如果这被认为是边缘检测或斑点检测,我很困惑,因为维基百科将高斯拉普拉斯(LoG)列为斑点检测.
此外,有人可以解释并提供更深层次的解释,说明为什么计算绝对值以及focus_stack()函数中发生了什么?
# Compute the gradient map of the image
def doLap(image):
# YOU SHOULD TUNE THESE VALUES TO SUIT YOUR NEEDS
kernel_size = 5 # Size of the laplacian window
blur_size = 5 # How big of a kernal to use for the gaussian blur
# Generally, keeping these two values the same or very close works well
# Also, odd numbers, please...
blurred = cv2.GaussianBlur(image, (blur_size,blur_size), 0)
return cv2.Laplacian(blurred, cv2.CV_64F, ksize=kernel_size)
#
# This …Run Code Online (Sandbox Code Playgroud) python opencv image-processing computer-vision laplacianofgaussian
我们一直在学习像 Sobel 和 Roberts 的卷积矩阵这样的方法来检测图像中的边缘,扩展到 Canny 方法来清除它们。但是现在,我们正在学习“线”检测,而不是“边缘”检测 - 使用霍夫变换等方法。
问题是 - 我什至不知道如何概念化“线”和“边缘”之间的区别。有人可以在不使用复杂的数学方程等的情况下向我解释这种差异吗?
image image-processing edge-detection straight-line-detection