PS3 Multicam in Python-OpenCV
Posted: 26 March 2010 08:24 AM   [ Ignore ]
New Member
Rank
Total Posts:  5
Joined  2010-03-24

Hello,

We have been working with Python-OpenCV and PS3Eye on Linux-Ubuntu were the things work fine for multicam applications.

Now we are working in Windows 7, my code still in Python-OpenCV and with the CLEye Platform Driver we are able to work with one PS3Eye as it was expected.

Then we downloaded the CLEye Platform Driver to work with 2 PS3Eye but we didn’t figure out how to make them work, only one of them were detected by the Windows7 OS, and the CL-Eye Test under the “Devices” shows us only one PS3Eye cámera and the laptop cámera

Then we bought the CLEye Dual Pack ($20) thinking it will let the Windows7 OS detect both cameras but it doesn’t work either, the CL-Eye Test sill showing us one PS3Eye cámera and the laptop cámera

We need an advise on how to use both cameras in Python-OpenCV

Thanks in advance,

Andres Caro

Profile
 
 
Posted: 27 March 2010 12:30 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  585
Joined  2009-09-17

In order to use multi-camera you need to use the CLEyeMulticam API and not DirectShow. Download the SDK and take a look at the source code in the sample directory.

Profile
 
 
Posted: 27 March 2010 01:04 PM   [ Ignore ]   [ # 2 ]
New Member
Rank
Total Posts:  5
Joined  2010-03-24

Thanks for your answer Alex!!!
Now i have detected both cameras in python, I loaded the CLEyeMulticam.dll library like this:

from ctypes import cdll,c_int
lib = “/Program Files/Code Laboratories/CL-Eye Platform SDK/Bin/CLEyeMulticam.dll”
dll=cdll.LoadLibrary(lib)
dll.CLEyeGetCameraCount()

and i get the number of cams that i have connected.

But now… i don´t know how to declare the CL-Eye Multicam Variables (CamUIID as GUID, CLEyeCameraColorMode, CLEyeCameraResolution, Framerate as int )

Can you give me a hint on how to do that??

Profile
 
 
Posted: 27 March 2010 01:28 PM   [ Ignore ]   [ # 3 ]
New Member
Rank
Total Posts:  5
Joined  2010-03-24

Alex!, On the other hand, we are trying to compile the CLEyeMulticamTest.cpp in Visual Studio 2008 but we get the following error “fatal error LNK1104: cannot open file ‘cxcore.lib’”.
We were looking for that library in the PC, but only found cxcore.h

Need a little help, we need to make it work in windows with opencv, in python or in c++.

Profile
 
 
Posted: 28 March 2010 02:42 PM   [ Ignore ]   [ # 4 ]
New Member
Rank
Total Posts:  5
Joined  2010-03-24

AlexP

I finally achieve to complile the CLEyeMulticamTest.cpp in VC2008. I think the API lack of information.

The problem trying to compile the CLEyeMulticamTest.cpp in Visual Studio 2008 was because the OpenCV versión. I was using V2.0 where the libraries are .dll’s. The CLEyeMulticamTest.cpp calls cxcore.lib, but it doesn’t exist, instead there is cxcore200.dll.a . The solution for me was uninstall OpenCV v2.0 and install OpenCV v1.1.

Any ideas to make it work with OpenCV v2.0?

——————————————

Talking about the CLEyeMulticam API, we have achieve the following:

from ctypes import cdllc_int
lib 
"/Program Files/Code Laboratories/CL-Eye Platform SDK/Bin/CLEyeMulticam.dll"
dll=cdll.LoadLibrary(lib)
print 
dll.CLEyeGetCameraCount()

from ctypes import oledllStructurebyref
from ctypes
.wintypes import BYTEWORDDWORD
class GUID(Structure):
     
_fields_ [("Data1"DWORD),
             (
"Data2"WORD),
             (
"Data3"WORD),
             (
"Data4"BYTE 8)]
guid 
GUID()
oledll.ole32.CoCreateGuid(byref(guid))
guid.Data1=0xc4072a9d
guid
.Data2=0xf0c2
guid
.Data3=0x266f

guid
.Data4[0]=0xbe
guid
.Data4[1]=0xae
guid
.Data4[2]=0x3a
guid
.Data4[3]=0x5d
guid
.Data4[4]=0x43
guid
.Data4[5]=0x75
guid
.Data4[6]=0x97
guid
.Data4[7]=0x0d

cam
=dll.CLEyeCreateCamera(guid,1,1,30)

import cv
import ctypes

cv
.NamedWindow"camara"
imagen=cv.CreateImage((640,480),8,4)
dll.CLEyeCameraStart(cam)

p2=imagen.origin


while True:
            
dll.CLEyeCameraGetFrame(cam,p2
            
cv.ShowImage"camara"imagen )
        
            
cv.WaitKey(7)
            if 
== 27:
                break 

I don’t know if the guid data is well defined, I tried that because the uuid native data from python doesn’t work. Do you know how to get the guid data from cámeras in python?

When I execute the code, the window opens, but in doesn’t shows the image from the cámera. What I’m doing wrong?

Thanks

Profile
 
 
Posted: 28 March 2010 07:23 PM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  585
Joined  2009-09-17

The CLEyeMulticam examples were compiled to work with OpenCV 1.0 as its noted in the readme file. I haven’t had a time to play with version 2.0 yet, but can’t imagine it difficult to port it to newer version of OpenCV. The Guid is a standard data type of size 16bytes.
I suggest you to do the port to Python one thing at a time. Do the CLEyeMulticam API port and get it to work with OpenCV v1.1 first, then work on OpenCV 2.0 if you need it to work with this version.

Profile
 
 
Posted: 28 April 2011 11:00 AM   [ Ignore ]   [ # 6 ]
New Member
Rank
Total Posts:  1
Joined  2011-04-28

hi everyone: python seend me this error when i try to run the progam. Can anybody help me?

File “C:/Python27/prueba 5”, line 3, in

  dll=cdll.LoadLibrary(lib)
  File “C:\Python27\lib\ctypes\__init__.py”, line 431, in LoadLibrary
  return self._dlltype(name)
  File “C:\Python27\lib\ctypes\__init__.py”, line 353, in __init__
  self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] No se puede encontrar el módulo especificado


i don´t have cdll for import to my program….

can anybody send to me an example to use a simple cam(ps3eye) in python?
how i can use c or c++ code examples in python?

tanks in advance.

Profile
 
 
 
 


RSS 2.0     Atom Feed