Questions tagged [laplacian]

The Laplacian is a generalized second order derivative. Frequently applied as a filter in image processing. When using this tag also include the more generic [image-processing] tag if applicable, as well as the language you are coding in for context.

The Laplacian is the sum of the second order derivatives along each dimension, equivalent to the trace of the Hessian matrix.

In image processing, the discrete approximation to the Laplacian most frequently used is a 3x3 filtering mask with weights:

0  1  0           1  1  1
1 -4  1     or    1 -8  1
0  1  0           1  1  1

The left one can be seen as the addition of the 1D second order derivative [1 -2 1] and its transpose. The right one additionally adds two diagonal versions.

The filter can be used to construct an edge detector (Marr-Hildreth), to enhance edges (by subtracting it from the original image), etc.

See also .

51 questions
15
votes
4 answers

Laplacian of gaussian filter use

This is a formula for LoG filtering: (source: ed.ac.uk) Also in applications with LoG filtering I see that function is called with only one parameter: sigma(σ). I want to try LoG filtering using that formula (previous attempt was by gaussian…
maximus
  • 4,201
  • 15
  • 64
  • 117
10
votes
1 answer

Plot the timeframe of each unique sound loop in a song, with rows sorted by sound similarity using python Librosa

Background Here's a video of a song clip from an electronic song. At the beginning of the video, the song plays at full speed. When you slow down the song you can hear all the unique sounds that the song uses. Some of these sounds repeat. Mp3, Wav…
Sam
  • 1,765
  • 11
  • 82
  • 176
8
votes
2 answers

How to calculate a Laplacian mask or any size

I would like to know how to calculate a Laplacian mask of an arbitrary odd size kernel (2nd derivative). For example, I know a 3x3 would be: 1 1 1 1 -8 1 1 1 1 And a 5x5 mask would be: 1 1 1 1 1 1 1 1 1 1 1 1 -24 1 1 1 1 1 1 …
terry
  • 83
  • 1
  • 1
  • 4
7
votes
1 answer

how is Laplacian filter calculated?

I don't really follow how they came up with the derivative equation. Could somebody please explain in some details or even a link to somewhere with sufficient math explanation? Laplacian filter looks like
wisdom
  • 412
  • 2
  • 5
  • 20
5
votes
1 answer

GPU-based Laplacian Pyramid

I have implemented an image blending method for seamless blending using plain C++. Now I want to convert this code for GPU (using OpenGL ES 2 Shaders for mobile devices). Basically the method creates Gaussian and Laplacian Pyramides for each image…
Hyndrix
  • 4,282
  • 7
  • 41
  • 82
4
votes
1 answer

Solve Poisson's equation with FFTW, MPI and C programming language

Currently I am trying to implement a 3D solver for Poisson's equation thanks to the FFTW3 library and with MPI in C. My problem consists on solving the problem in Fourier space and then perform a backward transform which allows me to get the…
steven
  • 41
  • 3
4
votes
1 answer

How does the skimage.filters.laplace function work in Python?

I am trying to figure out the kernel being used in skimage.filters's laplace function. I know that a Laplacian filter is based on matrix convolution, but I just can't seem to make sense of the values produced by skimage.filters's laplace…
Ethan Yim
  • 85
  • 1
  • 6
4
votes
1 answer

Laplacian Filter opencv c++

I was learning filters in OpenCV, but I'm a little confused about the Laplacian filter. My result is very different from the Laplacian filter in OpenCV lib. For first, I use a Gaussian filter for the image: Mat filtroGauss(Mat src){ Mat gauss =…
ShottyNo
  • 63
  • 1
  • 7
3
votes
1 answer

Why is the blurry image getting a better variance of laplacian score?

The following code finds the best-focus image within a set most of the time, but there are some images where it returns a higher value for the image that is way more blurry to my eye. I am using OpenCV 3.4.2 on Linux and/or Mac. import…
Eric Hansen
  • 187
  • 1
  • 1
  • 10
2
votes
0 answers

Implementing sharpness measure using Laplace Operator OpenCV

this is my first question, any criticism is welcome. I've been trying to implement the sharpness estimator presented in section 2.2 of this paper, using Python and OpenCV, but haven't been very succesful. First I load the Original Image: and crop…
Cassio-4
  • 21
  • 2
2
votes
1 answer

Second derivative using fft

All, I am trying to take the laplacian of the following function: g(x,y) = 1/2cx^2+1/2dy2 The laplacian is c + d, which is a constant. Using FFT I should get the same ( in my FFT example I am padding the function to avoid edge effects). Here is my…
2
votes
0 answers

Implementation of FitzHugh-Nagumo diffusion model diverging by first iteration

I'm trying to implement the model described in this paper, which simulates the equation proposed by Alan Turing of the FitzHugh-Nagumo model in 2D as a model for forming animal skin patterns — in other words: simulating two substances diffusing…
micycle
  • 3,328
  • 14
  • 33
2
votes
0 answers

Laplacian Matrix Has Negative Eigenvalues

I am trying to implement a simple version of spectral clustering using the normalized (random walk) Laplacian matrix in Python. After testing my function with a toy dataset, I found that my Laplacian matrix has negative eigenvalues. Here is my…
YLZ
  • 21
  • 2
2
votes
1 answer

Laplacian kernels of higher order in image processing

In literature on digital image processing you find examples of Laplace kernels of relatively low orders, typically, 3 or 5. I wonder, is there any general way to build Laplace kernels or arbitrary order? Links or/and references would be appreciated.
Francesca Y
  • 183
  • 1
  • 11
1
vote
1 answer

Optimization problem with Laplacian constraints

I am trying to solve the following optimization problem and trying to obtain a set of values x_1, x_2, ..., x_k as follows: argmin Σx_i * a_i subject to ~ Lap(m, b) The terms a_i are constants, and the values x_i are drawn…
1
2 3 4