Core.inrange OpenCV 2.31 (Android)

asked 2013-05-24 09:35:32 -0500

baharsan gravatar image

I use core.inrange to skin detection but the problem is when app running about 1 minutes, it will turn off without returning any error. is this bug in opencv android ?

this my code :

       case ImageManipulationsActivity.VIEW_MODE_SKIN:
        capture.retrieve(mRgba, Highgui.CV_CAP_ANDROID_COLOR_FRAME_RGBA);
        Mat HSV = new Mat();
        Imgproc.cvtColor(mRgba, HSV, Imgproc.COLOR_RGB2HSV, 3);
        Core.inRange(HSV,  new Scalar(0, 100, 30), new Scalar(5, 255, 255), mRgba);
        Imgproc.cvtColor(mRgba, mRgba, Imgproc.COLOR_GRAY2BGRA, 4); 
        break;
    }
    Bitmap bmp = Bitmap.createBitmap(mRgba.cols(), mRgba.rows(), Bitmap.Config.ARGB_8888);
    if (Utils.matToBitmap(mRgba, bmp))
        return bmp;
    bmp.recycle();
    return null;

if i remove core.inrange, the app just running smoothly. i accept any suggestion about this, thanks.

edit retag flag offensive close merge delete