Hi Everybody,
I am astronomer, and I ve been studying also an astrophotography program based on Mathematica comands, as I am helping an amateur meteor capturing network using cheap cctvs:http:video meteor homepage.
A proprietary program captures events and then an file .avi is created. Like this sample:sample of a video of celestial phenomena
So,
First of all, I have to clean the avi video preparing it to astrometry, I think doing that way:
a - A video (could be a sequence of images also) is recorded with some celestial phenomena (in our example is a fireball);
b - After the video (a), I take dark frames ( thermal noises from CCD): 2 secs of video (for example), and then I do a "Master Dark Frame". the principle of dark frames is taking pictures with the lens closed, using the same equipment and temperature, we want only the noise current being registered, so the images will be dark, and then averaging these frames doing a final Master Dark frame that will be used to subtracted the noises from the original image ( or video).
c -I split the video (a) in frames (using virtual dub program): sample of videos frames of a celestial phenomena , and then I stack them in one single picture, and subtract it from the Master dark Frame (b). The goal here is a single image: the trajectory of the celestial object , with the dark current noise out.
So, I did the following codes, using a settings of frames from an video file.avi for dark images,they are already separated in frames, I used Virtual Dub previously: sample of dark frames for doing the dark frames and the cleaning the sample video:
Adding frames and taking an average frame for Dark Frame
imagDark =
ImageTake[#, 463] & /@
Table[Import[
"C:\\Users\\decicco\\Desktop\\TratImag\\DarkSeparadoAvi\\" <>
ToString[FileNames[][[i]]]], {i, 1, Length[FileNames[]]}];
ImageAdd[imagDark];
MasterDark = ImageApply[#/(27) &, %]
Then I get the frames from the sample video:
SetDirectory["C:\\Users\\decicco\\Desktop\\TratImag\\AviSeparado\\"]
FileNames[]
imagBackGroun =
ImageTake[#, 462] & /@
Table[Import[
"C:\\Users\\decicco\\Desktop\\TratImag\\AviSeparado\\" <>
ToString[FileNames[][[i]]]], {i, 1, Length[FileNames[]]}]
ImagEmpilhamento = ImageAdd[(*here the jpeg frames*)];
ImageSubtract[ImagEmpilhamento, MasterDark];
Export["C:\\Users\\decicco\\Desktop\\TratImag\\ImagemFinal\\ImagFinal.\
jpeg", %]
But the final result is this:
Well, any help is welcome!
references:
Richard Berry, http://www.stargazing.net/david/ccd/ccdmaglib.html