Skip to content

OpenCV acting up with two webcams #5

Description

@ptomato

Per @trygentoo:

I can't switch from internal laptop webcam to external which is going to work as beamprofiler.
When I go to "Choose camera..." menu there only 2 options OpenCV and Dummy Gauss. Moreover app is stunned if OpenCV chosen after alert "No camera was detected. Did you forget to plug it in?"

Console output:

/usr/lib64/python2.7/site-packages/traits/trait_handlers.py:1599: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  if value in self.values:
/usr/lib64/python2.7/site-packages/chaco/image_data.py:190: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  self._data = newdata
/usr/lib64/python2.7/site-packages/chaco/array_data_source.py:123: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  self._data = newdata
/usr/lib64/python2.7/site-packages/chaco/axis.py:498: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  for tickpos in mapped_tick_positions]))
/usr/lib64/python2.7/site-packages/chaco/axis.py:499: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  self._tick_label_list = tick_list
/usr/lib64/python2.7/site-packages/chaco/axis.py:500: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  self._tick_label_positions = self._tick_positions
Exception occurred in traits notification handler.
Please check the log file for details.
Exception occurred in traits notification handler for object: <beams.MainWindow.MainWindow object at 0x7f7f3f317110>, trait: camera, old value: <beams.Webcam.Webcam object at 0x7f7f3f277290>, new value: <beams.Webcam.Webcam object at 0x7f7f3022e6b0>
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/traits/trait_notifiers.py", line 520, in _dispatch_change_event
    self.dispatch( handler, *args )
  File "/usr/lib64/python2.7/site-packages/traits/trait_notifiers.py", line 615, in dispatch
    handler( *args )
  File "/usr/lib64/python2.7/site-packages/traitsui/ui.py", line 824, in _evaluate_when
    self._do_evaluate_when(at_init=False)
  File "/usr/lib64/python2.7/site-packages/traitsui/ui.py", line 838, in _do_evaluate_when
    self._evaluate_condition(self._visible, 'visible', at_init)
  File "/usr/lib64/python2.7/site-packages/traitsui/ui.py", line 883, in _evaluate_condition
    context = self._get_context( self.context )
  File "/usr/lib64/python2.7/site-packages/traitsui/ui.py", line 804, in _get_context
    context2 = value.trait_get()
  File "/usr/lib64/python2.7/site-packages/traits/has_traits.py", line 1485, in trait_get
    value = getattr( self, name, Missing )
  File "build/bdist.linux-x86_64/egg/beams/Webcam.py", line 62, in _resolution_default
    width = cv.GetCaptureProperty(self._capture, FRAME_WIDTH)
TypeError: Expected CvCapture for argument 'capture'
libv4l2: error setting pixformat: Device or resource busy
HIGHGUI ERROR: libv4l unable to ioctl S_FMT
libv4l2: error setting pixformat: Device or resource busy
libv4l1: error setting pixformat: Device or resource busy
HIGHGUI ERROR: libv4l unable to ioctl VIDIOCSPICT

I don't currently have access to an external webcam to test this, so help is appreciated.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions