How to avoid an image with the bayer pattern?

Somewhere to ask questions about the best way to use SharpCap
Forum rules


If you have a problem or question, please check the FAQ to see if it already has an answer : https://www.sharpcap.co.uk/sharpcap-faqs
descott12
Posts: 57
Joined: Mon Dec 17, 2018 2:32 am
Location: Charlotte, NC USA

How to avoid an image with the bayer pattern?

#1

Post by descott12 »

Hello All,
Here is an example for the output file I am trying to fix or, better yet, avoid altogether.
It was captured in SC (I think .ser format), stacked and drizzled in AS!3 and sharpened in RS6.
The camera was an ASI 294 MC and the pattern was present after stacking so Registax was not the cause.

I have tried a bunch of programs (PIPP, Fitsworks, Gimp, etc) to try to fix this but have not had any luck. Ideally, there should be a way to avoid this altogether so I am hoping there is something in my workflow that I can fix.
Thanks, in advance.
Attachments
23_57_54_lapl4_ap31_Drizzle15_RS6.png
23_57_54_lapl4_ap31_Drizzle15_RS6.png (243.81 KiB) Viewed 3886 times
User avatar
turfpit
Posts: 1779
Joined: Mon Feb 13, 2017 8:13 pm
Location: UK
Contact:

Re: How to avoid an image with the bayer pattern?

#2

Post by turfpit »

Dave

This is viewed at 400% zoom in GIMP.

GIMP-400percent-zoom.JPG
GIMP-400percent-zoom.JPG (21.69 KiB) Viewed 3877 times

Can you post the AS log file plus camera settings file for the capture. How big is the capture file with a view to an upload somewhere?

What happens if you stack without drizzle?

What optics are used?

How was the debayering done - e.g in AS via Color > Auto Detect?

Once we have the full workflow from Capture (Colour Space etc) through processing I am sure something will stand out.

BTW, I have a theory but will await more details first.

Dave
descott12
Posts: 57
Joined: Mon Dec 17, 2018 2:32 am
Location: Charlotte, NC USA

Re: How to avoid an image with the bayer pattern?

#3

Post by descott12 »

Hi Dave,
Thanks for the response.
I have attached the AS!3 file (renamed with a .txt extension) and the SC camera settings.
This was captured with my Evo 8 and ASI 294 MC at f10. Exp 5.4 ms, gain 243, Captured 500 frames and stacked best 10%
RAW 16 and debayering was done in AS with Auto Detect.

I thought drizzle might has something to do with it but it occurs without drizzling and some drizzled images also do not have the problem.

Unfortunately, I deleted the video file before I realized there was a problem. It is a little odd...I have played with the color space and debayering settings and could not find a pattern. Sometimes the same settings appear to have the problem and then not the next time, although my methodology for changing each setting might have not been the best...
Attachments
23_57_54_lapl4_ap31_Drizzle15.as3.txt
(18.58 KiB) Downloaded 140 times
23_57_54.CameraSettings.txt
(785 Bytes) Downloaded 128 times
User avatar
turfpit
Posts: 1779
Joined: Mon Feb 13, 2017 8:13 pm
Location: UK
Contact:

Re: How to avoid an image with the bayer pattern?

#4

Post by turfpit »

Dave

Thanks for the info.

Nothing stands out to me in the capture settings. If you use RAW8, that will double the fps, which might be beneficial.

I use the same AS!3 as you, so I was able to work out from the log what settings you have used to stack. I would use all the same settings as you have. I do turn on 'Sharpened' which is useful to see the output of a quick test stack during a capture session.

At the present, all I can suggest is - acquire some more data and the next time you see the problem, in AS!3, instead of using Color > Auto try forcing each of the bayer patterns and see what happens. Make sure to preserve SER and Camera Settings files for further investigation.

AS-Color.JPG
AS-Color.JPG (17.25 KiB) Viewed 3835 times


Dave
User avatar
turfpit
Posts: 1779
Joined: Mon Feb 13, 2017 8:13 pm
Location: UK
Contact:

Re: How to avoid an image with the bayer pattern?

#5

Post by turfpit »

Dave

As an afterthought, go through your capture and processing steps using a land based object to see if this issue can be reproduced. That will save waiting for/wasting decent skies. I would expect grid patterns on images to be related to debayering.

Dave
descott12
Posts: 57
Joined: Mon Dec 17, 2018 2:32 am
Location: Charlotte, NC USA

Re: How to avoid an image with the bayer pattern?

#6

Post by descott12 »

Hey Dave,
Yes I am sure it is debayering-related somehow but I have just spent the last couple of nights running every different combination of settings with resolution, color space, SC debayer preview on/off, drizzle on/off and there is absolutely no commonality as to when it happens or not. In fact, in the last dozen runs, I had a hard time reproducing the problem. The only thing different between the image from my original post is that that data was pretty good and the frame quality was much better. The last few day have been a horrible seeing mess but I can't imagine that could affect this anomaly.

I was, however, able to reproduce it a few times. Attached are the camera settings and the resulting horribly bad-data image from AS!3.
I also have included a screenshot of SC running with debayer preview off. I think this appearance is expected but I wanted you to see that to double check.

I have also attached a link to the avi that resulted in the image included here. It was a short 500-frame shot but it is still 680 MB.
www.raptormed.com/astro/bayer.avi Hopefully you can download it ok.

This whole thing is quite odd: when I had great seeing, every stacked image would be ruined with this artifact and now that I am testing with bad skies, I can hardly reproduce it. I was starting to think it was a problem with the camera but I got a really bad grid pattern when doing a few quick tests with my NexImage 10. Also, I noticed that when the grid pattern was NOT visible in the AS!3 image even at extreme zoom, it would often appear readily in Registax with some moderate sharpening so that tells me it is probably always there but to a lesser degree.
Attachments
BayerPattern.png
BayerPattern.png (376.46 KiB) Viewed 3782 times
21_45_53.Histogram.csv
(2.34 KiB) Downloaded 138 times
21_45_53_lapl4_ap181.png
21_45_53_lapl4_ap181.png (74.45 KiB) Viewed 3782 times
User avatar
turfpit
Posts: 1779
Joined: Mon Feb 13, 2017 8:13 pm
Location: UK
Contact:

Re: How to avoid an image with the bayer pattern?

#7

Post by turfpit »

Dave

There was an error encountered when trying to download the AVI with a direct click. Copying the url and pasting into a browser has worked.

Any reason you use AVI as opposed to SER? The sccreen dump above looks like Colour Space starts with R and Output Format with A. RAW and AVI perhaps? Have a read of https://docs.sharpcap.co.uk/3.2/#AVI particularly "While AVI files can be used to save captures in RAW format, processing software will not recognize this automatically and will generally show a monochrome image with a pixel grid visible if the appropriate Bayer pattern is not specified manually."

See https://www.cloudynights.com/topic/573161-ser-or-avi/ post #1 and post #4. Post #4 is by Chris Garry, author of PIPP. I met Chris at a Damian Peach High Speed Planetary Imaging workshop - he certainly knows his stuff.

Dave
User avatar
turfpit
Posts: 1779
Joined: Mon Feb 13, 2017 8:13 pm
Location: UK
Contact:

Re: How to avoid an image with the bayer pattern?

#8

Post by turfpit »

Dave

I have managed to download the AVI now. Loading it into PIPP gives a debayer pattern of RGGB. It is easy to try all 4 debayer patterns in PIPP by selecting an option and clicking the 'Test Options' button at top right of the screen. Loading the AVI into AS!3 returned RGGB (via Auto). The stacked file did show a fine grid but only when further processed in Registax 6, but the problem will relate to the AVI format.

Try a capture in RAW8 using SER as the output and see what happens. Load into the SER file into PIPP and check the debayer pattern reported, load into AS!3. Forget drizzle, this is just a red herring and complicating things. RAW8 will result in a faster fps (and thus better chance of beating the 'seeing'). RAW16 will give better quality (if the 'seeing' is decent) but a slower fps.

I often see the question on forums 'what is the debayer pattern for camera X?' when really the question needs to be what is the debayer pattern for camera X using software Y?' The colour filter array on the sensor is fixed but some software reads the pattern top down and other software reads bottom up. So much for standards.

I am struggling with a mobile phone at rural broadband at the moment but will be back on the grid this evening.

Dave
descott12
Posts: 57
Joined: Mon Dec 17, 2018 2:32 am
Location: Charlotte, NC USA

Re: How to avoid an image with the bayer pattern?

#9

Post by descott12 »

Hey Dave,
Thanks for spending so much time on this. Regarding AVI vs SER: I believe SC selects AVI by default for RAW8 and SER for most other color schemes. I assumed it was smarter than I am so I accepted those settings. I will definitely try to force it to SER and see what happens.

Regarding the debayer pattern: Yes, I thought it was RGGB and "auto" mode in AS3 seemed to figure that out properly. I will try playing with PIPP - I have sort of avoided that as, from a user-interface standpoint, it is a bit of a nightmare and I never quite knew what I was doing. But I now realize how powerful it is...

Question: if registax can produce the grid with some sharpening, that means the pattern must be there deep down but maybe not quite visible after stacking...correct?

Thanks again. Next time I am in the UK, beers are on me!

EDIT: I just went back to the original image that started this post and it was captures in SER format. So maybe the AVI format is not the problem... The avi I posted above was just another example where it also occured.

Dave
User avatar
turfpit
Posts: 1779
Joined: Mon Feb 13, 2017 8:13 pm
Location: UK
Contact:

Re: How to avoid an image with the bayer pattern?

#10

Post by turfpit »

Dave
Thanks for spending so much time on this.
No problem - every time I help some one with this topic I am farther down the path to enlightenment. When I first came across the word 'debayer' in a post, I ended up writing this viewtopic.php?f=35&t=254. 2 years on with 5870 views and 742 downloads it shows this topic is still hot.
I believe SC selects AVI by default for RAW8
Check your File > Sharpcap Settings.
Mine looks like this:

SC-settings.JPG
SC-settings.JPG (11.3 KiB) Viewed 3745 times

and on opening a camera I get this:

default-startup-with-short-exposure.JPG
default-startup-with-short-exposure.JPG (30.43 KiB) Viewed 3745 times

Back on the grid now with some proper computing facilities. I dragged and dropped the AVI onto PIPP

PIPP-startup-screen.JPG
PIPP-startup-screen.JPG (73.67 KiB) Viewed 3745 times

It gave me BGGR (don't know what happened this morning). I clicked on OK and selected Planetary. Then debayered the file and output as AVI. When loaded into Autostakkert3 it was displayed as RGB. Stacked and the output loaded into Registax 6 for a quick process.


Jupiter-in-RS6.JPG
Jupiter-in-RS6.JPG (68.88 KiB) Viewed 3745 times

The result was


bayer_pipp_lapl6_ap31.jpg
bayer_pipp_lapl6_ap31.jpg (22.04 KiB) Viewed 3745 times


I then loaded the result into GIMP and zoomed in to 400%. The grid is there but this is just how the screen displays any heavily zoomed in file on my system.


400percent-zoom-in-GIMP.JPG
400percent-zoom-in-GIMP.JPG (18.17 KiB) Viewed 3745 times

I think if you work with RAW and SER, everything will work for you.


Talking about 'seeing', I captured this Jupiter Thursday evening. I am working with an elevation of around 14 degrees (Saturn is about 10 degrees).

Jupiter-capture-in-progress.JPG
Jupiter-capture-in-progress.JPG (57.43 KiB) Viewed 3745 times


A near textbook histogram for a planetary capture leaves me with this and nothing I can do except wait a year and try again:


2000-frames-30fps.JPG
2000-frames-30fps.JPG (27.31 KiB) Viewed 3745 times


You might find something useful in this viewtopic.php?f=35&t=1156, another shameless plug.


PIPP is worth getting to know - the site documentation is very good. By selecting the appropriate image capture type at the bottom right of the opening screen, a lot of sensible defaults are set. PIPP can crop and centre all the frames to reduce the size of the file to be processed, as well as throw away any frames with a partial or no image (kick tripod, cloud passing over).
Next time I am in the UK, beers are on me!
Thanks for the offer - be warned that my capacity for free beer is infinite! :D

Dave
Post Reply