android : Blur detection using OpenCV

asked 2019-09-27 06:31:19 -0500

quinch gravatar image

updated 2019-09-30 07:30:57 -0500

Hello, i am developing an application which is capture the users id's images and OCR from those id's so i need to detect blur using OpenCV because some time users capture images in lighting condition. so that time OCR not work properly.

edit retag flag offensive close merge delete

Comments

and how exactly is your question releated to opencv ? what have you tried already ?

berak gravatar imageberak ( 2019-09-27 06:40:13 -0500 )edit

code:

val destination = Mat()
        val matGray = Mat()
        Utils.bitmapToMat(bitmap, sourceMatImage)
        Imgproc.cvtColor(sourceMatImage, matGray, Imgproc.COLOR_BGR2GRAY)
        Imgproc.Laplacian(matGray, destination, 3)
        val median = MatOfDouble()
        val std = MatOfDouble()
        Core.meanStdDev(destination, median, std)
        return DecimalFormat("0.00").format(Math.pow(std.get(0, 0)[0], 2.0)).toDouble()
quinch gravatar imagequinch ( 2019-09-27 06:52:10 -0500 )edit
Chris gravatar imageChris ( 2019-09-30 05:25:53 -0500 )edit