Marcelo,
A couple things I noticed about your code:
1)
You can get the list of dark frames more simply:
imagDarks = ImageTake[#,463]&/@Import["C:\\Users\\decicco\\Desktop\\TratImag\\DarkSeparadoAvi\\*.jpeg"];
2) You need to average to get the master dark frame, not just add. By just adding you get a 'white' frame which reduces the
final stack to 'black' when subtracted. I have the following function that I use for this:
ImageMeanFlat[imageList_List] :=
Module[{sepList},
sepList = Map[ColorSeparate, imageList];
ColorCombine[{Image[Mean[Map[ImageData, Map[#[[1]] &, sepList]]]],
Image[Mean[Map[ImageData, Map[#[[2]] &, sepList]]]],
Image[Mean[Map[ImageData, Map[#[[3]] &, sepList]]]]}]];
You can also create a similar function using Median, which may also be useful.
masterDark = ImageMeanFlat[imagDarks];
Some people like to create libraries of master dark frames based on temperature and exposure.
3) You can do the same thing for the light frames (cropping the same as the darks):
imagLights = ImageTake[#,463]&/@Import["C:\\Users\\decicco\\Desktop\\TratImag\\AviSeparado\\*.jpeg"];
4) Then you subtract out the dark frame to get the final image (which can then be stretched using ImageAdjust):
theImage = ImageSubtract[ImageMeanFlat[imagLights], masterDark];
Since this is all coming from an AVI, I'm guessing the overall exposure isn't terribly long, so there shouldn't be a
big problem aligning the sub-frames. However, if you are trying to capture a transient event, like a meteor or an asteroid
moving across the frame, be aware that the stacking process may smear that out unless you align each frame on the object you
are trying to capture.
Here is the final image I obtained from using the above procedure on your data (plus some stretching):
Tom
Attachments: