Ask Your Question

joyrae's profile - activity

2015-02-24 02:05:43 -0500 asked a question CLAHE in android

I wrote same question before, but i didn't receive any advice or reply.

If you are interested with this problem, then please reply.

Then, we can discuss it together.

I used JNI for clahe by the column, http://answers.opencv.org/question/27....

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

I couldn't find the reason because of none of the error 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, 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.

================== JAVA Code =======================

At first,

 if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_9, this, mOpenCVCallBack))  
       {    
             Log.e("TEST", "Cannot connect to OpenCV Manager");
    }
CallBack Function,

private BaseLoaderCallback mOpenCVCallBack = new BaseLoaderCallback(this) {
    @Override
    public void onManagerConnected(int status) {
        switch (status) {
        case LoaderCallbackInterface.SUCCESS: {
            Log.i("TEST", "OpenCV loaded successfully");

            System.loadLibrary("clahe");

            m_matClahe = new Mat(commData.getWindowingHeight(), commData.getWindowingWidth(), CvType.CV_8UC1);
            m_matClaheDst = new Mat(commData.getWindowingHeight(), commData.getWindowingWidth(), CvType.CV_8UC1);
Use CLAHE, ( CLAHE is used in handler)

          Utils.bitmapToMat(commData.m_bitMain, m_matClahe);

            int temp = InitCLAHE( commData.m_piDispData, commData.getWindowingWidth(), commData.getWindowingHeight(), m_matClahe.getNativeObjAddr(), m_matClaheDst.getNativeObjAddr());
            Utils.matToBitmap(m_matClaheDst, commData.m_bitMain);
            m_textLog.setText(String.format("Return : %d, %d", m_matClaheDst.getNativeObjAddr(), temp));

Dst is initailized in callback function. So i think this is not problem,

And i checked the address of dst.

Thanks,

2015-01-15 01:42:59 -0500 received badge  Enthusiast
2015-01-13 17:46:44 -0500 asked a question 'apply' function in clahe for android application

I used JNI for clahe by the column, http://answers.opencv.org/question/27....

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

I couldn't find the reason because of none of the error 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, 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.

================== JAVA Code =======================

At first,

 if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_9, this, mOpenCVCallBack))  
       {    
             Log.e("TEST", "Cannot connect to OpenCV Manager");
    }

CallBack Function,

private BaseLoaderCallback mOpenCVCallBack = new BaseLoaderCallback(this) {
    @Override
    public void onManagerConnected(int status) {
        switch (status) {
        case LoaderCallbackInterface.SUCCESS: {
            Log.i("TEST", "OpenCV loaded successfully");

            System.loadLibrary("clahe");

            m_matClahe = new Mat(commData.getWindowingHeight(), commData.getWindowingWidth(), CvType.CV_8UC1);
            m_matClaheDst = new Mat(commData.getWindowingHeight(), commData.getWindowingWidth(), CvType.CV_8UC1);

Use CLAHE, ( CLAHE is used in handler)

          Utils.bitmapToMat(commData.m_bitMain, m_matClahe);

            int temp = InitCLAHE( commData.m_piDispData, commData.getWindowingWidth(), commData.getWindowingHeight(), m_matClahe.getNativeObjAddr(), m_matClaheDst.getNativeObjAddr());
            Utils.matToBitmap(m_matClaheDst, commData.m_bitMain);
            m_textLog.setText(String.format("Return : %d, %d", m_matClaheDst.getNativeObjAddr(), temp));

Dst is initailized in callback function. So i think this is not problem,

And i checked the address of dst.

Plz... help me...T.T

2015-01-12 01:25:01 -0500 asked a question CLAHE in android

I used JNI for clahe by the column, http://answers.opencv.org/question/27....

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

I couldn't find the reason because of none of the error 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, 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.

================== JAVA Code =======================

At first,

 if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_9, this, mOpenCVCallBack))  
       {    
             Log.e("TEST", "Cannot connect to OpenCV Manager");
    }

CallBack Function,

private BaseLoaderCallback mOpenCVCallBack = new BaseLoaderCallback(this) {
    @Override
    public void onManagerConnected(int status) {
        switch (status) {
        case LoaderCallbackInterface.SUCCESS: {
            Log.i("TEST", "OpenCV loaded successfully");

            System.loadLibrary("clahe");

            m_matClahe = new Mat(commData.getWindowingHeight(), commData.getWindowingWidth(), CvType.CV_8UC1);
            m_matClaheDst = new Mat(commData.getWindowingHeight(), commData.getWindowingWidth(), CvType.CV_8UC1);

Use CLAHE, ( CLAHE is used in handler)

          Utils.bitmapToMat(commData.m_bitMain, m_matClahe);

            int temp = InitCLAHE( commData.m_piDispData, commData.getWindowingWidth(), commData.getWindowingHeight(), m_matClahe.getNativeObjAddr(), m_matClaheDst.getNativeObjAddr());
            Utils.matToBitmap(m_matClaheDst, commData.m_bitMain);
            m_textLog.setText(String.format("Return : %d, %d", m_matClaheDst.getNativeObjAddr(), temp));

Dst is initailized in callback function. So i think this is not problem,

And i checked the address of dst.

Plz... help me...T.T

2015-01-09 22:43:54 -0500 commented question CLAHE in android

Dst is initailized in callback function. So i think this is not problem,

And i checked the address of dst.

2015-01-09 22:43:03 -0500 commented question CLAHE in android

CLAHE is used in handler,

2015-01-09 22:42:32 -0500 commented question CLAHE in android

Use CLAHE,

                    Utils.bitmapToMat(commData.m_bitMain, m_matClahe);

                    int temp = InitCLAHE( commData.m_piDispData, commData.getWindowingWidth(), commData.getWindowingHeight(), m_matClahe.getNativeObjAddr(), m_matClaheDst.getNativeObjAddr());
                    Utils.matToBitmap(m_matClaheDst, commData.m_bitMain);
                    m_textLog.setText(String.format("Return : %d, %d", m_matClaheDst.getNativeObjAddr(), temp));
2015-01-09 22:41:51 -0500 commented question CLAHE in android

At Start,

     if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_9, this, mOpenCVCallBack))
     {
         Log.e("TEST", "Cannot connect to OpenCV Manager");
     }

CallBack Function,

private BaseLoaderCallback mOpenCVCallBack = new BaseLoaderCallback(this) {
    @Override
    public void onManagerConnected(int status) {
        switch (status) {
        case LoaderCallbackInterface.SUCCESS: {
            Log.i("TEST", "OpenCV loaded successfully");

            System.loadLibrary("clahe");

            m_matClahe = new Mat(commData.getWindowingHeight(), commData.getWindowingWidth(), CvType.CV_8UC1);
            m_matClaheDst = new Mat(commData.getWindowingHeight(), commData.getWindowingWidth(), CvType.CV_8UC1);               

            // tmp = new Mat(commData.getWindowingHeight(),
            // commData.getWindowingWidth(), CvType.CV_8UC1);
2015-01-08 02:59:37 -0500 received badge  Student (source)
2015-01-08 02:52:32 -0500 asked a question CLAHE in android

I used JNI for clahe by the column, http://answers.opencv.org/question/27....

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

I couldn't find the reason because of none of the error 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, 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.