ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

OpenCV sample broken after Diamondback upgrade

asked 2011-04-14 01:27:10 -0500

Pi Robot gravatar image

updated 2011-04-14 07:46:10 -0500

Eric Perko gravatar image

Hello OpenCV + ROS users,

I will submit a ticket for this but I'm wondering if anyone has a quick fix in the meantime. I was using the OpenCV Python sample successfully under Cturtle. Now, using Diamondback (Debian packages), I get the following error after selecting a rectangle to track:

Traceback (most recent call last):
  File "", line 115, in <module>
  File "", line 79, in run
    (iters, (area, value, rect), track_box) = cv.CamShift(backproject, self.track_window, crit)
TypeError: <unknown> is not a numpy array

Does anyone know how I can modify this line to make it work? I am using the latest from SVN since the samples don't seem to be included in the ROS vision_opencv stack.

Thanks! patrick

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2011-04-14 07:45:37 -0500

Eric Perko gravatar image

updated 2011-04-14 07:45:59 -0500

See for how to get the samples in the OpenCV package. Can you try that and see if the problem persists? There might be some sort of API mismatch between in trunk vs. OpenCV included in Diamondback if the samples included in vision_opencv work for you.

edit flag offensive delete link more


Hi Eric--thanks for the link. Alas, I get exactly the same error from even after downloading and building from source...
Pi Robot gravatar image Pi Robot  ( 2011-04-14 14:47:52 -0500 )edit
I've submitted a ticket for this issue at Note that the C++ version of the demo works fine but when comparing the two, I couldn't figure out why the Python version fails. I think it might have something to do with using an Image type instead of Mat for the backproject image/matrix...
Pi Robot gravatar image Pi Robot  ( 2011-04-15 11:04:40 -0500 )edit
This problem seems to have been fixed in OpenCV 2.3 RC which I just now compiled and tried.
Pi Robot gravatar image Pi Robot  ( 2011-06-26 05:33:58 -0500 )edit

Question Tools


Asked: 2011-04-14 01:27:10 -0500

Seen: 877 times

Last updated: Apr 14 '11