The fixed pattern noise (FPN) is an important parameter in imaging devices such as CCD or CMOS sensors that becomes more important when we consider about precision. There is no simple technique to remove FPN without any inconvenience. An algorithm is proposed, which can reduce both, gain and offset FPN noise. At first, the gain FPN of all pixels will be unified. Then, the same procedure applies to the offset FPN. For a particular application in a star tracker, one can exploit stars image and its dark background or satellite motion to calibrate the camera during a mission. The efficiency of the proposed algorithm has been proved by simulation results. This technique also can be used in any camera or infrared devices that use a focal arrays system to observe the scenes.