Variance of Laplacian #4729
-
|
Hi, I’m looking to implement a Variance of Laplacian calculation similar to OpenCV’s Laplacian function. My goal is to use it for blur detection as described here: https://pyimagesearch.com/2015/09/07/blur-detection-with-opencv Previously, I solved this using SKIA by creating a matrix convolution filter with the Laplace kernel. However, SKIA is slow and memory-intensive compared to VIPS. I can convert the image to grayscale using I hope you can provide me some guidance here. The expected result is that an image like Kind regards, Stefan |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Hi @StefanOltmann, there's an example here: https://github.com/libvips/pyvips?tab=readme-ov-file#example so eg.: mask = pyvips.Image.new_from_array([
[-1, -1, -1],
[-1, 16, -1],
[-1, -1, -1],
], scale=8)
image = image.conv(mask, precision='integer')You'll want a slightly different mask, of course. |
Beta Was this translation helpful? Give feedback.


Hi @StefanOltmann, there's an example here:
https://github.com/libvips/pyvips?tab=readme-ov-file#example
so eg.:
You'll want a slightly different mask, of course.