(19)
(11)EP 3 179 716 B1

(12)EUROPEAN PATENT SPECIFICATION

(45)Mention of the grant of the patent:
09.10.2019 Bulletin 2019/41

(21)Application number: 14900893.0

(22)Date of filing:  27.08.2014
(51)Int. Cl.: 
H04N 9/07  (2006.01)
G06T 5/00  (2006.01)
H04N 5/232  (2006.01)
(86)International application number:
PCT/CN2014/085280
(87)International publication number:
WO 2016/029380 (03.03.2016 Gazette  2016/09)

(54)

IMAGE PROCESSING METHOD, COMPUTER STORAGE MEDIUM, DEVICE, AND TERMINAL

BILDVERARBEITUNGSVERFAHREN, COMPUTERSPEICHERMEDIUM, VORRICHTUNG UND ENDGERÄT

PROCÉDÉ DE TRAITEMENT D'IMAGE, SUPPORT DE STOCKAGE INFORMATIQUE, DISPOSITIF ET TERMINAL


(84)Designated Contracting States:
AL AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MC MK MT NL NO PL PT RO RS SE SI SK SM TR

(43)Date of publication of application:
14.06.2017 Bulletin 2017/24

(73)Proprietor: Huawei Technologies Co., Ltd.
Longgang District Shenzhen, Guangdong 518129 (CN)

(72)Inventors:
  • ZHU, Congchao
    Shenzhen Guangdong 518129 (CN)
  • LUO, Wei
    Shenzhen Guangdong 518129 (CN)

(74)Representative: Körber, Martin Hans 
Mitscherlich PartmbB Patent- und Rechtsanwälte Sonnenstrasse 33
80331 München
80331 München (DE)


(56)References cited: : 
CN-A- 101 331 754
CN-A- 101 426 091
JP-B2- 5 567 235
US-A1- 2007 077 055
US-A1- 2010 157 078
CN-A- 101 345 824
CN-A- 102 340 626
US-A1- 2006 127 084
US-A1- 2009 115 859
US-B1- 6 778 210
  
      
    Note: Within nine months from the publication of the mention of the grant of the European patent, any person may give notice to the European Patent Office of opposition to the European patent granted. Notice of opposition shall be filed in a written reasoned statement. It shall not be deemed to have been filed until the opposition fee has been paid. (Art. 99(1) European Patent Convention).


    Description

    TECHNICAL FIELD



    [0001] The present invention relates to the field of image processing technologies, and in particular, to an image processing method, a computer storage medium, an apparatus, and a terminal.

    BACKGROUND



    [0002] Regardless of whether a mobile phone or a digital camera is used to take a photo, if hand trembling occurs at a moment a shutter button is pressed, photographing quality is affected, which decreases definition of an image and makes the taken photo breezing or blurred, or even causes ghosting. For example, when a mobile phone is used to take a photo, because a sensor of a camera of the mobile phone is relatively small in terms of area, a maximum exposure time with no apparent motion blur during photographing is relatively short, and therefore this phenomenon is more likely to occur. In particular, in a night scene or an indoor scene with low light, to achieve adequate exposure for a photo, generally a relatively long exposure time is required, and therefore this phenomenon is more apparent.
    The document US 2006/0127084 A1 shows an image taking method and apparatus to correct image blur caused by hand shake. If image stabilization is turned on, a consecutive image sequence is taken with a shorter exposure time than used without image stabilization. Shift is determined between the images and a reference. After coordinate conversion the images are combined by averaging the signals of corresponding coordinates, then the gain of the combined image is increased, and then gamma correction and image compression is performed to obtain one final image.
    The document US 2007/0077055 A1 shows an image taking apparatus and method for obtaining a composite object image by performing multiple-exposure shooting with a short exposure time. Multiple-exposure shooting is performed if the exposure time is equal to or greater than a camera shake limit. The camera shake limit is calculated based on a focal length and a camera shake coefficient. To obtain the composite object image the multiple object images are combined by correcting the motion among the multiple object images.
    Document US 6778 210 B1 shows an image pickup apparatus and method having a static image taking function capable of suppressing blur in the image for example due to camera shake. If an exposure time longer than a camera shake limit exposure time is set, the exposure time is divided into a plurality of exposure periods each shorter than the shake lime exposure time and an image sequence is taken. The images of the image sequence are added together after correcting motion to form one long-time exposure image.
    Document JP 5 567235 B2) shows a device and method to capture a highly-detailed image by combining plural images. The first image or the image in the middle of the plural images is selected as the reference image. Motion vectors are detected and the non-reference image is transformed. Then the absolute value of the difference between each reference image pixel and a corresponding non-reference image pixel is computed. When combining the reference and the non-reference image to generate an intermediate composite image, the two pixels are weighted depending on the absolute value of difference. If at least one non-reference image was not combined, the intermediate composite image is selected as the reference image and the steps for generating the intermediate composite image are repeated for another non-reference image.
    Document US 2010/0157078 A1 shows a wireless device and a method for high range image combining, wherein an image is captured with two different exposure times. The at least two low dynamic range images are combined to a high dynamic range (HDR) image after image registration and scaling the intensity of various pixel levels of the two images to compensate for the different exposure times. The HDR image is compressed using both global and local tone mapping, performed by luminance histogram equalization to perform range compression of the HDR image.
    Document US 2009/0115859 A1 shows an apparatus and method for digital image stabilization that corrects an image blur caused by shaky hands at the time of obtaining a digital image. A first digital image, e.g. a preview image, is taken under a first exposure value and a plurality of second digital images are taken under a second exposure value with the second exposure value less than the first exposure value.
    After motion-compensation images are overlapped with a reference image to generate a combined image by averaging the color data of the reference image and each motion compensated image. If the magnitude of a motion vector is excessively large, the color data of the comparative image is excluded. If a difference in brightness is smaller than a preselected threshold, the comparative second image is discarded to reduce operational overhead.

    [0003] In the prior art, to improve a photographing effect in low illumination and decrease blurring caused due to hand trembling, a professional photographer is usually equipped with an expensive optical image stabilization lens or takes a photo with the assistance of a tripod. However, for a common user who takes a photo at any time anywhere using a mobile phone, these methods are currently not popularized and are inconvenient in actual use.

    [0004] Therefore, in the prior art, there is a problem that a photographed image has relatively poor quality due to a relatively long exposure time.

    SUMMARY



    [0005] Embodiments of the present invention provide an image processing method, a computer storage medium, an apparatus, and a terminal, so as to resolve a technical problem that a photographed image has relatively poor quality due to a relatively long exposure time.

    [0006] According to a first aspect of the present invention, an image processing method is provided, including:

    determining a first exposure time required for photographing a first image;

    determining whether the first exposure time is longer than a preset exposure time,
    where a motion blurring degree corresponding to an image photographed using to the preset exposure time is less than or equal to a preset motion blurring degree;

    separately photographing N second images using the preset exposure time if the first exposure time is longer than the preset exposure time, where a scene corresponding to the N second images is the same as a scene corresponding to the first image, and N is a positive integer; and

    processing the N second images to obtain a first specific image, where a motion blurring degree of the first specific image is less than a motion blurring degree of the first image photographed according to the first exposure time ;

    wherein after the determining if the first exposure time is longer than a preset exposure time, the method further comprises: photographing the first image according to the first exposure time if the first exposure time is shorter than or equal to the preset exposure time;
    wherein N is greater than or equal to 3, and the processing the N second images to obtain a first specific image includes:

    selecting, from the N second images, one second image as a reference image;

    separately registering remaining N-1 second images to align with the reference image so as to obtain N-1 third images;

    performing local moving object compensation on the N-1 third images to obtain N-1 fourth images; and

    obtaining the first specific image according to pixel values of all pixels in the reference image and pixel values of all pixels in the N-1 fourth images;
    wherein the performing local moving object compensation on the N-1 third images to obtain N-1 fourth images comprises:
    separately performing, according to the following steps, the local moving object compensation on each third image of the N-1 third images to obtain the N-1 fourth images:

    for the jth pixel comprised in this third image, determining whether an absolute value of a difference between a pixel value of the jth pixel and a pixel value of the jth pixel in the reference image is greater than or equal to a preset threshold; and

    if the absolute value of the difference between the pixel value of the jth pixel in this third image and the pixel value of the jth pixel in the reference image is greater than or equal to the preset threshold, setting the pixel value of the jth pixel in the corresponding fourth image to the pixel value of the jth pixel in the reference image, wherein j is any integer from 1 to M, and M is a total quantity of pixels comprised in the reference image;

    wherein after the determining whether an absolute value of a difference between a pixel value of the jth pixel in this third image and a pixel value of the jth pixel in the reference image is greater than or equal to a preset threshold, the method further comprises:

    keeping the pixel value of the jth pixel in this third image unchanged and setting the pixel value of the j pixel of the corresponding fourth image to the pixel value of the jth pixel in this third image if the absolute value of the difference between the pixel value of the jth pixel in this third image and the pixel value of the jth pixel in the reference image is less than the preset threshold;

    wherein the obtaining the first specific image according to pixel values of all pixels in the reference image and pixel values of all pixels in the N-1 fourth images comprises:
    summing a pixel value of the ith pixel in the reference image and a pixel value of the ith pixel in each of the N-1 fourth images, wherein i is any integer from 1 to M, and M is the total quantity of the pixels comprised in the reference image; and
    obtaining the first specific image according to the summed pixel values.



    [0007] With reference to the first aspect, in a first possible implementation manner of the first aspect, the separately registering remaining N-1 second images to align with the reference image so as to obtain N-1 third images includes:

    [0008] for each image of the remaining N-1 second images, separately determining a transformation matrix between this second image and the reference image, and registering, by using the transformation matrix, this second image to align with the reference image so as to obtain a third image corresponding to this second image, where the transformation matrix is used to indicate a relative motion relationship between this second image and the reference image. With reference to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the obtaining the first specific image according to the summed pixel values includes:

    if a pixel value of a pixel in the first specific image exceeds a maximum pixel value of the display device obtaining a second specific image according to the summed pixel values; and

    adjusting luminance and chrominance of the second specific image to obtain the first specific image.



    [0009] With reference to the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the adjusting luminance and chrominance of the second specific image to obtain the first specific image includes:

    adjusting the luminance of the second specific image according to a luminance histogram; and

    adjusting the chrominance of the second specific image according to a compression degree of the adjusted luminance to obtain the first specific image.



    [0010] According to a second aspect of the present invention, a computer storage medium is provided, where the computer storage medium stores a program, and when the program is being executed, the steps described above are included.

    [0011] According to a third aspect of the present invention, an image processing apparatus is provided, including:

    a determining module, configured to: determine a first exposure time required for photographing a first image;

    a judging module, configured to determine whether the first exposure time is longer than a preset exposure time, where a motion blurring degree corresponding to an image photographed using to the preset exposure time is less than or equal to a preset motion blurring degree;

    a photographing module, configured to separately photograph N second images using to the preset exposure time if the first exposure time is longer than the preset exposure time, where a scene corresponding to the N second images is the same as a scene corresponding to the first image, and N is a positive integer; and

    a processing module, configured to process the N second images to obtain a first specific image, where a motion blurring degree of the first specific image is less than a motion blurring degree of the first image photographed according to the first exposure time;

    wherein the processing module is further configured to: after the judging module determines if the first exposure time is longer than the preset exposure time, photograph the first image according to the first exposure time if the first exposure time is shorter than or equal to the preset exposure time;

    wherein N is greater than or equal to 3, and the processing module is specifically configured to:

    select, from the N second images, one second image as a reference image;

    separately register remaining N-1 second images to align with the reference image so as to obtain N-1 third images;

    perform local moving object compensation on the N-1 third images to obtain N-1 fourth images; and

    obtain the first specific image according to pixel values of all pixels in the reference image and pixel values of all pixels in the N-1 fourth images;
    wherein that the processing module is specifically configured to perform local moving object compensation on the N-1 third images to obtain N-1 fourth images is specifically:
    separately performing, according to the following steps, the local moving object compensation on each third image of the N-1 third images to obtain the N-1 fourth images:

    for the jth pixel comprised in this third image, determining whether an absolute value of a difference between a pixel value of the jth pixel in this third image and a pixel value of the jth pixel in the reference image is greater than or equal to a preset threshold; and

    if the absolute value of the difference between the pixel value of the jth pixel in this third image and the pixel value of the jth pixel in the reference image is greater than or equal to the preset threshold, setting the pixel value of the jth pixel in the corresponding fourth image to the pixel value of the jth pixel in the reference image as the pixel value of the jth pixel, wherein j is any integer from 1 to M, and M is a total quantity of pixels comprised in the reference image;

    wherein the processing module is further configured to: after determining whether the absolute value of the difference between the pixel value of the jth pixel in this third image and the pixel value of the jth pixel in the reference image is greater than or equal to the preset threshold, keep the pixel value of the jth pixel in this third image unchanged and set the pixel value of the jth pixel of the corresponding fourth image to the pixel value of the jth pixel in this third image if the absolute value of the difference between the pixel value of the jth pixel in this third image and the pixel value of the jth pixel in the reference image is less than the preset threshold;

    wherein the processing module is specifically configured to obtain the first specific image according to pixel values of all pixels in the reference image and pixel values of all pixels in the N-1 fourth images is specifically: summing a pixel value of the ith pixel in the reference image and a pixel value of the ith pixel in each of the N-1 fourth images, where i is any integer from 1 to M, and M is the total quantity of the pixels included in the reference image; and obtaining the first specific image according to the obtained summed pixel values.



    [0012] With reference to the third aspect, in a first possible implementation manner of the third aspect, that the processing module is specifically configured to separately register remaining N-1 second images to align with the reference image so as to obtain N-1 third images is specifically: for each image of the remaining N-1 second images, separately determining a transformation matrix between this second image and the reference image, and registering, by using the transformation matrix, this second image to align with the reference image so as to obtain a third image corresponding to this second image, where the transformation matrix is used to indicate a relative motion relationship between this second image and the reference image.

    [0013] According to the embodiments of the present invention, when an image is being photographed, an exposure time required for photographing the first image in a current environment is first determined, and the exposure time is referred to as the first exposure time; after the determining, the first exposure time is compared with the preset exposure time; if the first exposure time is longer than the preset exposure time, it indicates that the first exposure time is excessively long, the first exposure time may be abandoned, and the preset exposure time is used to photograph the N second images, thereby avoiding an excessively long exposure time as much as possible during the image photographing; in addition, an exposure time used for photographing the N images is relatively short, and therefore a possibility that hand trembling occurs on a user is significantly reduced, or even if hand trembling occurs, a blurring degree caused due to the hand trembling is also reduced, thereby effectively improving photographing quality of the image. In addition, the N second images are further processed subsequently to obtain the first specific image, where as compared with the first image photographed according to the first exposure time, the first specific image has relatively high image definition, and a phenomenon such as breezing, blurring, or even ghosting is prevented from occurring on a taken photo.

    BRIEF DESCRIPTION OF DRAWINGS



    [0014] 

    FIG. 1 is a flowchart of an image processing method according to an embodiment of the present invention;

    FIG. 2 is a flowchart of a method for performing image registration on one second image according to an embodiment of the present invention;

    FIG. 3 is a flowchart of a method for performing local motion compensation on a third image according to an embodiment of the present invention;

    FIG. 4 is a flowchart of a method for obtaining a first specific image according to an embodiment of the present invention;

    FIG. 5 is a structural block diagram of an image processing apparatus according to an embodiment of the present invention;

    FIG. 6 is a schematic structural diagram of a terminal according to an embodiment of the present invention; and

    FIG. 7 is another schematic structural diagram of a terminal according to an embodiment of the present invention.


    DESCRIPTION OF EMBODIMENTS



    [0015] Embodiments of the present invention provide an image processing method, including: when a first image is being photographed, determining a first exposure time required for photographing the first image; determining whether the first exposure time is longer than a preset exposure time, where a blurring degree of an image photographed according to the preset exposure time is less than or equal to a preset blurring degree; separately photographing N second images according to the preset exposure time if the first exposure time is longer than the preset exposure time, where a scene corresponding to the N second images is the same as a scene corresponding to the first image, and N is a positive integer; and processing the N second images to obtain a first specific image, where a blurring degree of the first specific image is less than a blurring degree of the first image photographed according to the first exposure time.

    [0016] According to the embodiments of the present invention, when an image is being photographed, an exposure time required for photographing the first image in a current environment is first determined, and the exposure time is referred to as the first exposure time; after the determining, the first exposure time is compared with the preset exposure time; if the first exposure time is longer than the preset exposure time, it indicates that the first exposure time is excessively long, the first exposure time may be abandoned, and the preset exposure time is used to photograph the N second images, thereby avoiding an excessively long exposure time as much as possible during the image photographing; in addition, an exposure time used for photographing the N images is relatively short, and therefore a possibility that hand trembling occurs on a user is significantly reduced, or even if hand trembling occurs, a blurring degree caused due to the hand trembling is also reduced, thereby effectively improving photographing quality of the image. In addition, the N second images are further processed subsequently to obtain the first specific image, where as compared with the first image photographed according to the first exposure time, the first specific image has relatively high image definition, and a phenomenon such as breezing, blurring, or even ghosting is prevented from occurring on a taken photo.

    [0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following clearly and completely describes the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

    [0018] In addition, the terms "system" and "network" may be used interchangeably in this specification. The term "and/or" in this specification describes only an association relationship for describing associated objects and represents that three relationships may exist. For example, A and/or B may represent the following three cases: Only A exists, both A and B exist, and only B exists. In addition, the character "/" in this specification generally indicates an "or" relationship between the associated objects, unless otherwise specified.

    [0019] The following further describes the embodiments of the present invention in detail with reference to accompanying drawings in this specification.

    [0020] Referring to FIG. 1, an embodiment of the present invention provides an image processing method, where a main procedure of the method is described as follows:
    Step 101: When a first image is being photographed, determine a first exposure time required for photographing the first image.

    [0021] In this embodiment of the present invention, when an image needs to be photographed, an exposure time required for photographing the image may be determined. The image is referred to as the first image, and the exposure time required for photographing the image is referred to as the first exposure time.

    [0022] For example, the first exposure time required for photographing the first image may be determined by using an automatic exposure (AE) algorithm.

    [0023] Automatic exposure is that an image processing apparatus automatically adjusts exposure according to light intensity, so as to prevent overexposure or underexposure. It can be understood that the first exposure time is determined according to the light intensity by using the automatic exposure algorithm.

    [0024] Step 102: Determine whether the first exposure time is longer than a preset exposure time, where a blurring degree of an image photographed according to the preset exposure time is less than or equal to a preset blurring degree.

    [0025] On the premise that factors such as a weight of an electronic device and a photographing level of a photographer are not considered, the preset exposure time may be estimated according to parameters such as a focal length of a lens (Lens) and dimensions of a Sensor.

    [0026] In this embodiment of the present invention, the preset exposure time may refer to a maximum exposure time with no apparent motion blur. That is, a blurring degree corresponding to a photo photographed according to the preset exposure time is within an acceptable range of human eyes, and for human eyes, the photo photographed according to the preset exposure time basically can be viewed normally. It can be understood that the preset blurring degree is a maximum blurring degree acceptable by human eyes.

    [0027] Step 103: Separately photograph N second images according to the preset exposure time if the first exposure time is longer than the preset exposure time, where a scene corresponding to the N second images is the same as a scene corresponding to the first image, and N is a positive integer.

    [0028] Generally, N ≥ t/T, where t represents the first exposure time, and T represents the preset exposure time.

    [0029] In this embodiment of the present invention, if the first exposure time is longer than the preset exposure time, it indicates that an actually required exposure time is excessively long, and if the first image is photographed according to the first exposure time, in a process from pressing a shutter button to finishing photographing, a user's hand may tremble because of an excessively long time, which may cause the image to be blurred.

    [0030] Optionally, in this embodiment of the present invention, the separately photographing the N second images according to the preset exposure time if the first exposure time is longer than the preset exposure time may include: if the first exposure time is longer than the preset exposure time, stopping photographing the first image, and separately photographing the N second images according to the preset exposure time.

    [0031] In this embodiment of the present invention, for the first image, photographing is actually not started, but the exposure time required for photographing the first image is calculated first; therefore, if the first exposure time is longer than the preset exposure time, the photographing of the first image may be given up and the first exposure time may be abandoned, and the preset exposure time may be directly used. In this case, N images may be photographed, where N is a positive integer, and each image herein is referred to as a second image, that is, N second images may be photographed. Preferably, it is preferred that N is greater than or equal to 2, that is, multiple second images may be photographed. In this way, if multiple images are processed, an effect of a finally obtained image is better. Certainly, there may alternatively be a case in which N=1.

    [0032] In this way, an exposure time required for photographing is not excessively long, the preset exposure time is the maximum exposure time with no apparent motion blur, and a blurring degree of a photographed image is relatively low.

    [0033] If N is an integer not less than 2, and an electronic device used for photographing is an electronic device provided with only one image acquisition unit, the N second images may be obtained by performing photographing for N times, but if the electronic device used for photographing is an electronic device provided with two image acquisition units, the N second images may be obtained by performing photographing for N/2 times. That is, a quantity of required photographing times is related to a quantity of image acquisition units provided in an electronic device that is used, where the image acquisition unit may be, for example, a camera.

    [0034] In this embodiment of the present invention, a scene corresponding to the N second images and a scene corresponding to the first image are a same scene, that is, if the first exposure time is longer than the preset exposure time, and the first image cannot be photographed normally, the N second images may be photographed for a scene the same as the scene of the first image. If it is not considered that factors such as a blurring degree of different images are different, the N second images may be deemed as a same image.

    [0035] In this embodiment of the present invention, that scenes corresponding to two images are the same may mean that framing ranges for a shutter when the two images are photographed are the same, or may mean that focal points for focusing when the two images are photographed are the same, and no specific limitation is imposed thereto in the present invention. That the scenes corresponding to the two images are the same may be approximately understood as that photographed objects included in the two images are the same.

    [0036] In this way, it is ensured as much as possible that an exposure time used for photographing an image is relatively short, and therefore a possibility that a user's hand trembles during photographing is significantly reduced, or even if hand trembling occurs, a blurring degree caused due to the hand trembling is also reduced, thereby effectively improving photographing quality of the image, improving image definition, and preventing a phenomenon such as breezing, blurring, or even ghosting from occurring on a taken photo.

    [0037] Optionally, in this embodiment of the present invention, after the determining whether the first exposure time is longer than the preset exposure time, the method may further include: photographing the first image according to the first exposure time if the first exposure time is shorter than or equal to the preset exposure time.

    [0038] If the first exposure time is not longer than the preset exposure time, it indicates that the exposure time required for photographing the first image is within an acceptable range, and the first image may be photographed directly according to the first exposure time. In this case, a possibility that image blurring is caused because a user's hand trembles is not high.

    [0039] Step 104: Process the N second images to obtain a first specific image, where a blurring degree of the first specific image is less than a blurring degree of the first image photographed according to the first exposure time.

    [0040] Optionally, in this embodiment of the present invention, if the N second images are photographed, the N second images further need to be processed to obtain one final image, and this image is referred to as the first specific image.

    [0041] Optionally, in an example not falling into the scope of the present invention, if N is greater than or equal to 2, the processing the N second images to obtain the first specific image may include: selecting, from the N second images, one second image as a reference image; separately registering remaining N-1 second images to align with the reference image so as to obtain N-1 third images; performing local motion compensation on the N-1 third images to obtain N-1 fourth images; and obtaining the first specific image according to pixel values of all pixels in the reference image and pixel values of all pixels in the N-1 fourth images.

    [0042] Optionally, in this embodiment of the present invention, the separately registering remaining N-1 second images to align with the reference image so as to obtain N-1 third images includes: for each image of the remaining N-1 second images, separately determining a transformation matrix between this second image and the reference image, and registering, by using the transformation matrix, this second image to align with the reference image so as to obtain a third image corresponding to this second image, where the transformation matrix is used to indicate a relative motion relationship between this second image and the reference image.

    [0043] To perform image registration, the reference image needs to be selected first. In this embodiment of the present invention, if multiple second images are photographed, after photographing of the second images is complete, one second image is selected from the multiple second images as the reference image. When the selection is performed, there may be multiple different selection manners: For example, the first photographed second image may be selected as the reference image, or the last photographed second image may be selected as the reference image, or any second image may be selected as the reference image. The present invention imposes no limitation on a specific selection manner.

    [0044] After the reference image is selected, the remaining N-1 second images of the N second images need to be registered to align with the reference image, and after the registration is complete, the N-1 third images are obtained.

    [0045] For example, referring to FIG. 2, a registration process for one second image is described as follows:
    Step 201: Determine a transformation matrix between a second image and the reference image.

    [0046] Each image of the N second images may be represented by Ii, where i = 2, 3, ..., or N. For the Iith second image, a relative motion relationship between the Iith second image and the reference image is estimated. When the relative motion relationship between the Iith second image and the reference image is being estimated, to improve noise resistance of an algorithm, a feature point extraction and matching algorithm may be used to determine the transformation matrix between the Iith second image and the reference image.

    [0047] For example, the reference image has 500 pixels in total. Likewise, each second image also has the same 500 pixels in total. When the transformation matrix between the Iith second image and the reference image is being determined, for example, some feature points may be determined from all the pixels, that is, all or a part of the 500 pixels may be determined to be used as the feature points. For example, 300 pixels are determined from the 500 pixels to be used as feature points. For each feature point, location information corresponding to the feature point in the Iith second image is determined, and location information corresponding to the feature point in the reference image is determined. Then, location transformation information of each feature point can be determined, and according to the location transformation information of each feature point, the transformation matrix between the Iith second image and the reference image can be determined. Generally, the transformation matrix may be a 3*3 square matrix.

    [0048] There are various methods for determining the transformation matrix, and the above is merely a simple example used for description. Specifically, different algorithms may be used when performing the determining, for example, a speeded-up robust feature (SURF) algorithm may be used, or for example, a scale-invariant feature transform (SIFT) algorithm may be used, or the like.

    [0049] Step 202: Register, by using the transformation matrix, the second image to align with the reference image to obtain a corresponding third image.

    [0050] For the Iith second image, after the transformation matrix is determined, image transformation is performed on the Iith second image according to the transformation matrix, so as to align with the reference image to obtain the Iith third image corresponding to the Iith second image, for example, I'i may be used to represent each of the N-1 third images, where i = 2, 3, ..., or N-1.

    [0051] Then, because a moving object such as a pedestrian, a driving vehicle, or the like may exist in a photographing scene when the N second images are being photographed, to reduce a blur and/or ghosting that may exist on the moving object in subsequent processing, detection and compensation need to be performed on a local moving object.

    [0052] In this embodiment of the present invention, the performing local motion compensation on the N-1 third images to obtain N-1 fourth images includes:

    [0053] Referring to FIG. 3, in this embodiment of the present invention, the N-1 fourth images may be obtained by separately performing, according to the following steps, the local motion compensation on each third image of the N-1 third images, and method description is as follows:

    [0054] Step 301: For the jth pixel included in this third image, determine whether an absolute value of a difference between a pixel value of the jth pixel and a pixel value of the jth pixel in the reference image is greater than or equal to a preset threshold.

    [0055] For example, I1 is used to represent the reference image, I1(x,y) is used to represent a pixel value of any pixel (x, y) in the reference image, and I'i(x,y) is used to represent a pixel value of the same pixel (x, y) in any third image of the N-1 third images, and the following local motion compensation method may be performed on I'i (x,y) :



    [0056] In the formula (1), Th represents the preset threshold. Th may be debugged according to experience, or may be an adaptive threshold, and no limitation is imposed thereto in the present invention. I''i(x,y) represents a pixel value of the same pixel (x, y) in any fourth image of the N-1 fourth images.

    [0057] If represented by YUV channels, a value of a pixel may be a value of a three-dimensional property. For example, a value of a pixel 1 may be represented by (a, b, c), where a represents a value of a Y channel of the pixel 1, b represents a value of a U channel of the pixel 1, and c represents a value of a V channel of the pixel 1. In this embodiment of the present invention, when the formula (1) is being implemented, what specifically participating in comparison and calculation may refer to a value of a Y channel of a pixel; or a value of each pixel may be deemed as a vector, and what specifically participating in comparison and calculation in the formula (1) may refer to a norm of a vector corresponding to a pixel, or the like.

    [0058] Step 302: If the absolute value of the difference between the pixel value of the jth pixel and the pixel value of the jth pixel in the reference image is greater than or equal to the preset threshold, use the pixel value of the jth pixel in the reference image as the pixel value of the jth pixel, where j is any integer from 1 to M, and M is a total quantity of pixels included in the reference image.

    [0059] In the formula (1), if |Ii'(x,y) - I1(x,y)|≥ Th, it indicates that the pixel (x, y) is a pixel corresponding to a moving object. To be aligned with the reference image, a pixel value of this point in the reference image is directly used as a pixel value of this point, which prevents a phenomenon such as blurring, ghosting, or the like that may occur. Otherwise, if |Ii'(x,y)-I1(x,y)|<Th, it indicates that the pixel (x, y) is a pixel corresponding to a non-moving object, and a pixel value of this point may retain a pixel value of this point in the third image, so as to retain valid information in the third image as much as possible.

    [0060] Optionally, in this embodiment of the present invention, after the determining whether an absolute value of a difference between a pixel value of the jth pixel and a pixel value of the jth pixel in the reference image is greater than or equal to a preset threshold, the method may further include: keeping the pixel value of the jth pixel unchanged if the absolute value of the difference between the pixel value of the jth pixel and the pixel value of the jth pixel in the reference image is less than the preset threshold.

    [0061] Optionally, in this embodiment of the present invention, the foregoing local motion compensation operation may be performed on each pixel in each third image. In this case, j may be any integer from 1 to M. In this way, the local motion compensation operation is performed on each pixel, which can better prevent occurrence of a motion blurring phenomenon and obtain a better image effect. Alternatively, the foregoing local motion compensation operation may be performed on a part of pixels in each third image. In this case, j may be any of some integers from 1 to M. Which integers used as j, for example, may be selected randomly, or may be selected according to a specific rule, for example, a specific value may be selected, and no limitation is imposed thereto in the present invention. If the local motion compensation operation is performed on only a part of the pixels, required operation steps are fewer, and load of an apparatus is reduced.

    [0062] After processing on the N-1 third images is complete, the N-1 four images are obtained.

    [0063] Optionally, in this embodiment of the present invention, referring to FIG. 4, the first specific image is obtained according to pixel values of all pixels in the reference image and pixel values of all pixels in the N-1 fourth images, and method description is as follows:

    [0064] Step 401: Sum a pixel value of the ith pixel in the reference image and a pixel value of the ith pixel in the N-1 fourth images, where i is any integer from 1 to M, and M is the total quantity of the pixels included in the reference image.

    [0065] That is, after the image registration and the local motion compensation, an image motion caused by the hand trembling and a motion of an object in a scene are both registered, and in this case, cumulative summing may be separately performed on pixel values of all pixels in the N images.



    [0066] In the formula (2), I(x, y) represents a pixel value of any pixel (x, y) in the first specific image, I1(x,y) represents a pixel value of the same pixel (x, y) in the reference image, and I''i(x,y) represents a pixel value of the same pixel (x, y) in any fourth image of the N-1 fourth images. In no consideration of non-linear impact of a Sensor, the cumulative summing of the formula (2) is equivalent to performing photographing with an exposure time of N*T.

    [0067] In this embodiment of the present invention, in the reference image and the N-1 fourth images, same pixels are included in each image. Then, the foregoing summing operation may be performed on each pixel of the reference image and the N-1 fourth images. In this case, i may be any integer from 1 to M, that is, a maximum of M summed pixel values are obtained. The first specific image obtained in this way relatively accurately restores an originally to-be-photographed image and has a better effect, because all original pixels are included. Alternatively, the foregoing summing operation may be performed on a part of the pixels. In this case, i may be any of some integers from 1 to M. Which integers used as i, for example, may be selected randomly, or may be selected according to a specific rule, for example, a specific value may be selected, and no limitation is imposed thereto in the present invention. If only a part of the pixels are selected for the summing operation, required operation steps are fewer, and a workload of an apparatus is reduced; in addition, if the selected pixels are feature points, an obtained image can better restore an originally to-be-photographed image object.

    [0068] Step 402: Obtain the first specific image according to an obtained summed pixel value.

    [0069] The following explains a procedure of FIG. 4 by using an example in which the summing operation is performed on each pixel.

    [0070] For example, the reference image includes three pixels in total, which are respectively a pixel 1, a pixel 2, and a pixel 3. Each of the N-1 fourth images also includes the three pixels in total, namely, the pixel 1, the pixel 2, and the pixel 3. For example, a value of the pixel 1 in the reference image is 1, N=2, a value of the pixel 1 in the first fourth image is 2, and a value of the pixel 1 in the second fourth image is 3; these values of the pixels 1 are summed, and an obtained value of the pixels 1 is 6. A value of the pixel 2 in the reference image is 2, a value of the pixel 2 in the first fourth image is 2, and a value of the pixel 2 in the second fourth image is 4; these values of the pixels 2 are summed, and an obtained value of the pixels 2 is 8. A value of the pixel 3 in the reference image is 1, a value of the pixel 3 in the first fourth image is 2, and a value of the pixel 3 in the second fourth image is 1; these values of the pixels 3 are summed, and an obtained value of the pixels 3 is 4. The first specific image can be obtained according to the newly obtained value (6) of the pixels 1, the value (8) of the pixels 2, and the value (4) of the pixels 3. Certainly, the specific values herein are merely examples but not represent actual values. The examples herein are merely used to describe a manner of obtaining the first specific image.

    [0071] In addition, what participating in specific calculation may alternatively refer to a value of a Y channel of a pixel; or a value of each pixel may be deemed as a vector, and what specifically participating in calculation may refer to a norm of a vector corresponding to a pixel, or the like.

    [0072] In an embodiment of the present invention, after the first specific image is obtained, it may be determined whether pixel values of all pixels in the first specific image exceed a maximum pixel value that can be displayed on a display device. If a pixel value of a pixel exceeds the maximum pixel value that can be displayed on the display device, luminance and chrominance of the first specific image may be adjusted separately to obtain an adjusted first specific image. Herein, for distinguishing, after the first specific image is obtained, if the luminance and the chrominance of the obtained first specific image further needs to be adjusted, the first specific image before being adjusted may be referred to as a second specific image, and what obtained after the second specific image is adjusted is referred to as the first specific image.

    [0073] That is, if pixel values of all pixels in an image obtained according to the summed pixel value are all within a range that can be displayed by the display device, luminance and chrominance of the image may not be further adjusted, and in this case, the image obtained according to the summed pixel value may be referred to as the first specific image. However, if a pixel value of a pixel in pixels included in an image obtained according to the summed pixel value is out of the range that can be displayed by the display device, luminance and chrominance of the image need to be further adjusted, the image obtained according to the summed pixel value may be referred to as the second specific image, and an image obtained after the luminance and the chrominance of the second specific image are adjusted is referred to as the first specific image.

    [0074] That is, in this embodiment of the present invention, the obtaining the first specific image according to an obtained summed pixel value may include: obtaining a second specific image according to the obtained summed pixel value; and adjusting luminance and chrominance of the second specific image to obtain the first specific image.

    [0075] Optionally, in this embodiment of the present invention, the adjusting luminance and chrominance of the second specific image to obtain the first specific image includes: adjusting the luminance of the second specific image according to a luminance histogram; and adjusting the chrominance of the second specific image according to adjusted luminance of the second specific image to obtain the first specific image.

    [0076] The luminance histogram represents a quantity of pixels of each luminance level in the image by using a diagram, and demonstrates a distribution situation of the pixels in the image.

    [0077] Because a result obtained by an operation of the formula (2) is likely to exceed a dynamic range that can be represented by the display device, that is, pixel values of some pixels are likely to exceed the dynamic range that can be represented by the display device, dynamic range compression needs to be performed on the second specific image to obtain expected luminance distribution. For example, dynamic adaptive compression may be performed according to luminance histogram distribution of the image.

    [0078] An 8-bit (bit) image with N=6 is used as an example. In the second specific image obtained according to six second images, a maximum value of pixel values is 255*6 = 1530, different transformation curves may be used according to different cases of a scene in which overall luminance is relatively low, relatively high, or concentrated, so as to obtain relatively good luminance distribution.

    [0079] For example, if the second specific image is relatively dark overall, a left area of the luminance histogram occupies a relatively large proportion, a convex curve may be used to perform compression to improve the luminance of the second specific image; on the contrary, if the second specific image is relatively bright overall, a concave curve may be used to perform compression to reduce the luminance of the second specific image. If a majority of pixels of the second specific image concentrate in a central area of the luminance histogram, generally, transparency of the image is relatively poor, and an S-shaped curve may be used to perform compression to improve a contrast of the second specific image.

    [0080] In this embodiment of the present invention, the luminance of the second specific image may be adjusted first, and then the chrominance of the second specific image is adjusted according to a luminance adjustment result.

    [0081] Corresponding processing is performed on chrominance components (U and V) according to a compression degree of a luminance component (that is, the Y channel), to obtain expected color saturation.





    [0082] In the formula (3) and the formula (4), uout represents a value of U in the first specific image, vout represents a value of V in the first specific image, uin represents a value of U in the second specific image, vin represents a value of V in the second specific image, yout represents a value of Y in the first specific image, yin represents a value of Y in the second specific image, and

    represents the compression degree of the luminance component.

    [0083] Preferably, in this embodiment of the present invention, a value of N may generally be 5 or 6, and an effect of a final image obtained in this way is relatively good. If the value of N is relatively small, the luminance of the obtained first specific image may be not good in some cases. If the value of N is relatively large, a calculation amount is relatively large, a calculation time is relatively long, and more computing resources are occupied. Therefore, generally, it is a relatively good choice to use 5 or 6 as N. Certainly, in actual application, different values may be used as N according to a need, and embodiments corresponding to various values of N all fall within the protection scope of the present invention.

    [0084] An embodiment of the present invention provides a computer storage medium, where the computer storage medium stores a program, and when the program is being executed, the steps described in the procedures in FIG. 1 to FIG. 4 are included.

    [0085] The computer storage medium, for example, includes: any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk, or an optical disc.

    [0086] Referring to FIG. 5, based on a same inventive concept, an embodiment of the present invention provides an image processing apparatus, where the apparatus may include a determining module 501, a judging module 502, a photographing module 503, and a processing module 504.

    [0087] The determining module 501 is configured to: when a first image is being photographed, determine a first exposure time required for photographing the first image.

    [0088] The judging module 502 is configured to determine whether the first exposure time is longer than a preset exposure time, where a blurring degree of an image photographed according to the preset exposure time is less than or equal to a preset blurring degree.

    [0089] The photographing module 503 is configured to separately photograph N second images according to the preset exposure time if the first exposure time is longer than the preset exposure time, where a scene corresponding to the N second images is the same as a scene corresponding to the first image, and N is a positive integer.

    [0090] The processing module 504 is configured to process the N second images to obtain a first specific image, where a blurring degree of the first specific image is less than a blurring degree of the first image photographed according to the first exposure time.

    [0091] Optionally, in this embodiment of the present invention, if N is greater than or equal to 2, the processing module 504 is specifically configured to: select, from the N second images, one second image as a reference image; separately register remaining N-1 second images to align with the reference image so as to obtain N-1 third images; perform local motion compensation on the N-1 third images to obtain N-1 fourth images; and obtain the first specific image according to pixel values of all pixels in the reference image and pixel values of all pixels in the N-1 fourth images.

    [0092] Optionally, in this embodiment of the present invention, that the processing module 504 is specifically configured to separately register remaining N-1 second images to align with the reference image so as to obtain N-1 third images is specifically: for each image of the remaining N-1 second images, separately determining a transformation matrix between this second image and the reference image, and registering, by using the transformation matrix, this second image to align with the reference image so as to obtain a third image corresponding to this second image, where the transformation matrix is used to indicate a relative motion relationship between this second image and the reference image.

    [0093] Optionally, in this embodiment of the present invention, that the processing module 504 is specifically configured to perform local motion compensation on the N-1 third images to obtain N-1 fourth images is specifically:
    separately performing, according to the following steps, the local motion compensation on each third image of the N-1 third images to obtain the N-1 fourth images:

    for the jth pixel included in this third image, determining whether an absolute value of a difference between a pixel value of the jth pixel and a pixel value of the jth pixel in the reference image is greater than or equal to a preset threshold; and

    if the absolute value of the difference between the pixel value of the jth pixel and the pixel value of the jth pixel in the reference image is greater than or equal to the preset threshold, using the pixel value of the jth pixel in the reference image as the pixel value of the jth pixel, where j is any integer from 1 to M, and M is a total quantity of pixels included in the reference image.



    [0094] Optionally, in this embodiment of the present invention, the processing module 504 is further configured to: after determining whether the absolute value of the difference between the pixel value of the jth pixel and the pixel value of the jth pixel in the reference image is greater than or equal to the preset threshold, keep the pixel value of the jth pixel unchanged if the absolute value of the difference between the pixel value of the jth pixel and the pixel value of the jth pixel in the reference image is less than the preset threshold.

    [0095] Optionally, in this embodiment of the present invention, that the processing module 504 is specifically configured to obtain the first specific image according to pixel values of all pixels in the reference image and pixel values of all pixels in the N-1 fourth images is specifically: summing a pixel value of the ith pixel in the reference image and a pixel value of the ith pixel in the N-1 fourth images, where i is any integer from 1 to M, and M is the total quantity of the pixels included in the reference image; and obtaining the first specific image according to an obtained summed pixel value.

    [0096] Optionally, in this embodiment of the present invention, that the processing module 504 is specifically configured to obtain the first specific image according to an obtained summed pixel value is specifically: obtaining a second specific image according to the obtained summed pixel value; and adjusting luminance and chrominance of the second specific image to obtain the first specific image.

    [0097] Optionally, in this embodiment of the present invention, that the processing module 504 is specifically configured to adjust luminance and chrominance of the second specific image to obtain the first specific image is specifically: adjusting the luminance of the second specific image according to a luminance histogram; and adjusting the chrominance of the second specific image according to adjusted luminance of the second specific image to obtain the first specific image.

    [0098] Optionally, in this embodiment of the present invention, the photographing module 503 is further configured to: after the judging module 502 determines whether the first exposure time is longer than the preset exposure time, photograph the first image according to the first exposure time if the first exposure time is shorter than or equal to the preset exposure time.

    [0099] Referring to FIG. 6, based on a same inventive concept, an embodiment of the present invention provides a terminal, where the terminal and the apparatus in FIG. 5 may be a same device. The terminal may include a processor 601, a memory 602, and an input device 603 that are connected to a same bus 600; because they are all connected to the bus 600, the memory 602 and the input device 603 are separately connected to the processor 601.

    [0100] The memory 602 is configured to store an instruction required by the processor 601 to execute a program. The processor 601 is configured to read the instruction stored in the memory 602 to execute the following method: when a first image is being photographed, determining a first exposure time required for photographing the first image; determining whether the first exposure time is longer than a preset exposure time, where a blurring degree of an image photographed according to the preset exposure time is less than or equal to a preset blurring degree; separately photographing N second images according to the preset exposure time by using the input device 603 if the first exposure time is longer than the preset exposure time, where a scene corresponding to the N second images is the same as a scene corresponding to the first image, and N is a positive integer; and processing the N second images to obtain a first specific image, where a blurring degree of the first specific image is less than a blurring degree of the first image photographed according to the first exposure time.

    [0101] Optionally, in this embodiment of the present invention, if N is greater than or equal to 2, that the processor 601 is configured to process the N second images to obtain a first specific image is specifically: selecting, from the N second images, one second image as a reference image; separately registering remaining N-1 second images to align with the reference image so as to obtain N-1 third images; performing local motion compensation on the N-1 third images to obtain N-1 fourth images; and obtaining the first specific image according to pixel values of all pixels in the reference image and pixel values of all pixels in the N-1 fourth images.

    [0102] Optionally, in this embodiment of the present invention, that the processor 301 is specifically configured to separately register remaining N-1 second images to align with the reference image so as to obtain N-1 third images is specifically: for each image of the remaining N-1 second images, separately determining a transformation matrix between this second image and the reference image, and registering, by using the transformation matrix, this second image to align with the reference image so as to obtain a third image corresponding to this second image, where the transformation matrix is used to indicate a relative motion relationship between this second image and the reference image.

    [0103] Optionally, in this embodiment of the present invention, that the processor 301 is specifically configured to perform local motion compensation on the N-1 third images to obtain N-1 fourth images is specifically:
    separately performing, according to the following steps, the local motion compensation on each third image of the N-1 third images to obtain the N-1 fourth images:

    for the jth pixel included in this third image, determining whether an absolute value of a difference between a pixel value of the jth pixel and a pixel value of the jth pixel in the reference image is greater than or equal to a preset threshold; and

    if the absolute value of the difference between the pixel value of the jth pixel and the pixel value of the jth pixel in the reference image is greater than or equal to the preset threshold, using the pixel value of the jth pixel in the reference image as the pixel value of the jth pixel, where j is any integer from 1 to M, and M is a total quantity of pixels included in the reference image.



    [0104] Optionally, in this embodiment of the present invention, the processor 301 is further configured to execute the instruction to: after determining whether the absolute value of the difference between the pixel value of the jth pixel and the pixel value of the jth pixel in the reference image is greater than or equal to the preset threshold, keep the pixel value of the jth pixel unchanged if the absolute value of the difference between the pixel value of the jth pixel and the pixel value of the jth pixel in the reference image is less than the preset threshold.

    [0105] Optionally, in this embodiment of the present invention, that the processor 301 is specifically configured to obtain the first specific image according to pixel values of all pixels in the reference image and pixel values of all pixels in the N-1 fourth images is specifically: summing a pixel value of the ith pixel in the reference image and a pixel value of the ith pixel in the N-1 fourth images, where i is any integer from 1 to M, and M is the total quantity of the pixels included in the reference image; and obtaining the first specific image according to an obtained summed pixel value.

    [0106] Optionally, in this embodiment of the present invention, that the processor 301 is specifically configured to obtain the first specific image according to an obtained summed pixel value is specifically: obtaining a second specific image according to the obtained summed pixel value; and adjusting luminance and chrominance of the second specific image to obtain the first specific image.

    [0107] Optionally, in this embodiment of the present invention, that the processor 301 is specifically configured to adjust luminance and chrominance of the second specific image to obtain the first specific image is specifically: adjusting the luminance of the second specific image according to a luminance histogram; and adjusting the chrominance of the second specific image according to adjusted luminance of the second specific image to obtain the first specific image.

    [0108] Optionally, in this embodiment of the present invention, the processor 301 is further configured to execute the instruction to: after determining whether the first exposure time is longer than the preset exposure time, photograph the first image according to the first exposure time by using the input device 603 if the first exposure time is shorter than or equal to the preset exposure time.

    [0109] In this embodiment of the present invention, the input device 603 may include a device provided with an image collection function, such as a camera (camera) or a dual camera.

    [0110] Preferably, referring to FIG. 7, FIG. 7 is another schematic structural diagram of a terminal according to an embodiment of the present invention. The terminal in FIG. 7, the terminal in FIG. 6, and the image processing apparatus in FIG. 5 may be a same device. FIG. 7 is merely a more detailed schematic structural diagram of the terminal.

    [0111] It can be seen from FIG. 7 that the terminal includes: an input device 703, a processor 701, an output device 701, a random access memory 702, a read-only memory 702, and a bus 700. By using the bus 700, the processor 701 is separately coupled to the input device 703, the output device 701, the random access memory 702, and the read-only memory 702. When the terminal needs to be run, a basic input/output system that is built into the read-only memory 702 leads a system to start up and leads the image processing apparatus to enter a normal operating state. It can be learned that the processor 601 in FIG. 6 and the processor 701 in FIG. 7 are a same component, the bus 600 in FIG. 6 and the bus 700 in FIG. 7 are a same component, the input device 603 in FIG. 6 and the input device 703 in FIG. 7 are a same component, and the memory 602 in FIG. 6 and the random access memory 702 in FIG. 7 are a same component.

    [0112] After the image processing apparatus enters the normal operating state, an application program and an operating system run in the random access memory 702.

    [0113] The input device 703 is configured to collect an image, where the input device 703 may include a device provided with an image collection function, such as a camera or a dual camera.

    [0114] The output device 701 is configured to display a resulting image, where the output device 701 may include a touchscreen, a display, a printer, and the like.

    [0115] In this embodiment of the present invention, a photographing process with a long exposure time is split into multiple photographing processes with a short exposure time, subsequent registration by an algorithm and cumulative summing are performed, and a result obtained by means of the cumulative summing is dynamically mapped to standard luminance for output, which can reduce blurring caused due to hand trembling and blurring caused due to an object motion in a scene, and can further implement adaptive adjustment of image luminance and play an important role in improving photographing experience of a user.

    [0116] Embodiments of the present invention provide an image processing method, including: when a first image is being photographed, determining a first exposure time required for photographing the first image; determining whether the first exposure time is longer than a preset exposure time, where a blurring degree of an image photographed according to the preset exposure time is less than or equal to a preset blurring degree; separately photographing N second images according to the preset exposure time if the first exposure time is longer than the preset exposure time, where a scene corresponding to the N second images is the same as a scene corresponding to the first image, and N is a positive integer; and processing the N second images to obtain a first specific image, where a blurring degree of the first specific image is less than a blurring degree of the first image photographed according to the first exposure time.

    [0117] According to the embodiments of the present invention, when an image is being photographed, an exposure time required for photographing the first image in a current environment is first determined, and the exposure time is referred to as the first exposure time; after the determining, the first exposure time is compared with the preset exposure time; if the first exposure time is longer than the preset exposure time, it indicates that the first exposure time is excessively long, the first exposure time may be abandoned, and the preset exposure time is used to photograph the N second images, thereby avoiding an excessively long exposure time as much as possible during the image photographing; in addition, an exposure time used for photographing the N images is relatively short, and therefore a possibility that hand trembling occurs on a user is significantly reduced, or even if hand trembling occurs, a blurring degree caused due to the hand trembling is also reduced, thereby effectively improving photographing quality of the image. In addition, the N second images are further processed subsequently to obtain the first specific image, where as compared with the first image photographed according to the first exposure time, the first specific image has relatively high image definition, and a phenomenon such as breezing, blurring, or even ghosting is prevented from occurring on a taken photo.

    [0118] It may be clearly understood by a person skilled in the art that, for the purpose of convenient and brief description, division of the foregoing functional modules is taken as an example for illustration. In actual application, the foregoing functions can be allocated to different functional modules and implemented according to a requirement, that is, an inner structure of an apparatus is divided into different functional modules to implement all or some of the functions described above. For a detailed working process of the foregoing system, apparatus, and unit, reference may be made to a corresponding process in the foregoing method embodiments, and details are not described herein again.

    [0119] In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the described apparatus embodiment is merely an example. For example, the module or unit division is merely logical function division and may be other division in actual implementation. For example, a plurality of units or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented by using some interfaces. The indirect couplings or communication connections between the apparatuses or units may be implemented in electronic, mechanical, or other forms.

    [0120] The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.

    [0121] In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each of the units may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in a form of hardware, or may be implemented in a form of a software functional unit.

    [0122] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, the integrated unit may be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of the present application essentially, or the part contributing to the prior art, or all or some of the technical solutions may be implemented in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for instructing a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to perform all or some of the steps of the methods described in the embodiments of the present application. The foregoing storage medium includes: any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory, a random access memory, a magnetic disk, or an optical disc.

    [0123] The foregoing embodiments are merely used to describe in detail the technical solutions of the present application. The descriptions of the foregoing embodiments are merely intended to help understand the method and core idea of the present invention, and shall not be construed as a limitation to the present invention. Any variation or replacement readily figured out by a person skilled in the art within the technical scope disclosed in the present invention as defined by the appended claims shall fall within the protection scope of the present invention.


    Claims

    1. An image processing method, comprising:

    determining (101) a first exposure time required for photographing a first image;

    determining (102) whether the first exposure time is longer than a preset exposure time, wherein a motion blurring degree corresponding to an image photographed using the preset exposure time is less than or equal to a preset motion blurring degree;

    separately photographing (103) N second images using the preset exposure time if the first exposure time is longer than the preset exposure time, wherein a scene corresponding to the N second images is the same as a scene corresponding to the first image, and N is a positive integer; and

    processing (104) the N second images to obtain a first specific image, wherein a motion blurring degree of the first specific image is less than a motion blurring degree of the first image photographed according to the first exposure time ;

    wherein after the determining if the first exposure time is longer than a preset exposure time, the method further comprises: photographing the first image according to the first exposure time if the first exposure time is shorter than or equal to the preset exposure time; wherein if N is greater than or equal to 3, and the processing the N

    second images to obtain a first specific image comprises:

    selecting, from the N second images, one second image as a reference image;

    separately registering remaining N-1 second images to align with the reference image so as to obtain N-1 third images;

    performing local moving object compensation on the N-1 third images to obtain N-1 fourth images; and

    obtaining the first specific image according to pixel values of all pixels in the reference image and pixel values of all pixels in the N-1 fourth images;

    wherein the performing local moving object compensation on the N-1 third images to obtain N-1 fourth images comprises:
    separately performing, according to the following steps, the local moving object compensation on each third image of the N-1 third images to obtain the N-1 fourth images:

    for the jth pixel comprised in this third image, determining (301) whether an absolute value of a difference between a pixel value of the jth pixel and a pixel value of the jth pixel in the reference image is greater than or equal to a preset threshold; and

    if the absolute value of the difference between the pixel value of the jth pixel in this third image and the pixel value of the jth pixel in the reference image is greater than or equal to the preset threshold (302), setting the pixel value of the jth pixel in the corresponding fourth image to the pixel value of the jth pixel in the reference image, wherein j is any integer from 1 to M, and M is a total quantity of pixels comprised in the reference image;

    wherein after the determining whether an absolute value of a difference between a pixel value of the jth pixel in this third image and a pixel value of the jth pixel in the reference image is greater than or equal to a preset threshold, the method further comprises:

    keeping the pixel value of the jth pixel in this third image unchanged and setting the pixel value of the jth pixel of the corresponding fourth image to the pixel value of the jth pixel in this third image if the absolute value of the difference between the pixel value of the jth pixel in this third image and the pixel value of the jth pixel in the reference image is less than the preset threshold;

    wherein the obtaining the first specific image according to pixel values of all pixels in the reference image and pixel values of all pixels in the N-1 fourth images comprises:

    summing (401) a pixel value of the ith pixel in the reference image and a pixel value of the ith pixel in each of the N-1 fourth images, wherein i is any integer from 1 to M, and M is the total quantity of the pixels comprised in the reference image; and

    obtaining (402) the first specific image according to the summed pixel values.


     
    2. The method according to claim 1, wherein the separately registering remaining N-1 second images to align with the reference image so as to obtain N-1 third images comprises:
    for each image of the remaining N-1 second images, separately determining (201) a transformation matrix between this second image and the reference image, and registering (202), by using the transformation matrix, this second image to align with the reference image so as to obtain a third image corresponding to this second image, wherein the transformation matrix is used to indicate a relative motion relationship between this second image and the reference image.
     
    3. The method according to claim 1 or 2, wherein the obtaining the first specific image according to the summed pixel values comprises:

    if a pixel value of a pixel in the first specific image exceeds a maximum pixel value of the display device obtaining a second specific image according to the summed pixel values; and

    adjusting luminance and chrominance of the second specific image to obtain the first specific image.


     
    4. The method according to claim 3, wherein the adjusting luminance and chrominance of the second specific image to obtain the first specific image comprises:

    adjusting the luminance of the second specific image according to a luminance histogram; and

    adjusting the chrominance of the second specific image according to a compression degree of the adjusted luminance to obtain the first specific image.


     
    5. A computer storage medium, wherein the computer storage medium stores a program, and when the program is being executed, the steps according to any one of claims 1 to 4 are comprised.
     
    6. An image processing apparatus, comprising:

    a determining module (501), configured to: determine a first exposure time required for photographing a first image;

    a judging module (502), configured to determine whether the first exposure time is longer than a preset exposure time, wherein a motion blurring degree corresponding to an image photographed using the preset exposure time is less than or equal to a preset motion blurring degree;

    a photographing module (503), configured to separately photograph N second images using the preset exposure time if the first exposure time is longer than the preset exposure time, wherein a scene corresponding to the N second images is the same as a scene corresponding to the first image, and N is a positive integer; and

    a processing module (504), configured to process the N second images to obtain a first specific image, wherein a motion blurring degree of the first specific image is less than a motion blurring degree of the first image photographed according to the first exposure time;

    wherein the processing module (504) is further configured to: after the judging module (502) determines if the first exposure time is longer than the preset exposure time, photograph the first image according to the first exposure time if the first exposure time is shorter than or equal to the preset exposure time;

    wherein N is greater than or equal to 3, and the processing module (504) is specifically configured to:

    select, from the N second images, one second image as a reference image;

    separately register remaining N-1 second images to align with the reference image so as to obtain N-1 third images;

    perform local moving object compensation on the N-1 third images to obtain N-1 fourth images; and

    obtain the first specific image according to pixel values of all pixels in the reference image and pixel values of all pixels in the N-1 fourth images;

    wherein the processing module (504) is specifically configured to perform local moving object compensation on the N-1 third images to obtain N-1 fourth images is specifically:
    separately performing, according to the following steps, the local moving object compensation on each third image of the N-1 third images to obtain the N-1 fourth images:

    for the jth pixel comprised in this third image, determining whether an absolute value of a difference between a pixel value of the jth pixel in this third image and a pixel value of the jth pixel in the reference image is greater than or equal to a preset threshold; and

    if the absolute value of the difference between the pixel value of the jth pixel in this third image and the pixel value of the jth pixel in the reference image is greater than or equal to the preset threshold, setting the pixel value of the jth pixel in the corresponding fourth image to the pixel value of the jth pixel in the reference image as the pixel value of the jth pixel, wherein j is any integer from 1 to M, and M is a total quantity of pixels comprised in the reference image;

    wherein the processing module (504) is further configured to: after determining whether the absolute value of the difference between the pixel value of the jth pixel in this third image and the pixel value of the jth pixel in the reference image is greater than or equal to the preset threshold, keep the pixel value of the jth pixel in this third image unchanged and set the pixel value of the jth pixel of the corresponding fourth image to the pixel value of the jth pixel in this third image if the absolute value of the difference between the pixel value of the jth pixel in this third image and the pixel value of the jth pixel in the reference image is less than the preset threshold;

    wherein the processing module (504) is specifically configured to obtain the first specific image according to pixel values of all pixels in the reference image and pixel values of all pixels in the N-1 fourth images is specifically: summing a pixel value of the ith pixel in the reference image and a pixel value of the ith pixel in each of the N-1 fourth images, where i is any integer from 1 to M, and M is the total quantity of the pixels included in the reference image; and obtaining the first specific image according to the summed pixel values.


     
    7. The apparatus according to claim 6, wherein that the processing module (504) is specifically configured to separately register remaining N-1 second images to align with the reference image so as to obtain N-1 third images is specifically: for each image of the remaining N-1 second images, separately determining a transformation matrix between this second image and the reference image, and registering, by using the transformation matrix, this second image to align with the reference image so as to obtain a third image corresponding to this second image, wherein the transformation matrix is used to indicate a relative motion relationship between this second image and the reference image.
     


    Ansprüche

    1. Bildverarbeitungsverfahren, das Folgendes umfasst:

    Bestimmen (101) einer ersten Belichtungszeit, die zum Fotografieren eines ersten Bildes notwendig ist;

    Bestimmen (102), ob die erste Belichtungszeit länger als eine voreingestellte Belichtungszeit ist, wobei ein Bewegungsunschärfegrad, der einem unter Verwendung der voreingestellten Belichtungszeit aufgenommenen Bild entspricht, geringer als ein oder gleich einem voreingestellten Bewegungsunschärfegrad ist;

    getrenntes Fotografieren (103) von N zweiten Bildern unter Verwendung der eingestellten Belichtungszeit, falls die erste Belichtungszeit länger als die voreingestellte Belichtungszeit ist, wobei eine Szene, die den N zweiten Bildern entspricht, gleich einer Szene ist, die dem ersten Bild entspricht, und N eine positive ganze Zahl ist; und

    Verarbeiten (104) der N zweiten Bilder, um ein erstes spezielles Bild zu erhalten, wobei ein Bewegungsunschärfegrad des ersten speziellen Bildes geringer als ein Bewegungsunschärfegrad des ersten Bildes ist, das gemäß der ersten Belichtungszeit fotografiert wird;

    wobei das Verfahren nach dem Bestimmen, ob die erste Belichtungszeit länger als eine voreingestellte Belichtungszeit ist, ferner Folgendes umfasst: Fotografieren des ersten Bildes gemäß der ersten Belichtungszeit, falls die erste Belichtungszeit kürzer als die oder gleich der voreingestellten Belichtungszeit ist; wobei N größer als oder gleich 3 ist, und

    das Verarbeiten der N zweiten Bilder, um ein erstes spezielles Bild zu erhalten, Folgendes umfasst:

    Auswählen eines zweiten Bildes aus den N zweiten Bildern als ein Referenzbild;

    getrenntes Registrieren verbleibender N-1 zweiter Bilder zur Ausrichtung mit dem Referenzbild, sodass N-1 dritte Bilder erhalten werden;

    Durchführen einer lokalen Bewegungsobjektkompensation an den N-1 dritten Bildern, um N-1 vierte Bilder zu erhalten; und

    Erhalten des ersten speziellen Bildes gemäß Pixelwerten aller Pixel in dem Referenzbild und Pixelwerten aller Pixel in den N-1 vierten Bildern;

    wobei das Durchführen der lokalen Bewegungsobjektkompensation an den N-1 dritten Bildern, um N-1 vierte Bilder zu erhalten, Folgendes umfasst:
    getrenntes Durchführen der lokalen Bewegungsobjektkompensation an jedem dritten Bild der N-1 dritten Bilder gemäß den folgenden Schritten, um die N-1 vierten Bilder zu erhalten:

    für das j-te Pixel, das in diesem dritten Bild enthalten ist, Bestimmen (301), ob ein Absolutwert einer Differenz zwischen einem Pixelwert des j-ten Pixels und einem Pixelwert des j-ten Pixels in dem Referenzbild größer als eine oder gleich einer voreingestellten Schwelle ist; und

    falls der Absolutwert der Differenz zwischen dem Pixelwert des j-ten Pixels in diesem dritten Bild und dem Pixelwert des j-ten Pixels in dem Referenzbild größer als die oder gleich der voreingestellten Schwelle ist (302), Einstellen des Pixelwertes des j-ten Pixels in dem entsprechenden vierten Bild auf den Pixelwert des j-ten Pixels in dem Referenzbild, wobei j eine beliebige ganze Zahl von 1 bis M ist und M eine Gesamtanzahl an Pixeln ist, die in dem Referenzbild enthalten sind;

    wobei das Verfahren nach dem Bestimmen, ob ein Absolutwert einer Differenz zwischen einem Pixelwert des j-ten Pixels in diesem dritten Bild und einem Pixelwert des j-ten Pixels in dem Referenzbild größer als eine oder gleich einer voreingestellten Schwelle ist, ferner Folgendes umfasst:

    unverändertes Beibehalten des Pixelwertes des j-ten Pixels in diesem dritten Bild und Einstellen des Pixelwertes des j-ten Pixels des entsprechenden vierten Bildes auf den Pixelwert des j-ten Pixels in diesem dritten Bild, falls der Absolutwert der Differenz zwischen dem Pixelwert des j-ten Pixels in diesem dritten Bild und dem Pixelwert des j-ten Pixels in dem Referenzbild geringer als die voreingestellte Schwelle ist;

    wobei das Erhalten des ersten speziellen Bildes gemäß den Pixelwerten aller Pixel in dem Referenzbild und Pixelwerten aller Pixel in den N-1 dritten Bildern Folgendes umfasst:

    Summieren (401) eines Pixelwertes des i-ten Pixels in dem Referenzbild und eines Pixelwertes des i-ten Pixels in jedem der N-1 vierten Bilder, wobei i eine beliebige ganze Zahl von 1 bis M ist und M die Gesamtanzahl der Pixel ist, die in dem Referenzbild enthalten sind; und

    Erhalten (402) des ersten speziellen Bildes gemäß den summierten Pixelwerten.


     
    2. Verfahren nach Anspruch 1, wobei das getrennte Registrieren von verbleibenden N-1 zweiten Bildern zum Ausrichten mit dem Referenzbild, sodass N-1 dritte Bilder erhalten werden, Folgendes umfasst:
    für jedes Bild der verbleibenden N-1 zweiten Bilder getrenntes Bestimmen (201) einer Transformationsmatrix zwischen diesem zweiten Bild und dem Referenzbild und Registrieren (202) des zweiten Bildes durch Verwenden der Transformationsmatrix zum Ausrichten mit dem Referenzbild, sodass ein drittes Bild erhalten wird, das diesem zweiten Bild entspricht, wobei die Transformationsmatrix verwendet wird, um eine Relativbewegungsbeziehung zwischen diesem zweiten Bild und dem Referenzbild anzugeben.
     
    3. Verfahren nach Anspruch 1 oder 2, wobei das Erhalten des ersten speziellen Bildes gemäß den summierten Pixelwerten Folgendes umfasst:

    falls ein Pixelwert eines Pixels in dem ersten speziellen Bild einen maximalen Pixelwert der Anzeigevorrichtung überschreitet, Erhalten eines zweiten speziellen Bildes gemäß den summierten Pixelwerten; und

    Anpassen von Luminanz und Chrominanz des zweiten speziellen Bildes, um das erste spezielle Bild zu erhalten.


     
    4. Verfahren nach Anspruch 3, wobei das Anpassen von Luminanz und Chrominanz des zweiten speziellen Bildes, um das erste spezielle Bild zu erhalten, Folgendes umfasst:

    Anpassen der Luminanz des zweiten speziellen Bildes gemäß einem Luminanzhistogramm; und

    Anpassen der Chrominanz des zweiten speziellen Bildes gemäß einem Kompressionsgrad der angepassten Luminanz, um das erste spezielle Bild zu erhalten.


     
    5. Computerspeichermedium, wobei das Computerspeichermedium ein Programm speichert und, wenn das Programm ausgeführt wird, die Schritte nach einem der Ansprüche 1 bis 4 enthalten sind.
     
    6. Bildverarbeitungseinrichtung, die Folgendes umfasst:

    ein Bestimmungsmodul (501), das zu Folgendem konfiguriert ist: Bestimmen einer ersten Belichtungszeit, die zum Fotografieren eines ersten Bildes notwendig ist;

    ein Beurteilungsmodul (502), das zum Bestimmen konfiguriert ist, ob die erste Belichtungszeit länger als eine voreingestellte Belichtungszeit ist, wobei ein Bewegungsunschärfegrad, der einem unter Verwendung der voreingestellten Belichtungszeit aufgenommenen Bild entspricht, geringer als ein oder gleich einem voreingestellten Bewegungsunschärfegrad ist;

    ein Fotografiermodul (503), das zum getrennten Fotografieren von N zweiten Bildern unter Verwendung der eingestellten Belichtungszeit konfiguriert ist, falls die erste Belichtungszeit länger als die voreingestellte Belichtungszeit ist, wobei eine Szene, die den N zweiten Bildern entspricht, gleich einer Szene ist, die dem ersten Bild entspricht, und N eine positive ganze Zahl ist; und

    ein Verarbeitungsmodul (504), das zum Verarbeiten der N zweiten Bilder konfiguriert ist, um ein erstes spezielles Bild zu erhalten, wobei ein Bewegungsunschärfegrad des ersten speziellen Bildes geringer als ein Bewegungsunschärfegrad des ersten Bildes ist, das gemäß der ersten Belichtungszeit fotografiert wird;

    wobei das Verarbeitungsmodul (504) ferner zu Folgendem konfiguriert ist: nachdem das Beurteilungsmodul (502) bestimmt hat, ob die erste Belichtungszeit länger als eine voreingestellte Belichtungszeit ist, Fotografieren des ersten Bildes gemäß der ersten Belichtungszeit, falls die erste Belichtungszeit kürzer als die oder gleich der voreingestellten Belichtungszeit ist;

    wobei N größer als oder gleich 3 ist, und

    das Verarbeitungsmodul (504) speziell zu Folgendem konfiguriert ist:

    Auswählen eines zweiten Bildes aus den N zweiten Bildern als ein Referenzbild;

    getrenntes Registrieren verbleibender N-1 zweiter Bilder zur Ausrichtung mit dem Referenzbild, sodass N-1 dritte Bilder erhalten werden;

    Durchführen einer lokalen Bewegungsobjektkompensation an den N-1 dritten Bildern, um N-1 vierte Bilder zu erhalten; und

    Erhalten des ersten speziellen Bildes gemäß Pixelwerten aller Pixel in dem Referenzbild und Pixelwerten aller Pixel in den N-1 vierten Bildern;

    wobei, dass das Verarbeitungsmodul (504) speziell zum Durchführen einer lokalen Bewegungsobjektkompensation an den N-1 dritten Bildern konfiguriert ist, um N-1 vierte Bilder zu erhalten, speziell Folgendes ist:
    getrenntes Durchführen der lokalen Bewegungsobjektkompensation an jedem dritten Bild der N-1 dritten Bilder gemäß den folgenden Schritten, um die N-1 vierten Bilder zu erhalten:

    für das j-te Pixel, das in diesem dritten Bild enthalten ist, Bestimmen, ob ein Absolutwert einer Differenz zwischen einem Pixelwert des j-ten Pixels in diesem dritten Pixel und einem Pixelwert des j-ten Pixels in dem Referenzbild größer als eine oder gleich einer voreingestellten Schwelle ist; und

    falls der Absolutwert der Differenz zwischen dem Pixelwert des j-ten Pixels in diesem dritten Bild und dem Pixelwert des j-ten Pixel in dem Referenzbild größer als die oder gleich der voreingestellten Schwelle ist, Einstellen des Pixelwertes des j-ten Pixels in dem entsprechenden vierten Bild auf den Pixelwert des j-ten Pixels in dem Referenzbild als den Pixelwert des j-ten Pixels, wobei j eine beliebige ganze Zahl von 1 bis M ist und M eine Gesamtanzahl an Pixeln ist, die in dem Referenzbild enthalten sind;

    wobei das Verarbeitungsmodul (504) ferner zu Folgendem konfiguriert ist: nach dem Bestimmen, ob der Absolutwert der Differenz zwischen dem Pixelwert des j-ten Pixels in diesem dritten Bild und dem Pixelwert des j-ten Pixels in dem Referenzbild größer als die oder gleich der voreingestellten Schwelle ist, unverändertes Beibehalten des Pixelwertes des j-ten Pixels in diesem dritten Bild und Einstellen des Pixelwertes des j-ten Pixels des entsprechenden vierten Bildes auf den Pixelwert des j-ten Pixels in diesem dritten Bild, falls der Absolutwert der Differenz zwischen dem Pixelwert des j-ten Pixels in diesem dritten Bild und dem Pixelwert des j-ten Pixels in dem Referenzbild geringer als die voreingestellte Schwelle ist;

    wobei, dass das Verarbeitungsmodul (504) speziell zum Erhalten des ersten speziellen Bildes gemäß Pixelwerten aller Pixel in dem Referenzbild und Pixelwerten aller Pixel in den N-1 dritten Bildern konfiguriert ist, speziell Folgendes ist:
    Summieren eines Pixelwertes des i-ten Pixels in dem Referenzbild und eines Pixelwertes des i-ten Pixels in jedem der N-1 vierten Bilder, wobei i eine beliebige ganze Zahl von 1 bis M ist und M die Gesamtanzahl der Pixel ist, die in dem Referenzbild enthalten sind; und Erhalten des ersten speziellen Bildes gemäß den summierten Pixelwerten.


     
    7. Einrichtung nach Anspruch 6, wobei, dass das Verarbeitungsmodul (504) speziell zum getrennten Registrieren von verbleibenden N-1 zweiten Bildern zum Ausrichten mit dem Referenzbild konfiguriert ist, sodass N-1 dritte Bilder erhalten werden, speziell Folgendes ist: für jedes Bild der verbleibenden N-1 zweiten Bilder getrenntes Bestimmen einer Transformationsmatrix zwischen diesem zweiten Bild und dem Referenzbild und Registrieren dieses zweiten Bildes durch Verwenden der Transformationsmatrix zum Ausrichten mit dem Referenzbild, sodass ein drittes Bild erhalten wird, das diesem zweiten Bild entspricht, wobei die Transformationsmatrix verwendet wird, um eine Relativbewegungsbeziehung zwischen diesem zweiten Bild und dem Referenzbild anzugeben.
     


    Revendications

    1. Procédé de traitement d'image, comprenant :

    la détermination (101) d'une première durée d'exposition nécessaire à la photographie d'une première image ;

    la détermination (102) si la première durée d'exposition est supérieure ou non à une durée d'exposition préétablie, un degré de flou de mouvement correspondant à une image photographiée à l'aide de la durée d'exposition préétablie étant inférieur ou égal à un degré de flou de mouvement préétabli ;

    la photographie séparée (103) de N deuxièmes images à l'aide de la durée d'exposition préétablie si la première durée d'exposition est supérieure à la durée d'exposition préétablie, une scène correspondant aux N deuxièmes images étant identique à une scène correspondant à la première image et N étant un entier positif ; et

    le traitement (104) des N deuxièmes images afin d'obtenir une première image spécifique, un degré de flou de mouvement de la première image spécifique étant inférieur à un degré de flou de mouvement de la première image photographiée selon la première durée d'exposition ;

    après la détermination si la première durée d'exposition est supérieure à une durée d'exposition préétablie, le procédé comprenant en outre : la photographie de la première image selon la première durée d'exposition si la première durée d'exposition est inférieure ou égale à la durée d'exposition préétablie ; N étant supérieur ou égal à 3, et

    le traitement des N deuxièmes images afin d'obtenir une première image spécifique comprenant :

    la sélection, à partir des N deuxièmes images, d'une deuxième image comme image de référence ;

    la mise en coïncidence séparée de N-1 deuxièmes images restantes afin de les aligner avec l'image de référence dans le but d'obtenir N-1 troisièmes images ;

    la réalisation d'une compensation locale d'objet en mouvement sur les N-1 troisièmes images afin d'obtenir N-1 quatrièmes images ; et

    l'obtention de la première image spécifique selon des valeurs de pixel de tous les pixels dans l'image de référence et des valeurs de pixel de tous les pixels dans les N-1 quatrièmes images ;

    la réalisation d'une compensation locale d'objet en mouvement sur les N-1 troisièmes images afin d'obtenir N-1 quatrièmes images comprenant :
    la réalisation séparée, selon les étapes suivantes, de la compensation locale d'objet en mouvement sur chaque troisième image des N-1 troisièmes images afin d'obtenir les N-1 quatrièmes images :

    pour le j-ème pixel contenu dans cette troisième image, la détermination (301) si une valeur absolue d'une différence entre une valeur de pixel du j-ème pixel et une valeur de pixel du j-ème pixel dans l'image de référence est supérieure ou égale ou non à un seuil préétabli ; et

    si la valeur absolue de la différence entre la valeur de pixel du j-ème pixel dans cette troisième image et la valeur de pixel du j-ème pixel dans l'image de référence est supérieure ou égale au seuil préétabli (302), l'assignation à la valeur de pixel du j-ème pixel dans la quatrième image correspondante de la valeur de pixel du j-ème pixel dans l'image de référence, j étant un entier quelconque compris entre 1 et M, et M représentant une quantité totale de pixels contenus dans l'image de référence ;

    après la détermination si une valeur absolue d'une différence entre une valeur de pixel du j-ème pixel dans cette troisième image et une valeur de pixel du j-ème pixel dans l'image de référence est supérieure ou égale ou non à un seuil préétabli, le procédé comprenant en outre :

    le maintien de la valeur de pixel du j-ème pixel dans cette troisième image inchangée et l'assignation à la valeur de pixel du j-ème pixel de la quatrième image correspondante de la valeur de pixel du j-ème pixel dans cette troisième image si la valeur absolue de la différence entre la valeur de pixel du j-ème pixel dans cette troisième image et la valeur de pixel du j-ème pixel dans l'image de référence est inférieure au seuil préétabli ;

    l'obtention de la première image spécifique selon des valeurs de pixel de tous les pixels dans l'image de référence et des valeurs de pixel de tous les pixels dans les N-1 quatrièmes images comprenant :

    la sommation (401) d'une valeur de pixel du i-ème pixel dans l'image de référence et d'une valeur de pixel du i-ème pixel dans chacune des N-1 quatrièmes images, i étant un entier quelconque compris entre 1 et M, et M représentant la quantité totale des pixels contenus dans l'image de référence ; et

    l'obtention (402) de la première image spécifique selon les valeurs de pixel sommées.


     
    2. Procédé selon la revendication 1, dans lequel la mise en coïncidence séparée de N-1 deuxièmes images restantes afin de les aligner avec l'image de référence dans le but d'obtenir N-1 troisièmes images comprend :
    pour chaque image des N-1 deuxièmes images restantes, la détermination séparée (201) d'une matrice de transformation entre cette deuxième image et l'image de référence, et la mise en coïncidence (202), à l'aide de la matrice de transformation, de cette deuxième image afin de l'aligner avec l'image de référence dans le but d'obtenir une troisième image correspondant à cette deuxième image, la matrice de transformation servant à indiquer une relation de mouvement relatif entre cette deuxième image et l'image de référence.
     
    3. Procédé selon la revendication 1 ou 2, dans lequel l'obtention de la première image spécifique selon les valeurs de pixel sommées comprend :

    si une valeur de pixel d'un pixel dans la première image spécifique dépasse une valeur de pixel maximale du dispositif d'affichage, l'obtention d'une deuxième image spécifique selon les valeurs de pixel sommées ; et

    l'ajustement d'une luminance et d'une chrominance de la deuxième image spécifique afin d'obtenir la première image spécifique.


     
    4. Procédé selon la revendication 3, dans lequel l'ajustement d'une luminance et d'une chrominance de la deuxième image spécifique afin d'obtenir la première image spécifique comprend :

    l'ajustement de la luminance de la deuxième image spécifique selon un histogramme de luminance ; et

    l'ajustement de la chrominance de la deuxième image spécifique selon un degré de compression de la luminance ajustée afin d'obtenir la première image spécifique.


     
    5. Support d'enregistrement d'ordinateur, dans lequel est enregistré un programme, l'exécution du programme mettant en oeuvre les étapes selon l'une quelconque des revendications 1 à 4.
     
    6. Appareil de traitement d'image, comprenant :

    un module de détermination (501), configuré pour : déterminer une première durée d'exposition nécessaire à la photographie d'une première image ;

    un module d'évaluation (502), configuré pour déterminer si la première durée d'exposition est supérieure ou non à une durée d'exposition préétablie, un degré de flou de mouvement correspondant à une image photographiée à l'aide de la durée d'exposition préétablie étant inférieur ou égal à un degré de flou de mouvement préétabli ;

    un module de photographie (503), configuré pour photographier séparément N deuxièmes images à l'aide de la durée d'exposition préétablie si la première durée d'exposition est supérieure à la durée d'exposition préétablie, une scène correspondant aux N deuxièmes images étant identique à une scène correspondant à la première image et N étant un entier positif ; et

    un module de traitement (504), configuré pour traiter les N deuxièmes images afin d'obtenir une première image spécifique, un degré de flou de mouvement de la première image spécifique étant inférieur à un degré de flou de mouvement de la première image photographiée selon la première durée d'exposition ;

    le module de traitement (504) étant configuré en outre pour : après que le module d'évaluation (502) a déterminé si la première durée d'exposition est supérieure à la durée d'exposition préétablie, photographier la première image selon la première durée d'exposition si la première durée d'exposition est inférieure ou égale à la durée d'exposition préétablie ;

    N étant supérieur ou égal à 3, et le module de traitement (504) étant plus particulièrement configuré pour :

    sélectionner, à partir des N deuxièmes images, une deuxième image comme image de référence ;

    mettre en coïncidence séparément N-1 deuxièmes images restantes afin de les aligner avec l'image de référence dans le but d'obtenir N-1 troisièmes images ;

    réaliser une compensation locale d'objet en mouvement sur les N-1 troisièmes images afin d'obtenir N-1 quatrièmes images ; et

    obtenir la première image spécifique selon des valeurs de pixel de tous les pixels dans l'image de référence et des valeurs de pixel de tous les pixels dans les N-1 quatrièmes images ;

    le fait que le module de traitement (504) est plus particulièrement configuré pour réaliser une compensation locale d'objet en mouvement sur les N-1 troisièmes images afin d'obtenir N-1 quatrièmes images consistant plus particulièrement en :
    la réalisation séparée, selon les étapes suivantes, de la compensation locale d'objet en mouvement sur chaque troisième image des N-1 troisièmes images afin d'obtenir les N-1 quatrièmes images :

    pour le j-ème pixel contenu dans cette troisième image, la détermination si une valeur absolue d'une différence entre une valeur de pixel du j-ème pixel dans cette troisième image et une valeur de pixel du j-ème pixel dans l'image de référence est supérieure ou égale ou non à un seuil préétabli ; et

    si la valeur absolue de la différence entre la valeur de pixel du j-ème pixel dans cette troisième image et la valeur de pixel du j-ème pixel dans l'image de référence est supérieure ou égale au seuil préétabli, l'assignation à la valeur de pixel du j-ème pixel dans la quatrième image correspondante de la valeur de pixel du j-ème pixel dans l'image de référence, comme valeur de pixel du j-ème pixel, j étant un entier quelconque compris entre 1 et M, et M représentant une quantité totale de pixels contenus dans l'image de référence ;

    le module de traitement (504) étant configuré en outre pour : après avoir déterminé si la valeur absolue de la différence entre la valeur de pixel du j-ème pixel dans cette troisième image et la valeur de pixel du j-ème pixel dans l'image de référence est supérieure ou égale ou non au seuil préétabli, maintenir la valeur de pixel du j-ème pixel dans cette troisième image inchangée et assigner à la valeur de pixel du j-ème pixel de la quatrième image correspondante la valeur de pixel du j-ème pixel dans cette troisième image si la valeur absolue de la différence entre la valeur de pixel du j-ème pixel dans cette troisième image et la valeur de pixel du j-ème pixel dans l'image de référence est inférieure au seuil préétabli ;

    le fait que le module de traitement (504) est plus particulièrement configuré pour obtenir la première image spécifique selon des valeurs de pixel de tous les pixels dans l'image de référence et des valeurs de pixel de tous les pixels dans les N-1 quatrièmes images consistant plus particulièrement en : la sommation d'une valeur de pixel du i-ème pixel dans l'image de référence et d'une valeur de pixel du i-ème pixel dans chacune des N-1 quatrièmes images, i étant un entier quelconque compris entre 1 et M, et M représentant la quantité totale des pixels contenus dans l'image de référence ; et l'obtention de la première image spécifique selon les valeurs de pixel sommées.


     
    7. Appareil selon la revendication 6, dans lequel le fait que le module de traitement (504) est plus particulièrement configuré pour mettre en coïncidence séparément N-1 deuxièmes images restantes afin de les aligner avec l'image de référence dans le but d'obtenir N-1 troisièmes images consiste plus particulièrement en : pour chaque image des N-1 deuxièmes images restantes, la détermination séparée d'une matrice de transformation entre cette deuxième image et l'image de référence, et la mise en coïncidence, à l'aide de la matrice de transformation, de cette deuxième image afin de l'aligner avec l'image de référence dans le but d'obtenir une troisième image correspondant à cette deuxième image, la matrice de transformation servant à indiquer une relation de mouvement relatif entre cette deuxième image et l'image de référence.
     




    Drawing















    REFERENCES CITED IN THE DESCRIPTION



    This list of references cited by the applicant is for the reader's convenience only. It does not form part of the European patent document. Even though great care has been taken in compiling the references, errors or omissions cannot be excluded and the EPO disclaims all liability in this regard.

    Patent documents cited in the description