Mathematical Road-python Computing (21)-Machine vision-Laplace linear filtering

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.