Ask Your Question

erdna's profile - activity

2013-05-06 12:33:55 -0500 received badge  Student (source)
2012-07-10 09:08:54 -0500 received badge  Famous Question (source)
2012-07-09 06:59:22 -0500 commented question Performance issues on porting warpPerspective into my project

Thank you for asking. With the original warpPerspective I get around 7 fps while with de modified one I get 5 Fps. It is a loss of around 30%...

2012-07-05 09:40:44 -0500 received badge  Notable Question (source)
2012-07-02 06:10:18 -0500 received badge  Popular Question (source)
2012-06-29 10:59:20 -0500 received badge  Organizer (source)
2012-06-29 10:55:07 -0500 asked a question Performance issues on porting warpPerspective into my project

Hello all,

I wanted to create a modified version of OpenCV warpPerspective to run on my tablet. To begin, I downloaded the OpenCV source code, located the warpPerspective function inside the imgwarp.cpp and copied it into mine JNI file.

I changed the arguments as follows:

    JNIEXPORT void JNICALL Java_com_myproject_project_Sample4View_WarpPerspective2( JNIEnv* env, jobject thiz, jlong _src, jlong _dst, jlong _M0,
jdouble dsizeRows, jdouble dsizeCols, int flags, int borderType, jint scalar0, jint scalar1, jint scalar2, jint scalar3 )

        Scalar borderValue = Scalar(scalar0, scalar1, scalar2, scalar3);
        Size dsize = Size(dsizeRows,dsizeCols);
        Mat* src = (Mat*)_src, *M0 = (Mat*)_M0;
        //_dst.create( dsize.area() == 0 ? src.size() : dsize, src.type() );
        Mat* dst = (Mat*)_dst;

        CV_Assert( (*src).cols > 0 && (*src).rows > 0 );
        if( (*dst).data == (*src).data )
            *src = (*src).clone();



This function is working as it is. But a noticeable performance loss occurs when comparing with the original warpPerspective.

Can anyone explain me why is this happening? Could it be the way it is being compiled?I am really struggling with this and have no idea....

Thank you!