We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpVideo Capture,  Movie Playback,  Vision Libraries › Is there a video library that does <1fps
Page Index Toggle Pages: 1
Is there a video library that does <1fps? (Read 1149 times)
Is there a video library that does <1fps?
Oct 25th, 2009, 4:18am
 
Hi All, I'm starting a project that will allow me to do long exposure images with a webam, anywhere from 1fps to 0.1fps (1 to 10second exposure or longer).  

I have a modified philips SPC900NC webcam, that will allow me to do long exposures via a 4066 IC and a serial port.  my aim is to use processing to trigger the serial exposure and then use processing to grab the correct 'new' frame from the webcam.

Unfortunately my plan came unstuck when I went looking through the source for the video library, as FPS/frameRate appear to integer based Sad Coupled wiht the fact that 'frameRate' doesn't currently work.

I saw that there are quite a few other video libraries, which have some interesting features that I might be able to use, does anyone know of a library that allows you to do sub 1fps exposures?

Re: Is there a video library that does <1fps?
Reply #1 - Oct 28th, 2009, 1:04am
 
Are you doing something like this: http://members.tele2.nl/m.m.j.meijer/D_I_Y/spc900nc.htm ?

Did you actually try it? What exactly is the problem, can't you just grab frames as they come and work with the pixel data?
Re: Is there a video library that does <1fps?
Reply #2 - Oct 28th, 2009, 6:29am
 
Yes, I've sucessfully done that mod without issue and have used it to get some decent astrophotos of some very nice Nebula, object tracking at a few trillion miles or so is a wonderful thing Wink

I should explain a little more about the purpose of what I am trying to do, I am part of a project that is providing free and open source astronomy related software/hardware based around the arduino platform,  We are currently working on a motorised eletronic focuser controller, which is controlled via the ASCOM standard drivers for hooking astronomy kit together using a PC or it will work completely standalone.

So that's where we're at, the logical extension to being able to focus electronically is to have the computer do it for you, there is already software that's out there that will do this, I would like to provide this functionality in our software for free.

I use a program called PHD-Guiding to run the camera in long exposure mode, all it does is look at the same spot of sky and keep a single star in exactly the same position (camera and software have control over the mounts motors) but just grabbing a frame isn't quite as simple as you'd think though, there are timing issues where the long exposure frame  is grabbed, grab the wrong one and you get a blank frame.

Standard capture software doesn't deal with frame rates <5fps, so the framerate controls exposed in the processing video library aren't adequate for the job, only deals with integer values Sad

I'd like to be able to set an arbtrary length 'exposure' and then 'tweak' the frame grab timing until I get what I want.

I'm trying to figure out how its done in the phd guiding software, they've either exposed extra 'things' through the software + hardware hack or there is something else, it should be noted that its quite possible to dump the cameras registers, change and re-upload them to the camera with software available.

I think he might do something like this in the software, hold the serial pin high to stop the camera from emptying the sensor, expose as long as needed, drop the serial pin low, timed grab for the data.

My other issue with the SPC900NC in processing is that I can't actually get it to activate at a decent resolution, always comes up as 176x144 (CIF).
Re: Is there a video library that does <1fps?
Reply #3 - Oct 28th, 2009, 7:57am
 
I'm not entirely sure that the long exposure is necessary for focus, I'm really at the exploratory stage with the focusing, not really sure of the methods you would use to do so, I've searched the libraries, processing and googled and not really come up with anything but I think I can see a way using the difference between frames and blob? recognition.

that having been said, if the autofocus routine works out I may well look at adding tracking support which will require long exposure control.
Re: Is there a video library that does <1fps?
Reply #4 - Oct 29th, 2009, 2:24am
 
OK, so your issue with the grabbing is that you get blank frames A quick solution (that I've used before) is to have a look at every frame you get, grab a bunch of pixels - some random ones or perhaps a line down the middle - add up the total RGB, compare the total with a threshold value and just ignore frames where the the total is below the threshold. This may not work as well for you since you're looking at a black sky, but still worth a shot.

What exactly is the point of doing it with a hardware hack rather than just stacking up frames in software A better dynamic range Or is there something else

Another fun thing to do with long exposure is light painting à la Pablo Picasso http://bit.ly/3Ym22O - my guess, which may be wrong, is that you can find more people here eager to help on that.

Also check out this thread http://processing.org/discourse/yabb2/num_1243385017.html and http://glowdoodle.com
Re: Is there a video library that does <1fps?
Reply #5 - Oct 29th, 2009, 5:54am
 
hi Bridell, thanks for taking the time to look at this with me, much appreciated Smiley

My main issue is that I can't start the spc900nc webcam at anything except 176x144 and not being able to set the length of exposure that I want I can't even get to the 'blank' frames.  Although I do accept that we may have a 'solution' to the exposure length/blank frames already in this thread (thanks for being here to let me 'think it out' Smiley), I'll get some test code knocked out for it a bit later on.

I'll explain a little about what's going on in the setup.

My DSLR is setup to capture around 20-30x 600second exposures (depending on conditions), so stacking works very well with this as at around 300seconds I am starting to get the photons that I actually want, anything less than 300seconds and I won't get any of the data that I need, stacked with full dynamic range or not Smiley

At faster exposure times the webcam simply isn't sensitive enough to pick up enough 'stars' with stacking, we're talking about stacking enough images at 5-25fps to make up a 2second exposure, If I do a straight 2sec exposure I get loads more stars to choose from (this makes 'framing' my DSLR shot a lot easier).

as I understand things, the processing video library wouldn't be able to cope with handling that much video data for stacking in a timely manner?

I like your threshold idea as a stopgap but ideally I'd like to be able to 'predict' the frame and just grab that, all things being equal the delay after the 'shot' should be the same everytime and as I am calling the shot I should be able to get it bang on.  The phd guiding software uses <50 millisecond delay times so it's not super tight (but still tight enough).

I'll take a look at those websites a little later, not quite my thing but I am interested Smiley
Page Index Toggle Pages: 1