Mintoris

Author Topic: Fastest TakePhotoAuto method?  (Read 2776 times)

FlyByPC

  • Jr. Member
  • **
  • Posts: 6
Fastest TakePhotoAuto method?
« on: May 02, 2013, 01:57 PM »
I am trying to use the camera to gauge light levels, and so need a way to take a very simple picture -- ideally once per second or faster. Resolution and quality are absolutely unimportant, since the picture will be reduced to a scalar value 0-255. Right now, TakePhotoAuto works, but is very slow. Any recommendations to speed up the process? Thanks.

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Fastest TakePhotoAuto method?
« Reply #1 on: May 02, 2013, 02:24 PM »
I'll have to look into that. Would the GetLight() function help?

-Chuck

FlyByPC

  • Jr. Member
  • **
  • Posts: 6
Re: Fastest TakePhotoAuto method?
« Reply #2 on: May 02, 2013, 02:44 PM »
GetLight() works well, but unfortunately I need to get a light level from the camera's CCD. Thanks.

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Fastest TakePhotoAuto method?
« Reply #3 on: May 03, 2013, 12:12 PM »
I've spent some time working with the camera code. I've added a couple new parameters to the TakePhotoAuto command.

TakePhotoAuto filename${,flashmode, quality, photoDelay}

There was a fixed 2 second delay before the photo taking process began. This was to give the focus and auto flash time to do their work. The new photoDelay parameter will allow you to set that delay in milliseconds. The minimum delay is 25ms. If not specified it defaults to 2000ms. I had thought that this would eliminate the delay, but setting it to 25ms still takes about 5 seconds to take a photo.

Next I added a quality parameter which sets the compression quality of the photo. This parameter may be 1 to 100 and will default to 100 if not specified. I thought that the delay may have been from writing the image file to the sdcard, but even at 25% it still takes 5 seconds to take a photo. This parameter is very useful in reducing the size of the image file and may solve the out of memory problems when loading the full size image back into memory.

I will release an update with these changes shortly. A new video mode would be needed to capture frames at the speed you would like. I will have to think about that.

-Chuck
« Last Edit: May 03, 2013, 01:37 PM by Chuck »

FlyByPC

  • Jr. Member
  • **
  • Posts: 6
Re: Fastest TakePhotoAuto method?
« Reply #4 on: May 03, 2013, 12:13 PM »
That will help, though. Thanks!