1. A method of labeling connected components for an image having a plurality of pixels, wherein each of the plurality of pixels is an object pixel or a background pixel, and the method comprises: scanning the image in row-major order to acquire an object block located on the same row of the image, wherein the object block comprises i object pixels connected to one another, and i is a positive integer; performing a first phase labeling process according to an upper left pixel, an upper pixel, and an upper right pixel of a first object pixel in the object block to set a temporary label of the first object pixel and determine a representative label corresponding to the temporary label; when i is larger than 1, performing a second phase labeling process sequentially for i−1 times according to the upper right pixel of each of a second object pixel to an i th object pixel in the object block to set the temporary label of each of the second object pixel to the i th object pixel and determine the representative label corresponding to the temporary label; repeating the above steps until the image has been scanned completely; and replacing the temporary label of each object pixel in the image with the corresponding representative label according to a relationship between each temporary label and each representative label.