Some of my PhD work involves the use of cameras, and pre-empting a talk I will inevitably have to give at some point, I should learn how they work.
The first thing you need to know is that cameras detect electromagnetic radiation. For us humans, we can only detect this radiation between the wavelength of 390-700 nm. Because of this, most digital cameras are set to capture this specific band of radiation. Cameras can be built to detect wavelengths of almost any size, from X-ray’s which are very small to radio telescopes which are extremely large. Here is an excellent graphical representation of this.
Source – https://www.quora.com/What-is-the-wavelength-of-the-visible-spectrum
The word camera, according to Wikipedia, ‘comes from camera obscura, which means “dark chamber” and is the Latin name of the original device for projecting an image of external reality onto a flat surface.’ I prefer to think of cameras as electromagnetic (EM) radiation detectors.
Cameras detect the EM radiation that is not absorbed and therefore, reflected from whatever they are pointed at. The sensor is mostly a trap for the EM radiation. Then EM is trapped, and the camera’s computer converts the signals it has in its ‘trap’ into colour In the form of digital values.
In most cameras that you will encounter, a Bayer filter is used. This filter filters light into three colours: red, green and blue (RGB). The filter is positioned in front of the ‘trap’ and using this filter, and you can quantify how much R, G or B is landing on your ‘trap’. The other two primary colours are estimated using good old maths. Here is a good image showing this.
After the relevant processing steps, a giant array of pixels is created. Pixels are the smallest elements in the image. The atoms of the image world. An image can be thought of as a three-dimensional array with width, height and depth. Where depth, in this case, is a different colour channel. So, you will have three two-dimensional arrays stacked on top of each other in an RGB image. With a value in each channel. For example, see the picture below.
In this case the cell in position (o,o,o) – [255,255,255] would be rendered as white, black would be [0,0,0]