Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenCV acting up with two webcams #5

Open
ptomato opened this issue Sep 2, 2015 · 5 comments
Open

OpenCV acting up with two webcams #5

ptomato opened this issue Sep 2, 2015 · 5 comments

Comments

@ptomato
Copy link
Owner

ptomato commented Sep 2, 2015

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.

@trygentoo
Copy link

How can I help you?

@ptomato
Copy link
Owner Author

ptomato commented Sep 3, 2015

That would be great if you could help! First thing is, could you try your beam profiler webcam on another computer with no internal webcam? Just to see if it works when it's the only webcam attached to the computer.

(I'm not sure I actually ever supported two webcams with the OpenCV plugin. If not, then I'll have to figure out how to do that.)

@trygentoo
Copy link

Hello,

sorry for large delay. Finally managed to run beams on another comp, the
result is the same: about 1 frame per minute and everything is very slow.

On Thu, Sep 3, 2015 at 7:26 PM P. F. Chimento [email protected]
wrote:

That would be great if you could help! First thing is, could you try your
beam profiler webcam on another computer with no internal webcam? Just to
see if it works when it's the only webcam attached to the computer.

(I'm not sure I actually ever supported two webcams with the OpenCV
plugin. If not, then I'll have to figure out how to do that.)


Reply to this email directly or view it on GitHub
#5 (comment).

@ptomato
Copy link
Owner Author

ptomato commented Sep 29, 2015

This computer only has 1 webcam in total?

Hmm, I don't know what to do next. Is there any chance you could do some experimenting and find out what is happening during the intervals between frames? For example, by adding some print statements in the ProcessingThread.py code.

@ptomato
Copy link
Owner Author

ptomato commented May 23, 2016

I have added some code to allow selecting between two webcams when using OpenCV. Maybe that helps or fixes this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants