I'm trying to capture frames from a Firewire Cam (Firefyl MV) using OpenCV 2.3.1 and Python 2.7 on Windows XP.
My example finds the Camera when i use
capture = cv.CaptureFromCAM(-1)
but i cant capture the frames with
frame = cv.QueryFrame(capture)
Here http://opencv.willowgarage.com/documentation/python/highgui_reading_and_writing_images_and_video.html#capturefromcam they write:
Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394).
So is it not possible to use a Firewire Cam with OpenCV+Python on WinXP? Is there any simple workaround?
Only if the firewire camera maker included a VFW driver.
It's also possible to grab data from a DirectShow filter which the camera maker might provide instead
Related
I have a problem with using external camera in Python OpenCV.
I am using Windows.
In device manager, camera is not under "Cameras", but under "Imaging devices" and is called USB3 Vision compliant camera.
The camera is working fine on app given by company (UcamViewer).
I want to connect to this camera using cv2.VideoCapture().
I have of course tried:
cv2.VideoCapture(k)
for k = [0..100]
Only k = 0 is occupied and works - that is my webcam.
I have also tried adding multiple possible values to the second parameter of the VideoCapture(), which did not work.
how to get video from a "USB3 Vision" device?
This question suggested to use cv.CAP_XIMEA as the second parameter of VideoCapture(), but CAP_XIMEA does not seem to be a possible value.
If I can not fix this issue and use VideoCapture(), what would you suggest to use to capture the video and convert it to format that can be used by openCV methods?
Any ideas how could I solve this issue will be appreciated.
Thank you for your help.
Heading I need to get an image at the same time (almost, it is possible to take turns in a loop) from two PS3 Eye cameras, and then work with them using OpenCV.
We need drivers for the ps3 eye multicam (for example, these are not suitable https://codelaboratories.com/downloads/)
As an option for drivers there is a program zadig(https://zadig.akeo.ie/), and in particular WinUSB (libusb), but OpenCV Python (the standard function cv2.VideoCapture) sees only one camera. I found a project that can use several cameras at once in OpenCV with WinUSB drivers (libusb) - https://github.com/psmoveservice/PSMoveService/releases (Open bin/test_camera.exe). But it is written in C++ and due to its incompetence in this programming language, I could not port the code to python.
In the end, I need drivers and Python code to use the ps3 eye multicam in OpenCV.
Try checking this. Get the environment you want to build.
https://github.com/bensondaled/pseyepy
Let's you configure the camera as well.
I am using Windows 7 64 bit operation system together with Python 3 and OpenCV. My computer is interfaced to two Logitech webcam of the following model:
1) Logitech HD Webcam C615
2) Logitech QuickCam Pro 9000
In Python I am running the below script
import cv2
cap1 = cv2.VideoCapture()
cap2 = cv2.VideoCapture()
cap1.set(cv2.CAP_PROP_AUTOFOCUS,0) # I want to change the focus manually myself
cap1.set(cv2.CAP_PROP_FOCUS,10)
cap2.set(cv2.CAP_PROP_FOCUS,10)
cap1.set(cv2.CAP_PROP_EXPOSURE,25)
cap2.set(cv2.CAP_PROP_EXPOSURE,25)
#get frame
ret, frame1 = cap1.read()
ret, frame2 = cap2.read()
#display result
cv2.imshow('cam 1',frame1)
cv2.imshow('cam 2',frame2)
The problem is, regardless on how I change the parameters in my cv2.set, I don't see the change being reflected in the captured image.
I then went to download Logitech's driver for the camera called Logitech Webcam Software. Using their software I can make the appropriate settings in both of the cameras. When closing the software, and restart python and running the script, the captured images appear exactly according to the settings that I have set in the Logitech Webcam Software.
My questions are:
1) Why can I not set the camera settings directly using Python and OpenCV?
2) How should I change my script in order to interface the camera settings direct from Python?
Thanks!
I have an ASUS Xtion 3D Sensor Camera. I want to record video with this camera by using python.
I have tried opencv using this tutorial; http://docs.opencv.org/2.4/doc/user_guide/ug_kinect.html, but it seems that there is no video recording by using OpenNI API through OpenCV. It only shows that how to grab frames, but that is not video recording.
How can I manage to make a video recording with this camera in python?
Thanks,
You can use Recorder class to capture data into ONI file.
http://www.openni.ru/wp-content/doxygen/html/classopenni_1_1_recorder.html
Then you can convert ONI into avi format https://github.com/KirillLykov/oni2avi
I am trying to code up simple face detection in python using opencv. But unfortunately my opencv is refusing to detect my webcam. I am not sure how it works internally, as documentation is very limited, but CaptureFromCAM(-1) returns some object, but QueryFrame returns nones. When I try to use one of my two cameras for example in cheese, I get video without a problem.
capture = cv.CaptureFromCAM(-1)
faceCascade = cv.Load("haarcascade_frontalface_alt.xml")
while (cv.WaitKey(15)==-1):
img = cv.QueryFrame(capture)
if img != None:
image = DetectFace(img, faceCascade)
cv.ShowImage("face detection test", image)
cv.ReleaseCapture(capture)
Any ideas?
Ok, I have figured it out. Basically my openvc was compiled with v4l (video for linux) support.
When solving this problem you first need to make sure your camera is working with some other application using v4l. If that is the case then you can try to recompile openvc with v4l support. For gentoo (which uses portage) it is very simple:
sudo su
USE="v4l v4l2" emerge -av opencv
for other package managers either figure something out or compile from source with USE_V4L=ON.