Author Topic: A question on Debayering  (Read 1998 times)

Offline JamesB

  • Newcomer
  • Posts: 6
A question on Debayering
« on: 2018 October 27 11:24:33 »
Hello everyone :)
I am a newbie to Pixinsight but I am making good progress after viewing the Videos on YouTube by "AstroDude" and I have purchased "Inside Pixinsight" by Warren A. Keller.

My question about Debayering is: Do I need to use it when processing RAW (nef) colour files from my Nikon D810a. The examples where I have seen it used appear to be where a grey-scale image is converted to colour. I am also presuming that it is necessary in Pixinsight to select your input file format in "Format Explorer" before starting processing.

Thanks a lot,
Jim

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: A question on Debayering
« Reply #1 on: 2018 October 27 14:00:15 »
My question about Debayering is: Do I need to use it when processing RAW (nef) colour files from my Nikon D810a

Hi Jim,

Well, it depends on what your camera and download software actually provide you with when you ask for a 'raw data' file. 'Raw' really just mens 'unprocessed' in many cases (especially when dealing with DSLR cameras that have little or no concept of what 'raw' means in terms of an astro-image.

In astro-imaging, the term 'raw' is abused slighly, and tends to be used to refer to the data files downloaded from 'One-Shot Colour' sensor arrays (also known as 'OSC' imagers). These images are definitely 'monochromatic' whilst in their 'raw' state - in other words they need to have their Bayer Array of (fixed) colour filters taken into account before the image can yield any colour information whatsoever - this process is known as 'DeBayering', and PixInsight has some of the most powerful algorithms available in order to perform this action.

In DSLR cameras, the term 'raw' could mean that the DeBayering has already been performed, but that no attempt has been made to perform any other processing, like White Balancing, Contrast Adjustment, Noise Removal, etc. Alternatively, perhaps the camera software will still apply some pre-processing (like thermal noise removal by application of a single Dark Frame) - but it will not apply these steps intuitively, for the typically long exposures required for astro-imaging.

So, you will either have to find someone using a similar DSLR to yours, who has already decoded what is actually happening, or you will have to do the decoding for yourself. Personally, I have two DSLR cameras that I started out with, and one has already been scrapped (literally) and I am not even entirely sure where the other is (along with the $1500-worth of lenses that I purchased between the two DSLR bodies). I gave up on both back around 2006, and worked my way up through 'hobby' astro-imagers until I finally got what I always needed - my QHY10 OSC. I don't have time (due to extremely short weather windows) to take monochrome images through filters, so I chose to completely avoid that route alrogether.

Anyway, I hope some of my personal thoughts may actually help you get to grips with your DSLR.
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 pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: A question on Debayering
« Reply #2 on: 2018 October 27 20:47:21 »
if you are dealing with NEF files, then you are starting out with raw files.
you don't need to set your input file format in the format explorer (or anywhere), because PI looks at the type of file (.NEF, .CR2, .fits, etc.) and decides what handler to use.

but, the way the DSLR_RAW file handler module (in the format explorer) is configured influences how PI actually opens your NEF files. if DSLR_RAW is set to "pure raw" then the NEF file will be opened as a monochrome, bayered image. if DSLR_RAW is configured to debayer the images, then PI will open the images and immediately debayer them to 3-plane color files.

with astroimaging, you need to keep your files in the purest raw form until the images have been calibrated with darks/bias and flats. after calibration the next step should be debayering. after debayering, the next step is registration (star alignment) and after that, integration of the star aligned subs into a master light.

hope that makes sense.

rob

Offline JamesB

  • Newcomer
  • Posts: 6
Re: A question on Debayering
« Reply #3 on: 2018 October 28 03:31:35 »
Thank you very much for your replies gentlemen,

All is much clearer. I'd missed the bit about "Pure Raw" so Pixinsight has been opening the .nef images from my D810a as RGB but I have still been using the Debayer step which produces the characteristic green-tinted Intergrated image from an RGGB matrix.

The weather not been suitable here for observing, so I am just reprocessing old images with llittle in the way of calibration files but, nontheless I am doing a good job in getting "a silk purse out of a sow's ear!"

Pixinsight is a brilliant program. I am currently on the 45 day trial but I will certainly be purchasing the program when that expires.

Thanks again and kindest regards,

Jim