OpenCV Assertion Failed Error - Perspective Transform

asked 2016-09-21 03:07:00 -0600

WhoAmI gravatar image

updated 2016-09-21 03:09:03 -0600

Before posting this question I followed the answers posted in this thread but it didn't helped me however the question is eactly the same one.

http://answers.opencv.org/question/18...

I am using OpenCV for Android Version 3.1.0. I tried to use AKAZE detector and AKAZE descriptor. When I run the code on my Emulator am getting the below error.

 OpenCV Error: Assertion failed (scn + 1 == m.cols) in void CV:perspectiveTransform(cv::InputArray, cv::OutputArray, cv::InputArray), 
file/Volumes/Linux/builds/master_pack-android/opencv/modules/core/src/matmul.cpp, line 2125

core::perspectiveTransform_10() caught cv::Exception: /Volumes/Linux/builds/master_pack-android/opencv/modules/core/src/matmul.cpp:2125: 
error: (-215) scn + 1 == m.cols in function void CV:perspectiveTransform(cv::InputArray, cv::

Am using

private final Mat firstCorners = new Mat(4,1, CvType.CV_32FC2)

private final Mat secondCorners = new Mat(4,1, CvType.CV_32FC2)

final Mat homography = Calib3d.findHomography(first, second, Calib3d.RANSAC, 1)

Core.perspectiveTransform(firstCorners, secondCorners, homography)

I used Cv_32FC2 as posted in the above thread answer but still am getting the same error.

Any help on this.

edit retag flag offensive close merge delete

Comments

what if it's Mat(4,2, CvType.CV_32FC1) ? (sorry, can't test locally)

berak gravatar imageberak ( 2016-09-21 03:13:45 -0600 )edit

Same error. even if I try it with CV_32FC1

WhoAmI gravatar imageWhoAmI ( 2016-09-21 03:22:56 -0600 )edit

ok, sorry, again, all i could do is guess..

berak gravatar imageberak ( 2016-09-21 03:38:33 -0600 )edit

No problem. I will try any approach that is suggested over here

WhoAmI gravatar imageWhoAmI ( 2016-09-21 03:43:07 -0600 )edit

Any help on this friends

WhoAmI gravatar imageWhoAmI ( 2016-09-21 07:36:11 -0600 )edit