1 of 6
1
>>> The PS3Eye Multicam Driver is here!!! <<<
Posted: 04 September 2009 04:32 AM   [ Ignore ]
Avatar
RankRankRank
Joined  2008-05-08
Total Posts:  342
Administrator

Finally, here is the long awaited PS3Eye multicam driver.

UPDATE: For the latest CL-Eye Multicam API read this article. For a OpenCV sample code look at this article.

After a lot of testing and optimization of the internal driver code, I finally am ready to release the first version of the PS3Eye multicam driver.
For your reference, below is the diagram of the internal components of the driver. For a single camera configuration the ‘Image Stitching’ component is bypassed.

PS3EyeMulticam.jpg width=800

The driver exports simple API that allows for full control of PS3Eye cameras.
I chose a C style export functions this time to allow for easier integration with different programming languages such as C#.
Here is the ‘PS3EyeMulticam.h’ file that you would normally include in your code:

////////////////////////////////////////////////////////////////////////////////////////////
//
// This library allows you to use multiple PS3Eye cameras in your own applications.
//
// For updates, more information and downloads visit: 
// http://www.alexpopovich.com or
// http://alexpopovich.wordpress.com/
//
// Copyright 2008,2009 (c) AlexP.  All rights reserved.
//
////////////////////////////////////////////////////////////////////////////////////////////
#pragma once
#include <windows.h>

#ifdef PS3EYEMULTICAM_EXPORTS
#define PS3EYEMULTICAM_API extern "C" __declspec(dllexport)
#else
#define PS3EYEMULTICAM_API extern "C" __declspec(dllimport)
#endif

////////////////////////////////////////////////////////////////////////////////////////////
// PS3EyeMulticam API
////////////////////////////////////////////////////////////////////////////////////////////

typedef enum{ QVGAVGA }Resolution;

// Camera information
PS3EYEMULTICAM_API int PS3EyeMulticamGetCameraCount();

// Library initialization
PS3EYEMULTICAM_API bool PS3EyeMulticamOpen(int camCntResolution resint frameRate);
PS3EYEMULTICAM_API void PS3EyeMulticamClose();

// Capture control
PS3EYEMULTICAM_API bool PS3EyeMulticamStart();
PS3EYEMULTICAM_API void PS3EyeMulticamStop();

// Settings control
PS3EYEMULTICAM_API bool PS3EyeMulticamLoadSettings(charfileName="settings.xml");
PS3EYEMULTICAM_API bool PS3EyeMulticamSaveSettings(charfileName="settings.xml");
PS3EYEMULTICAM_API void PS3EyeMulticamShowSettings();

// Processed frame image data retrieval
PS3EYEMULTICAM_API bool PS3EyeMulticamGetFrameDimensions(int &widthint &height);
PS3EYEMULTICAM_API bool PS3EyeMulticamGetFrame(PBYTE pDataint waitTimeout=2000);

////////////////////////////////////////////////////////////////////////////////////////////

Included in the driver archive is a full source code of a simple ‘PS3EyeMulticamTest’ application that allows you to run and test the multicamera driver. This code could also serve as a good starting point for writing your own OpenCV image processing apps.
The PS3EyeMulticamTest app uses all of the API functions defined in ‘PS3EyeMulticam.h’ file.
Here is the ‘PS3EyeMulticamTest.cpp’ file:

//
// PS3EyeMulticamTest.cpp
//
// This is a quick test application for the 
// PS3EyeMulticam driver
//
// To build it, in VS2008 create en empty window app project
// and add all the files in this folder to it.
//
#include "stdafx.h"

#define WINDOW_NAME        "Capture Window"
bool bRunning false;
int wh;
 
// Capture thread
DWORD WINAPI Capture(LPVOID)
{
    IplImage 
*grayImage cvCreateImage(cvSize(wh), IPL_DEPTH_8U1);
    
PS3EyeMulticamStart();
    while(
bRunning)
    
{
        PBYTE pBuffer 
NULL;
        
cvGetImageRawData(grayImage, &pBuffer);
        
PS3EyeMulticamGetFrame(pBuffer);
        
cvShowImage(WINDOW_NAMEgrayImage);
    
}
    PS3EyeMulticamStop
();
    
cvReleaseImage(&grayImage);
    return 
0;
}

void Program
()
{
    
// Query driver for number of connected PS3Eye cameras
    
int camCnt PS3EyeMulticamGetCameraCount();
    
printf("Found %d PS3Eye cameras\n"camCnt);
    if(
camCnt == 0)
    
{
        MessageBox
(NULL,"No PS3Eye camera(s) found","PS3EyeMulticamTest"MB_ICONEXCLAMATION);
        return;
    
}
    
// Open cameras
    
if(!PS3EyeMulticamOpen(camCntVGA30))
    
{
        MessageBox
(NULL,"Could not open PS3Eye camera(s)","PS3EyeMulticamTest"MB_ICONEXCLAMATION);
        return;
    
}
    
// Load the default camera settings 'settings.xml' file
    // If the file is not found it will be created
    
PS3EyeMulticamLoadSettings("settings.xml");

    
// Get output image dimensions
    
PS3EyeMulticamGetFrameDimensions(wh);
    
printf("Image dimensions (%d, %d)\n"wh);

    
// Create OpenCV main window
    
cvNamedWindow(WINDOW_NAMECV_WINDOW_AUTOSIZE);
    
cvMoveWindow(WINDOW_NAME00);
    
cvResizeWindow(WINDOW_NAMEwh);

    
// Start PS3Eye image capture thread
    
HANDLE hThread CreateThread(NULL0CaptureNULL00);
    if(
hThread == NULL)
    
{
        MessageBox
(NULL,"Could not create capture thread","PS3EyeMulticamTest"MB_ICONEXCLAMATION);
        
PS3EyeMulticamClose();
        return;
    
}
    bRunning 
true;
    
// The '<esc>' key will exit the program
    // The 's' key will open camera settings dialog
    
while(bRunning)
    
{
        int key 
cvWaitKey(0);
        switch(
key)
        
{
            
case 's':
            case 
'S':
                
// Display settings
                
PS3EyeMulticamShowSettings();
            break;
            case 
0x1b:
                
printf("Exiting...\n");
                
// Stop the capture thread
                
bRunning false;
                
// Wait for thread to exit
                
WaitForSingleObject(hThread3000);
                
printf("Thread exited\n");
            break;        
        
}
    }
    
// Save camera settings
    
printf("Saving settings\n");
    
PS3EyeMulticamSaveSettings();
    
printf("Closing OpenCV window\n");
    
cvDestroyWindow(WINDOW_NAME);
    
PS3EyeMulticamClose();
}

// This is the program entry if you link with /SUBSYSTEM:CONSOLE option
int main(int argcchar *argv[])
{
    Program
();
    return 
0;
}

// This is the program entry if you link with /SUBSYSTEM:WINDOWS option
int WINAPI WinMain(HINSTANCE hInstanceHINSTANCE hPrevInstanceLPSTR lpCmdLineint nShowCmd)
{
    Program
();
    return 
0;
}

Last but not least, here you will find the PS3EyeMulticam.rar file.
Enjoy!

~Alex

 Signature 

Computing is not about computers any more.  It is about living!

Code Laboratories
CL Studio Live - Video like never before
CL Eye Platform SDK

Profile
 
 
Posted: 04 September 2009 04:47 AM   [ Ignore ]   [ # 1 ]
RankRank
Joined  2009-04-20
Total Posts:  215
Member

yeah baby :D
THANKS a lot

Profile
 
 
Posted: 04 September 2009 05:34 AM   [ Ignore ]   [ # 2 ]
Avatar
RankRankRank
Joined  2009-08-02
Total Posts:  254
Sr. Member

AlexP , Thank you !

 Signature 

My second prototype FTIR video

Musaab Hashim

Profile
 
 
Posted: 04 September 2009 06:03 AM   [ Ignore ]   [ # 3 ]
Avatar
RankRankRankRank
Joined  2008-06-04
Total Posts:  565
Elite

Ohh my now im gunna need to buy a whole load of PS3 cams!  Can peau keep up with the orders!? 

So much resoloution…

 Signature 

}---)))@

V JAY!  http://www.v-lux.net LASER tut http://nuigroup.com/forums/viewthread/6407/

Architectural Technician and Building Surveys

http://www.jpgainsfordassociates.com

Profile
 
 
Posted: 04 September 2009 06:49 AM   [ Ignore ]   [ # 4 ]
Avatar
RankRank
Joined  2009-06-19
Total Posts:  150
Member

So who’s going to be the first to demonstrate this? I’m looking forward to seeing the results!

 Signature 

Meirion’s LLP Multitouch Table at City University London (showcase)
Screw laser mounts
Build gallery: http://www.getdropbox.com/gallery/579708/1/Build?h=ffb7dd
Videos: http://www.vimeo.com/meirion/videos

Profile
 
 
Posted: 04 September 2009 07:16 AM   [ Ignore ]   [ # 5 ]
Avatar
Rank
Joined  2007-07-13
Total Posts:  71
New Member

Hi AlexP,
Little bit off topic just if you know if there is a way to pull out frame rate signal from the ps3Eye for syncing so be able to use it as an interrupt signal for IR amplifier hardware.

tx,

Goran

Profile
 
 
Posted: 04 September 2009 09:40 AM   [ Ignore ]   [ # 6 ]
Rank
Joined  2009-07-31
Total Posts:  3
New Member

Emergency! ccv how to run? How to make ccv read? Please expert guidance.

 Signature 

================================================================================
HCI Table support windows 7 Microsoft Touch Pack—http://hci.cn
================================================================================

Profile
 
 
Posted: 04 September 2009 11:14 AM   [ Ignore ]   [ # 7 ]
Avatar
RankRank
Joined  2008-10-23
Total Posts:  148
Member

@AlexP : I want a child from you kiss

Profile
 
 
Posted: 04 September 2009 11:44 AM   [ Ignore ]   [ # 8 ]
Avatar
RankRankRankRankRankRank
Joined  2008-09-12
Total Posts:  2225
Dedicated
ajlovegrove - 04 September 2009 06:03 AM

Ohh my now im gunna need to buy a whole load of PS3 cams!  Can peau keep up with the orders!? 

So much resoloution…

You bet I can smile

 Signature 

MT Website - A Collection of the Most Relevant Multitouch Info From These Forums
Multitouch Blog
Multitouch Parts Store - Buy Infrared Touch Frames (No Camera Needed!), Complete Modified Cameras and DIY Upgrade Kits, m12/CS Mounts, m12/CS Lenses, Infrared Lasers, LEDs, etc

Profile
 
 
Posted: 04 September 2009 12:30 PM   [ Ignore ]   [ # 9 ]
Avatar
RankRankRankRank
Joined  2008-02-12
Total Posts:  1111
Member

Correct me if i’m wrong from what i can tell this is only a dual camera driver… not really multicam. Or is it??
Can i connect 5 cameras and use them like in the surface?

 Signature 

Company Website - Knode Research and Development
My Youtube

Profile
 
 
Posted: 04 September 2009 12:52 PM   [ Ignore ]   [ # 10 ]
Rank
Joined  2009-09-01
Total Posts:  13
New Member

Sorry for my silly question… how do I update the driver? Or can I have the installer..? rasberry

Profile
 
 
Posted: 04 September 2009 01:29 PM   [ Ignore ]   [ # 11 ]
Rank
Joined  2009-06-23
Total Posts:  14
New Member

Thanks, you definitely are helping advance the community by leaps and bounds.

Profile
 
 
Posted: 05 September 2009 08:51 AM   [ Ignore ]   [ # 12 ]
Avatar
Rank
Joined  2009-05-19
Total Posts:  10
New Member

Alex,
Thanks very much for this multicam driver , I’ve been waiting so long for this you’ve made my day grin
Can’t wait to start working on my own open cv application using your api!!

Regards

 Signature 

“Strive for perfection in everything you do. Take the best that exists and make it better. When it doesn’t exist, design it, build it and Open Source it!”

Profile
 
 
Posted: 05 September 2009 09:18 AM   [ Ignore ]   [ # 13 ]
RankRank
Joined  2007-06-06
Total Posts:  139
Member

Great News! Thanks for the hard work on this AlexP.  It’s going to open up so many possibility for not only multitouch, but all sorts of lower-cost computer vision applications smile

 Signature 

- Miketavius

Profile
 
 
Posted: 06 September 2009 08:45 PM   [ Ignore ]   [ # 14 ]
Rank
Joined  2008-12-14
Total Posts:  5
New Member

Excellent work once again Alex.

Looking forward to trying this.

 Signature 

"640K ought to be enough for anybody.” - Bill Gates, 1981

Profile
 
 
Posted: 07 September 2009 03:49 AM   [ Ignore ]   [ # 15 ]
Rank
Joined  2008-08-26
Total Posts:  59
New Member

Alex == Superman !

Profile
 
 
   
1 of 6
1