Ask Your Question

NTxC's profile - activity

2017-01-24 09:36:18 -0500 commented answer Sobel using dx=1, dy=0 gives exactly same output as dx=0, dy=1 (bug?)

I have reported this issue. Thank you for your suggestions.

2017-01-24 08:30:55 -0500 received badge  Self-Learner (source)
2017-01-21 08:15:34 -0500 commented question Sobel using dx=1, dy=0 gives exactly same output as dx=0, dy=1 (bug?)

Thanks for the answer. Unfortunately it really was all zeros. The gradients were identical. I have just fixed this issue:

The OpenCV library can be used in two ways on an Android smartphone: it can be embedded within an application directly, or installed as an app - "OpenCV Manager", which then provides the libraries to the OpenCV apps dynamically.

My application was using the OpenCV Manager app to get the libraries. Unfortunately, it appears that OpenCV Manager for Android is bugged, because when I embedded the OpenCV library directly within my app, the Sobel calls started working properly.

So I recommend everyone to link their applications to OpenCV statically.

2017-01-21 06:49:05 -0500 asked a question Sobel using dx=1, dy=0 gives exactly same output as dx=0, dy=1 (bug?)

Greetings,

this piece of code seems to be generating exactly same Sobel gradients for dx=1, dy=0 and dx=0, dy=1. This means I can't subtract gradY from gradX because that leaves me with a black image. Is this a bug in OpenCV?

    Mat gradX = new Mat();
    Mat gradY = new Mat();
    Mat gray = new Mat();
    Mat gradient = new Mat()

    Imgproc.cvtColor( cameraSnapshotFrame, gray, COLOR_BGR2GRAY );

    Imgproc.Sobel( gray, gradX, CV_32F, 1, 0, -1, 1.0, 0 );
    Imgproc.Sobel( gray, gradY, CV_32F, 0, 1, -1, 1.0, 0 ); // for some reason this gives the same result as the line above

    Core.subtract( gradX, gradY, gradient );
    Core.convertScaleAbs( gradient, gradient ); // gradient is an empty black image

Using OpenCV for Android version 3.1.0. Please help.