Hello !
I'm trying to adapt that : cv2.Laplacian(image, cv2.CV_64F).var() from https://www.pyimagesearch.com/2015/09/07/blur-detection-with-opencv/
For yet i'm in : _frame.laplacian(cv.CV_64F), but I don't find variance function to Mat structure.
=> Is there one tip to get that calculation ?
Thanks !
Hmm maybe this is what you are looking for? http://answers.opencv.org/question/53985/is-there-a-built-in-function-to-calculate-the-variance-of-a-cvmat/
Bindings for Mat.meanStdDev are implemented.
Thank you ! Yes it was a part of the answer @justadudewhohacks :)
Here is how the g33k of my team done that :
# Convert to gray
_imgGray = _img.bgrToGray()
# Detect blurry level
_laplacian = _imgGray.laplacian(cv.CV_64F)
# Get the standard deviation
_meanStdDev = _laplacian.meanStdDev()
_stdDevArray = _meanStdDev.stddev.getDataAsArray()
_stdDeviation = _stddevarray[0]
# Get the variation
_variation = Math.pow(_stdDeviation, 2)
And as expected, the threesold of 100 is pertinent
@G33kLabs - Thanks for sharing the code!
Most helpful comment
Thank you ! Yes it was a part of the answer @justadudewhohacks :)
Here is how the g33k of my team done that :
And as expected, the threesold of 100 is pertinent