Author Topic: DBE+pixelMath to apply corrections to multiple files?  (Read 4618 times)

Offline rockyraccoon

  • Member
  • *
  • Posts: 63
    • My gallery of astrophotos
I'd like to use DBE on a sample image out of a sequence of, say, 100 images and then use the extracted "synthetic" flat (or background model image) to correct the entire sequence of images.

If I use DBE on the sample image I can check the box to show the show the background model (so, I'm fine thus far).
How do I now use pixelmath to  use this background model and apply a "division correction" (in DBE parlance) to a number of files?
« Last Edit: 2014 March 14 19:00:59 by rockyraccoon »

Offline Alejandro Tombolini

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1267
    • Próxima Sur
Re: DBE+pixelMath to apply corrections to multiple files?
« Reply #1 on: 2014 March 14 18:48:37 »
Hi, I believe that you can do it with the help of ImageContainer:

Open a single image
Open DBE
Place de samples conveniently and set DBE parameters. Be sure to check "Discard background model" and "Replace target image"
Generate a DBE instance
Close DBE Tool
Open Image Container
Add Files
Output template: rename conveniently (See the help "?" for more information)
Generate ImageContainer instance
Close ImageContainer
Drag & Drop DBE instance over ImageContainder instance

Saludos. Alejandro.

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: DBE+pixelMath to apply corrections to multiple files?
« Reply #2 on: 2014 March 15 01:09:06 »
i'm pretty sure i say this every time... and i hope i'm right... DBE does not work with ImageContainer.

how about the following: extract your background (be sure to set the Downsampling to 1 in the Model Image pane - by default the background is 1/2 the size of the DBE'd frame). now save the background.

use the background in ImageCalibration as the master flat.

should work... i have done this but was never happy with the quality of the result; not sure the DBE background i came up with was really a flat.

alternately you can create the pixelmath expression, set it up to replace the target image, drag the triangle to the desktop, thus creating a process icon. then do as alejandro says to create an imagecontainer and apply the imagecontainer to the process icon.

rob

Offline Alejandro Tombolini

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1267
    • Próxima Sur
Re: DBE+pixelMath to apply corrections to multiple files?
« Reply #3 on: 2014 March 15 05:58:30 »
Hi Rob, may be I am considering something wrong, but seem to work for me... :o

I uploaded a video to endor with an example: Forum Shared Files > Alejandro Tombolini > DBE

Saludos, Alejandro.

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: DBE+pixelMath to apply corrections to multiple files?
« Reply #4 on: 2014 March 15 09:06:49 »
mechanically, it works. but if you look at the results carefully you will see that every image had the same background subtracted from it. you can prove this by taking one of the images and applying the DBE to it manually, then dividing the manually DBE'd file by the automatically DBE'd file. or subtract them. they will differ.

or, you can try to recover the gradients by subtracting the 2 DBE'd images from the original image and see how it differs.

it's really obvious when you have subs with very different LP gradients. in that case you can just see that the result images are different.

i'd really like to be wrong about this but in my experience only ABE works right with ImageContainer.

rob

Offline rockyraccoon

  • Member
  • *
  • Posts: 63
    • My gallery of astrophotos
Re: DBE+pixelMath to apply corrections to multiple files?
« Reply #5 on: 2014 March 15 09:19:02 »
Thanks Alejandro and Rob, I'll test both workflows and report back!

Offline Alejandro Tombolini

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1267
    • Próxima Sur
Re: DBE+pixelMath to apply corrections to multiple files?
« Reply #6 on: 2014 March 15 11:17:02 »
Hi Rob, You are right, I tested with a single image manually and with ImageContainer and the result is ok. Then with two different images the background model that is substracted/divided is the corresponding to the image were originaly placed the samples.

Saludos. Alejandro.

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
Re: DBE+pixelMath to apply corrections to multiple files?
« Reply #7 on: 2014 March 15 13:30:59 »
This problem is unfortunately deeply rooted in the way DBE is currently implemented. The calculation of the correction is done in the user interface and the script contains only rules on how to apply them (apparently pretty complicated rules,see http://pixinsight.com/forum/index.php?topic=6477.msg44040#msg44040).
It is not easy to make a script for this purpose, except if you recalculate the corrections factors yourself. The calculation is not reachable from Javascript and it is not even possible to ask the DBE process to do the calculation with a specific image. DBE is a pretty old process (not old enough to be documented, though...)
May be something to add the the wish list? We probably take more subs and are more demanding on the result than when DBE was written, so the possibility to easily use it with varying background is more important.
-- bitli



Offline Geoff

  • PixInsight Padawan
  • ****
  • Posts: 908
Re: DBE+pixelMath to apply corrections to multiple files?
« Reply #8 on: 2014 March 15 13:43:15 »
You could try ABE. That does work with the container.
Geoff
Don't panic! (Douglas Adams)
Astrobin page at http://www.astrobin.com/users/Geoff/
Webpage (under construction) http://geoffsastro.smugmug.com/

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: DBE+pixelMath to apply corrections to multiple files?
« Reply #9 on: 2014 March 16 15:05:17 »
okay, so i'm not crazy :)

rob

Offline rockyraccoon

  • Member
  • *
  • Posts: 63
    • My gallery of astrophotos
Re: DBE+pixelMath to apply corrections to multiple files?
« Reply #10 on: 2014 March 18 15:03:56 »
Thanks all for the suggestions.
Both of Rob's suggestions below worked for me.


i'm pretty sure i say this every time... and i hope i'm right... DBE does not work with ImageContainer.

how about the following: extract your background (be sure to set the Downsampling to 1 in the Model Image pane - by default the background is 1/2 the size of the DBE'd frame). now save the background.

use the background in ImageCalibration as the master flat.

should work... i have done this but was never happy with the quality of the result; not sure the DBE background i came up with was really a flat.

alternately you can create the pixelmath expression, set it up to replace the target image, drag the triangle to the desktop, thus creating a process icon. then do as alejandro says to create an imagecontainer and apply the imagecontainer to the process icon.

rob