Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

CLAHE in android

I used JNI for clahe by the column, http://answers.opencv.org/question/27360/clahe-implemenation-in-java/.

But there is error in clahe->apply(Mat m1, Mat m2) .

I couldn't find the reason because of none of the error message.

So Plz help me...T.T

The Code in JNI

JNIEXPORT int JNICALL Java_com_example_i3bolometerapp_MainActivity_InitCLAHE( JNIEnv env, jobject thiz, jintArray disp, jint _width, jint _height, jlong addrClahe, jlong addrClaheDst ) { Mat &mGr = *(Mat)addrClahe; Mat &mGr2 = (Mat)addrClaheDst;

Ptr<CLAHE> clahe = createCLAHE();
clahe->setClipLimit(5);
clahe->apply(mGr, mGr2);

return mGr.cols;

}

Actually, the column of mGr is returned well. So i dont think mat data is wrong.

CLAHE in android

I used JNI for clahe by the column, http://answers.opencv.org/question/27360/clahe-implemenation-in-java/.

But there is error in clahe->apply(Mat m1, Mat m2) .

I couldn't find the reason because of none of the error message.message. (Just turn down the application.)

So Plz help me...T.T

The Code in JNI

JNIEXPORT int JNICALL Java_com_example_i3bolometerapp_MainActivity_InitCLAHE( JNIEnv env, *env, jobject thiz, jintArray disp, jint _width, jint _height, jlong addrClahe, jlong addrClaheDst ) { Mat &mGr = *(Mat)addrClahe; Mat &mGr2 = (Mat)addrClaheDst; {

Mat &mGr  = *(Mat*)addrClahe;
Mat &mGr2  = *(Mat*)addrClaheDst;

Ptr<CLAHE> clahe = createCLAHE();
clahe->setClipLimit(5);
clahe->apply(mGr, mGr2);

return mGr.cols;

}

Actually, the column of mGr is returned well. So i dont think mat data is wrong.