Mousetrap getsubrect() incorrect size input array

asked 2013-02-08 12:39:23 -0600

alh93 gravatar image

Hello, I'm new to the opencv world, and am trying to make some updates to run Gnome's Mousetrap. I have encountered an error (see below) about the roi not containing the correct size array. Anyone have ideas to what the correct size would be? Or how to determine it?

Here is an example of the rect that passes to GetSubRect() to obtain the roi: (264, 258, 190, 196) *Note: I've imported cv2.cv as cv

 /usr/lib/python2.7/site-packages/gobject/constants.py:24: Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed
  import gobject._gobject
DEBUG: mousetrap.ocvfw.idm -> Starting Forehead idm
INFO: mousetrap.ocvfw.idm -> Forhead Algorithm loaded
DEBUG: mousetrap.ocvfw.idm -> Setting Capture
DEBUG: Commons -> New Singleton Add (mousetrap.ocvfw.dev.camera.Camera)
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
DEBUG: ocvfw -> cmStartCamera: Camera Started
DEBUG: Camera -> Loaded backend OcvfwPython
DEBUG: OcvfwBase -> Changed lk_swap value to True
INFO: mousetrap - Idm loaded and started
DEBUG: ui.main - Interface Built
DEBUG: ui.main - Addons loaded
INFO: mousetrap - MouseTrap's Interface Built and Loaded
DEBUG: ocvfw -> cmGetHaarPoints: detected some matches
OpenCV Error: Incorrect size of input array () in cvGetSubRect, file /builddir/build/BUILD/OpenCV-2.3.1/modules/core/src/array.cpp, line 1262
Traceback (most recent call last):
  File "mousetrap/app/main.py", line 238, in update_frame
    self.itf.update_frame(self.idm.get_capture(), self.idm.get_pointer())
  File "mousetrap/ocvfw/idm/forehead.py", line 127, in get_capture
    self.get_forehead()
  File "mousetrap/ocvfw/idm/forehead.py", line 163, in get_forehead
    (startF[0], startF[1]) ) # replaced x and y
  File "mousetrap/ocvfw/dev/camera.py", line 378, in get_area
    return Camera.get_haar_roi_points(haar_csd, roi, orig)
  File "mousetrap/ocvfw/_ocv.py", line 389, in get_haar_roi_points
    imageROI = cv.GetSubRect(self.img, rect)
cv2.error
/usr/local/bin/mousetrap: line 139:  2423 Segmentation fault      (core dumped) /usr/bin/python -c "import mousetrap.app.main as mousetrap; mousetrap.Controller().start();" "$ARGS"

edit retag flag offensive close merge delete