planar_tracking selectROI not work

asked 2017-05-02 03:47:43 -0500

I am a newer to opencv,i want to look the planar_tracking demo,but when i new my project in vs2015,the cv::selectROI not resolve, then i change it to selectROI ,it works.i start the application,i select rect by my mouse,it crash,i put down my left mouse button , move ,then leftbutton up.i check the selectROI return rect is 0,0,0,0. please help me!!thanks a lot. here is bug information

Debug Error!

Program: D:\opencv3.2\opencv\build\x64\vc14\bin\opencv_world320d.dll Module: D:\opencv3.2\opencv\build\x64\vc14\bin\opencv_world320d.dll File:

Run-Time Check Failure #2 - S

(Press Retry to debug the application)


edit retag flag offensive close merge delete

Comments

I cannot reproduce your issue using vs 2015-64 bits and opencv 3.2.0-dev. Have you mixed release with debug program?

LBerger gravatar imageLBerger ( 2017-05-02 06:47:19 -0500 )edit

i work in release mode, but when i put down my mouse leftbutton on the frame ,it crash. cv::selectROI(video_name, frame) complier says there is no members in namespace cv so i remove cv:: ,it works.

lighter gravatar imagelighter ( 2017-05-03 02:54:37 -0500 )edit

"put down my mouse leftbutton on the frame" and "cv::selectROI(video_name, frame) complier says there is no members" how can you run a program with compilation error? and you post a new question http://answers.opencv.org/question/14... : I don't understand your problem

LBerger gravatar imageLBerger ( 2017-05-03 03:06:39 -0500 )edit

the source code is cv::selectROI ,it says there is no selectROI function,so i change it into selectROI then it can call the function,but it crash when i select roi on the frame. so i manually set a rectangel as a roi,i found it is slow in debug mode (in release mode it is faster). so , selectROI function not work in my project . i was in win 7,vs2015 opencv3.2dev. i new my project ,and copy the header file and the main cpp file to my project. thanks a lot .

lighter gravatar imagelighter ( 2017-05-03 07:58:35 -0500 )edit

Are we talking about same source code ? I have tested this one

Did you use cmake tou build this sample?

LBerger gravatar imageLBerger ( 2017-05-03 08:16:54 -0500 )edit

line 162 is the cv::selectROI i am at win7 ,vs2015 ,i don't know how to cmake and build(linux)

lighter gravatar imagelighter ( 2017-05-03 08:21:35 -0500 )edit

Ok follow this post. You don't need to clone vtk. But opencv contrib it is a good idea to use it

LBerger gravatar imageLBerger ( 2017-05-03 08:30:29 -0500 )edit

can you explain why i need opencv_contrib module?is there some functions in opencv_contrib module called by selectROI ?

lighter gravatar imagelighter ( 2017-05-04 02:11:08 -0500 )edit

" opencv contrib it is a good idea to use it" you don't need it for planar_tracking but if you want to go on with opencv you will find many algorithms (see extra modules)

LBerger gravatar imageLBerger ( 2017-05-04 02:19:58 -0500 )edit