Apply blindness filter lags

asked 2014-08-25 04:11:20 -0500

kronos_r gravatar image

I come at you to know how to apply a simple colored filter in a camera preview with OpenCV Android.

I want to apply a filter like "Sepia" in "Image manipulaton sample" with the kernel. I found my XYZ filter, here the blindness kernel.

// Fill TRINATOPIA kernel
    mTritanopia = new Mat(4, 4, CvType.CV_32F);
    mTritanopia.put(0, 0, /* R */0.95, 0.05, 0, 0);
    mTritanopia.put(1, 0, /* G */0, 0.43333, 0.56667, 0);
    mTritanopia.put(2, 0, /* B */0, 0.475, 0.525,0);
    mTritanopia.put(3, 0, /* A */0.000f, 0.000f, 0.000f, 0f);

Next to this step, I use transform(), the same thing found in the sample.

        Core.transform(rgba, rgba, mTritanopia);

The result LAGS a bit ! There is an other way to success ?

edit retag flag offensive close merge delete