Exposure parameter determination method, image processing method, electronic equipment and storage medium
By using the preview image to judge the motion scene and determine the exposure parameter when shooting high dynamic range images, the problem of poor handling of the motion scene in the prior art is solved, and efficient exposure parameter setting and image quality improvement are achieved.
Patent Information
- Application Number
- CN202311008234.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-10
- Publication Date
- 2025-02-18
AI Technical Summary
In the prior art, when shooting high dynamic range images, it is difficult to effectively judge and process motion scenes, resulting in inaccurate determination of exposure parameters and affecting image quality.
By acquiring at least two adjacent preview images, the background subtraction method and the scale invariant feature transformation algorithm are used to determine whether the scene to be shot is a motion scene. If it is a motion scene, the exposure value corresponding to the high dynamic range is determined based on the scene information, and Exposure parameters are calculated by automatic exposure control.
It realizes accurate determination of exposure parameters when shooting sports scenes, ensures the high dynamic range effect of the image, reduces the equipment reaction time, and improves the shooting effect.
Smart Images

Figure CN119485049A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technology, and in particular to an exposure parameter determination method, an image processing method, an electronic device, and a storage medium. Background Art
[0002] High Dynamic Range (HDR) has become an increasingly popular imaging technology due to its advantages of rich imaging layers, strong sense of reality, and ability to restore light and shadow effects close to real scenes. Currently, users can use the terminal's camera to shoot high dynamic range images. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the present disclosure provides an exposure parameter determination method, an image processing method, an electronic device and a storage medium.
[0004] According to a first aspect of an embodiment of the present disclosure, a method for determining an exposure parameter is provided, comprising:
[0005] Acquire at least two adjacent preview image frames of the scene to be captured;
[0006] Determining whether the scene to be captured is a motion scene according to the at least two preview image frames;
[0007] In response to the scene to be captured being a motion scene, determining a set of preset exposure values corresponding to a high dynamic range according to scene information of the scene to be captured;
[0008] The exposure parameter is obtained by automatic exposure control calculation according to the exposure value.
[0009] In some embodiments, determining whether the scene to be captured is a motion scene according to the at least two preview image frames includes:
[0010] Determine the motion area in the at least two preview image frames based on a background subtraction method;
[0011] For each of the at least two preview images: based on a scale-invariant feature transformation algorithm, calculating a first feature point in a motion region of the preview image and a first feature vector corresponding to the first feature point; performing Euclidean distance matching of the first feature vector of the preview image with the first feature vector of preview images other than the preview image to obtain a plurality of first feature matching pairs;
[0012] Calculating the deviation value of the pixel position of each first feature matching pair, and taking the first feature matching pair whose corresponding deviation value is greater than or equal to a preset deviation threshold as a target feature matching pair;
[0013] In response to the number of the target feature matching pairs being greater than or equal to a number threshold, it is determined that the scene to be captured is a motion scene.
[0014] In some embodiments, the calculating, based on a scale-invariant feature transformation algorithm, a first feature point in a motion region of the preview image and a first feature vector corresponding to the first feature point comprises:
[0015] Generating Gaussian difference pyramids at different scales of the motion region to construct first characteristic scale spaces at different scales;
[0016] Performing spatial extreme point detection on the motion region based on the two-dimensional image space and each of the first characteristic scale spaces to obtain a plurality of first spatial extreme points;
[0017] Removing unstable points from the plurality of first spatial extreme value points to obtain the first characteristic points corresponding to each of the first characteristic scale spaces;
[0018] For each of the first feature points: mapping the first feature point to the preview image; and constructing the first feature vector corresponding to the first feature point according to feature distribution in a preset area centered on the first feature point.
[0019] In some embodiments, before calculating the deviation value of the pixel position of each feature matching pair, the exposure parameter determination method further includes:
[0020] Screening the plurality of first feature matching pairs based on a random sampling consensus algorithm;
[0021] The calculating the deviation value of the pixel position of each first feature matching pair includes:
[0022] For each of the screened first feature matching pairs, the deviation value of its pixel position is calculated.
[0023] According to a second aspect of an embodiment of the present disclosure, there is provided an image processing method, including:
[0024] In response to the start-up of a shooting application program of the terminal, a preview image of the scene to be shot is acquired in real time through an image sensor;
[0025] Determine the exposure parameters using the exposure parameter determination method provided by any one of the embodiments of the first aspect of the present disclosure;
[0026] In response to a user's shooting instruction for the scene to be shot, obtaining a timestamp corresponding to the shooting instruction, and determining whether the scene to be shot is a motion scene;
[0027] In response to the scene to be captured being a motion scene, searching for the preview image according to the timestamp, and taking the preview image matching the timestamp as a reference image;
[0028] According to the exposure parameters, acquiring an overexposed image and an underexposed image of the scene to be photographed through the image sensor;
[0029] A target image with a high dynamic range of the scene to be photographed is obtained according to the overexposed image, the underexposed image and the reference image.
[0030] In some embodiments, after searching for the preview image according to the timestamp and taking the preview image matching the timestamp as the reference image, the method further includes:
[0031] Acquire the preview images of the first N frames of the reference image, where N is a positive integer;
[0032] According to the preview images of the first N frames, the reference image is processed based on a super-resolution algorithm;
[0033] The step of obtaining a target image with a high dynamic range of the scene to be photographed according to the overexposed image, the underexposed image and the reference image comprises:
[0034] The target image is obtained according to the overexposed image, the underexposed image and the processed reference image.
[0035] In some embodiments, obtaining a target image with a high dynamic range of the scene to be photographed according to the overexposed image, the underexposed image and the reference image includes:
[0036] Determine a fusion area in the overexposed image and the underexposed image that corresponds to the reference image;
[0037] According to the fusion area, the overexposed image, the underexposed image and the reference image are processed based on an image fusion algorithm to obtain the target image.
[0038] In some embodiments, determining a fusion area in the overexposed image and the underexposed image corresponding to the reference image includes:
[0039] Based on a scale-invariant feature transformation algorithm, second feature points of the overexposed image, the underexposed image, and the reference image and second feature vectors corresponding to the second feature points are respectively calculated;
[0040] Calculating a hash value of the reference image;
[0041] For each of the overexposed image and the underexposed image: perform Euclidean distance matching on the second feature vector of the image and the second feature vector of the reference image to obtain a plurality of second feature matching pairs; determine a feature matching area of the image according to the plurality of second feature matching pairs; estimate a cropped area in the feature matching area according to the field of view of the reference image; determine a similar area in the cropped area corresponding to the reference image; upsample the similar area according to the size of the reference image; calculate a hash value of the upsampled similar area; determine a similarity corresponding to the similar area according to the hash value of the similar area and the hash value of the reference image; and in response to the similarity of the similar area being less than or equal to a preset similarity threshold, determine the similar area as the fusion area.
[0042] In some embodiments, the calculating of the second feature points of the overexposed image, the underexposed image, and the reference image and the second feature vectors corresponding to the second feature points based on the scale-invariant feature transformation algorithm respectively includes:
[0043] For each of the overexposed image, the underexposed image, and the reference image:
[0044] Generate Gaussian difference pyramids at different scales of the image to construct second feature scale spaces at different scales;
[0045] Performing spatial extreme point detection on the image based on the two-dimensional image space and each of the second characteristic scale spaces to obtain a plurality of second spatial extreme points;
[0046] Removing unstable points from the plurality of second spatial extreme value points to obtain the second characteristic points corresponding to each of the second characteristic scale spaces;
[0047] For each of the second feature points: the second feature point is mapped to the image; and the second feature vector corresponding to the second feature point is constructed according to the feature distribution in a preset area centered on the second feature point.
[0048] In some embodiments, determining the feature matching area of the image according to the plurality of second feature matching pairs includes:
[0049] Screening the plurality of second feature matching pairs based on a random sampling consensus algorithm;
[0050] The feature matching area is determined according to the screened second feature matching pairs.
[0051] In some embodiments, determining a similar area in the cropped area corresponding to the reference image includes:
[0052] Calculating the pixel-level similarity between the cropped area and the reference image to determine a candidate area in the cropped area;
[0053] Calculating a motion offset between the candidate region and the reference image;
[0054] In response to the motion offset being less than or equal to a preset offset threshold, the candidate region is determined as the similar region.
[0055] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0056] processor;
[0057] a memory for storing processor-executable instructions;
[0058] In which, the processor is configured to run the executable instructions to implement the steps of the exposure parameter determination method provided in any embodiment of the first aspect of the present disclosure, or the processor is configured to run the executable instructions to implement the steps of the image processing method provided in any embodiment of the second aspect of the present disclosure.
[0059] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the exposure parameter determination method provided in any embodiment of the first aspect of the present disclosure are implemented; or, when the program instructions are executed by a processor, the steps of the image processing method provided in any embodiment of the second aspect of the present disclosure are implemented.
[0060] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: obtaining at least two adjacent preview images of the scene to be shot; determining whether the scene to be shot is a motion scene based on at least two preview images; in response to the scene to be shot being a motion scene, determining a set of preset exposure values corresponding to a high dynamic range based on the scene information of the scene to be shot; and obtaining exposure parameters through automatic exposure control calculation based on the exposure values. Thus, by determining whether the scene to be shot is a motion scene, a set of exposure values corresponding to a high dynamic range is determined, and the exposure parameters are determined in the preview process based on this, so as to ensure the high dynamic range effect of the image collected during shooting, reduce the device response time during actual shooting, and improve the shooting effect of motion scenes.
[0061] And, in response to the start-up of the shooting application of the terminal, a preview image of the scene to be shot is obtained in real time through the image sensor; the exposure parameters are determined by using the above-mentioned exposure parameter determination method; in response to the shooting instruction of the user for the scene to be shot, the timestamp corresponding to the shooting instruction is obtained, and it is determined whether the scene to be shot is a motion scene; in response to the scene to be shot being a motion scene, the preview image is searched according to the timestamp, and the preview image matching the timestamp is used as the reference image; according to the exposure parameters, an overexposed image and an underexposed image of the scene to be shot are obtained through the image sensor; according to the overexposed image, the underexposed image and the reference image, a target image with a high dynamic range of the scene to be shot is obtained. Thus, a reference image corresponding to the moment when the user issues the shooting instruction is obtained according to the timestamp matching, and the reference image is a reference image with normal exposure obtained according to the exposure parameters, which reduces the frame acquisition time and makes the reference image consistent with the image previewed by the user when the shooting instruction is issued; the overexposed image and the underexposed image are obtained according to the exposure parameters, and the target image with a high dynamic range of the scene to be shot is obtained according to the overexposed image, the underexposed image and the reference image, so as to improve the shooting effect of the motion scene.
[0062] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0064] Figure 1 is a flow chart of a method for determining exposure parameters according to an exemplary embodiment.
[0065] Figure 2 This is a flow chart of an implementation method of step S120 in the embodiment of the present disclosure.
[0066] Figure 3 This is a flow chart of an implementation method of step S122 in the embodiment of the present disclosure.
[0067] Figure 4 A schematic diagram of a differential pyramid provided in an embodiment of the present disclosure.
[0068] Figure 5 A schematic diagram of spatial extreme point detection provided in an embodiment of the present disclosure.
[0069] Figure 6 A schematic diagram of constructing a feature vector provided in an embodiment of the present disclosure.
[0070] Figure 7 This is a flow chart of an implementation method of step S123 in the embodiment of the present disclosure.
[0071] Figure 8 The figure is a flowchart of an image processing method according to an exemplary embodiment.
[0072] Fig. 9 A schematic diagram of obtaining a reference image provided by an embodiment of the present disclosure.
[0073] Fig.10 is a flowchart of another image processing method according to an exemplary embodiment.
[0074] Fig.11 This is a flow chart of an implementation method of step S260 in the embodiment of the present disclosure.
[0075] Fig.12 This is a flow chart of an implementation method of step S262 in the embodiment of the present disclosure.
[0076] Fig.13 This is a flow chart of an implementation method of step S2623 in the embodiment of the present disclosure.
[0077] Fig.14 A schematic diagram of obtaining a high-magnification and high-dynamic-range image provided in an embodiment of the present disclosure.
[0078] Fig.15 Another schematic diagram of obtaining high-magnification and high-dynamic-range images provided in an embodiment of the present disclosure.
[0079] Fig.16 A flowchart of a high-magnification and high-dynamic-range photographing process is shown according to an exemplary embodiment.
[0080] Fig.17 is a block diagram of an electronic device 800 according to an exemplary embodiment. DETAILED DESCRIPTION
[0081] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0082] It should be noted that all actions of acquiring signals, information or data in the present disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the device is located and with the authorization given by the owner of the corresponding device.
[0083] Figure 1FIG. 1 is a flow chart of a method for determining exposure parameters according to an exemplary embodiment. Figure 1 As shown, the method includes the following steps.
[0084] Step S110: Acquire at least two adjacent preview image frames of the scene to be captured.
[0085] After the shooting application of the terminal is started, a preview image is acquired in real time through an image sensor (Sensor) and displayed on a preview interface of the terminal.
[0086] In some embodiments, the at least two preview image frames include a current frame preview image and M preview image frames before the current frame, where M is a positive integer.
[0087] Step S120: determining whether the scene to be captured is a motion scene according to at least two preview image frames.
[0088] Wherein, whether the scene to be shot is a motion scene is determined according to at least two adjacent preview image frames.
[0089] In some embodiments, whether there is a moving object in the scene to be captured is determined based on a motion detection algorithm according to at least two frames of preview images, so as to determine whether the scene to be captured is a motion scene.
[0090] Step S130 : In response to the scene to be captured being a motion scene, a set of preset exposure values (EV) corresponding to a high dynamic range is determined according to scene information of the scene to be captured.
[0091] The scene information represents the environmental conditions corresponding to the scene to be photographed, such as lighting conditions.
[0092] In some embodiments, different exposure ratios are dynamically set according to scene information, and illustratively, five levels of intensity are correspondingly set.
[0093] In some embodiments, a set of exposure values is selected from a preset exposure value list (EVlist) corresponding to a high dynamic range according to scene information.
[0094] In some embodiments, in response to the scene to be captured being a motion scene, the shooting mode is adjusted to a high dynamic range mode or a high magnification high dynamic range (ZoomHDR) mode; in some embodiments, the motion scene may also be referred to as a high dynamic range motion scene and a high magnification high dynamic range scene, etc., but is not limited thereto.
[0095] In some embodiments, the method further includes: in response to the scene to be captured being a motion scene, adjusting the image sensor to a dual conversion gain (DCG) mode, and selecting to use a high conversion gain (HCG) or a low conversion gain (LCG) according to scene information. In a strong light environment, to prevent overexposure during shooting, a lower light sensitivity is obtained based on a low conversion gain, and in a weak light environment, to obtain more useful information, a higher light sensitivity is obtained based on a high conversion gain.
[0096] In some embodiments, in response to the scene to be captured not being a motion scene, the image sensor is kept in a regular capture mode, and an exposure value corresponding to normal exposure is determined according to the scene information.
[0097] Step S140: Calculate exposure parameters through automatic exposure control (AEC) according to the exposure value.
[0098] In some embodiments, the exposure parameters include the exposure time calculated by the automatic exposure control; in some embodiments, the exposure parameters include the number of exposure rows (FrameLength) corresponding to the image sensor and the number of exposures (LineCount) for each row.
[0099] The disclosed embodiment provides a method for determining exposure parameters, the method comprising: obtaining at least two adjacent preview frames of a scene to be shot; determining whether the scene to be shot is a motion scene according to the at least two preview frames; in response to the scene to be shot being a motion scene, determining a set of preset exposure values corresponding to a high dynamic range according to scene information of the scene to be shot; and obtaining exposure parameters through automatic exposure control calculation according to the exposure values. Thus, by determining whether the scene to be shot is a motion scene, a set of exposure values corresponding to a high dynamic range is determined, and the exposure parameters are determined in the preview process, thereby ensuring the high dynamic range effect of the image collected during shooting, reducing the device response time during actual shooting, and improving the shooting effect of motion scenes.
[0100] Figure 2 FIG. 1 is a flow chart of an implementation method of step S120 in the embodiment of the present disclosure. Figure 2 As shown, step S120, determining whether the scene to be captured is a motion scene according to at least two preview images, includes:
[0101] Step S121: Determine the motion area in at least two preview image frames based on the background subtraction method.
[0102] Wherein, the corresponding foreground object is determined based on at least two adjacent preview image frames based on a background subtraction method, and the motion area in each preview image is estimated based on the position of the foreground object.
[0103] Step S122, for each of at least two preview images: based on a scale-invariant feature transform (SIFT) algorithm, calculate a first feature point in a motion region of the preview image and a first feature vector corresponding to the first feature point; perform Euclidean distance matching on the first feature vector of the preview image with a first feature vector of a preview image other than the preview image to obtain a plurality of first feature matching pairs.
[0104] Among them, the feature information extracted based on the scale-invariant feature transformation algorithm has the characteristics of spatial scale invariance and can be used to detect the scaling, rotation and translation of the target.
[0105] The first feature matching pair includes a pair of first feature points corresponding to the matching first feature vectors.
[0106] In some embodiments, the feature vector may also be referred to as a feature descriptor, which is not limited thereto.
[0107] Step S123: Calculate the deviation value of the pixel position of each first feature matching pair, and take the first feature matching pair whose corresponding deviation value is greater than or equal to the preset deviation threshold as the target feature matching pair.
[0108] Step S124: In response to the number of target feature matching pairs being greater than or equal to the number threshold, determining that the scene to be captured is a motion scene.
[0109] Among them, if the deviation value of the matched first feature point in the adjacent preview image is greater than or equal to the deviation threshold, it is considered that an offset has occurred. If the number of offset first feature points is greater than or equal to the number threshold, it is determined that the scene to be captured is a motion scene.
[0110] Therefore, whether the scene to be shot is a motion scene is judged through background subtraction method and scale-invariant feature transformation algorithm, so as to improve the accuracy of motion scene judgment and determine the exposure parameters corresponding to the high dynamic range.
[0111] Figure 3 FIG. 1 is a flow chart of an implementation method of step S122 in the embodiment of the present disclosure. Figure 3 As shown, in step S122, based on the scale-invariant feature transformation algorithm, the first feature point in the motion area of the preview image and the first feature vector corresponding to the first feature point are calculated, including:
[0112] Step S1221: Generate Gaussian difference pyramids at different scales of the motion region to construct first characteristic scale spaces at different scales.
[0113] Figure 4 A schematic diagram of a differential pyramid provided by an embodiment of the present disclosure. Figure 4 As shown in the figure, Gaussian difference pyramids are generated at different scales to construct feature scale spaces at different scales, where arrows indicate the direction of scale descent. A group is also called a sub-octave. The scale of the first group corresponds to the original image, and the second group is the result of downsampling of the first group. The same goes for each group, and the Gaussian difference (DOG) is calculated.
[0114] Step S1222: perform spatial extreme point detection on the motion region based on the two-dimensional image space and each first characteristic scale space to obtain a plurality of first spatial extreme points.
[0115] Figure 5 A schematic diagram of a spatial extreme point detection provided by an embodiment of the present disclosure. Figure 5 As shown, spatial extreme point detection is performed based on the two-dimensional image space and each characteristic scale space. For example, Figure 5 As shown in the figure, for a point in the image (represented by a cross), in the same layer, the point is compared with the other 8 points in its 3*3 neighborhood (represented by circles). In the same group, the point is compared with a total of 2*9 points (represented by circles) in the two adjacent layers above and below it. The spatial extreme points thus obtained are local extreme points in each feature scale space and the two-dimensional image space.
[0116] Step S1223: remove unstable points from the plurality of first spatial extreme value points to obtain first characteristic points corresponding to each first characteristic scale space.
[0117] Step S1224: for each first feature point: map the first feature point to the preview image; and construct a first feature vector corresponding to the first feature point according to feature distribution in a preset area centered on the first feature point.
[0118] The first feature points at different scales are mapped to the original preview image, and the first feature vectors corresponding to the first feature points are constructed.
[0119] Figure 6 A schematic diagram of constructing a feature vector provided by an embodiment of the present disclosure. Figure 6 As shown, the feature distribution in a preset area (represented by a circle) centered on the feature point is counted, and a feature vector describing the feature point is constructed in a grid of a preset size. For example, the image gradient in the grid is represented by an arrow, corresponding to the feature distribution, Figure 6 A 2*2*8 feature vector is shown.
[0120] Figure 7 FIG. 1 is a flow chart of an implementation method of step S123 in the embodiment of the present disclosure. Figure 7 As shown, in step S123, the deviation value of the pixel position of each first feature matching pair is calculated, including:
[0121] Step S1231: Screen multiple first feature matching pairs based on a random sample consensus (RANSAC) algorithm.
[0122] Step S1232: For each first feature matching pair after screening, calculate the deviation value of its pixel position.
[0123] Among them, in order to improve the accuracy of feature matching based on Euclidean distance, the multiple first feature matching pairs determined are screened based on the random sampling consensus algorithm; the basic idea of the random sampling consensus algorithm is to assume that the data distribution conforms to a certain mathematical model, and through iterative calculation, remove outliers and obtain the probabilistically optimal model parameters at the same time; when screening multiple first feature matching pairs, the inliers are correct matches, the outliers are incorrect matches, the parameter model is the spatial transformation matrix of the feature matching pairs, and the desired subset of screened feature matching pairs needs to satisfy the inlier reprojection error as small as possible and the number of inliers as large as possible.
[0124] Figure 8 is a flow chart of an image processing method according to an exemplary embodiment. In some embodiments, the method can be applied to a terminal provided with an image sensor; Figure 8 As shown, the method includes the following steps.
[0125] Step S210: in response to the shooting application of the terminal starting to run, a preview image of the scene to be shot is obtained in real time through the image sensor.
[0126] The preview image of the scene to be photographed is obtained in real time through the image sensor and displayed on the preview interface of the terminal.
[0127] Step S220: Determine exposure parameters.
[0128] The exposure parameters are determined using the exposure parameter determination method provided by any of the above embodiments of the present disclosure.
[0129] Step S230: In response to the user's shooting instruction for the scene to be shot, obtain a timestamp (Timestamp) corresponding to the shooting instruction, and determine whether the scene to be shot is a motion scene.
[0130] Among them, the user issues a shooting instruction for the shooting scene through preset user behaviors, and the user behaviors include: performing a preset touch operation in a preset area of the terminal screen, pressing a preset button, and performing voice control behaviors, etc.; the timestamp corresponding to the shooting instruction represents the moment when the user issues the shooting instruction, such as the moment when the user performs a touch operation, presses a button, and voice control.
[0131] In some embodiments, whether the scene to be captured is a motion scene is determined based on whether the scene to be captured is a motion scene when determining exposure parameters during the preview process.
[0132] Step S240 : In response to the scene to be captured being a motion scene, searching for preview images according to the timestamp, and taking the preview images matching the timestamp as reference images.
[0133] The preview image acquired in real time is searched according to the timestamp corresponding to the shooting instruction.
[0134] Among them, the timestamp corresponding to the shooting instruction and the timestamp of the preview image are matched, and the preview image with the same timestamp is used as the reference image. The matched reference image is the preview image with normal exposure obtained by the image sensor according to the exposure parameters when the user issues the shooting instruction; or the preview image with the smallest difference in timestamps is used as the reference image, and the matched reference image is the preview image with normal exposure obtained according to the exposure parameters and the acquisition time is closest to the time when the user issues the shooting instruction.
[0135] Step S250: acquiring an overexposed image and an underexposed image of the scene to be photographed through an image sensor according to the exposure parameters.
[0136] Among them, the exposure parameters are exposure parameters corresponding to the high dynamic range, based on which the overexposed image and the underexposed image of the scene to be shot are directly acquired through the image sensor.
[0137] Step S260: Obtain a target image with a high dynamic range of the scene to be photographed according to the overexposed image, the underexposed image and the reference image.
[0138] Among them, in the high dynamic range shooting mode, a target image with a high dynamic range of the scene to be shot is obtained according to the overexposed image, the underexposed image and the reference image.
[0139] Fig. 9 A schematic diagram of obtaining a reference image provided by an embodiment of the present disclosure. Fig. 9As shown, an arrow indicates the moment when the user issues a shooting command, and a box indicates the image captured by the image sensor, which includes a preview image; see (1), corresponding to the related art, when the user takes a photo, the shooting command is processed after the underlying cache request is processed, and a frame is taken to obtain a normally exposed output image, and the frame taking time is long and deviates from the framing content previewed by the user; see (2), based on the method for obtaining a reference image provided by the embodiment of the present disclosure, a corresponding timestamp is obtained when the user issues a shooting command, and a preview image is searched according to the timestamp, and the preview image matching the timestamp is used as the reference image, thereby reducing the frame taking time while ensuring that the obtained reference image of normal exposure is consistent with the user preview.
[0140] The disclosed embodiment provides an image processing method, which includes: in response to the start-up of a shooting application of a terminal, obtaining a preview image of a scene to be shot through an image sensor in real time; determining exposure parameters using the above-mentioned exposure parameter determination method; in response to a shooting instruction of a user for the scene to be shot, obtaining a timestamp corresponding to the shooting instruction, and determining whether the scene to be shot is a motion scene; in response to the scene to be shot being a motion scene, searching for preview images according to the timestamp, and using the preview image matching the timestamp as a reference image; according to the exposure parameters, obtaining an overexposed image and an underexposed image of the scene to be shot through an image sensor; obtaining a target image with a high dynamic range of the scene to be shot according to the overexposed image, the underexposed image and the reference image. Thus, a reference image corresponding to the moment when the user issues the shooting instruction is obtained according to the timestamp matching, and the reference image is a reference image with normal exposure obtained according to the exposure parameters, which reduces the frame acquisition time, improves the capture and continuous shooting effects, and makes the reference image consistent with the image previewed by the user when the shooting instruction is issued; obtaining an overexposed image and an underexposed image according to the exposure parameters, and obtaining a target image with a high dynamic range of the scene to be shot according to the overexposed image, the underexposed image and the reference image, thereby improving the shooting effect of the motion scene.
[0141] Fig.10 is a flowchart of another image processing method according to an exemplary embodiment. In some embodiments, the method can be applied to a terminal provided with an image sensor; Fig.10 As shown, the method includes the following steps.
[0142] Step S310: in response to the shooting application of the terminal starting to run, a preview image of the scene to be shot is obtained in real time through the image sensor.
[0143] Step S320: Determine exposure parameters.
[0144] The exposure parameters are determined using the exposure parameter determination method provided by any of the above embodiments of the present disclosure.
[0145] Step S330: In response to the user's shooting instruction for the scene to be shot, obtain a timestamp corresponding to the shooting instruction, and determine whether the scene to be shot is a motion scene.
[0146] Step S340: In response to the scene to be captured being a motion scene, the preview image is searched according to the timestamp, and the preview image matching the timestamp is used as a reference image.
[0147] Step S341: Obtain the first N preview frames of the reference image.
[0148] Wherein, N is a positive integer, and the first N preview images include N frames of images. Exemplarily, N may be 6.
[0149] Step S342: Process the reference image based on the first N preview images using a super-resolution algorithm.
[0150] Among them, according to the first N frames of preview images, the resolution of the reference image is improved based on the super-resolution algorithm, and the noise reduction effect can be achieved, thereby ensuring the image quality of the reference image.
[0151] Step S350: acquiring an overexposed image and an underexposed image of the scene to be photographed through an image sensor according to the exposure parameters.
[0152] Step S361: Obtain a target image with a high dynamic range of the scene to be photographed according to the overexposed image, the underexposed image and the processed reference image.
[0153] In some embodiments, the method further includes: processing the overexposed image, the underexposed image and the reference image by an image signal processor (ISP).
[0154] Fig.11 FIG. 2 is a flow chart of an implementation method of step S260 in the embodiment of the present disclosure. Fig.11 As shown, step S260, obtaining a target image of a high dynamic range of the scene to be photographed according to the overexposed image, the underexposed image and the reference image, includes:
[0155] Step S262: Determine a fusion area in the overexposed image and the underexposed image that corresponds to the reference image.
[0156] Among them, the overexposed image and the underexposed image are full-size exposure images directly acquired by the image sensor according to the exposure parameters, and the reference image is taken from the preview image, which is consistent with the preview interface observed by the user. Before image fusion, the fusion area in the overexposed image and the underexposed image needs to be determined according to the content previewed and selected by the user.
[0157] Step S263: According to the fusion area, the overexposed image, the underexposed image and the reference image are processed based on an image fusion algorithm to obtain a target image.
[0158] In some embodiments, image fusion is performed according to a weight fusion algorithm based on a Gaussian pyramid or a Laplacian pyramid to obtain a target image.
[0159] Fig.12 FIG. 2 is a flow chart of an implementation method of step S262 in the embodiment of the present disclosure. Fig.12 As shown, step S262, determining the fusion area corresponding to the reference image in the overexposed image and the underexposed image, includes:
[0160] Step S2621: Based on the scale-invariant feature transformation algorithm, second feature points of the overexposed image, the underexposed image, and the reference image and second feature vectors corresponding to the second feature points are respectively calculated.
[0161] In some embodiments, step S2621, based on the scale-invariant feature transformation algorithm, respectively calculates the second feature points of the overexposed image, the underexposed image and the reference image and the second feature vectors corresponding to the second feature points, including: for each of the overexposed image, the underexposed image and the reference image: generating a Gaussian difference pyramid at different scales of the image, and constructing a second feature scale space at different scales; performing spatial extreme point detection on the image based on the two-dimensional image space and each second feature scale space to obtain a plurality of second spatial extreme points; removing unstable points from the plurality of second spatial extreme points to obtain second feature points corresponding to each second feature scale space; for each second feature point: mapping the second feature point to the image; and constructing a second feature vector corresponding to the second feature point based on the feature distribution in a preset area centered on the second feature point.
[0162] Among them, the optional implementation methods and related terminology explanations of the scale-invariant feature transformation algorithm, feature points and feature vectors can be found in the optional implementation methods of the relevant steps and other related parts of the embodiments involved in the relevant steps, and will not be repeated here.
[0163] Step S2622: Calculate the hash value of the reference image.
[0164] In some embodiments, the hash value is calculated based on a message digest algorithm such as the MD5 algorithm.
[0165] Step S2623, for each of the overexposed image and the underexposed image: perform Euclidean distance matching on the second feature vector of the image and the second feature vector of the reference image to obtain multiple second feature matching pairs; determine the feature matching area of the image based on the multiple second feature matching pairs; estimate the cropped area in the feature matching area based on the field of view (FOV) of the reference image; determine the similar area in the cropped area corresponding to the reference image; upsample the similar area according to the size of the reference image; calculate the hash value of the upsampled similar area; determine the similarity corresponding to the similar area based on the hash value of the similar area and the hash value of the reference image; in response to the similarity of the similar area being less than or equal to a preset similarity threshold, determine the similar area as a fusion area.
[0166] Among them, the cropping area in the feature matching area is estimated according to the field of view angle of the reference image, so that the overexposed image and the underexposed image can be cropped according to the viewing angle of the user preview.
[0167] Among them, the overexposed image and the underexposed image are full-size exposure images directly acquired by the image sensor according to the exposure parameters, and the reference image is taken from the preview image, which is consistent with the preview interface observed by the user; corresponding to the motion scene under high magnification and high dynamic range, the image size of the reference image is inconsistent with that of the overexposed image and the underexposed image, and the framing content of the reference image is also inconsistent with that of the overexposed image and the underexposed image. The fusion area in the overexposed image and the underexposed image is the high magnification area corresponding to the framing content of the reference image.
[0168] In some embodiments, corresponding to the MD5 algorithm, the similarity threshold (MD5Comp) may take a value of 5.
[0169] In some embodiments, in step S2623, determining a feature matching area of the image based on multiple second feature matching pairs includes: screening multiple second feature matching pairs based on a random sampling consensus algorithm; and determining a feature matching area based on the screened second feature matching pairs.
[0170] Among them, the optional implementation methods and related terminology explanations of the random sampling consensus algorithm can be found in the optional implementation methods of the relevant steps and other related parts of the embodiments involved in the relevant steps, and will not be repeated here.
[0171] Therefore, by determining the fusion area in the overexposed image and the underexposed image, and processing the overexposed image, the underexposed image and the reference image based on the image fusion algorithm according to the fusion area, a high-magnification and high-dynamic range target image can be obtained.
[0172] Fig.13 FIG. 2 is a flow chart of an implementation method of step S2623 in the embodiment of the present disclosure. Fig.13As shown, in step S2623, determining a similar area in the cropping area corresponding to the reference image includes:
[0173] Step S26231: Calculate the pixel-level similarity between the cropped area and the reference image to determine the candidate area in the cropped area.
[0174] Wherein, based on pixel-level fine granularity, the similarity between the cropped area and the reference image is calculated to determine the candidate area of the similar area in the cropped area.
[0175] Step S26232: Calculate the motion offset between the candidate region and the reference image.
[0176] Step S26233: In response to the motion offset being less than or equal to a preset offset threshold, the candidate region is determined as a similar region.
[0177] In some embodiments, the offset threshold may take a value of 100.
[0178] Thus, similar regions in the cropped region are determined by calculating pixel-level similarity and motion offset.
[0179] The exposure parameter determination method and image processing method provided by the present disclosure are described below in combination with practical applications.
[0180] Corresponding to the related art, the high-magnification and high-dynamic-range imaging effect is not ideal, and the image may include obvious noise.
[0181] Fig.14 A schematic diagram of obtaining a high-magnification high dynamic range image provided by an embodiment of the present disclosure. Corresponding to related technologies, such as Fig.14 As shown, the framing content is indicated by a slash, the solid-line frame represents the image obtained by framing at the original magnification, the dotted-line frame represents the normal exposure image Ev0 obtained by framing at a high magnification after the user zooms, the frame with dotted lines as edges represents the overexposed image Ev+ obtained by exposing after the normal exposure image Ev0 is acquired, and the frame with dots as edges represents the underexposed image Ev- obtained by exposing after the normal exposure image Ev0 is acquired. It can be seen that in the related art, the overexposed image Ev+ and the normal exposure image Ev0 have almost no overlapping area, which will cause misalignment and blur after image fusion.
[0182] Fig.15 Another schematic diagram of obtaining a high-magnification high dynamic range image provided by the embodiment of the present disclosure. Corresponding to the related art, such as Fig.15As shown, the moving objects in the scene corresponding to the image are indicated by slashes, the solid-line frame represents the image obtained by framing at the original magnification, the frame with dots as edges represents the underexposed image obtained by capturing and cropping the normally exposed image after the user zooms in, and the frame with dot-dashed lines as edges represents the overexposed image obtained by capturing and cropping the underexposed image after the user captures and cropps the underexposed image. It can be seen that in the related art, for moving objects, there are differences in the framing content between the captured underexposed image and the overexposed image, and the two may not be synthesized during image fusion.
[0183] Corresponding to the method provided in the embodiment of the present disclosure, a reference image corresponding to the moment when the user issues a shooting command is obtained according to timestamp matching, and the reference image is a reference image with normal exposure obtained according to exposure parameters, which reduces the frame acquisition time, improves the snapshot and continuous shooting effects, and makes the reference image consistent with the image previewed by the user when the shooting command is issued; overexposed images and underexposed images are obtained according to the exposure parameters, and fusion areas in the overexposed images and underexposed images are determined. According to the fusion area, the overexposed images, underexposed images and reference images are processed based on an image fusion algorithm to obtain a high-magnification and high-dynamic range target image, thereby ensuring a high-magnification and high-dynamic range effect and improving the shooting effect of motion scenes.
[0184] Fig.16 A flowchart of a high-magnification and high-dynamic-range photographing process is shown according to an exemplary embodiment.
[0185] Step S400: in response to the start of the shooting application of the terminal, a preview image of the scene to be shot is acquired in real time through the image sensor, and the preview image is displayed on the preview interface of the terminal.
[0186] The preview image processed by the image processor is displayed on the preview interface of the terminal.
[0187] Step S401: Obtain at least two adjacent preview image frames.
[0188] Exemplarily, three adjacent preview image frames are acquired, wherein the three preview image frames include a current frame preview image and two preview image frames before the current frame.
[0189] Step S402: Determine the motion area in at least two preview image frames based on the background subtraction method.
[0190] For each of the three preview image frames, step S403 and step S404 are performed.
[0191] Step S403: Calculate a first feature point in the motion region of the preview image and a first feature vector corresponding to the first feature point based on a scale-invariant feature transformation algorithm.
[0192] Among them, a Gaussian difference pyramid is generated at different scales of the motion area to construct the first feature scale space at different scales; spatial extreme point detection is performed on the motion area based on the two-dimensional image space and each first feature scale space to obtain a plurality of first spatial extreme points; unstable points among the plurality of first spatial extreme points are removed to obtain the first feature points corresponding to each first feature scale space; for each first feature point: the first feature point is mapped to the preview image; and according to the feature distribution in a preset area centered on the first feature point, a first feature vector corresponding to the first feature point is constructed.
[0193] Step S404: Perform Euclidean distance matching on the first feature vector of the preview image and the first feature vectors of preview images other than the preview image to obtain a plurality of first feature matching pairs.
[0194] Step S405 : Calculate the deviation value of the pixel position of each first feature matching pair, and take the first feature matching pair whose corresponding deviation value is greater than or equal to a preset deviation threshold as the target feature matching pair.
[0195] When calculating the deviation value of the pixel position of each first feature matching pair, multiple first feature matching pairs are screened based on a random sampling consensus algorithm, and for each screened first feature matching pair, the deviation value of its pixel position is calculated.
[0196] Step S406: determine whether the scene to be captured is a motion scene.
[0197] In which, in response to the number of target feature matching pairs being greater than or equal to the number threshold, it is determined that the scene to be captured is a motion scene, and step S407 is executed. In response to the number of target feature matching pairs being less than the number threshold, it is determined that the scene to be captured is not a motion scene, and step S409 is executed.
[0198] Step S407: adjusting the image sensor to a dual conversion gain mode, and determining a set of preset exposure values corresponding to a high dynamic range according to scene information of the scene to be captured.
[0199] The image sensor is adjusted to a dual conversion gain mode, and a high conversion gain or a low conversion gain is selected according to scene information.
[0200] Step S408: obtaining exposure parameters through automatic exposure control calculation according to the exposure value.
[0201] Step S409: Keep the image sensor in the normal shooting mode.
[0202] Step S410: In response to a shooting instruction from a user for a scene to be shot, a timestamp corresponding to the shooting instruction is obtained.
[0203] Step S411: Determine whether the scene to be captured is a motion scene.
[0204] In which, in response to the scene to be shot being not a motion scene, step S412 is executed, and in response to the scene to be shot being a motion scene, step S420 is executed.
[0205] Step S412: acquiring a normally exposed image of the scene to be photographed by using an image sensor in a conventional photographing mode.
[0206] Step S413: output a normally exposed image.
[0207] Among them, the normal exposure image processed by the image processor and related algorithms is output.
[0208] Step S420: Search for preview images according to the timestamp, and use the preview image matching the timestamp as the reference image.
[0209] Step S421: Obtain the first N preview frames of the reference image.
[0210] Step S422: Process the reference image based on the first N preview images using a super-resolution algorithm.
[0211] Step S430: acquiring an overexposed image and an underexposed image of the scene to be photographed through an image sensor according to the exposure parameters.
[0212] The following steps are performed after the image processor processes the overexposed image, the underexposed image and the super-resolution reference image.
[0213] Step S440: Based on the scale-invariant feature transformation algorithm, second feature points of the overexposed image, the underexposed image, and the reference image and second feature vectors corresponding to the second feature points are respectively calculated.
[0214] Step S441: Calculate the hash value of the reference image.
[0215] For each of the overexposed image and the underexposed image, steps S442 to S449 are performed.
[0216] Step S442: Perform Euclidean distance matching on the second feature vector of the image and the second feature vector of the reference image to obtain a plurality of second feature matching pairs.
[0217] Step S443: determine a feature matching area of the image according to multiple second feature matching pairs.
[0218] Step S444: Estimate the cropping area in the feature matching area according to the field of view of the reference image.
[0219] Step S445: Determine a similar area in the cropped area that corresponds to the reference image.
[0220] Among them, the pixel-level similarity between the cropped area and the reference image is calculated to determine the candidate area in the cropped area; the motion offset between the candidate area and the reference image is calculated; in response to the motion offset being less than or equal to a preset offset threshold, the candidate area is determined as a similar area.
[0221] Step S446: up-sample the similar area according to the size of the reference image.
[0222] Step S447: Calculate the hash value of the similar area after upsampling.
[0223] Step S448: Determine the similarity corresponding to the similar region according to the hash value of the similar region and the hash value of the reference image.
[0224] Step S449: In response to the similarity of the similar regions being less than or equal to a preset similarity threshold, the similar regions are determined as fusion regions.
[0225] Step S450: According to the fusion area, the overexposed image, the underexposed image and the reference image are processed based on an image fusion algorithm to obtain a target image.
[0226] Wherein, the images are fused according to a weight fusion algorithm based on a Gaussian pyramid or a Laplacian pyramid to obtain a target image.
[0227] Thus, a target image with high magnification and high dynamic range is obtained.
[0228] The present disclosure also provides a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the steps of the exposure parameter determination method provided by the present disclosure; or, when executed by a processor, implement the steps of the image processing method provided by the present disclosure.
[0229] Fig.17 1 is a block diagram of an electronic device 800 according to an exemplary embodiment. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0230] Reference Fig.17 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output interface 812 , a sensor component 814 , and a communication component 816 .
[0231] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned exposure parameter determination method, or to complete all or part of the steps of the above-mentioned image processing method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0232] The memory 804 is configured to store various types of data to support operations on the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0233] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.
[0234] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0235] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0236] The input / output interface 812 provides an interface between the processing component 802 and the peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0237] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the electronic device 800, the relative positioning of the components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0238] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0239] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned exposure parameter determination method or image processing method.
[0240] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to complete the above-mentioned exposure parameter determination method or image processing method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0241] In another exemplary embodiment, a computer program product is also provided, which includes a computer program that can be executed by a programmable device, and the computer program has a code portion for executing the above-mentioned exposure parameter determination method or image processing method when executed by the programmable device.
[0242] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0243] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for determining exposure parameters, characterized in that: include: Acquire at least two adjacent preview image frames of the scene to be captured; Determining whether the scene to be captured is a motion scene according to the at least two preview image frames; In response to the scene to be captured being a motion scene, determining a set of preset exposure values corresponding to a high dynamic range according to scene information of the scene to be captured; The exposure parameter is obtained by automatic exposure control calculation according to the exposure value.
2. The exposure parameter determination method according to claim 1, characterized in that: The determining whether the scene to be captured is a motion scene according to the at least two preview image frames includes: Determine the motion area in the at least two preview image frames based on a background subtraction method; For each of the at least two preview images: based on a scale-invariant feature transformation algorithm, calculating a first feature point in a motion region of the preview image and a first feature vector corresponding to the first feature point; performing Euclidean distance matching of the first feature vector of the preview image with the first feature vector of preview images other than the preview image to obtain a plurality of first feature matching pairs; Calculating the deviation value of the pixel position of each first feature matching pair, and taking the first feature matching pair whose corresponding deviation value is greater than or equal to a preset deviation threshold as a target feature matching pair; In response to the number of the target feature matching pairs being greater than or equal to a number threshold, it is determined that the scene to be captured is a motion scene.
3. The exposure parameter determination method according to claim 2, characterized in that: The step of calculating the first feature point in the motion region of the preview image and the first feature vector corresponding to the first feature point based on the scale-invariant feature transformation algorithm includes: Generating Gaussian difference pyramids at different scales of the motion region to construct first characteristic scale spaces at different scales; Performing spatial extreme point detection on the motion region based on the two-dimensional image space and each of the first characteristic scale spaces to obtain a plurality of first spatial extreme points; Removing unstable points from the plurality of first spatial extreme value points to obtain the first characteristic points corresponding to each of the first characteristic scale spaces; For each of the first feature points: mapping the first feature point to the preview image; and constructing the first feature vector corresponding to the first feature point according to feature distribution in a preset area centered on the first feature point.
4. The exposure parameter determination method according to claim 2, characterized in that: Before calculating the deviation value of the pixel position of each feature matching pair, the exposure parameter determination method further includes: Screening the plurality of first feature matching pairs based on a random sampling consensus algorithm; The calculating the deviation value of the pixel position of each first feature matching pair includes: For each of the screened first feature matching pairs, the deviation value of its pixel position is calculated.
5. An image processing method, characterized in that: include: In response to the start-up of a shooting application program of the terminal, a preview image of the scene to be shot is acquired in real time through an image sensor; Determine the exposure parameters using the exposure parameter determination method described in any one of claims 1 to 4; In response to a user's shooting instruction for the scene to be shot, obtaining a timestamp corresponding to the shooting instruction, and determining whether the scene to be shot is a motion scene; In response to the scene to be captured being a motion scene, searching for the preview image according to the timestamp, and taking the preview image matching the timestamp as a reference image; According to the exposure parameters, acquiring an overexposed image and an underexposed image of the scene to be photographed through the image sensor; A target image with a high dynamic range of the scene to be photographed is obtained according to the overexposed image, the underexposed image and the reference image.
6. The image processing method according to claim 5, characterized in that: After searching the preview image according to the timestamp and taking the preview image matching the timestamp as the reference image, the method further includes: Acquire the preview images of the first N frames of the reference image, where N is a positive integer; According to the preview images of the first N frames, the reference image is processed based on a super-resolution algorithm; The step of obtaining a target image with a high dynamic range of the scene to be photographed according to the overexposed image, the underexposed image and the reference image comprises: The target image is obtained according to the overexposed image, the underexposed image and the processed reference image.
7. The image processing method according to claim 5, characterized in that: The step of obtaining a target image with a high dynamic range of the scene to be photographed according to the overexposed image, the underexposed image and the reference image comprises: Determine a fusion area in the overexposed image and the underexposed image that corresponds to the reference image; According to the fusion area, the overexposed image, the underexposed image and the reference image are processed based on an image fusion algorithm to obtain the target image.
8. The image processing method according to claim 7, characterized in that: The determining a fusion area in the overexposed image and the underexposed image corresponding to the reference image includes: Based on a scale-invariant feature transformation algorithm, second feature points of the overexposed image, the underexposed image, and the reference image and second feature vectors corresponding to the second feature points are respectively calculated; Calculating a hash value of the reference image; For each of the overexposed image and the underexposed image: perform Euclidean distance matching on the second feature vector of the image and the second feature vector of the reference image to obtain a plurality of second feature matching pairs; determine a feature matching area of the image according to the plurality of second feature matching pairs; estimate a cropped area in the feature matching area according to the field of view of the reference image; determine a similar area in the cropped area corresponding to the reference image; upsample the similar area according to the size of the reference image; calculate a hash value of the upsampled similar area; determine a similarity corresponding to the similar area according to the hash value of the similar area and the hash value of the reference image; and in response to the similarity of the similar area being less than or equal to a preset similarity threshold, determine the similar area as the fusion area.
9. The image processing method according to claim 8, characterized in that: The step of respectively calculating the second feature points of the overexposed image, the underexposed image, and the reference image and the second feature vectors corresponding to the second feature points based on the scale-invariant feature transformation algorithm includes: For each of the overexposed image, the underexposed image, and the reference image: Generate Gaussian difference pyramids at different scales of the image to construct second feature scale spaces at different scales; Performing spatial extreme point detection on the image based on the two-dimensional image space and each of the second characteristic scale spaces to obtain a plurality of second spatial extreme points; Removing unstable points from the plurality of second spatial extreme value points to obtain the second characteristic points corresponding to each of the second characteristic scale spaces; For each of the second feature points: the second feature point is mapped to the image; and the second feature vector corresponding to the second feature point is constructed according to the feature distribution in a preset area centered on the second feature point.
10. The image processing method according to claim 8, characterized in that: The determining the feature matching area of the image according to the plurality of second feature matching pairs comprises: Screening the plurality of second feature matching pairs based on a random sampling consensus algorithm; The feature matching area is determined according to the screened second feature matching pairs.
11. The image processing method according to claim 8, characterized in that: The determining a similar area in the cropped area corresponding to the reference image comprises: Calculating the pixel-level similarity between the cropped area and the reference image to determine a candidate area in the cropped area; Calculating a motion offset between the candidate region and the reference image; In response to the motion offset being less than or equal to a preset offset threshold, the candidate region is determined as the similar region.
12. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to run the executable instructions to implement the steps of the exposure parameter determination method described in any one of claims 1 to 4, or the processor is configured to run the executable instructions to implement the steps of the image processing method described in any one of claims 5 to 11.
13. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the steps of the exposure parameter determination method described in any one of claims 1 to 4 are implemented; or, when the program instructions are executed by a processor, the steps of the image processing method described in any one of claims 5 to 11 are implemented.