Patent ID: 8358368

Claim:
An image processing method, comprising: (a) obtaining a preview image of a photographic scene and a luminance of each pixel of the preview image; (b) calculating a frequency of each luminance of the preview image based on the luminance of each pixel of the preview image; (c) grouping each pixel into a high luminance group or a low luminance group based on the frequency of each luminance of the preview image, obtaining a central luminance of the high luminance group and a central luminance of the low luminance group, and calculating an absolute difference between the central luminance of the high luminance group and the central luminance of the low luminance group; (d) determining whether the photographic scene has a high luminance difference by comparing the absolute difference with a predetermined value; and (e) if the photographic scene has a high luminance difference, switching the image pickup unit to a high luminance difference exposure mode; if the photographic scene does not have a high luminance difference, switching the image pickup unit to a normal exposure mode; wherein each pixel is grouped into the high luminance group or the low luminance group using a K-means algorithm; wherein the step of grouping each pixel using the K-means algorithm comprises: (1) presetting a central luminance of the high luminance group and a central luminance of the low luminance group; (2) grouping each pixel of the preview image into the high luminance group and the low luminance group based on an absolute difference between the luminance of the particular pixel and the central luminance of the low luminance group, and an absolute difference between the luminance of the particular pixel and the central luminance of the high luminance group; (3) calculating the average luminance of the high luminance group and the average luminance of the low luminance group, considering the average luminance of the high luminance group to be a new central luminance of the high luminance group, and considering the average luminance of the low luminance group to be a new central luminance of the low luminance group; and (4) based on the new central luminance of the high luminance group and the new central luminance of the low luminance group, repeating the step (2) to step (4) until the change ratio of the grouping result reaches a stable state.