OpenCV Error: Assertion failed (channels () == CV_MAT_CN (dtype)) in copyTo, file /home/tau/opencv/opencv-3.1.0/modules/core/src/copy.cpp, line 257

asked 2016-12-13 00:43:56 -0500

joseph3010 gravatar image

Currently am working on real_time_pose_estimation for 3d objects: 1.successfully compiled and executed model registration 2.when comes to model detection compiling is successful but throwing above run time error while executing.

source code:/../../opencv/opencv-3.1.0/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src I am new to OpenCV though I succeeded in detecting objects in an image and now I started to work on detecting 3D pose estimation of textured object in an image. I have tried the best of my knowledge to solve this problem but failed and finally landing here.It will be great if anyone could suggest me why is it throwing error and how to solve it .

edit retag flag offensive close merge delete

Comments

can you try to debug it, to see, where the error happens ?

(the only copyTo() i can find is, in model.cpp:69)

berak gravatar imageberak ( 2016-12-13 01:50:28 -0500 )edit

hi berak ,thanks for your interest you can find the function definition where am thrown an error in line 257 from the below link:

https://github.com/opencv/opencv/blob...

joseph3010 gravatar imagejoseph3010 ( 2016-12-13 03:35:35 -0500 )edit

error on terminal: OpenCV Error: Assertion failed (channels() == CV_MAT_CN(dtype)) in copyTo, file /home/joseph/opencv/opencv-3.1.0/modules/core/src/copy.cpp, line 257 terminate called after throwing an instance of 'cv::Exception' what(): /home/joseph/opencv/opencv-3.1.0/modules/core/src/copy.cpp:257: error: (-215) channels() == CV_MAT_CN(dtype) in function copyTo

Aborted (core dumped)

joseph3010 gravatar imagejoseph3010 ( 2016-12-13 03:36:17 -0500 )edit

yes, i know, where copyTo() is. the problem now, is finding where it is called, and in what context.

berak gravatar imageberak ( 2016-12-13 03:46:34 -0500 )edit