OpenCV connection ps3 eye camera (python) - python

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.

Related

Python OpenCV with Imaging device USB3 Vision compliant camera - VideoCapture() index of camera not found

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.

Embedded linux printer using cups raster driver

I'm busy with a project to make a custom printer. basically a RPi/beaglebone connected to a gantry with stepper motors and a print-head.
I'm working on getting this setup to print an image from memory (with python), but I want to be able to print essentially any format from any application.
At this point I think the easiest way would be to setup CUPS on RPi to appear as a network printer over Wi-Fi. I've seen a few tutorials showing how to do this with a regular USB printer.
So I'd like to know how to write a custom CUPS raster driver that just takes the file and saves it as a raster image in memory at a specific dpi.
Otherwise, I'd like to know if there is an easier way to do this. It seems one should be able to simply query CUPS for a raster version of any job in the queue, not so?

Python Wifi Issue Connect to Mysterious Camera

I have been working with some drones and robotics projects using arduino and python. There was a kickstarter project for a neat little hex copter, that hasn't been managed well.
I was lucky, i got my copter and then some time later after some frustrated email exchanges, i finally recieved the camera as well. To this day, their forum has people still complaining. Their maker forum is now down and their wiki hasn't been updated with any specifics on the camera.
http://www.flexbot.cc/wiki/index.php?title=Main_Page#Hardware
Their app to accompany the drone still doesn't support the camera module. Not that it'd matter, as their code isn't very well documented or annotated.
https://github.com/HexAirbot
There are some tips on switching the camera on the comments page of their kickstarter campaign.
https://www.kickstarter.com/projects/1387330585/hex-a-copter-that-anyone-can-fly/posts/1093716
So, sob story over, i'm stuck with this neat little wifi camera that i am unsure on how to connect to. I know how to switch it on and it does have a micro-usb port on it.
What library in Python could i use to stream an image from this camera given that it is a wifi camera. If i wanted the video stream as a numpy matrix.
I need to interface with the camera, so i can connect and disconnect.
Then, be able to read images frame by frame with ffmpeg. I have some python modules that can detect and read from a camera, but how can my code ensure that the camera is connected?
Totally stuck. Any help would be appreciated.
Considering you are building for the android platform, you will more than likely need to use some sort of java/python driver/interface, unless you just use java.
Here is an article on java/python, and using python from within java.
Using Python from within Java

Python Switching Active Cameras

Here is the objective I wish to achieve: I would like to connect multiple web cameras to a single Windows machine and take snapshots from one of them at different instances (so one camera must active at one point of time, while another must be active at another). From what I have tried, an user has to go to the control panel and set which camera should be active at a given moment to use it. Is there a way to achieve this objective via python? (If there is a way to keep all cameras active at once, how should I specify which camera should take a snapshot?
I have investigated a couple options since then. One of the tools that I could utilize is devcon, through which usb cameras could be disabled/enabled to take snapshots. Another (simpler) option is to use a function in python opencv - cv2.VideoCapture(i) will automatically allow the program to iterate through different camera devices connected to the computer via usb.

Getting Python input from Webcam on raspberry pi?

i'm using a sony ps3 eye as webcam input on my pi for an OpenCL python program I'm writing, but for some reason no matter what i do the pi python compiler isn't accessing the webcam. Yet the same code when run on my laptop using the same webcam runs perfectly. Then i checked the usb devices on my pi and it state that "sony playstation 3 eye cam" was on usb port 6. also when using the "motion" package on the pi i was able to use the camera perfectly as input. So my problem is again that the python compiler isn't communicating with my webcam on the pi. Please, think about this and tell me how to fix it; i simply can't think of what's wrong. Here's the sample code I used, and please help me out. Thank you very much.
import cv2.cv as cv
#cv.NamedWindow("w1", cv.CV_WINDOW_AUTOSIZE)
camera_index = 0
capture = cv.CaptureFromCAM(camera_index)
while not capture:
print "error opening capture device, correction attempt"
while True:
frame = cv.QueryFrame(capture)
if frame is None:
print "fail with putting in frame"
else:
c = cv.WaitKey(100)
print 'capturing!'
cv.SaveImage("pictest.png", frame)
I never updated this but my solution was: I used the Motion Package for Raspberry Pi to receive images (since the Sony Ps3 EyeToy Camera did not have drivers written that were compatible with the Pi) and then Used OpenCV to analyze each Image. Doing this as each image came in, many times a second, is the same as analyzing video through OpenCV.This implementation worked perfectly for my needs, and I used other Bash tools to delete old image files after a certain time period so my memory was not unnecessarily filled.
There are some known problems with isochronous USB. Some camera issues have been addressed with recent fixes, but others remain (and apparently being worked upon). What kernel version are you using (uname -a)?
The fixes have not worked their way into the official distribution yet, so if you don't want to wait can run rpi-update to pick up the latest kernel (assuming you're using Raspbian). You want at least #389.

Categories

Resources