Jump to content

  •  

CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.

Photo

Changing Bayer Pattern within the same Sequence

astrophotography
  • Please log in to reply
6 replies to this topic

#1 Landy100at

Landy100at

    Lift Off

  • -----
  • topic starter
  • Posts: 3
  • Joined: 26 Sep 2020
  • Loc: Austria

Posted 26 September 2020 - 05:13 AM

Hello,
I'm obviously facing a problem with my ToupTek ATR3CMOS-OSC-Camera (similar to the ZWO ASI 1600 MC and others)
Did an extensive Testing with 'APT' and 'ToupSky' (comes with the Camera) for capturing the Images. So far, so good - basically satisfied with the results.
BUT:
Surprisingly I found different Bayer Pattern - when I evaluated the single shots in DSS - even within the same Sequence. Some of them are BGGR (=set in DSS) others are GRBG !
Any idea what happenend here ?



#2 Tapio

Tapio

    Gemini

  • -----
  • Posts: 3,147
  • Joined: 24 Sep 2006
  • Loc: Tampere, Finland

Posted 26 September 2020 - 05:32 AM

That shouldn't happen if you shoot raw - and that shouldn't happen, period.

Why can you tell this happened ?



#3 AstroBrett

AstroBrett

    Mariner 2

  • *****
  • Posts: 200
  • Joined: 26 Jan 2009

Posted 26 September 2020 - 07:11 AM

Those aren't different Bayer Patterns, BGGR is the same pattern as GRBG, the only difference is where you start. This can be easily seen by repeating each pattern as phase shifting the second two positions relative to the first, as can be easily seen below:

 

BGGRBGGRBGGRBGGRBGGRBGGRBGGR

     GRBGGRBGGRBGGRBGGRBGGRBGGRBG

 

As to why the software shifted it's starting point, I can't say. You would have to look at the algorithm used to determine how that happened. 

 

Brett



#4 jdupton

jdupton

    Mercury-Atlas

  • *****
  • Posts: 2,814
  • Joined: 21 Nov 2010
  • Loc: Central Texas, USA

Posted 26 September 2020 - 09:51 AM

Landy100at,

 

   Welcome to Cloudy Nights!

 

   The reason for two differing Bayer patterns is that APT and ToupSky are writing the FITs frames differently. Here is what is happening. Lets look at an array of pixels from the sensor. We will look at only four adjacent pixels. The pattern of those four is repeated across the whole chip.

 

RG

GB

 

   Reading from top to bottom, left to right, these are seen to be RGGB. That is one valid pattern to use. However, if the software reads from bottom to top, left to right, that same pattern of pixels become GBRG. This pattern is also valid depending on how the capture software wrote the frames and whether your software reads rows top to bottom or bottom to top.

 

   The real root of this confusion is that the FITs standard says software can define pixels from the top row to the bottom row or vice versa. Both are within specification for the FITs format. Software can choose which way to read a FITs file. Depending on whether it was written as top to bottom, you might need to use RGGB. if it reads bottom to top, you might need to use GBRG. Unfortunately some software does not tell you which way it will be reading the data. The capture software may not tell you which way it is going to write the data either. 

 

   You just have to do a quick experiment when using different capture software and staking software. Use whichever matrix (RGGB or GBRG) that makes a sample look correct for the software pair you are using. Both Bayer patterns are valid for the sensor you are using. It all depends on how the frame was written and how it is interpreted when it is read back.

 

 

John


Edited by jdupton, 26 September 2020 - 09:52 AM.


#5 Landy100at

Landy100at

    Lift Off

  • -----
  • topic starter
  • Posts: 3
  • Joined: 26 Sep 2020
  • Loc: Austria

Posted 26 September 2020 - 11:02 AM

Thank you for your replies.

 

 

Yes, I knew already the Bayer Pattern System. But i expected that all shots of a sequence has the wrong or right Bayer Pattern.

 

But this is not the case.

 

When I'm judging a Sequence of 10 shots in DSS (set to BGGR) roughly one half of the Images has a BGGR-Bayer Pattern and is displayed in correct colours, but the others are displayed in wrong colours having a GBRG-Pattern.

 

So i was forced to introduce an additional preprocessing step. I did a Colour conversion of all Images with MaximDL to a uniform Bayer Pattern (in my case to BGGR). 

 

After this procedure stacking could be done correctly.

 

However it's not the best solution, but it works.

 

Alfred



#6 jdupton

jdupton

    Mercury-Atlas

  • *****
  • Posts: 2,814
  • Joined: 21 Nov 2010
  • Loc: Central Texas, USA

Posted 26 September 2020 - 11:37 AM

Alfred,

 

   Were all the frames in question shot at the same time? (back to back on a single computer with the same program? This would include all target light frames as well as all Bias, Dark, Dark-Flat, and/or Flat -- whichever were used.) Were any the frames of the sequence shot with different applications? Using one application for one set of frames and other program for others can cause the mismatch. Also using different version of the same application can cause the difference. I think I saw that APT recently started adding a FITs ROWORDER keyword recently. Did you update APT between the time any of the different frames were shot?

 

   If everything was shot on the same day with the same computer, with the same capture software of the same version, then I cannot guess why each frame might be interpreted differently. The only wild guess is that a bug in the capture software is inconsistently handling the writing of the FITs frame or the FITs header.

 

   Good luck. Until you figure out the puzzle, your workaround of manually deBayering before stacking is about all you can do.

 

 

John



#7 Landy100at

Landy100at

    Lift Off

  • -----
  • topic starter
  • Posts: 3
  • Joined: 26 Sep 2020
  • Loc: Austria

Posted 26 September 2020 - 01:05 PM

John,

 

yes, all Light Frames were shot at the same time, same computer and same program (APT 3.84). I didn't do any Flats, darks, ...

 

It seems I've to live with my workaround, made a macro (Colour Conversion) in MaximDL for making life easier.

 

Thanks for your support.

 

Alfred


  • jdupton likes this


CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.


Recent Topics





Also tagged with one or more of these keywords: astrophotography



Cloudy Nights LLC
Cloudy Nights Sponsor: Astronomics