Author Message

<  beginners  ~  Sony PS3 Eye

PostPosted: Thu Oct 23, 2008 6:47 pm
Site AdminJoined: Thu Mar 01, 2007 10:03 pmPosts: 916Location: Amsterdam
I just picked up one today in amsterdam - so needless to say it will soon be working with VI/OF

:D

Theo



_________________
http://www.theowatson.com
Offline Profile
PostPosted: Thu Oct 23, 2008 6:57 pm
Site AdminJoined: Thu Mar 01, 2007 10:03 pmPosts: 916Location: Amsterdam
ohh and it works with mac too! just tested it :D
http://forums.macrumors.com/showthread.php?t=522097



_________________
http://www.theowatson.com
Offline Profile
PostPosted: Thu Oct 23, 2008 7:08 pm
Joined: Thu May 15, 2008 7:52 amPosts: 192Location: California
Yay! lol :)

Unfortunately, I think the mac and linux driver only goes to 30fps (I could be wrong). Maybe someone will make a driver for mac that takes up the full potential of the camera. It'd be pretty crazy to have a $40 camera that does 120fps on mac and windows (maybe even linux) hehe.

I don't have the camera yet, looks like I'm going to have to go buy one today or tomorrow :)



_________________
Website - http://sethsandler.com
Twitter - http://twitter.com/SethSandler
Linkedin - http://www.linkedin.com/in/sethsandler
techsparked - http://techsparked.com/users/seth
Offline Profile
PostPosted: Thu Oct 23, 2008 8:15 pm
User avatarJoined: Tue Jul 10, 2007 6:44 pmPosts: 238Location: nyc
Sweet! Any knowledge if it's possible to control cam settings (aperture,gain,...) programmatically?



_________________
stefan hechenberger

http://linear.nortd.com/
Offline Profile
PostPosted: Fri Oct 24, 2008 7:18 am
Joined: Fri Oct 24, 2008 7:08 amPosts: 13Location: Las Vegas
cerupcat wrote:
@ Theo and arturo, that is great news!

Theo, I don't think there's a need to adjust FPS on the fly, only to be able to set it on init. Many cameras don't allow you to set their fps once they initialize. So although we have access to videoSetting, most of these just adjust image quality (brightness, contrast, etc) but don't let you set resolution, frame rate, colorspace. The philips SPC900nc is an exception to this, it lets you change fps after it starts in the videoSettings. But, generally we have to set that before the camera starts which is why it's so important. I could say more why we need this feature, but I don't want to hijack this thread heh. Hopefully eventually we can get a FPS setting for all platforms.

@ Progen, that's not good news :( I'll PM Alex and point him to this thread. I wonder what he changed between the version you had working and the current one.

Should we look into using his PS3lib and SDK instead or should the directshow one work the same you think?


cerupcat, it is the best if you can use the PS3Eye SDK since it provides minimal latency and the best performance. You will see much improvements in both performance and stability if you run it under Vista as opposed to XP. This especially applies when running at high frame rates.
I will look into DirectShow filter issue. It is a major pain to write DS video source filter since there is not much info about this process out there...

~Alex



_________________
Computing is not about computers any more. It is about living...
Offline Profile
PostPosted: Fri Oct 24, 2008 9:32 am
Site AdminJoined: Thu Mar 01, 2007 10:03 pmPosts: 916Location: Amsterdam
Hey Alex

Welcome to the forums!
Thanks for all your work on the PS3 Eye - its a nice piece of hardware!

Quote:
It is a major pain to write DS video source filter since there is not much info about this process out there...

Yeah I can imagine - dealing with DS is definitely not a fun experience - but anything you can do to make it work with DS would be appreciated! I am going to play around with videoInput today and see if there are any major issues with the Eye.

Now for OS X - I was going through the maccam source and found the class that deals with the PS3 Eye. Its in src/cameras/OV534Driver.m (even though it is a OV538 - it is grouped with the OV534 code ).

Anyway 60/120 fps doesn't seem that far off - by changing the code a little I get 60 fps at 320 by 240 although the image is a little scrambled like the width of the image was not calculated correctly or something.

You can do this by making the following changes:

Code:
- (BOOL) supportsResolution: (CameraResolution) res fps: (short) rate
{
    switch (res)
    {
        case ResolutionVGA:
            if (rate > 30)
                return NO;
            return YES;
            break;
           
        case ResolutionSIF:
            if (rate > 120)
                return NO;
            return NO; // Not working yet <-- change to YES
            break;
           
        default:
            return NO;
    }
}

- (CameraResolution) defaultResolutionAndRate: (short *) rate
{
   if (rate)
        *rate = 30; // <-- change to 60
   
   return ResolutionVGA; //<-- change to ResolutionSIF
}



There is also a ton of code in the .m file that sets the register values.
EG:

Code:
   [self setRegister:0x1d toValue:0x02];
    [self setRegister:0x1d toValue:0x57];
    [self setRegister:0x1d toValue:0xff];
   
    [self verifySetRegister:0x8d toValue:0x1c];
    [self verifySetRegister:0x8e toValue:0x80];
    [self verifySetRegister:0xe5 toValue:0x04];



and

Code:
    [self setSensorRegister:0x12 toValue:0x80];
    [self setSensorRegister:0x11 toValue:0x01];
    [self setSensorRegister:0x11 toValue:0x01];


I am figuring that these register values would be the same for the code you had to write for the Directshow driver / SDK. Would you happen to have a list of all the register values and what they are responsible for? Would be great to get more control over the PS3 Eye on mac too!

Cheers
Theo



_________________
http://www.theowatson.com
Offline Profile
PostPosted: Fri Oct 24, 2008 11:13 am
Site AdminJoined: Thu Mar 01, 2007 10:03 pmPosts: 916Location: Amsterdam
So I got the PS3 Eye working at 60 - 90 fps on a mac by modifying the maccam driver source code.

EDIT
Patched Maccam Driver and Demo App:
Supports both 640by480@30fps and 320by240@60-90fps
Modified source code included - http://www.openframeworks.cc/files/macc ... ps3eye.zip

Image

Mainly thanks to this post which covered all the issues I was facing
http://forums.ps2dev.org/viewtopic.php?p=74541#74541

Right now the changes I made completely disabled 640 by 480 - but I think I can get it to do both!

Also linked of the same forum was this page which describes the register values for other settings! So maybe we can disable auto gain on mac too!
http://www.invisible.ca/~jmcneill/outgoing/7720Rev2.set

Theo



_________________
http://www.theowatson.com
Offline Profile
PostPosted: Mon Oct 27, 2008 12:02 am
Site AdminJoined: Thu Mar 01, 2007 10:03 pmPosts: 916Location: Amsterdam
So here is a little update -
I have auto gain, shutter, gain, hue, and flicker controls added to the macam driver - for both 320x240 and 640x480

Image

You can see how it works here - excuse the crappy screen capture
http://www.openframeworks.cc/files/more ... PS3Eye.mov

Anyway it is working pretty well - one thing I don't know how to do is add the properties that the macam app controls to the quicktime settings panel that OF uses.

This seems pretty interesting though - and points to possible being able to control the settings in code - http://lists.apple.com/archives/QuickTi ... 00227.html

Macam app - component and Source code here:
http://www.openframeworks.cc/files/macc ... ntrols.zip

To compile download the current macam from here: http://prdownloads.sourceforge.net/webc ... g?download
Then replace OV534Driver.h and OV534Driver.m with the two in my zip



_________________
http://www.theowatson.com
Offline Profile
PostPosted: Mon Oct 27, 2008 12:34 am
Joined: Thu May 15, 2008 7:52 amPosts: 192Location: California
Wow very cool theo! I'm sure you'll make a lot of (both OF and non-OF) people happy very with this update. Can't wait to finally get my ps3 eye and try it out on mac and windows.

I'm still a little unclear on the windows side how we should best integrate the camera in OF since alex said it be better to use his ps3lib and sdk rather than use directshow.



_________________
Website - http://sethsandler.com
Twitter - http://twitter.com/SethSandler
Linkedin - http://www.linkedin.com/in/sethsandler
techsparked - http://techsparked.com/users/seth
Offline Profile
PostPosted: Mon Oct 27, 2008 1:21 am
Site AdminJoined: Thu Mar 01, 2007 10:03 pmPosts: 916Location: Amsterdam
thanks!

I tried it in windows and the ps3 eye was quite buggy with VideoInput.
I need to spend a bit more time with it (and not so much time on macam : ) but it could be something on my end or something with the directshow driver.

One thing it is doing is freezing after a few seconds of video - very strange!

Theo



_________________
http://www.theowatson.com
Offline Profile
PostPosted: Thu Oct 30, 2008 12:31 am
Joined: Fri Oct 24, 2008 7:08 amPosts: 13Location: Las Vegas
theo wrote:
So I got the PS3 Eye working at 60 - 90 fps on a mac by modifying the maccam driver source code.

EDIT
Patched Maccam Driver and Demo App:
Supports both 640by480@30fps and 320by240@60-90fps
Modified source code included - http://www.openframeworks.cc/files/macc ... ps3eye.zip

Image

Mainly thanks to this post which covered all the issues I was facing
http://forums.ps2dev.org/viewtopic.php?p=74541#74541

Right now the changes I made completely disabled 640 by 480 - but I think I can get it to do both!

Also linked of the same forum was this page which describes the register values for other settings! So maybe we can disable auto gain on mac too!
http://www.invisible.ca/~jmcneill/outgoing/7720Rev2.set

Theo


Theo,
Did you modify any camera sensor registers to get this higher capture frame rate? I looked the code but I didn't find any modifications in there. I saw that you are modifying the default rate here:
Code:
   
- (CameraResolution) defaultResolutionAndRate: (short *) rate
{
  if (rate)
     *rate = 90;
  return ResolutionSIF;
}


This does increases the rate at which Mac reads the frames form the driver, but it does not increases the effective capture frame rate.

Alex


Offline Profile
PostPosted: Fri Oct 31, 2008 10:02 pm
Joined: Sat Mar 29, 2008 1:05 pmPosts: 261Location: Lisbon, Portugal
Hi Theo!
thanks a lot for this. i've had a lot of problems in the past trying to find a decent/ reasonably priced web cam for mac and this just seems perfect.

So for now, gain and other parameters cannot be controlled in OF, but are they automatic? Auto gain is terrible and if the ps3 eye doesn't have auto gain i would probably buy it.

thanks

Rui



_________________
www.ruim.pt
Offline Profile
PostPosted: Mon Nov 03, 2008 12:01 am
User avatarJoined: Wed Aug 13, 2008 12:11 amPosts: 134Location: Buffalo, NY
This is very exciting. I've been looking to buy a high frame rate camera for use with oF. I just read this thread, ran out and bought the camera. If this ends up working I'll have saved a few hundred bucks.

I'm having a bit of trouble interfacing with the SDK:

Code:
in IPs3EyeLib.h...
123   virtual byte GetGain() PURE;
error: `byte' does not name a type
error: `byte' has not been declared
error: ISO C++ forbids declaration of `value' with no type


I'm quite positive this is a stupid problem on my part, i'm just not sure what to do from here.


Offline Profile
PostPosted: Mon Nov 03, 2008 2:32 pm
User avatarJoined: Tue Jul 10, 2007 6:44 pmPosts: 238Location: nyc
thanks theo, I just got the macam sources going and started playing with register values. Well to say the least ... there are a lot! Very nice you got so far already.

You said you got it working with 640x480. How did you do that. If I simply change the corresponding register I get a scrambled stream. I assume I have to change the with/height variables. Where do I do that and where do they come from?

back to playing with register values ;)



_________________
stefan hechenberger

http://linear.nortd.com/
Offline Profile
PostPosted: Mon Nov 03, 2008 3:07 pm
User avatarJoined: Thu May 31, 2007 2:32 pmPosts: 292Location: PDX
Hey Tim,

Do a search in the source for something like

typedef unsigned char byte

Or that's my largely uneducated thought.Something isn't getting included when you compile.


Offline Profile

Display posts from previous:  Sort by:

All times are UTC
Page 2 of 15
216 posts
Go to page Previous  1, 2, 3, 4, 5 ... 15  Next
Users browsing this forum: Google [Bot], yesyesnono and 1 guest
Search for:
Post new topic  Reply to topic
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
cron