Ask Your Question
0

OpenCV camshift.py sample broken after Diamondback upgrade

asked Apr 14 '11

Pi Robot gravatar image Pi Robot
1649 4 35 68
http://www.pirobot.org/

updated Apr 14 '11

Eric Perko gravatar image Eric Perko flag of United States
5281 27 53 101
http://ericperko.com/

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 camshift.py 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 "camshift.py", line 115, in <module>
    demo.run()
  File "camshift.py", 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 camshift.py https://code.ros.org/svn/opencv/trunk/opencv/samples/python/">from SVN since the samples don't seem to be included in the ROS vision_opencv stack.

Thanks! patrick

delete close flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered Apr 14 '11

Eric Perko gravatar image Eric Perko flag of United States
5281 27 53 101
http://ericperko.com/

updated Apr 14 '11

See http://answers.ros.org/question/255/are-opencv-samples-in-diamondback-debs 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 camshift.py in trunk vs. OpenCV included in Diamondback if the samples included in vision_opencv work for you.

link delete flag offensive edit

Comments

Hi Eric--thanks for the link. Alas, I get exactly the same error from camshift.py even after downloading and building from source... Pi Robot (Apr 14 '11)edit
I've submitted a ticket for this issue at https://code.ros.org/trac/ros-pkg/ticket/4919. 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 (Apr 15 '11)edit
This problem seems to have been fixed in OpenCV 2.3 RC which I just now compiled and tried. Pi Robot (Jun 26 '11)edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[hide preview]

Question tools

Follow

subscribe to rss feed

Stats

Asked: Apr 14 '11

Seen: 354 times

Last updated: Apr 14 '11