Ask Your Question

ThomasZ's profile - activity

2017-07-25 06:44:13 -0600 received badge  Notable Question (source)
2015-10-22 11:37:16 -0600 received badge  Popular Question (source)
2013-08-14 06:34:04 -0600 commented answer warpPerspective with INTER_CUBIC or INTER_LINEAR and one channel Int source - crash

Thank you :-) ... I report this as a bug to OpenCV and I will see?!

2013-08-14 06:30:06 -0600 received badge  Scholar (source)
2013-08-14 05:05:19 -0600 received badge  Supporter (source)
2013-08-14 05:04:40 -0600 commented answer warpPerspective with INTER_CUBIC or INTER_LINEAR and one channel Int source - crash

First of all: >>Thank you<< . (is this a bug or a feature?) -> Is there a workaround? What would be the best cast for me (I use a value range of about 0 to 2 000 000 [mK] per pixel)? I take a look into "remapBilinear" and I do not undersand why is INT not supported... is the INT-cast commonly not supported?

2013-08-13 13:43:56 -0600 received badge  Student (source)
2013-08-13 13:31:47 -0600 received badge  Editor (source)
2013-08-13 13:27:12 -0600 asked a question 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?