## 3 Design Approach Details
### Image Stacking  
Taking a photo of a celestial object is essentially catching more and more photons using long exposure. Each pixel takes values in red, green, and blue colors only. These channels are divided into 256 discrete digital values from 0 to 255 for each color. A combination of these three values produces the color of the pixel [13]. Allowing a pixel to expose beyond this value will flood the value above 255 for at least one color and will result in a white pixel with no information.  
Waiting for photons is like rolling a die to predict how many photons from a certain object will hit the sensor during a given period of time within a given interval of certainty. These incoming photons are from the target \"signal\", and it has to be predicted that the number of photons from the object will be higher than the dark surrounding, but it cannot be predicted where the next photon will hit, since this is totally random. Therefore, the \"Law of Large Numbers\" has been followed by the rolling the dice method, as shown in Figure 18.  
The first few trials will yield random, unusable information. However, after the experiment of rolling the dice has been performed several times, the bias in information in different pixels starts to appear. Allowing for more dice rolls is as effective as taking longer and longer exposures. Hence, exposures with short durations tend to be noisier than those with longer durations, since more photons have hit the right pixels. By taking more and more exposures, all the data are added by stacking; also, this number is divided by the total number of exposures taken; otherwise, the image will become brighter and brighter,  
Figure 17: The low-light lens was used for the results.  
Figure 18: RGB values of a pixel.  
resulting in an unusable white image. The division by 'n' only keeps the brightness level constant. This results in a better signal-to-noise ratio (SNR).  
\[resulting\;image=(image1+\dots\dots\;imagen)/n \tag{1}\]  
The dark current suppression technology blocks the DC * time component, leaving only the random noise. In order to make dark current suppression technology effective, manufacturers have had to refine manufacturing methods so that the sensors are very uniform, reducing pattern noise (banding). The measurement of dark frames has the main purpose of subtracting an offset caused by the accumulation of the dark current level (DC * time) and pattern noise (including banding and amp glow) from the pixel-to-pixel variation in (DC * time), but dark current subtraction cannot remove random noise.  
Dark current suppression technology does the same thing, but in the pixel with the hardware architecture of the pixel, and it does so during the exposure on the subject (while the camera is taking the picture). Therefore, there is no need for dark frame subtraction in cameras in which the on sensor dark current suppression technology is well-implemented (e.g., as in most recent camera models from the last few years). With such sensors, dark current is already subtracted during the light integration. There is no need to do it again in post-processing (this would result in more noise).  
If the numbers of dark frames are subtracted, the equation for random noise at the darkest signal level in the image is given as:  
\[Total\;Noise\;in\;stack=((r2+DC*t)/N+(DCF*t+r2)/M)*0.5 \tag{2}\]  
where \(r=\) read noise, \(DC=\) sensor dark current, \(t=\) time, \(DCF=\) dark frame dark current, \(N=\) number of light frames, and \(M=\) number of dark frames. To measure the dark frames at the same temperature as the light frames, with \(DCF=DC\), the equation reduced to the noise is proportional to:  
\[Noise=(1/N+1/M)0.5q \tag{3}\]