Author Topic: Flat / Debayer question  (Read 3112 times)

Offline bhwolf

  • Member
  • *
  • Posts: 53
Flat / Debayer question
« on: 2014 March 05 13:21:14 »
Really more of a debayer question but I'm using Flats to figure this out.  I'm using SGPro with a DSLR and saving both FITS and RAW.   I imagine SGPro downloads the CR2 RAW file, loads it, and saves it as a Monochrome bayered FITS.

In PI, I have RAW format prefs set to use VNG and no black point correction is checked.  If I load the RAW, it is debayered in the process and I get a histogram that looks like histogram_raw.png attached.  If I load the FITS and use the debayer process (VNG, RGGB) I get a histogram that looks like histogram_fitsdebayer.png. 

The white spike is due to overscan.  Not suggesting there's a problem but I'm assuming the difference is possibly white balance or similar issue.  Honestly, just looking to understand this a bit more, as I've always been torn between using CR2 or FITS (that is typically encoded/saved from a CR2).  I imagine a big part of this is how the capture software converts the CR2 into a FITS file, but was hoping someone had some info they could share...

Thanks much,
Brian

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Flat / Debayer question
« Reply #1 on: 2014 March 05 14:47:28 »
i think if you loaded the CR2 with the "raw" format hint (that is, no debayering, no blackpoint correction, and either CFA or mono) and then used Debayer to debayer that image, it would look more like the bottom one.

i think the difference is letting DCRAW debayer the file as VNG vs loading in 'raw' format, which is probably what SGP did to convert to fits.

i don't like to let any program touch the CR2 data… i just save the CR2s and after calibration they turn into fits files anyway… which has advantages for ImageIntegration.

rob

Offline bhwolf

  • Member
  • *
  • Posts: 53
Re: Flat / Debayer question
« Reply #2 on: 2014 March 08 11:05:18 »
Thanks Rob -- had some time today to play around a little more, this time using a daylight photo as it's easier to see what's going on.   So this was my experiment:  in DSLR settings, color settings all 1, "Create raw bayer CFA / mono" and "No black point correction" were checked.  Loaded the image, it's monochrome as expected.  Apply the VNG debayer process.  Image is correct, however levels are very low compared to this:

In DSLR settings, dechecked "Create Raw bayer" (only thing now checked is the 'no black point correction') and selected VNG in the interpolation options.  DCRAW loads the image, and I have the same color image as above, but levels are more as you'd expect as a daylight image -- like the top histogram image in my first post.

Why the difference?  Is DCRAW applying some kind of non-linear correction?  What I'm getting at:  I often take test exposures to determine the best compromise between image, exposure time, saturation, etc.  So, I'll take an image and open it in PI, and decide whether I need more or less exposure.  An image that looks overexposed in say BackyardEOS or SGPro may look underexposed in PI by using my first method above.   Any suggestions?  What's the "right" way to preview data during acquisition? 

Thanks much,
Brian

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Flat / Debayer question
« Reply #3 on: 2014 March 08 18:27:01 »
well, i don't know what the right way to preview data is, but if you are going to calibrate your lights there is only one way to go - the "raw" or "raw cfa" configurations for DCRAW.

i don't know what happens in DCRAW when you let it debayer the image… i guess it's likely that it takes some of the other cr2 metadata into consideration when debayering…? not sure.

alls i know is i encountered this long ago while evaluating exposures for flats and i came to the conclusion above - the only histograms that are meaningful are those from raw/raw cfa -> debayer process cause that's the flow the images have to go thru if you will calibrate them. i suppose if we believe that DCRAW gives us the most raw image it can from the CR2 data then anything 'better' that DCRAW produces when debayering represents some post processing to the data.

rob