Image processing method and device, electronic device, and computer-readable storage medium

By registering and merging multiple frames of images, the overexposure problem caused by long-exposure shooting is solved, and the combination of clear motion trajectory capture and long-exposure effects is achieved.

CN111932587BActive Publication Date: 2024-09-03GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010768044.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-03
Publication Date
2024-09-03
Estimated Expiration
2040-08-03

AI Technical Summary

Technical Problem

In daytime scenes, due to the limitation of the lens aperture size of electronic equipment, images taken with long exposures are prone to overexposure, affecting image quality and making it difficult to capture clear motion trajectories.

Method used

By acquiring multiple frames of images, selecting the reference frame image and determining the mapping relationship based on its feature points and the feature points of the image to be processed, registration processing and fusion processing are performed to generate a target image containing the subject's motion trajectory, achieving the long exposure effect and avoiding Overexposed.

Benefits of technology

Without causing overexposure, the motion trajectory characteristics of the subject in the image are obtained to the greatest extent, and an image with a long exposure effect is generated, which overcomes the overexposure problem caused by long exposure of a single frame image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111932587B
    Figure CN111932587B
Patent Text Reader

Abstract

The present application relates to an image processing method and device, an electronic device, and a computer-readable storage medium, wherein the method comprises: acquiring multiple frames of images, selecting a reference frame image from the multiple frames of images; determining a mapping relationship between the reference frame image and each frame of images to be processed according to feature points of the reference frame image and feature points of each frame of images to be processed; the multiple frames of images include each frame of images to be processed; performing registration processing on each frame of images to be processed based on the mapping relationship; performing fusion processing on the reference frame image and each frame of images to be processed after registration processing to obtain the motion trajectory of the subject in the image, and generating a target image containing the motion trajectory of the subject. This solution can overcome the phenomenon of image overexposure caused by long exposure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an image processing method and device, an electronic device, and a computer-readable storage medium. Background Art

[0002] With the development of computer technology, using electronic devices to take photos has become a part of people's daily lives. The long exposure function of the camera can be used to capture scenes such as moving clouds and flowing water, so that the captured images can reflect the trajectory of cloud movement or water flow. However, due to the limitation of the aperture size of the electronic device lens, in daytime scenes, the images captured by extending the exposure time are prone to overexposure, affecting the image quality. Summary of the invention

[0003] The embodiments of the present application provide an image processing method, device, electronic device, and computer-readable storage medium, which can capture the motion trajectory of a subject in an image through image fusion, so that the image has the effect of a long exposure image without overexposure.

[0004] An image processing method, comprising:

[0005] Acquire multiple frame images, and select a reference frame image from the multiple frame images;

[0006] Determining a mapping relationship between the reference frame image and the images to be processed according to feature points of the reference frame image and feature points of the images to be processed; the multiple images include the images to be processed;

[0007] Performing registration processing on each frame of the image to be processed based on the mapping relationship;

[0008] The reference frame image and each frame of the image to be processed after the registration process are fused to obtain the motion trajectory of the subject in the image, and generate a target image containing the motion trajectory of the subject.

[0009] An image processing device, comprising:

[0010] An acquisition module, used for acquiring multiple frame images and selecting a reference frame image from the multiple frame images;

[0011] A determination module, used to determine the mapping relationship between the reference frame image and each frame of the image to be processed according to the feature points of the reference frame image and the feature points of each frame of the image to be processed; the multiple frames of images include each frame of the image to be processed;

[0012] A registration module, used for performing registration processing on each frame of the image to be processed based on the mapping relationship;

[0013] The generation module is used to fuse the reference frame image and each frame of the to-be-processed image after the registration process to obtain the motion trajectory of the subject in the image and generate a target image containing the motion trajectory of the subject.

[0014] An electronic device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the following steps:

[0015] Acquire multiple frame images, and select a reference frame image from the multiple frame images;

[0016] Determining a mapping relationship between the reference frame image and the images to be processed according to feature points of the reference frame image and feature points of the images to be processed; the multiple images include the images to be processed;

[0017] Performing registration processing on each frame of the image to be processed based on the mapping relationship;

[0018] The reference frame image and each frame of the image to be processed after the registration process are fused to obtain the motion trajectory of the subject in the image, and generate a target image containing the motion trajectory of the subject.

[0019] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0020] Acquire multiple frame images, and select a reference frame image from the multiple frame images;

[0021] Determining a mapping relationship between the reference frame image and the images to be processed according to feature points of the reference frame image and feature points of the images to be processed; the multiple images include the images to be processed;

[0022] Performing registration processing on each frame of the image to be processed based on the mapping relationship;

[0023] The reference frame image and each frame of the image to be processed after the registration process are fused to obtain the motion trajectory of the subject in the image, and generate a target image containing the motion trajectory of the subject.

[0024] The above-mentioned image processing method and device, electronic device, and computer-readable storage medium obtain multiple frame images, select a reference frame image from the multiple frame images, align the image to be processed in the multiple frame images, and fuse the aligned image and the reference frame image, so as to obtain the motion trajectory characteristics of the subject in the image to the greatest extent, generate a target image containing the motion trajectory of the subject, so that the target image has the effect of a long exposure image, and overcomes the overexposure phenomenon caused by the long exposure of a single frame image. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0026] Figure 1 is a schematic diagram of an image processing circuit in one embodiment;

[0027] Figure 2 is a flowchart of an image processing method in one embodiment;

[0028] Figure 3 is a schematic flow chart of an image processing method in another embodiment;

[0029] Figure 4 A flowchart of determining a mapping relationship between a reference frame image and each frame of an image to be processed according to feature points of the reference frame image and feature points of each frame of an image to be processed in one embodiment;

[0030] Figure 5 A schematic diagram of a process of registering an image to be processed in one embodiment;

[0031] Figure 6 A schematic diagram of a process of fusing an image to be processed and a reference frame image in one embodiment;

[0032] Figure 7 is a structural block diagram of an image processing device in one embodiment;

[0033] Figure 8 FIG. 1 is a schematic diagram of the internal structure of an electronic device in an embodiment. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0035] The embodiment of the present application also provides an electronic device. The electronic device includes an image processing circuit, which can be implemented using hardware and / or software components and can include various processing units that define an ISP (Image Signal Processing) pipeline. Figure 1 FIG. 1 is a schematic diagram of an image processing circuit in one embodiment. Figure 1As shown, for ease of explanation, only various aspects of the image processing technology related to the embodiments of the present application are shown.

[0036] like Figure 1 As shown, the image processing circuit includes an ISP processor 140 and a control logic 150. The image data captured by the imaging device 110 is first processed by the ISP processor 140, and the ISP processor 140 analyzes the image data to capture image statistics that can be used to determine and / or one or more control parameters of the imaging device 110. The imaging device 110 may include a camera having one or more lenses 112 and an image sensor 114. The image sensor 114 may include a color filter array (such as a Bayer filter), and the image sensor 114 may obtain light intensity and wavelength information captured by each imaging pixel of the image sensor 114, and provide a set of raw image data that can be processed by the ISP processor 140. The sensor 120 (such as a gyroscope) may provide the acquired image processing parameters (such as anti-shake parameters) to the ISP processor 140 based on the sensor 120 interface type. The sensor 120 interface may utilize a SMIA (Standard Mobile Imaging Architecture) interface, other serial or parallel camera interfaces, or a combination of the above interfaces.

[0037] In addition, the image sensor 114 may also send raw image data to the sensor 120 , and the sensor 120 may provide the raw image data to the ISP processor 140 based on the interface type of the sensor 120 , or the sensor 120 may store the raw image data in the image memory 130 .

[0038] The ISP processor 140 processes the raw image data pixel by pixel in a variety of formats. For example, each image pixel may have a bit depth of 8, 10, 12, or 14 bits, and the ISP processor 140 may perform one or more image processing operations on the raw image data and collect statistical information about the image data. The image processing operations may be performed at the same or different bit depth precisions.

[0039] The ISP processor 140 may also receive image data from the image memory 130. For example, the sensor 120 interface sends raw image data to the image memory 130, and the raw image data in the image memory 130 is then provided to the ISP processor 140 for processing. The image memory 130 may be a portion of a memory device, a storage device, or an independent dedicated memory within an electronic device, and may include a DMA (Direct Memory Access) feature.

[0040] When receiving raw image data from the image sensor 114 interface or from the sensor 120 interface or from the image memory 130, the ISP processor 140 may perform one or more image processing operations, such as temporal filtering. The processed image data may be sent to the image memory 130 for further processing before being displayed. The ISP processor 140 receives the processed data from the image memory 130 and processes the processed data in the original domain and in the RGB and YCbCr color spaces. The image data processed by the ISP processor 140 may be output to the display 170 for viewing by the user and / or further processed by a graphics engine or GPU (Graphics Processing Unit). In addition, the output of the ISP processor 140 may also be sent to the image memory 130, and the display 170 may read the image data from the image memory 130. In one embodiment, the image memory 130 may be configured to implement one or more frame buffers. In addition, the output of the ISP processor 140 may be sent to the encoder / decoder 160 to encode / decode the image data. The encoded image data may be saved and decompressed before being displayed on the display 170 device. The encoder / decoder 160 may be implemented by a CPU or a GPU or a coprocessor.

[0041] The statistical data determined by the ISP processor 140 may be sent to the control logic 150 unit. For example, the statistical data may include image sensor 114 statistical information such as automatic exposure, automatic white balance, automatic focus, flicker detection, black level compensation, lens 112 shading correction, etc. The control logic 150 may include a processor and / or microcontroller that executes one or more routines (such as firmware), and the one or more routines may determine control parameters of the imaging device 110 and control parameters of the ISP processor 140 based on the received statistical data. For example, the control parameters of the imaging device 110 may include sensor 120 control parameters (such as gain, integration time for exposure control, anti-shake parameters, etc.), camera flash control parameters, lens 112 control parameters (such as focal length for focus or zoom), or a combination of these parameters. The ISP control parameters may include gain levels and color correction matrices for automatic white balance and color adjustment (for example, during RGB processing), as well as lens 112 shading correction parameters.

[0042] In one embodiment, multiple frames of images are acquired through the lens 112 and the image sensor 114 in the imaging device (camera) 110, and the multiple frames of images are sent to the ISP processor 140. After receiving the multiple frames of images, the ISP processor 140 selects a reference frame image from the multiple frames of images. Then, the ISP processor 140 determines the mapping relationship between the reference frame image and each frame of the image to be processed based on the feature points of the reference frame image and the feature points of each frame of the image to be processed in the multiple frames of images. Then, the ISP processor 140 performs registration processing on each frame of the image to be processed based on the mapping relationship. The ISP processor 140 fuses the reference frame image and each frame of the image to be processed after the registration processing to obtain a clear motion trajectory of the subject in the image, thereby generating a target image containing the motion trajectory of the subject, so that the target image overcomes the overexposure problem caused by long exposure and can have the effect of a long exposure image.

[0043] Figure 2 FIG. 1 is a flowchart of an image processing method in an embodiment. The image processing method in this embodiment is executed on Figure 1 The electronic device in the example is used to describe. Figure 2 As shown, the image processing method includes steps 202 to 208.

[0044] Step 202: Acquire multiple frame images and select a reference frame image from the multiple frame images.

[0045] The multi-frame images can be any of RGB (Red, Green, Blue) images, grayscale images, depth images, images corresponding to the Y component in YUV images, etc. The "Y" in the YUV image represents the brightness (Luminance or Luma), that is, the grayscale value, and "U" and "V" represent the chrominance (Chrominance or Chroma), which is used to describe the color and saturation of the image and is used to specify the color of the pixel.

[0046] Specifically, the ISP processor or central processor of the electronic device can set the automatic exposure time, and obtain multiple frames of images by shooting the area of ​​interest through the imaging device without overexposure, so as to obtain multiple frames of images without overexposure. Overexposure refers to the phenomenon that the brightness of the picture is too high and the photo is white due to reasons such as the camera's aperture being too large and the shutter being too slow. Then, the electronic device can select a reference frame image from the multiple frames.

[0047] In this embodiment, the electronic device can automatically expose and shoot the moving subject to obtain multiple frames of images containing the subject. The moving subject can be water flow, waterfall, rotating person, etc., but is not limited thereto.

[0048] Step 204, determining a mapping relationship between the reference frame image and each frame of the image to be processed according to the feature points of the reference frame image and the feature points of each frame of the image to be processed; the multiple frames of images include each frame of the image to be processed.

[0049] Specifically, the ISP processor or central processor of the electronic device may select an image to be processed from multiple frames of images. Then, the ISP processor or central processor of the electronic device may extract feature points of the reference frame image and extract feature points in each frame of the image to be processed. The ISP processor or central processor of the electronic device determines the mapping relationship between the reference frame image and each frame of the image to be processed based on the feature points of the reference frame image and the feature points of each frame of the image to be processed.

[0050] In this embodiment, the ISP processor or the central processing unit of the electronic device can select the image to be processed and the reference frame image from multiple frames of images according to the clarity of the image.

[0051] Step 206: perform registration processing on each frame of the image to be processed based on the mapping relationship.

[0052] Specifically, for each frame of the image to be processed, the ISP processor or central processing unit of the electronic device determines the mapping relationship between the image to be processed and the reference frame image, and performs perspective transformation on the image to be processed to map the image to be processed to the image space corresponding to the reference frame image, thereby obtaining the registered image to be processed.

[0053] Step 208 , fusing the reference frame image and each frame of the to-be-processed image after the registration process to obtain the motion trajectory of the subject in the image, and generating a target image containing the motion trajectory of the subject.

[0054] Specifically, the ISP processor or central processing unit of the electronic device obtains the feature points of the reference frame image, obtains the feature points of each frame of the image to be processed after the registration processing, and determines the feature points that match the reference frame image and each frame of the image to be processed. Then, the ISP processor or central processing unit of the electronic device fuses the feature points that match the reference frame image and the image to be processed after each frame of registration. According to the same processing method, the reference frame image and the image to be processed after each frame of registration can be fused to obtain a target image. The target image incorporates the key features of the subject's motion trajectory in each frame of the image, thereby obtaining a clear motion trajectory of the subject in the image.

[0055] For example, the user sets the long exposure time to 1 second and shoots the fireworks that are blooming. The obtained image can reflect the motion trajectory of the fireworks blooming within 1 second. However, long exposure can easily cause the image obtained to be overexposed. In this embodiment, the automatic exposure time can be set to 0.1 second to obtain 10 frames of images of fireworks blooming, that is, 10 frames of images are obtained within 1 second. One frame of image is selected from the 10 frames as the reference frame image, and the remaining 9 frames of image are registered. Then, the reference frame image and the 9 registered images are fused according to the matching feature points to obtain a target image that fuses the motion trajectory of the fireworks blooming in the 10 frames of image, and the target image is also an image obtained within 1 second, and the motion trajectory of the fireworks blooming in the target image is the motion trajectory within 1 second. The image obtained by image registration and image fusion can achieve the effect of long exposure shooting (that is, reflecting the motion trajectory of the fireworks blooming within 1 second) and avoid the phenomenon of image overexposure caused by long exposure.

[0056] In this embodiment, multiple frames of images are acquired without overexposure, a reference frame image is selected from the multiple frames of images, and the image to be processed in the multiple frames of images is registered so that the image to be processed and the reference frame image are in the same image space. The registered image and the reference frame image are fused to obtain the motion trajectory features of the subject in the image to the greatest extent, and a target image containing the subject's motion trajectory is generated, so that the target image can achieve the effect of a long exposure image and avoid the overexposure phenomenon caused by the long exposure of a single frame image.

[0057] In one embodiment, registering each frame of the image to be processed based on the mapping relationship includes: when the shooting mode corresponding to the multiple frames of images is the handheld mode, executing the step of registering each frame of the image to be processed based on the mapping relationship.

[0058] Specifically, after the ISP processor or central processing unit of the electronic device acquires multiple frames of images, it can determine the shooting mode used when collecting the multiple frames of images. Shooting models include handheld mode and tripod mode. When the shooting mode corresponding to the multiple frames of images is handheld mode, the ISP processor or central processing unit of the electronic device can extract feature points from the reference frame image and each frame of the image to be processed in the multiple frames of images. The mapping relationship between the reference frame image and each frame of the image to be processed is determined based on the feature points, and each frame of the image to be processed is registered based on the mapping relationship. Then, the ISP processor or central processing unit of the electronic device can fuse the registered image to be processed and the reference frame image to obtain the motion trajectory of the subject in the image, and generate a target image containing the motion trajectory of the subject.

[0059] In this embodiment, the ISP processor or the central processor of the electronic device can determine whether the shooting mode is the handheld mode or the tripod mode according to the mark on the screen of the electronic device. Alternatively, the shooting mode can be determined as the handheld mode or the tripod mode according to the jitter parameter of the gyroscope. For example, when the number of jitters of the gyroscope is greater than the jitter threshold, it is determined to be the handheld mode; when the number of jitters of the gyroscope is less than or equal to the jitter threshold, it is determined to be the tripod mode.

[0060] In this embodiment, the shooting mode may be determined before acquiring multiple frames of images.

[0061] In this embodiment, when the shooting mode corresponding to the multiple frames of images is the handheld mode, the step of performing registration processing on each frame of the image to be processed based on the mapping relationship is executed, and the images collected in the handheld mode are registered to avoid the problem of image blur caused by user hand shaking.

[0062] In one embodiment, by shooting water flow using the image processing method of this embodiment, clear images with beautiful flowing water effects can be obtained under both tripod and handheld shooting, thereby enriching the photography functionality and improving the user's photography experience when shooting in special scenes.

[0063] In one embodiment, when the shooting mode corresponding to the multiple frames of images is the tripod mode, the reference frame image and each frame of the image to be processed are fused based on a mapping relationship to obtain the motion trajectory of the subject in the image, and generate a target image containing the motion trajectory of the subject.

[0064] Specifically, when the shooting mode corresponding to the multi-frame image is the tripod mode, the image may not be registered. When the shooting mode corresponding to the multi-frame image is the tripod mode, the ISP processor or the central processor of the electronic device may extract feature points from the reference frame image and each frame of the image to be processed in the multi-frame image. The mapping relationship between the reference frame image and each image to be processed is determined based on the feature points, and the image to be processed and the reference frame image are fused based on the mapping relationship to obtain the motion trajectory of the subject in the image, and generate a target image containing the motion trajectory of the subject.

[0065] In this embodiment, when the shooting mode corresponding to the multiple-frame images is the tripod mode, the reference frame image and each frame of the image to be processed are fused based on the mapping relationship to quickly obtain a target image containing the motion trajectory of the subject, so that the target image can achieve the effect of a long exposure image and avoid the image overexposure caused by long exposure.

[0066] like Figure 3As shown, it is a flow chart of an image processing method in an embodiment. The electronic device acquires multiple frames of images in YUV format by automatic exposure. Then, the first frame image captured in the multiple frames is used as a reference frame image. Alternatively, the image with the highest definition among the 3rd and 5th frames captured in the multiple frames is used as a reference frame image. Then, it is determined whether the shooting mode when acquiring the multiple frames of images is a handheld mode or a tripod mode. When the shooting mode corresponding to the multiple frames of images is a handheld mode, each frame of the image to be processed in the multiple frames of images is registered according to the reference frame image. The reference frame image and each frame of the image to be processed after the registration process are fused to obtain the motion trajectory of the subject in the image, and generate a target image containing the motion trajectory of the subject.

[0067] When the shooting mode corresponding to the multiple frames of images is the tripod mode, no registration processing is performed. The reference frame image and each frame of the image to be processed are fused to obtain the motion trajectory of the subject in the image, and a target image containing the motion trajectory of the subject is generated.

[0068] In one embodiment, Figure 4 As shown, according to the feature points of the reference frame image and the feature points of each frame of the image to be processed, the mapping relationship between the reference frame image and each frame of the image to be processed is determined, including:

[0069] Step 402: extracting feature points in the reference frame image and feature points in each frame of the image to be processed.

[0070] The feature point refers to a point where the grayscale value of the image changes dramatically or a point with a large curvature on the edge of the image (i.e., the intersection of two edges). Feature points include, but are not limited to, eyes, nose tips, corners of the mouth, moles, and the center of an object.

[0071] Specifically, the grayscale value of each pixel in the reference frame image is detected, and when the difference between the grayscale values ​​of adjacent pixels is greater than a threshold, the area where the adjacent pixels are located can be used as a feature point. The grayscale value of each pixel in each frame of the image to be processed is detected, and when the difference between the grayscale values ​​of adjacent pixels is greater than a threshold, the area where the adjacent pixels are located can be used as a feature point.

[0072] In one embodiment, corresponding feature points can be extracted from each frame of the image to be processed based on the feature points in the reference frame image. In another embodiment, the grayscale value of each pixel in the image to be processed can also be detected. When the difference in the grayscale values ​​of adjacent pixels is greater than a threshold, the area where the adjacent pixels are located can be used as a feature point, and the corresponding feature points can be extracted from the remaining images to be processed and the reference frame image.

[0073] Step 404 : determining matching point pairs between the reference frame image and each frame of the image to be processed according to the feature points of the reference frame image and the feature points of each frame of the image to be processed.

[0074] Specifically, the ISP processor or central processing unit of the electronic device forms matching point pairs with the feature points extracted from the reference frame image and the corresponding feature points of each frame of the image to be processed. Further, the ISP processor or central processing unit of the electronic device determines the feature points of the reference frame image and the feature points of each frame of the image to be processed, and determines the matching point pairs between the reference frame image and each frame of the image to be processed.

[0075] Step 406, determining the homography matrix between the reference frame image and each frame of the image to be processed according to the matching point pairs; the homography matrix is ​​used to represent the mapping relationship between the reference frame image and each frame of the image to be processed.

[0076] Homography is a concept in projective geometry, also known as projective transformation. It maps points (three-dimensional homogeneous vectors) on a projective plane to another projective plane, and maps straight lines to straight lines, with the property of line preservation. The homography matrix is ​​a mapping between points. The homography matrix can be used to find the exact position of the corresponding point of an image point on another image.

[0077] Specifically, the ISP processor or central processing unit of the electronic device can calculate the homography matrix between the reference frame image and each frame of the image to be processed based on the matching point pairs between the reference frame image and each frame of the image to be processed. The homography matrix can map the image to be processed to the same image space as the reference frame image.

[0078] Based on the mapping relationship, each frame of the image to be processed is registered, including:

[0079] Step 408: perform registration processing on each frame of the image to be processed based on the homography matrix.

[0080] Specifically, the ISP processor or central processing unit of the electronic device will perform registration processing on the image to be processed according to the homography matrix between the reference frame image and the image to be processed, thereby obtaining the registered image to be processed. According to the same processing method, the ISP processor or central processing unit of the electronic device can perform registration processing on each frame of the image to be processed according to the homography matrix between the reference frame image and each frame of the image to be processed, thereby obtaining the registered image to be processed.

[0081] In this embodiment, the homography matrix between the reference frame image and the image to be processed is determined based on the matching point pairs between the reference frame image and each frame of the image to be processed, so that each frame of the image to be processed can be mapped to the image space of the reference frame image, so that the image to be processed and the reference frame image are in the same perspective, thereby accurately registering the image to be processed.

[0082] In one embodiment, the multiple frames of images are YUV images; extracting feature points in the reference frame image and feature points of each frame of the image to be processed includes: performing corner point detection on the Y channel of the reference frame image and each frame of the image to be processed respectively to obtain feature points in the reference frame image and feature points of each frame of the image to be processed.

[0083] Specifically, the ISP processor or central processing unit of the electronic device may obtain multiple frames of YUV images, obtain the image to be processed from the multiple frames of YUV images, and select the reference frame image. Then, the ISP processor or central processing unit of the electronic device performs corner point detection on the Y channel of the reference frame image, and performs corner point detection on the Y channel of each frame of the image to be processed. Corner point detection may be performed using the Shi-Tomasi algorithm or the Harri algorithm.

[0084] Furthermore, the ISP processor or the central processor of the electronic device establishes a coordinate axis on the reference frame image, and uses an edge operator, such as a Sobel operator, to calculate the gradient value I of the image in the x and y directions of the coordinate axis. x ,I y Then calculate the product of the two directional gradients I x *I y Next, the ISP processor or central processing unit of the electronic device I x *I y Perform mean filtering to obtain a local feature matrix. Calculate the eigenvalues ​​of the local feature matrix. If the smaller of the two eigenvalues ​​is greater than the minimum threshold, the strong corner point of the reference frame image is obtained. The strong corner point is a point that is not disturbed by noise. The ISP processor or central processing unit of the electronic device uses the strong corner point as the feature point of the reference frame image. In the same processing method, the feature points in each frame of the image to be processed can be obtained.

[0085] In this embodiment, corner point detection is performed on the Y channel of the reference frame image in YUV format and each frame of the to-be-processed image in YUV format to obtain feature points in the image that are not interfered by noise, so that the extracted image feature points are more accurate.

[0086] In one embodiment, matching point pairs between the reference frame image and each frame of the image to be processed are determined based on feature points of the reference frame image and feature points of each frame of the image to be processed, including: generating a corresponding feature descriptor based on each feature point of the reference frame image; generating a corresponding feature descriptor based on each feature point of each frame of the image to be processed; matching the feature descriptors corresponding to the reference frame image with the feature descriptors corresponding to each frame of the image to be processed, to obtain matching point pairs between the reference frame image and each frame of the image to be processed.

[0087] The feature descriptor is used to represent the feature of the feature point. For example, the feature descriptor may represent the pixel value of the feature point, the feature description vector of the feature point, the direction of the feature point, the domain information of the feature point, etc., but is not limited thereto. The feature descriptor of the feature point is generated by acquiring the pixel value of the feature point, the direction of the feature point, the domain information of the feature point, and other data.

[0088] The feature descriptor may be an ORB feature descriptor = Fast feature point (corner point) extraction + BRIEF feature description; or a SIFT (Scale-invariant feature transform) feature descriptor; or other feature descriptors, but not limited thereto.

[0089] Specifically, the feature descriptors of the reference frame image are matched with the feature descriptors of the image to be processed, for example, at least one of the pixel value of the feature point, the direction of the feature point, the domain information of the feature point, etc. The more matched features are, the more accurate the matching point pair is.

[0090] For example, A(x,y) is the detected corner point. With point A as the center, its neighborhood is used as the sampling area, and the sampling area is divided into 4×4 sub-areas. The gradient histograms of the four directions are calculated in each sub-area, and the accumulated values ​​of the gradient direction in each direction are counted to form a seed point. A total of 4×4×4=64 data will be generated to form the feature description vector of corner point A.

[0091] In this embodiment, the feature descriptor of each feature point in the reference frame image is matched with the feature descriptor of each feature point in each frame of the image to be processed, so that a more accurate matching point pair can be generated. After the corner point is detected, the neighborhood information of the upper corner point is used to increase the reliability of the matching point pair, so that the global registration accuracy is improved, and the image synthesized by multiple frames is clear.

[0092] In one embodiment, a RANSAC (Random Sample Consensus) algorithm may be used to process the matching point pairs, thereby removing some matching point pairs with mismatches and obtaining more accurate matching point pairs.

[0093] In one embodiment, registration processing is performed on each frame of the image to be processed based on the mapping relationship, including: performing perspective transformation processing on each frame of the image to be processed according to the mapping relationship to obtain each frame of the registered image.

[0094] Among them, perspective transformation refers to the transformation that uses the condition that the perspective center, image point and target point are collinear, and according to the law of perspective rotation, the image receiving surface (perspective surface) is rotated around the trace line (perspective axis) by a certain angle, destroying the original projection light beam, while still keeping the projected geometric figure on the image receiving surface unchanged.

[0095] Specifically, for each frame of image to be processed, the ISP processor or central processing unit of the electronic device determines the mapping relationship between the image to be processed and the reference frame image, and performs perspective transformation on the image to be processed to map the image to be processed to the image space corresponding to the reference frame image, thereby accurately obtaining the registered image to be processed.

[0096] like Figure 5 As shown, it is a schematic diagram of the process of registering the image to be processed in one embodiment. The electronic device obtains multiple frames of images in YUV format, and selects a reference frame image and an image to be processed from the multiple frames. Then, corner point detection is performed on the Y channel of the reference frame image and each frame of the image to be processed to obtain the feature points of the reference frame image and the feature points of each frame of the image to be processed. Then, a corresponding feature description vector is generated according to each feature point of the reference frame image, and a corresponding feature description vector is generated according to each feature point of each frame of the image to be processed. Then, the distance between the feature description vector corresponding to the feature point of the reference frame image and the feature description vector corresponding to each feature point of the image to be processed is calculated by the L1 paradigm or the L2 paradigm. According to the distance sorting, the first 15% of the feature point pairs with the smallest distance are selected to be determined as the matching point pairs of the reference frame image and the image to be processed.

[0097] Next, the electronic device selects a preset number of matching point pairs, for example, 4 matching point pairs, to calculate the homography matrix between the reference frame image and the image to be processed. The optimization algorithm RANSAC is used to iteratively calculate and select the optimal solution of the homography matrix. Based on the homography matrix, the image to be processed is processed by perspective transformation to obtain the registered image to be processed.

[0098] In one embodiment, each frame of the image to be processed is registered based on the mapping relationship, including: determining the offset of each frame of the image to be processed relative to the reference frame image based on the mapping relationship; and registering the image to be processed whose offset is greater than the offset threshold based on the mapping relationship.

[0099] Specifically, the ISP processor or central processing unit of the electronic device will map the image to be processed to the image space corresponding to the reference frame image according to the mapping relationship between the reference frame image and the image to be processed, so that the image to be processed and the reference frame image are in the same image space, or on the same plane. Then, the ISP processor or central processing unit uses the reference frame image as a reference to determine the offset displacement of the image to be processed relative to the reference frame image, that is, the offset. According to the same processing method, the offset between each frame of the image to be processed and the reference frame image can be obtained.

[0100] Next, the ISP processor or the central processing unit of the electronic device obtains the offset threshold value, and compares the offset corresponding to each frame of the image to be processed with the offset threshold value. The ISP processor or the central processing unit of the electronic device can determine the image to be processed whose offset is greater than the offset threshold value, and perform registration processing on the image to be processed whose offset is greater than the offset threshold value to obtain the registered image to be processed.

[0101] In this embodiment, the offset of each frame of the image to be processed relative to the reference frame is determined, and the images to be processed whose offset is less than or equal to the offset threshold are removed to avoid the effective area of ​​the registered image being too small, thereby affecting the accuracy of image fusion.

[0102] In one embodiment, acquiring multiple image frames and selecting a reference frame image from the multiple image frames includes: acquiring multiple image frames, determining an image in the multiple image frames whose clarity is greater than a clarity threshold; and selecting a reference frame image from images whose clarity is greater than or equal to the clarity threshold.

[0103] Specifically, the ISP processor or central processing unit of the electronic device can set the time of automatic exposure, obtain multiple frames of images through the imaging device while avoiding overexposure, and obtain multiple frames of images that are not overexposed. Then, the ISP processor or central processing unit of the electronic device can determine the clarity of each frame of the image. The ISP processor or central processing unit of the electronic device obtains a clarity threshold and compares the clarity of each frame of the image with the clarity threshold. Then, the ISP processor or central processing unit of the electronic device deletes images whose clarity is less than or equal to the clarity threshold, and retains images whose clarity is greater than the clarity threshold. Alternatively, the ISP processor or central processing unit of the electronic device selects images whose clarity is greater than the clarity threshold from the multiple frames of images.

[0104] Next, the ISP processor or the central processing unit of the electronic device determines the image with the highest definition among the images whose definition is greater than the definition threshold, and determines the image with the highest definition as the reference frame image.

[0105] In this embodiment, the ISP processor or the central processor of the electronic device performs low-pass filtering on multiple frames of images, and selects the image with the highest definition from the images after low-pass filtering as the target image. The low-pass filtering process may be a Gaussian filtering process.

[0106] In this embodiment, by determining images whose clarity is greater than a clarity threshold in multiple frames of images, removing images with low clarity, and selecting reference frame images from images whose clarity is greater than or equal to the clarity threshold, the image with the best clarity is selected as the reference frame image, thereby ensuring the accuracy of image registration.

[0107] In one embodiment, the ISP processor or the central processor of the electronic device may determine the first frame image captured from the multiple frame images, and determine the captured first frame image as the reference frame image.

[0108] In one embodiment, the ISP processor or central processing unit of the electronic device may acquire a preset number of images from the beginning to the end according to the sequence of the acquisition of multiple frames of images, and determine the clarity of each frame of the preset number of images. The image with the highest clarity among the preset number of images is determined as the reference frame image. Furthermore, the ISP processor or central processing unit of the electronic device may perform low-pass filtering on the preset number of images, and select the image with the highest clarity from the preset number of images after the low-pass filtering to determine it as the target image.

[0109] In one embodiment, a reference frame image and each frame of the image to be processed after the registration process are fused to obtain a motion trajectory of a subject in the image, and a target image containing the motion trajectory of the subject is generated, including: a fusion process is performed based on the pixel values ​​of matching feature points in the reference frame image and each frame of the image to be processed after the registration process to obtain a motion trajectory of the subject in the image, and a target image containing the motion trajectory of the subject is generated.

[0110] Specifically, the ISP processor or central processing unit of the electronic device obtains the feature points of the reference frame image, obtains the feature points of each frame of the image to be processed after the registration process, and determines the feature points that match the reference frame image and each frame of the image to be processed. Then, the ISP processor or central processing unit of the electronic device obtains the pixel values ​​corresponding to the feature points that match the reference frame image and each frame of the image to be processed. Then, the ISP processor or central processing unit of the electronic device calculates the average of the pixel values ​​corresponding to the matching feature points. According to the same processing method, the reference frame image and the images to be processed after each frame of registration can be fused to obtain a target image. The target image incorporates the key features of each frame of the image, thereby obtaining the motion trajectory of the subject in the image.

[0111] In this embodiment, a fusion process is performed based on the pixel values ​​of the matching feature points in the reference frame image and each frame of the image to be processed after the registration process to generate a target image containing the motion trajectory of the subject. The generated target image can achieve the effect of long exposure shooting and avoid the phenomenon of image overexposure caused by long exposure.

[0112] like Figure 6 As shown, it is a schematic diagram of the process of fusing the image to be processed and the reference frame image in one embodiment. Then, the first frame image collected in the multiple frames is used as the reference frame image. Alternatively, the image with the highest clarity among the 3rd and 5th frames collected in the multiple frames is used as the reference frame image. Then, the images other than the reference frame image in the multiple frames are used as the images to be processed. The electronic device determines whether the clarity of the image to be processed is greater than the clarity threshold. When the clarity of the image to be processed is less than or equal to the clarity threshold, the image is removed. When the clarity of the image to be processed is greater than the clarity threshold, the image to be processed is aligned with the reference frame image. When performing the alignment, the displacement between the image to be processed and the reference frame image, that is, the offset, is determined. When the displacement is less than or equal to the offset threshold, the image is removed. After the images to be processed whose offset is greater than the threshold are registered, the pixel values ​​of the matching pixel points (feature points) of the reference frame image and each registered image to be processed are averaged, that is, multi-frame average value fusion is performed pixel by pixel, so that the reference frame image and the images to be processed after each frame registration are fused to obtain the target image containing the subject's motion trajectory.

[0113] In one embodiment, an image processing method is provided, comprising:

[0114] 1. Obtain multiple frames of images, and determine images whose clarity is greater than a clarity threshold in the multiple frames of images; the multiple frames of images are YUV images.

[0115] 2. Select a reference frame image from images whose clarity is greater than or equal to a clarity threshold.

[0116] 3. Perform corner point detection on the Y channel of the reference frame image and each frame of the image to be processed respectively to obtain feature points in the reference frame image and feature points of each frame of the image to be processed; the multi-frame image includes each frame of the image to be processed.

[0117] 4. Generate a corresponding feature description vector according to each feature point of the reference frame image, and generate a corresponding feature description vector according to each feature point of each frame of the image to be processed.

[0118] 5. Match the feature description vector corresponding to the reference frame image with the feature description vector corresponding to each frame of the image to be processed, and obtain matching point pairs between the reference frame image and each frame of the image to be processed.

[0119] 6. Determine the mapping relationship between the reference frame image and each frame of the image to be processed based on the matching point pairs.

[0120] 7. When the shooting mode corresponding to the multiple frames of images is the handheld mode, the offset of each frame of the image to be processed relative to the reference frame image is determined based on the mapping relationship.

[0121] 8. According to the mapping relationship, the images to be processed whose offset is greater than the offset threshold are subjected to perspective transformation to obtain the images after registration of each frame.

[0122] 9. Perform fusion processing based on the pixel values ​​of the matching feature points in the reference frame image and each frame of the image to be processed after the registration processing to obtain the motion trajectory of the subject in the image and generate a target image containing the motion trajectory of the subject.

[0123] 10. When the shooting mode corresponding to the multiple-frame images is the tripod mode, a fusion process is performed based on the pixel values ​​of the matching feature points in the reference frame image and each frame of the image to be processed to obtain the motion trajectory of the subject in the image, and generate a target image containing the motion trajectory of the subject.

[0124] In this embodiment, an image with a clarity higher than a clarity threshold is selected from the acquired multiple frames of images as a reference frame image to ensure the clarity of the reference frame image. Corner point detection is performed on the Y channel of the reference frame image and each frame of the image to be processed to accurately obtain the feature points of the image. The matching point pairs between the reference frame image and each frame of the image to be processed are accurately determined according to the feature description vector of the image. The homography matrix between the reference frame image and each frame of the image to be processed is determined according to the matching point pairs to perform a perspective transformation on the image to be processed in the handheld mode, so that the image to be processed can be mapped to the same image space or the same plane as the reference frame image. Based on the pixel values ​​of the matching feature points in the reference frame image and each frame of the image to be processed after the registration processing, the key features of the motion trajectory of the subject captured in each frame of the image can be fused to generate a target image containing the motion trajectory of the subject, so that the generated target image can achieve the effect of long exposure shooting, and can avoid the phenomenon of overexposure of the image caused by long exposure.

[0125] It should be understood that although Figure 2-6 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-6At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0126] Figure 7 FIG. 1 is a structural block diagram of an image processing device according to an embodiment. Figure 7 As shown, the image processing device includes: an acquisition module 702, a determination module 704, a registration module 706 and a generation module 708.

[0127] The acquisition module 702 is used to acquire multiple frame images and select a reference frame image from the multiple frame images.

[0128] The determination module 704 is used to determine the mapping relationship between the reference frame image and each frame of the image to be processed according to the feature points of the reference frame image and the feature points of each frame of the image to be processed; the multiple frames of images include each frame of the image to be processed.

[0129] The registration module 706 is used to perform registration processing on each frame of the image to be processed based on the mapping relationship.

[0130] The generation module 708 is used to fuse the reference frame image and each frame of the to-be-processed image after the registration process to obtain the motion trajectory of the subject in the image and generate a target image containing the motion trajectory of the subject.

[0131] In this embodiment, multiple frames of images are acquired without overexposure, a reference frame image is selected from the multiple frames of images, and the image to be processed in the multiple frames of images is registered so that the image to be processed and the reference frame image are in the same image space. The registered image and the reference frame image are fused to obtain the motion trajectory features of the subject in the image to the greatest extent, and a target image containing the subject's motion trajectory is generated, so that the target image can achieve the effect of a long exposure image and avoid the overexposure phenomenon caused by the long exposure of a single frame image.

[0132] In one embodiment, the registration module 706 is further used to: when the shooting mode corresponding to the multiple frames of images is the handheld mode, execute the step of performing registration processing on each frame of the to-be-processed image based on the mapping relationship.

[0133] In this embodiment, when the shooting mode corresponding to the multiple frames of images is the handheld mode, the step of performing registration processing on each frame of the image to be processed based on the mapping relationship is executed, and the images collected in the handheld mode are registered to avoid the problem of image blur caused by user hand shaking.

[0134] In one embodiment, the generation module 708 is also used for: when the shooting mode corresponding to the multiple-frame images is the tripod mode, the reference frame image and each frame of the image to be processed are fused based on the mapping relationship to obtain the motion trajectory of the subject in the image, and generate a target image containing the motion trajectory of the subject.

[0135] In this embodiment, when the shooting mode corresponding to the multiple-frame images is the tripod mode, the reference frame image and each frame of the image to be processed are fused based on the mapping relationship to quickly obtain a target image containing the motion trajectory of the subject, so that the target image can achieve the effect of a long exposure image and avoid the image overexposure caused by long exposure.

[0136] In one embodiment, the determination module 704 is further used to: extract feature points in the reference frame image and feature points of each frame of the image to be processed; determine matching point pairs between the reference frame image and each frame of the image to be processed according to the feature points of the reference frame image and the feature points of each frame of the image to be processed; determine the homography matrix between the reference frame image and each frame of the image to be processed according to the matching point pairs; the homography matrix is ​​used to characterize the mapping relationship between the reference frame image and each frame of the image to be processed;

[0137] The registration module 706 is also used to perform registration processing on each frame of the image to be processed based on the homography matrix.

[0138] In this embodiment, the homography matrix between the reference frame image and the image to be processed is determined based on the matching point pairs between the reference frame image and each frame of the image to be processed, so that each frame of the image to be processed can be mapped to the image space of the reference frame image, so that the image to be processed and the reference frame image are in the same perspective, thereby accurately registering the image to be processed.

[0139] In one embodiment, the multiple frames of images are YUV images; the determination module 704 is also used to: perform corner point detection on the reference frame image and each frame of the image to be processed on the Y channel respectively to obtain feature points in the reference frame image and feature points in each frame of the image to be processed.

[0140] In this embodiment, corner point detection is performed on the Y channel of the reference frame image in YUV format and each frame of the to-be-processed image in YUV format to obtain feature points in the image that are not interfered by noise, so that the extracted image feature points are more accurate.

[0141] In one embodiment, the determination module 704 is also used to: generate a corresponding feature descriptor according to each feature point of the reference frame image; generate a corresponding feature descriptor according to each feature point of each frame of the image to be processed; match the feature descriptors corresponding to the reference frame image with the feature descriptors corresponding to each frame of the image to be processed, respectively, to obtain matching point pairs between the reference frame image and each frame of the image to be processed.

[0142] In this embodiment, the feature descriptor of each feature point in the reference frame image is matched with the feature descriptor of each feature point in each frame of the image to be processed, so that a more accurate matching point pair can be generated.

[0143] In one embodiment, the registration module 706 is used to perform perspective transformation processing on each frame of the image to be processed according to the mapping relationship to obtain the registered image of each frame.

[0144] The image to be processed is processed by perspective transformation to map the image to be processed to the image space corresponding to the reference frame image, so as to accurately obtain the registered image to be processed.

[0145] In one embodiment, the registration module 706 is used to: determine the offset of each frame of the image to be processed relative to the reference frame image based on the mapping relationship; and perform registration processing on the image to be processed whose offset is greater than the offset threshold based on the mapping relationship.

[0146] In this embodiment, the offset of each frame of the image to be processed relative to the reference frame is determined, and the images to be processed whose offset is less than or equal to the offset threshold are removed to avoid the effective area of ​​the registered image being too small, thereby affecting the accuracy of image fusion.

[0147] In one embodiment, the acquisition module 702 is used to: acquire multiple frames of images, determine images whose clarity is greater than a clarity threshold in the multiple frames of images; and select a reference frame image from images whose clarity is greater than or equal to the clarity threshold.

[0148] In this embodiment, by determining images whose clarity is greater than a clarity threshold in multiple frames of images, removing images with low clarity, and selecting reference frame images from images whose clarity is greater than or equal to the clarity threshold, the image with the best clarity is selected as the reference frame image, thereby ensuring the accuracy of image registration.

[0149] In one embodiment, the generation module 708 is also used to: perform fusion processing based on the pixel values ​​of matching feature points in the reference frame image and each frame of the image to be processed after the registration processing to obtain the motion trajectory of the subject in the image, and generate a target image containing the motion trajectory of the subject.

[0150] In this embodiment, a fusion process is performed based on the pixel values ​​of the matching feature points in the reference frame image and each frame of the image to be processed after the registration process to generate a target image containing the motion trajectory of the subject. The generated target image can achieve the effect of long exposure shooting and avoid the phenomenon of image overexposure caused by long exposure.

[0151] The division of the various modules in the above-mentioned image processing device is only for illustration. In other embodiments, the image processing device may be divided into different modules as needed to complete all or part of the functions of the above-mentioned image processing device.

[0152] Figure 8 FIG. 1 is a schematic diagram of the internal structure of an electronic device in one embodiment. Figure 8 As shown, the electronic device includes a processor and a memory connected via a system bus. The processor is used to provide computing and control capabilities to support the operation of the entire electronic device. The memory may include a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program can be executed by the processor to implement an image processing method provided in each of the following embodiments. The internal memory provides a cached operating environment for the operating system computer program in the non-volatile storage medium. The electronic device may be a mobile phone, a tablet computer, a personal digital assistant, a wearable device, etc.

[0153] The implementation of each module in the image processing device provided in the embodiment of the present application may be in the form of a computer program. The computer program may be run on an electronic device or a server. The program modules constituted by the computer program may be stored in a memory of an electronic device or a server. When the computer program is executed by a processor, the steps of the method described in the embodiment of the present application are implemented.

[0154] The embodiment of the present application also provides a computer-readable storage medium, which is one or more non-volatile computer-readable storage media containing computer-executable instructions, and when the computer-executable instructions are executed by one or more processors, the processors execute the steps of the image processing method.

[0155] A computer program product comprising instructions, when executed on a computer, causes the computer to perform an image processing method.

[0156] Any reference to memory, storage, database or other media used in the embodiments of the present application may include non-volatile and / or volatile memory. Suitable non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM), which is used as an external cache memory. As an illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM) and memory bus dynamic RAM (RDRAM).

[0157] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. An image processing method, characterized in that: include: Shooting a moving subject to obtain a plurality of frames of images containing the subject; the plurality of frames of images are non-overexposed images, and the plurality of frames of images are YUV images; Selecting a reference frame image and an image to be processed from a plurality of frames of images containing the subject; Performing corner point detection on the Y channel of the reference frame image and each frame of the image to be processed respectively, to obtain feature points in the reference frame image and feature points of each frame of the image to be processed; Determining a mapping relationship between the reference frame image and each frame of the image to be processed according to the feature points of the reference frame image and the feature points of each frame of the image to be processed; Determining a shooting mode of the plurality of frames of the image according to a jitter parameter of the gyroscope; When the shooting mode is the handheld mode, determining the offset of each frame of the to-be-processed image relative to the reference frame image based on the mapping relationship; Obtaining an offset threshold, and determining an image to be processed whose offset is greater than the offset threshold; Performing registration processing on the image to be processed whose offset is greater than the offset threshold based on the mapping relationship; The reference frame image and each frame of the to-be-processed image after the registration process are fused to obtain the motion trajectory of the subject in the image, and generate a target image containing the motion trajectory of the subject; When the shooting mode is the tripod mode, the frames of the to-be-processed images and the reference frame images are fused based on the mapping relationship to obtain a motion trajectory of the subject in the image, and a target image containing the motion trajectory of the subject is generated.

2. The method according to claim 1, characterized in that The determining, according to the feature points of the reference frame image and the feature points of each frame of the image to be processed, a mapping relationship between the reference frame image and each frame of the image to be processed comprises: Determining matching point pairs between the reference frame image and each of the frames of the image to be processed, according to the feature points of the reference frame image and the feature points of each of the frames of the image to be processed; Determine a homography matrix between the reference frame image and each frame of the image to be processed according to the matching point pairs; the homography matrix is ​​used to characterize a mapping relationship between the reference frame image and each frame of the image to be processed; The registering process of each frame of the to-be-processed image based on the mapping relationship includes: The image to be processed is registered based on the homography matrix.

3. The method according to claim 2, characterized in that The determining, based on the feature points of the reference frame image and the feature points of the frames of the images to be processed, the matching point pairs between the reference frame image and the frames of the images to be processed respectively comprises: Generate a corresponding feature descriptor according to each feature point of the reference frame image; Generate a corresponding feature descriptor according to each feature point of each frame of the image to be processed; The feature descriptors corresponding to the reference frame image are matched with the feature descriptors corresponding to the frames of the image to be processed, respectively, to obtain matching point pairs between the reference frame image and the frames of the image to be processed.

4. The method according to claim 1, characterized in that The registering process of the to-be-processed image whose offset is greater than the offset threshold based on the mapping relationship includes: According to the mapping relationship, perspective transformation processing is performed on the image to be processed whose offset is greater than the offset threshold to obtain a registered image.

5. The method according to claim 1, characterized in that The step of selecting a reference frame image from a plurality of frames of images containing the subject comprises: Determine an image whose clarity is greater than a clarity threshold among a plurality of frames of images containing the subject; A reference frame image is selected from images whose definition is greater than or equal to the definition threshold.

6. The method according to any one of claims 1 to 5, characterized in that The step of fusing the reference frame image with each frame of the image to be processed after the registration process to obtain the motion trajectory of the subject in the image and generating a target image containing the motion trajectory of the subject includes: A fusion process is performed based on the pixel values ​​of the matching feature points in the reference frame image and each frame of the image to be processed after the registration process to obtain the motion trajectory of the subject in the image, and generate a target image containing the motion trajectory of the subject.

7. An image processing device, characterized in that: include: A module for photographing a moving subject to obtain multiple frames of images containing the subject; the multiple frames of images are non-overexposed images, and the multiple frames of images are YUV images; An acquisition module, used for selecting a reference frame image and an image to be processed from a plurality of frames of images containing the subject; A determination module, used to perform corner point detection on the Y channel of the reference frame image and each frame of the image to be processed, to obtain feature points in the reference frame image and feature points of each frame of the image to be processed; Determining a mapping relationship between the reference frame image and each frame of the image to be processed according to the feature points of the reference frame image and the feature points of each frame of the image to be processed; A module for determining a shooting mode of a plurality of frames of the image according to a jitter parameter of a gyroscope; A registration module, configured to determine, when the shooting mode is a handheld mode, the offset of each frame of the to-be-processed image relative to the reference frame image based on the mapping relationship; Obtaining an offset threshold, and determining an image to be processed whose offset is greater than the offset threshold; Performing registration processing on the image to be processed whose offset is greater than the offset threshold based on the mapping relationship; A generation module, used for fusing the reference frame image and each frame of the to-be-processed image after the registration process to obtain the motion trajectory of the subject in the image, and generating a target image containing the motion trajectory of the subject; The generating module is further used to fuse the frames of images to be processed and the reference frame images based on the mapping relationship when the shooting mode is the tripod mode, so as to obtain the motion trajectory of the subject in the image and generate a target image containing the motion trajectory of the subject.

8. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.