A scene is captured. A two-dimensional matrix comprising a plurality of image detection components is generated according to the captured scene. Each image detection component corresponds to one color component. A plurality of matrixes are generated according to the image detection components. One image detection component and a portion of matrixes are calculated to obtain the missing color components.