Author Topic: Debayering confusion  (Read 3691 times)

Offline astrodoc71

  • PixInsight Enthusiast
  • **
  • Posts: 93
Debayering confusion
« on: 2013 October 12 05:54:39 »
Totally new to this dslr thing as I am traditionally a mono ccd imager, but in my supreme ignorance I assumed that when you debayer your dslr raw image you would get 3 mono images, one for each channel, that you then recombine much like you do with mono imaging:P So either I am incorrect and don't understand it at all or I am doing something wrong.So I wonder if any of you can explain the following observations:
1) I loaded my raw CR2 files into the batch pre-processing script and checked off all of the appropriate options in the script for one shot color imaging. Apparently it "debayers" when it runs the script. The resulting single files are each designated "RGB" and have a green color but the brighter stars are still blue
2) When I first convert the CR2 to fits files and run the script the results are the same
3) When I do a batch debayering on the whole set of CR2  files before any pre-processing the files don't look any different than they did before
4) When I test a single CR2 file with the debayering process function the file doesn't look any different
5) When I run the debayering process function on a single file converted to fits first, I get a result similar to #1

I know for certain the bayer pattern is being read correctly as RGGB because the process console confirms that

Anyway thanks for looking
Regards
Dave

Offline Ignacio

  • PixInsight Old Hand
  • ****
  • Posts: 375
    • PampaSkies
Re: Debayering confusion
« Reply #1 on: 2013 October 12 07:00:27 »
Hi Dave,

Debayering takes place after raw calibration and before registration. Up to the point of debayering, the images can be kept in one of two forms: a Raw Bayer CFA image (monochrome), or a Raw Bayer RGB image, depending on how you setup your Raw Format Preference. The second kind keeps the three color panes separate, hence it takes about 3 times the disk space. Both work, and some argue (Juan included) that there is a benefit in using this format, as it allows for independent dark scaling for each color channel (always before debayering). I personally use the CFA format, since it is faster, uses a lot less disk space, and I haven't noticed any difference to using the bayered RGB format. It's true that you get only one scale factor for the whole CFA frame when calibrating with darks, but dark current being a "blind" sensor signature (meaning that no light goes thru the bayer matrix), to me it makes more sense to use the whole frame and hence get better statistics. In fact, I input "0" in the appropriate box in IC, to force the use of the whole frame for correlation/noise calculations. If you use CFA format, make sure you select "Force CFA" in IC.

I am not sure how Batchpreprocessing works (I don't use it), but I guess it will correctly accommodate your bayer format of choice.

So, in synthesis, with dslr all three color channels are pre-processed (and post-processed, if you like) at the same time. You could split them, but there is no need. And there is no need to preconvert to fits, as that takes place automatically when PI reads CR2 files (following your raw format preference or your format hint, if you input one).

Ignacio






 

« Last Edit: 2013 October 12 14:11:09 by Ignacio »

Offline Phil Leigh

  • PixInsight Addict
  • ***
  • Posts: 220
Re: Debayering confusion
« Reply #2 on: 2013 October 13 03:29:36 »
The benefit of pre-converting to FITs is purely down to memory issues; because of the nature of CR2 files they cannot be read incrementally like FITs so you can quickly run out of memory when processing large stacks of CR2 files.

Offline astrodoc71

  • PixInsight Enthusiast
  • **
  • Posts: 93
Re: Debayering confusion
« Reply #3 on: 2013 October 13 08:24:06 »
Thanks! That explains a lot 
Regards
Dave