OSC - Bayer Matrix - PI confused when debayering

Psyire

Member
Hello,

For some reason I have to select bayer matrix array "GBRG" in order to get the proper color output for my images when debayering with the process or WBPP.

I'm using a IMX571 camera which uses the RGGB matrix and that matches what is in the FITS header of my images.

How do I fix PI so both 'Auto' and 'RGGB' output the correct color combination when running a debayer?

Thanks
 
this is a fits reader direction problem. how to fix it depends on what you are doing... in WBPP there is a setting to change the fits coordinate origin from global to top-down or bottom-up. you can also change it in the global preferences and leave WBPP configured to use the global pref (format explorer -> double click FITS). or if you are using ImageCalibration to read in your fits files, you can give the format hint bottom-up or up-bottom. to see all the input hints for fits, click on "implementation" when FITS is selected in the format explorer.
 
All right what Rob wrote. Supplementary information:

Nowadays many image acquisition applications use the FITS keyword ROWORDER (possible values: top-down or bottom-up; take a look at the FITS header of a light frame). If present, PixInsight will take into account its value when option 'Use ROWORDER keywords' is enabled in FITS Format Preferences (this is the default). This will effect that option 'Auto' for 'Debayer/mosaic pattern' in the Debayer tool will work correctly.

However, caution is called for:
It is crucial that one and the same setting for the vertical orientation in FITS files is used for the generation of all master calibration files as well as for light frame calibration, otherwise the calibration result will be wrong. (This applies to both monochrome and color cameras and has to be considered generally when master calibration files are intended to be reused.)

So if you decide to change the setting of the vertical orientation in FITS files, you must no longer use master calibration files that were produced with the old setting. You'll have to newly generate all master calibration files.

Bernd
 
Thanks for the detailed explanation. I am using SkyX & Voyager as my automation and capture programs. I did some testing and changing from Top-Down to Bottom-Up in Global preferences didn't do anything. I unchecked 'use ROWORDER' and now 'Auto' is working correctly. I'm assuming that I'm ok to leave this unchecked?
 
I did some testing and changing from Top-Down to Bottom-Up in Global preferences didn't do anything. I unchecked 'use ROWORDER' and now 'Auto' is working correctly.
No, this is a weird result. You should not leave it this way. Different causes are possible.

Please disclose which camera you are using and which is the number of mirrors in the light path of your telescope.

Please check and post as well (separately for frames generated with both SkyX and Voyager) the presence and values of the following FITS keywords:
1. ROWORDER,
2. BAYERPAT,
3. XBAYROFF / YBAYROFF, or the unusual keywords BAYOFFX / BAYOFFY.

Bernd
 
Last edited:
Bernd,

I'm using a Player One Posideon-C Pro(IMX571) camera. It is attached to a Stellarvue SVX130T-R Refractor. (no mirrors)

1. ROWORDER = ? (I do not see this in the fits header)
2. BAYERPAT = RGGB
3. XBAYROFF/YBAYROFF/BAYOFFX/BAYOFFY = ? (These do not exist in the fits header)

I'm going to hazard a guess that these missing keywords are related to the problem?
 
yes, without those keywords you need to align the fits writer / reader directions manually. i'm surprised that "use ROWORDER" messed things up since ROWORDER does not exist in your files. maybe this is actually a bug, because it sounds like the reader/writer direction was already correct, if Auto picked RGGB as the pattern and the files debayered correctly.
 
The information given in post #1, #4 and #6 doesn't fit together. Please upload a light frame to a filehoster and post the shareable link here.

Bernd
 
Last edited:
Thank you for uploading the frames. These are my findings:

1. I confirm that no bayer offset keywords (XBAYROFF/YBAROFF or BAYOFFX/BAYOFFY) and no ROWORDER keyyword are present in the FITS header, but this is NOT a problem. Since no ROWORDER keyword is detected, the setting of option 'USE ROWORDER keywords' in FITS Format Preferences does not take any effect - contrary to your statement in post #4.

2. With setting 'Coordinate origin' to 'Upper left corner (top-down)' in FITS Format Preferences, a true sided image is obtained for the M81 frame; the astrometric solution says:

Rotation ................. -91.197 deg

North is at the left, west is at the top, the image is NOT flipped. This result is to be expected with a refractor (number of mirrors: 0) when the correct vertical orientation in FITS files was set.

3. With setting 'Coordinate origin' to 'Upper left corner (top-down)' in FITS Format Preferences, a correct Debayer result is obtained when option 'Bayer/mosaic pattern' is set to 'Auto'.

So in my view, everything is fine.

Recommendation for correct settings:
In FITS Format Preferences 'Coordinate origin' shall be set to 'Upper left corner (top-down)', and option 'USE ROWORDER keywords' should be enabled (these are the default settings).
In the WBPP script, global option 'FITS orientation' shall be set to 'Global Pref' (the default setting).

I want to stress that if you formerly used a different setting for 'Coordinate origin' in FITS Format Preferences or for 'FITS orientation' in the WBPP script, you must not use old master calibration files. You can use old calibration subframes, but new master calibration files have to be generated therefrom.

Bernd
 
Back
Top