Author Topic: New Script: Batch Debayer  (Read 24200 times)

Offline Harry page

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1458
    • http://www.harrysastroshed.com
Re: New Script: Batch Debayer
« Reply #15 on: 2010 April 20 23:02:02 »
Hi

Yes the bayer pattern is fixed , but the firmware decides where it starts to read the chip from  ;D


Harry
Harry Page

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: New Script: Batch Debayer
« Reply #16 on: 2010 August 20 18:11:20 »

Hi,

I purposely did not include channel weighting in the debayer module because there's no need for it. Color calibration after the fact does a much better job than anyone can hope to do by pre-weighing the colors. Even if you're a genius and the resulting image is 'close' you'll still need to fine tune it afterwards so why not simply tune it the whole way?

Anyway, if you're desperate to add weighting it's easy to add that to the debayer script. Simply use PixelMath to multiply each channel with a constant after the debayer phase.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: New Script: Batch Debayer
« Reply #17 on: 2010 August 21 02:14:23 »
Quote
Color calibration after the fact does a much better job than anyone can hope to do by pre-weighing the colors

I have to agree with Sander - I would just leave the 'weighting matrix' out of the equation altogether - set it to a 'unitary transform', which just leaves users the choice of where to 'satrt' the CFA matrix.

Cheers,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline Harry page

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1458
    • http://www.harrysastroshed.com
Re: New Script: Batch Debayer
« Reply #18 on: 2010 August 21 02:44:53 »
Hi

Yes CC does a excellent job 90% of the time , but not all the time this is why I would have liked the weight option  :-*


But if it is not in the pipeline :'(  I will have to resort to plan b



Harry
Harry Page

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: New Script: Batch Debayer
« Reply #19 on: 2010 August 21 06:08:47 »
Harry the point is that CC will always do a better job than weighting up front. I really don't believe anyone can pick weighting factors *before* seeing the final image that will produce a satisfactory result. LP and atmospheric extinction differences between different nights mean that factors for one night aren't accurate for the next. So you might as well give up on that and use CC or other methods to correct the color afterwards.

In any case, if you *must* apply factors to the channels it isn't even necessary to do that to individual frames. Just do it to the stacked image before further processing. There is no difference since it's multiplicative. If you have fixed ratios it would be trivial to write a PJSR script that does this for you (no GUI needed as the factors don't change) or to keep a PM instance ready to go that does the same.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: New Script: Batch Debayer
« Reply #20 on: 2010 September 03 04:23:07 »
Hi,

I've taken the liberty to modify Ken's great script. The motivation to do this comes from this thread, where the need to debayer RGB Bayer images --as created by the DSLR_RAW format module-- has arisen today. I hope Ken won't mind this interference.

Attached you'll find the new version 1.10 of the BatchDebayer script.

The changes are as follows:

- The script now allows debayering FITS and DSLR raw images (in fact, the script allows loading any installed image format). Previously it was limited to FITS.

- RGB Bayer images are now converted to monochrome CFA images and then debayered. This process is completely automatic and transparent to the user. This allows batch debayering of DSLR raw images, as loaded by the standard DSLR_RAW module, which has important implications to calibration of these images in PixInsight. Please refer to the above-commented forum thread.

- Several potential bugs have been fixed. In particular, the output image of Debayer is now correctly selected without resorting to empirical assumptions about the order of objects in the ImageWindow.windows array.

To find my changes, please search for the "// *** Begin modification by J. Conejero on 2010 Sep 03" string in the source code.

Hope it will be (even more) useful. If nobody argues it, I'll include this new version in the next release of PixInsight.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Ken Pendlebury

  • Newcomer
  • Posts: 47
Re: New Script: Batch Debayer
« Reply #21 on: 2010 September 03 07:49:43 »
Excellent!  No problems here.
Regards,
Ken
My Astro Photo Stream
http://www.flickr.com/photos/kenastro/

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: New Script: Batch Debayer
« Reply #22 on: 2010 September 04 13:28:09 »
I think Ken provided you with an excellent platform onto which you could add your proposed mods Juan - and it is definitely worthy of inclusion in the standard distribution.
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline Astrocava

  • PixInsight Addict
  • ***
  • Posts: 180
    • Astrocava.com
Re: New Script: Batch Debayer
« Reply #23 on: 2010 November 07 08:02:55 »
Hi all!

I'm spending whole day trying to do all the calibration and registering of my DSLR shots in PixInsight. I'm following these threads:

http://pixinsight.com/forum/index.php?topic=2462.0

http://pixinsight.com/forum/index.php?topic=1911.0

When I have my frames calibrated, I fail to do the debayering: Batchdebayer needs monochrome images and mine are bayer RGB.

Any input?

Thanks in advance,

Sergio

PD: Yes, with DSS is easier but I think PI is better with my noisy images. >:D
Moonfish ED80 over a Meade LX200GPS 8"

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: New Script: Batch Debayer
« Reply #24 on: 2010 November 07 13:12:00 »
Hi Sergio,

You should download and install version 1.10 of the BatchDebayer script. You have it just four posts before this one. Download the BatchDebayer-1.10-20100903.zip file, uncompress it, and copy the .js file to your src/scripts installation folder. The new version will debayer your RGB bayer images.

Thanks for the nice words by the way; they are really appreciated especially for the calibration module and encourage me to continue development  ;)
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Astrocava

  • PixInsight Addict
  • ***
  • Posts: 180
    • Astrocava.com
Re: New Script: Batch Debayer
« Reply #25 on: 2010 November 08 12:10:22 »
It worked, Juan. Thanks again.

Sergio
Moonfish ED80 over a Meade LX200GPS 8"