Laplace linear filtering,. Edge Detection
Laplacian
Calculates the Laplacian of an image.
-
-
C + +: void Laplacian (inputarray
src, outputarray
DST, int
ddepth, int
ksize=1, double
scale =1, double
delta=0, int
bordertype=border_default )
-
-
Python: Cv2. Laplacian (SRC, ddepth [Dst [, ksize [, scale [, Delta [, Bordertype ] ] ] ] ] )→dst
-
-
C:   void cvlaplace ( const cvarr*
src , cvarr* DST , int aperture_size =3 )
-
-
Python: cv. Laplace (src, DST, aperturesize=3 ) →none
-
Parameters: |
- 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. See Getderivkernels () for details. The size must be positive and odd.
- Scale –optional scale factor for the computed Laplacian values. By default, no scaling is applied. See Getderivkernels () for details.
- Delta –optional Delta value, added to the results prior to storing them in DST .
- Bordertype –pixel extrapolation method. SeeBorderinterpolate () for details.
|
The function calculates the Laplacian of the source image by adding up the second x and y derivatives calculated using the Sobel operator:
This is do when ksize > 1 . When ksize = = 1 , the Laplacian is computed by filtering the image with the following Aperture
Laplace
Laplacian transformation of the computed image
void Cvlaplace (const cvarr* SRC, cvarr* dst, int aperture_size=3);
-
Src
-
Enter an image.
-
Dst
-
The output image.
-
Aperture_size
-
the kernel size (as defined in Cvsobel).
The function Cvlaplace computes the Laplacian transformation of the input image by first calculating the second-order X-and Y-differential with the Sobel operator, and then summing:
The aperture_size=1 gives the fastest results, which is equivalent to making a convolution of images such as the following cores:
the whole content of this blog is original, if reproduced please indicate the sourcehttp://blog.csdn.net/myhaspl/
#-*-Coding:utf-8-*- #线性锐化滤波, Laplace image transform #code:[email protected]import cv2fn= "test6.jpg" Myimg=cv2.imread (FN) img= Cv2.cvtcolor (Myimg,cv2. Color_bgr2gray) Jgimg=cv2. Laplacian (img,-1) cv2.imshow (' src ', img) cv2.imshow (' DST ', jgimg) Cv2.waitkey () cv2.destroyallwindows ()
the whole content of this blog is original, if reproduced please indicate the sourcehttp://blog.csdn.net/myhaspl/
Mathematical Road-python Computing (21)-Machine vision-Laplace linear filtering