Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

warpPerspective with INTER_CUBIC or INTER_LINEAR and one channel Int source - crash

Hallo there,

because I work with a infrared data source I have a one channel intager matrix like

src = Mat::eye(480 , 640 , CV_32S);

now I want to use

warpPerspective (src, dest, transMat, size, WARP_INVERSE_MAP | INTER_LINEAR  ); //-  INTER_CUBIC | INTER_LINEAR | WARP_INVERSE_MAP

for Image rectification. When I do so, my Program crashs and I got the Error:

OpenCV Error: Assertion failed (ifunc != 0) in unknown function, file ..\..\..\src\opencv\modules\imgproc\src\imgwarp.cpp, line 2971

for Example:

#include "opencv/cv.h"
#include "opencv/highgui.h"

int main( int argc, char** argv )
{
    src = Mat::eye(480 , 640 , CV_32S);
    cv::Mat dest;

    Mat transMat = (Mat_<double>(3,3) << 0.83665, -0.0946, 35.96591, 0.00622, 0.49884, 92.2776, 0, -0.00029, 0.94627);

    cv::Size size( src.cols, src.rows);
    warpPerspective (src, dest, transMat, size, WARP_INVERSE_MAP | INTER_LINEAR  ); //-  OR: INTER_CUBIC | INTER_LINEAR

    imshow( "dest", dest );
    waitKey(0);
 }

When I use

src = Mat::eye(480 , 640 , CV_8U);

or

warpPerspective (src, dest, transMat, size, WARP_INVERSE_MAP | INTER_NEAREST  );

everything works fine... what's wrong with my code or is this a bug? Or should I use float-Point values? Perhaps this is even faster?

warpPerspective with INTER_CUBIC or INTER_LINEAR and one channel Int source - crash

Hallo there,

because I work with a infrared data source I have a one channel intager matrix like

src = Mat::eye(480 , 640 , CV_32S);

now I want to use

warpPerspective (src, dest, transMat, size, WARP_INVERSE_MAP | INTER_LINEAR  ); //-  INTER_CUBIC | INTER_LINEAR | WARP_INVERSE_MAP

for Image rectification. When I do so, my Program crashs and I got the Error:

OpenCV Error: Assertion failed (ifunc != 0) in unknown function, file ..\..\..\src\opencv\modules\imgproc\src\imgwarp.cpp, line 2971

for Example:

#include "opencv/cv.h"
#include "opencv/highgui.h"

int main( int argc, char** argv )
{
    src = Mat::eye(480 , 640 , CV_32S);
    cv::Mat dest;

    Mat transMat = (Mat_<double>(3,3) << 0.83665, -0.0946, 35.96591, 0.00622, 0.49884, 92.2776, 0, -0.00029, 0.94627);

    cv::Size size( src.cols, src.rows);
    warpPerspective (src, dest, transMat, size, WARP_INVERSE_MAP | INTER_LINEAR  ); //-  OR: INTER_CUBIC | INTER_LINEAR

    imshow( "dest", dest );
    waitKey(0);
 }

When I use

src = Mat::eye(480 , 640 , CV_8U);

or

warpPerspective (src, dest, transMat, size, WARP_INVERSE_MAP | INTER_NEAREST  );

everything works fine... what's wrong with my code or is this a bug? Or should I use float-Point values? Perhaps this is even faster?

warpPerspective with INTER_CUBIC or INTER_LINEAR and one channel Int source - crash

Hallo there,

because I work with a infrared data source I have a one channel intager matrix like

src = Mat::eye(480 , 640 , CV_32S);

now I want to use

warpPerspective (src, dest, transMat, size, WARP_INVERSE_MAP | INTER_LINEAR  ); //-  INTER_CUBIC | INTER_LINEAR | WARP_INVERSE_MAP

for Image rectification. When I do so, my Program crashs and I got the Error:

OpenCV Error: Assertion failed (ifunc != 0) in unknown function, file ..\..\..\src\opencv\modules\imgproc\src\imgwarp.cpp, line 2971

for Example:

#include "opencv/cv.h"
#include "opencv/highgui.h"

int main( int argc, char** argv )
{
    src = Mat::eye(480 , 640 , CV_32S);
    cv::Mat dest;

    Mat transMat = (Mat_<double>(3,3) << 0.83665, -0.0946, 35.96591, 0.00622, 0.49884, 92.2776, 0, -0.00029, 0.94627);

    cv::Size size( src.cols, src.rows);
    warpPerspective (src, dest, transMat, size, WARP_INVERSE_MAP | INTER_LINEAR  ); //-  OR: INTER_CUBIC | INTER_LINEAR

    imshow( "dest", dest );
    waitKey(0);
 }

When I use

src = Mat::eye(480 , 640 , CV_8U);

or

warpPerspective (src, dest, transMat, size, WARP_INVERSE_MAP | INTER_NEAREST  );

everything works fine... what's wrong with my code or is this a bug? Or is the a better way to do this? Or should I use float-Point values? Perhaps this is even faster?