OpenCV: Laplace Operator

摘自https://docs.opencv.org/4.2.0/d5/db5/tutorial_laplace_operator.html

摘自https://docs.opencv.org/4.2.0/d4/d86/group__imgproc__filter.html#gad78703e4c8fe703d479c1860d76429e6

Sobel Operator is based on the fact that in the edge area, the pixel intensity shows a "jump" or a high variation of intensity. Getting the first derivative of the intensity, we observed that an edge is characterized by a maximum.

The second derivative can also be used to detect edges. Since images are "2D", we would need to take the derivative in both dimensions. Here, the Laplacian operator comes handy.

This is done when ksize > 1. When ksize = 1, the Laplacian is computed by filtering the image with the following 3×3 aperture:

The Laplacian operator is implemented in OpenCV by the function Laplacian() . In fact, since the Laplacian uses the gradient of images, it calls internally the Sobel operator to perform its computation.

dst=cv.Laplacian(src, ddepth[, dst[, ksize[, scale[, delta[, borderType]]]]])

src Source image.
dst Destination image of the same size and the same number of channels as src .
ddepth Desired depth of the destination image.
ksize Aperture size used to compute the second-derivative filters.  The size must be positive and odd.
scale Optional scale factor for the computed Laplacian values. By default, no scaling is applied. 
delta Optional delta value that is added to the results prior to storing them in dst .
borderType Pixel extrapolation method, see BorderTypes

猜你喜欢

转载自blog.csdn.net/Airfrozen/article/details/104449983
今日推荐