Does Sharpcap normalise channels when capturing flats?

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
Post Reply
zerolatitude
Posts: 156
Joined: Mon Mar 01, 2021 5:24 am

Does Sharpcap normalise channels when capturing flats?

#1

Post by zerolatitude »

When capturing flats, I see 3 differently space histograms for R,G,B.

When I open the averaged flat, they are all aligned.

So pretty sure SC is doing a per channel calibration when stacking the flats, but would like to confirm.

Any way of turning this off if so desired?
User avatar
admin
Site Admin
Posts: 13177
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Does Sharpcap normalise channels when capturing flats?

#2

Post by admin »

Hi,

when you are creating flats there is a checkbox to allow you to create a monochrome flat (which I think is checked by default). That takes the colour image from the camera, debayers and then converts to mono before saving, which might be what you are seeing.

You can turn off the option for monochrome flat creation, which will leave the saved flat frame as a colour image, but then flat correction will tend to alter the white balance of the image (which may or may not be a good thing).

cheers,

Robin
zerolatitude
Posts: 156
Joined: Mon Mar 01, 2021 5:24 am

Re: Does Sharpcap normalise channels when capturing flats?

#3

Post by zerolatitude »

Didn't quite understand.

While capturing the flats, the live histogram window shows 3 histograms, eg Red with a peak at about 18000, Blue at 20,000 and Green at 36000. All 3 have a distinct physical separation from each other.

Once the flat is averaged and saved as a single mono file, and I open it with de-bayer preview on, all 3 histograms are now aligned - all with a mean of (say) 25000. (I can send screenshots tomorrow if that will help).

My interpretation was that the process works as follows
1. The image is debayered
2. Each channel is normalized so that the mean is now the same
3. It is then converted back to mono, but now all channels are aligned.

Is that correct?
And, does this lead to a kind of "double normalization" when the stacking software once again does per channel calibration for the flats? Would that lead to increased noise?

The context is a recent thread on CN about whether the color temperature of the light source for flats would make a difference to the quality of the flats.

https://www.cloudynights.com/topic/7797 ... ry11229261
User avatar
admin
Site Admin
Posts: 13177
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Does Sharpcap normalise channels when capturing flats?

#4

Post by admin »

Hi,

actually the procedure is

1) debayer image to full colour
2) at each pixel calculate luminosity = (R+G+B)/3 (not using the more complicated weighted r/g/b that is sometimes used in image processing)
3) you now have a mono image of the calculated luminosity above - the colour information has been thrown away.

Actually the noise level should be reduced a fair bit by this approach, both the debayer algorithm (which averages pixel values) and the conversion to mono will tend to reduce noise levels. They do this at the expense of a small amount of sharpness, but that is not usually important with flats - if you have a sharp edge in the flat it means the dust is actually right on the sensor and that probably won't correct out anyway.

cheers,

Robin
zerolatitude
Posts: 156
Joined: Mon Mar 01, 2021 5:24 am

Re: Does Sharpcap normalise channels when capturing flats?

#5

Post by zerolatitude »

Okay understood.

Doesnt that risk including any "idiosyncracy" of the debayering algo and changing the base data?

Would have thought it would be more like this
1. Make 3 datasets, for readings of R,G,B pixels respectively. So for a 4MP camera, 1M data points for R pixels, 1 for B and 2 for G
2. Normalise the R pixels using only the data in the R Channel. Similarly for G and B
3. The final flat will again have 3 peaks, but wouldn't have gone through a debayer

Not sure how much of a difference it would make in real life - will run some experiments once the rains are over
zerolatitude
Posts: 156
Joined: Mon Mar 01, 2021 5:24 am

Re: Does Sharpcap normalise channels when capturing flats?

#6

Post by zerolatitude »

Here are some flat histograms

1. SC Capture Histogram - as seen while flatcapture wizard is running
SC Histogram Capture Ceiling.jpg
SC Histogram Capture Ceiling.jpg (61.28 KiB) Viewed 555 times
2. SC Flat Histogram - Histogram of the final flat output from SC (debayering etc). All 3 channels pretty much equalised
SC Histogram Flat Ceiling.jpg
SC Histogram Flat Ceiling.jpg (47.97 KiB) Viewed 555 times
3. Flat Histogram - histogram of flat with manual method of stacking 30 flats with 1 ms bias (to keep things same as SC) - 3 peaks again and mono as has not been debayered at any stage.
Flat_Stacked_Histogram_Ceiling.jpg
Flat_Stacked_Histogram_Ceiling.jpg (37.47 KiB) Viewed 555 times
The shape of the histograms is quite different between 2 and 3.
User avatar
admin
Site Admin
Posts: 13177
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Does Sharpcap normalise channels when capturing flats?

#7

Post by admin »

Hi,

histogram 3 is the histogram of a RAW image that hasn't been debayered being treated as a mono image - so you see three spikes from the three sets of coloured pixels (R,G,B). That's basically expected behaviour if you work with the image in that particular way.

If you use the flat from (3) then you will find it will change the colour balance of your images when it is applied - looking at histogram (1) you can see that the blue pixels contribute to the left hand most peak and the green to the right hand most peak. That means that when the flat is applied it will boost the blue pixels most and the green the least, basically (sort of) white balancing the image.

cheers,

Robin
Post Reply