Ask Your Question

Mike Lawrence's profile - activity

2015-01-18 11:57:18 -0600 received badge  Famous Question (source)
2014-07-27 20:01:52 -0600 received badge  Nice Question (source)
2014-03-14 18:23:21 -0600 received badge  Notable Question (source)
2013-09-27 20:41:53 -0600 received badge  Supporter (source)
2013-09-13 19:03:05 -0600 asked a question 30fps capture in OSX, but only 15fps in ubuntu

I'm using a Logitech c920, and when I use the cv2 python interface on OS X, I get 1920x1080 frames at 30fps, but when I boot into ubuntu 12.04 on the same machine, the same cv2 code captures 1920x1080 frames at 15fps. Any suggestions on what I can do to bump up the fps in ubuntu?

2013-09-10 10:20:17 -0600 received badge  Popular Question (source)
2013-08-22 08:18:15 -0600 received badge  Editor (source)
2013-08-22 07:44:52 -0600 asked a question Crash when using USB webcam in multiprocessing process

I'm running OpenCV 2.4.5 via the cv2 python bindings, using OS X (10.8.4). I'm trying to capture images from a USB webcam in a separate process via the multiprocessing module. Everything seems to work if I use my laptop's (2011 macbook air) internal webcam, but when I attempt to read a usb webcam (Logitech C920), I get a crash. The crash log is here. Code I'm using that will reliably reproduce the crash is below. Getting this working is pretty mission-critical for me, so any help would be greatly appreciated!

import multiprocessing
import cv2 #doesn't matter if you import here or in cam()

def cam():
    vc = cv2.VideoCapture(0) #modify 0/1 to toggle between USB and internal camera
    while True:
        junk,image = vc.read()

camProcess = multiprocessing.Process( target=cam )
camProcess.start()

while True:
    pass
2012-12-10 16:15:44 -0600 received badge  Student (source)
2012-09-04 13:24:48 -0600 asked a question How to set resolution of video capture in python with Logitech c910 & c920

I have two webcams, Logitech c910 and c920. When I use the python interface to opencv2.4.1 on Ubuntu 12.04, I cannot seem to change the width or height of the capture from either camera. For example, if I run the code:

import cv2
cam = cv2.VideoCapture(-1)
cam.read()

I get a 640x480 image/numpy array. However, if I try to run:

import cv2
cam = cv2.VideoCapture(-1)
cam.set(3,1920)
cam.set(4,1080)
cam.read()

I first get the printout False after each attempt to set the resolution, and then the console hangs when it gets to cam.read().

On the other hand, when I run the above on my mac, everything works fine and I get the expected 1920x1080 image/numpy array.

Getting this working with Ubuntu is really mission critical for me, so any help would be greatly appreciated!

2012-07-15 07:06:15 -0600 asked a question Is there a fast way to zero pixels outside a set of rectangles?

I have an image of a face and I have used haar cascades to detect the locations (x,y,width,height) of the mouth, nose and each eye. I would like to set all pixels outside these regions to zero. What would be the fastest (computationally) way to do this? I'll eventually be doing it to video frames in real time. If it matters, I'm using the python interface to opencv.