Author Topic: how to equalize background levels?  (Read 3906 times)

Offline rockyraccoon

  • Member
  • *
  • Posts: 63
    • View Profile
    • My gallery of astrophotos
how to equalize background levels?
« on: 2014 March 03 05:32:14 »
I have a nine pane mosaic, where a couple of the panes have higher brighter background levels (possibly due to different sky conditions on those nights). Is there a tool of choice to "equalize" the histograms of a set of images?

Offline bianry

  • PixInsight Enthusiast
  • **
  • Posts: 90
    • View Profile
Re: how to equalize background levels?
« Reply #1 on: 2014 March 03 06:23:39 »
Hi.
DBE aka Dynamic Background Extraction is your tool of choice here.
Look at Harrys video http://harrysastroshed.com/dbevideo.html

Best of luck

r

Mats

Offline jkmorse

  • PixInsight Padawan
  • ****
  • Posts: 906
  • Two questions, Mitch . .
    • View Profile
    • Jim Morse Astronomy
Re: how to equalize background levels?
« Reply #2 on: 2014 March 03 06:45:52 »
Linear Fit is your best bet.  I always use it to balance my R, G, abd B images before doing the channel combination and it should work well here as well.  Its whole purpose it to equalize the histograms.

Best,

Jim
Really, are clear skies, low wind and no moon that much to ask for? 

New Mexico Skies Observatory
SBIG STXL 6303E w/AOX
Planewave CDK17 - Paramount MEII
Planewave IFR90 - Astrodon LRGB & NB filters
SkyX - MaximDL - ACP

http://www.jimmorse-astronomy.com
http://www.astrobin.com/users/JimMors

Offline bianry

  • PixInsight Enthusiast
  • **
  • Posts: 90
    • View Profile
Re: how to equalize background levels?
« Reply #3 on: 2014 March 03 07:15:37 »
Linear Fit is your best bet.  I always use it to balance my R, G, abd B images before doing the channel combination and it should work well here as well.  Its whole purpose it to equalize the histograms.

Best,

Jim

Of course. This is the better/correct answer. Serves me right for trying to show off my meager knowledge. Going back to newbie mode now  :embarassed:

r

Mats

Offline jkmorse

  • PixInsight Padawan
  • ****
  • Posts: 906
  • Two questions, Mitch . .
    • View Profile
    • Jim Morse Astronomy
Re: how to equalize background levels?
« Reply #4 on: 2014 March 03 08:11:04 »
Mats,

Never apologize for trying to help.  We all have something to learn here.

Jim
Really, are clear skies, low wind and no moon that much to ask for? 

New Mexico Skies Observatory
SBIG STXL 6303E w/AOX
Planewave CDK17 - Paramount MEII
Planewave IFR90 - Astrodon LRGB & NB filters
SkyX - MaximDL - ACP

http://www.jimmorse-astronomy.com
http://www.astrobin.com/users/JimMors

Offline chris.bailey

  • PixInsight Addict
  • ***
  • Posts: 185
    • View Profile
Re: how to equalize background levels?
« Reply #5 on: 2014 March 03 08:36:32 »
Linear fit can work well but an alternative that gives a little more control is to use the new Masked Stretch tool. Linear Fit seems to have trouble matching panels without much in them to panels that do and wont work if there are any geometrical differences between panels. Create a small preview of empty background and use Masked Stretch with Region of Interest to apply a stretch to a target background level, I used 0.05 as the initial target. Do this with each panel of the mosaic. IF there is any vignetting or gradients run DBE first paying particular attention to putting samples along the merge seams.


Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2169
  • Join the dark side... we have cookies
    • View Profile
    • http://www.astrophoto.cl
Re: how to equalize background levels?
« Reply #6 on: 2014 March 03 10:49:38 »
You may also try the GradientMergeMosaic process for this task. It should create a seamless mosaic from your images, regardless of the differences in the sky brightness (although, use same exposition times, or rescale them propperly).
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 3600
    • View Profile
Re: how to equalize background levels?
« Reply #7 on: 2014 March 03 18:01:57 »
Carlos, GMM works okay in this case (i have seen some of the data) modulo bright stars at the edges.

the problem is GMM does not do anything to change background values and so even if the seams are blended nicely it's still obvious that the panel brightnesses are different.

one thing that i've done in the past is to look at the overlapping areas - create a preview over them and then use the statistics tool to look at the median value in both areas, then use pixelmath on one of the images to multiply one image by a constant (the ratio of the medians) to try to fix up one of the images. this is pretty tedious however.

another thing i've done is use frame adaptation in the mosaic mode, taking note of the equations that it prints out on the console, and then just using those equations in pixelmath to fix the brightness of the panes, throwing away the result from StarAlignment.

if there are any gradients in the panels they should be removed with DBE of course, but the problem here is that if you even slightly oversubtract your backgrounds then you end up with some very obvious linear gradients in the data where DBE created a false background. in this particular case it might work okay since there's a lot of actual background but in images where there's not a lot (say, a mosaic of the horsehead area) it's really hard to do DBE without creating false gradients in the result. you don't notice these so much in a single frame but they become very obvious when you construct a mosaic.

rob

Offline rockyraccoon

  • Member
  • *
  • Posts: 63
    • View Profile
    • My gallery of astrophotos
Re: how to equalize background levels?
« Reply #8 on: 2014 March 04 01:55:44 »
Thanks all for the suggestions.
I thought of Linearfit, but that only works on identical sized images, and my panes are roughly the same size, but not exact replicas.
The idea of using the masked stretch function is intriguing and I'm going to give it a whirl. I wanted to preserve the linearity of the data until after the stitching though...
As Rob said, GMM works well to smooth out the seams but does not adjust the background brightness to a uniform value.

Offline jkmorse

  • PixInsight Padawan
  • ****
  • Posts: 906
  • Two questions, Mitch . .
    • View Profile
    • Jim Morse Astronomy
Re: how to equalize background levels?
« Reply #9 on: 2014 March 04 07:02:30 »
Mats,

See what I said about everybody in here learning and that certainly applies to me.  My answer of using Linear Fit only scratched the surface of the issue.  :embarassed:

Jim
Really, are clear skies, low wind and no moon that much to ask for? 

New Mexico Skies Observatory
SBIG STXL 6303E w/AOX
Planewave CDK17 - Paramount MEII
Planewave IFR90 - Astrodon LRGB & NB filters
SkyX - MaximDL - ACP

http://www.jimmorse-astronomy.com
http://www.astrobin.com/users/JimMors

Offline bianry

  • PixInsight Enthusiast
  • **
  • Posts: 90
    • View Profile
Re: how to equalize background levels?
« Reply #10 on: 2014 March 04 09:08:24 »
 :)

Jim, regarding your sig, don't you live in Dubai now? I should think you would have plenty of clear desert sky above you. But I suppose light pollution is a problem in a city that size.

regards

Mats

Offline jkmorse

  • PixInsight Padawan
  • ****
  • Posts: 906
  • Two questions, Mitch . .
    • View Profile
    • Jim Morse Astronomy
Re: how to equalize background levels?
« Reply #11 on: 2014 March 04 11:09:49 »
Mats,

Dubai is terrible for purposes of imaging.  It has a light dome like you wouldn't believe.  But I don't image here.  Anytime to moon is in the right place and the weather is cooperative (which is most of the time) I hop in my Land Cruiser with all my equipment in the back and drive 4.5 hours up to a mountain in Oman and spend two nights imaging.  While not perfect, its way better than Dubai.  And since I shoot one target over two night typically, SNR is not an issue for me.  For example, just spent the past weekend up on the mountain and was able to shoot 29 frames in each of R, G, and B and am processing it now. 

That said, Linear Fit is still necessary because even with great SNR, the different master frames are out of step in their histograms.  By using Linear Fit (btw, a huge shout out to Gerald who clued me into that tool and is my PixelMath guru), I end up with RGB image sets that are already aligned when I do the channel combination.

And my days in Dubai/Oman are numbered.  Just got my marching orders and the Company is sending me back to Houston effective April 1.  So no imaging for a while as my stuff gets shipped back to the States.  Looking for one last session in Oman this weekend before the movers come.  But once everything arrives, its back to imaging.  The Houston Astronomical Society has a great dark sky site about 90 minutes west of downtown Houston (will sure beat that 4.5 hour drive) that I used all the time before moving out here.  And it still has a nice southern horizon at 30 degrees N, though not quite as good as Oman at 23 degrees.  Will miss seeing the entire Southern Cross in the Spring.

Best,

Jim
Really, are clear skies, low wind and no moon that much to ask for? 

New Mexico Skies Observatory
SBIG STXL 6303E w/AOX
Planewave CDK17 - Paramount MEII
Planewave IFR90 - Astrodon LRGB & NB filters
SkyX - MaximDL - ACP

http://www.jimmorse-astronomy.com
http://www.astrobin.com/users/JimMors