Ask Your Question

david cairns's profile - activity

2019-04-12 04:17:34 -0500 received badge  Enthusiast
2019-03-06 00:39:29 -0500 marked best answer Glare detection in image

Hi all,

i'm trying to detect glare in image using opencv 3.3.1 in my android application. i am use GaussianBlur and than using MinMaxLocResult get the min and max value of the glare. it's working find but sometime if background is black and image does not contain any glare also detect glare.

Here the code :-

   public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) 
   {
    final Mat Rgba = inputFrame.rgba();
    Mat grayScaleGaussianBlur = new Mat();
    Imgproc.cvtColor(Rgba , grayScaleGaussianBlur, Imgproc.COLOR_BGR2GRAY);
    Imgproc.GaussianBlur(grayScaleGaussianBlur, grayScaleGaussianBlur, new Size(5, 5), 0);

    Core.MinMaxLocResult minMaxLocResultBlur = Core.minMaxLoc(grayScaleGaussianBlur);

    final double maxval = minMaxLocResultBlur.maxVal;
    final double minval = minMaxLocResultBlur.minVal;


    if (maxval >= 253.0 && minval > 0.0 && minval < 20.0) {
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                try {

                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });

    } else {
        if (popup.isShowing()) {
            runOnUiThread(new Runnable() {

                @Override
                public void run() {

                }
            });

        } else {

            Bitmap rotatedBitmap = Bitmap.createBitmap(Rgba.cols(), Rgba.rows(), Bitmap.Config.ARGB_8888);
            Utils.matToBitmap(Rgba, rotatedBitmap);
        }
    }
2019-03-06 00:39:29 -0500 received badge  Scholar (source)
2019-01-04 07:03:17 -0500 commented question how to match two images

above snippet of code is right what actual problem you face?

2018-12-26 04:39:46 -0500 received badge  Supporter (source)
2018-12-19 03:23:13 -0500 commented question Glare detection in image

anyone have an idea about this issue???

2018-12-19 03:13:43 -0500 received badge  Student (source)
2018-12-19 01:40:24 -0500 received badge  Editor (source)
2018-12-19 01:40:24 -0500 edited question Glare detection in image

Glare detection in image Hi all, i'm trying to detect glare in image using opencv 3.3.1 in my android application. i am

2018-12-19 01:37:16 -0500 asked a question Glare detection in image

Glare detection in image Hi all, i'm trying to detect glare in image using opencv 3.3.1 in my android application. i am