Author Topic: describe debayer pattern to Batch CMYG DeBayer Script  (Read 2222 times)

Offline sarg314

  • Newcomer
  • Posts: 9
I'm a newbie:  I'm trying to figure what debayer pattern is used on my Nikon .NEF files and then describe that to PI.  I think the output of exiftool is showing me the information, but I don't know how to translate it into PI-speak.  In the 188 lines of exiftool output from my .NEF files, I see these 3:

CFA Repeat Pattern Dim          : 2 2
CFA Pattern 2                   : 0 1 1 2
CFA Pattern                     : [Red,Green][Green,Blue]

The last line looks like RGGB, which Is what I expected.  But what do I tell the "Batch CMYG DeBayer Script" ?  I can't see how to translate this information into the "deBayer Parameters", and "CFA Parameters" which the script "setup" wants in order to do the deBayering.  I've searched through the forums for everything on debayering, but am just getting more confused.

Any help greatly appreciated - thanks.

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: describe debayer pattern to Batch CMYG DeBayer Script
« Reply #1 on: 2018 May 13 22:42:59 »
there may be no answer to your question, because the batch CMYG script is for the handful of oddball cameras that use Cyan/Magenta/Yellow/Green bayer matricies instead of RGB.

if you want to batch debayer your NEF files, just use the Debayer process. batch CMYG is not applicable to nikon DSLRs.

i guess a followon question is, why do you want to do this? if you want to skip calibration, you can configure DSLR_RAW to debayer your NEF files as they are opened, or you can provide the right format hints to ImageIntegration to override the settings in DSLR_RAW. if you want to calibrate your NEF files then just use the format hint "raw cfa" in ImageCalibration and you'll get undebayered, calibrated files out which you can then debayer with Debayer.

or, just use the BatchPreProcessing script to calibrate your files and let it handle all the configuration of the underlying processes.

rob

Offline sarg314

  • Newcomer
  • Posts: 9
Re: describe debayer pattern to Batch CMYG DeBayer Script
« Reply #2 on: 2018 May 14 17:01:25 »
I was following Kayron Mercieca's tutorial and got to the point after calibration of the lights where he advises to debayer them. I thought the debayer script was how you did it. Didn't realize it was to handle an odd case or that there was also a debayer process.  I guess I was just unlucky I came across that script first. Thanks for setting me straight.

Offline msmythers

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1178
    • astrobin
Re: describe debayer pattern to Batch CMYG DeBayer Script
« Reply #3 on: 2018 May 14 17:56:59 »
PI did have a separate batch debayer script but that scripts functionality is now part of the debayer tool. The old script was called Batch Debayer not Batch Debayer CMYG. Tools and scripts change over time. Many times tutorials are not updated to the latest changes in PI.


Mike 

Offline sarg314

  • Newcomer
  • Posts: 9
Re: describe debayer pattern to Batch CMYG DeBayer Script
« Reply #4 on: 2018 May 15 09:07:42 »
(Pardon me please if this is a duplicate post. My original from about 12hours ago has not appeared in the forum.)
I tried using the debayer process on .xisf files that were created by the batchFormatConversion script.  I used it to convert .NEF files into .xisf.  If I try to debayer these - just to see if I can do a successful debayer of anything - I get this error in the console:

*** Error:
*** Error: Unable to acquire CFA pattern information: Unavailable or invalid image properties.
run --execute-mode=auto "/opt/PixInsight/src/scripts/BatchFormatConversion/BatchFormatConversion.js"

The last line is apparently telling me to manually invoke a javascript file somehow. I never learned javascript so I'm not sure how to do this.

Offline sarg314

  • Newcomer
  • Posts: 9
Re: describe debayer pattern to Batch CMYG DeBayer Script
« Reply #5 on: 2018 May 15 09:49:27 »
I just tried running the debayer process again, but changed the "Bayer/mosaic pattern" from the default 'auto' to 'RGGB'.  It ran with no errors.  The resulting image looks OK - more color noise, but that is to be expected, I guess.  If RGGB is in fact the right pattern (I think it is), then my files are debayered correctly.

I thought PI could figure out the Bayer pattern from the meta information in the .NEF file.  Apparently not.

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: describe debayer pattern to Batch CMYG DeBayer Script
« Reply #6 on: 2018 May 15 10:08:47 »
i think this is because batchformatconversion did not copy the bayer format information from the NEF files to the xisf files. it is quite an old script and predates the xisf file format.

you should be able to run ImageCalibration (or any process that loads files) directly on the NEF files. if you do that, Debayer should be able to figure out the color matrix info.

as for the error, it's not telling you to run the javascript, it's saying that the error above belongs to that run command (which is what gets executed behind the scenes when you run BPP from the menu.) if you wanted to you could copy/paste that line into the console to launch BPP instead of choosing the menu option.

rob