Author Topic: Summing (and normalizing) lots of images  (Read 2240 times)

Offline Philip de Louraille

  • PixInsight Addict
  • ***
  • Posts: 289
Summing (and normalizing) lots of images
« on: 2013 December 07 09:04:21 »
I have an all-sky camera and it captures trees and parts of the horizon (buildings, ...). During the course of a night, cars, street lights, ambient light, whatever, change the light reflection off the trees.
I take over 2000 30-sec exposures every night.
I use the AdaptiveStretch function on each image (using ImageContainer) but whenever the light is different on the trees or background, the entire image is stretched differently than the previous image. So when I make a movie the next morning to find the asteroids and other interesting stuff, the sky can change a lot from one frame to another.
So I thought of making a mask to eliminate the background. Using PixelMath and a similar expression as this: iif($T<0.04,0,1) I can generate over 2000 masks and since the trees move a bit during the night, etc, I am catching all the conditions.
Now I want to *add* all these masks to generate a comprehensive mask, a master mask if you will.
ImageIntegration does not like my images: "Zero or insignificant signal detected: Empty image?" and stops.
How can I use PixelMath to add all the pictures (and scale them) ? I am not seeing how to reference all the pics.
It must be obvious but not for me this morning.
Thanks!
Philip de Louraille

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: Summing (and normalizing) lots of images
« Reply #1 on: 2013 December 07 09:48:35 »
As a test, try opening a few (say 4) masks and use the expression "a * b * c * d". This will give the intersection of the 4 binary masks. This may be what you want. If so a script would help automate this, reading all the masks and finding their overall intersection.
Mike

Another thought: if the masks are mostly the same, do the intersection on a few of them. Then open the result in an image editor and manually paint around the edges to clean it up further as you think is necessary?

It may be you want the union rather than the intersection. If so, invert the masks, run the expression and finally invert the result.
« Last Edit: 2013 December 07 10:08:27 by mschuster »