Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

imshow() call never returns openCV 3.2.0-dev

Running Linux Mint 18.1 with ROS Kinetic Python 2.7.12 /opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so OpenCV 3.2.0-dev

Using OpenCV with ROS Kinetic. If I run the camshift.py demo that works just fine, but in ROS code that worked fine with ROS Indigo and OpenCV 3.1.0 I have two problems.

First, with ROS the code subscribes to a topic message to get video camera raw data. This comes from another ROS node and is handled by a callback function in the code that I'm working on. This code worked with openCV 3.1.0 but imshow() never returns when called. No exceptions, no error output, just never returns. And, of course does not draw the frame image in the named window.

Note that the code never returns to call the waitKey function.

Second issue: A separate test with calling waitKey(5) before imshow() appears to behave the same, doesn't return but in this case I get the following error output on the terminal:

QObject::startTimer: Timers cannot be started from another thread

This error output doesn't happen with ROS Indigo and openCV 3.1.0

So I suspect this is a clue. I'm trying to determine if this is something that changed with openCV between 3.1.0 and 3.2.0-dev or something in ROS Kinetic that has broken things.

This failure of imshow and waitKey only appears to happen when the code is executed in the callback function that receives the video frame data. If I directly open the camera and read the frame data and then call imshow and waitKey everything works just fine in that case.

Any one seen this problem, and if so how did you work around it?

I've seem a couple of similar issues discussed here related to running on the Mac. That is imshow doesn't draw the frame data, etc.

Thanks, Burt