Image processing method and device, electronic equipment, chip and storage medium

Through semi-global matching processing and interpolation technology, the accuracy of motion vectors is improved, which solves the problem of low accuracy of motion vectors in the existing technology and improves the effect of image fusion.

CN118735963APending Publication Date: 2024-10-01BEIJING X RING TECHNOLOGY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310309794.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-27
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

The motion vector generated by the motion estimation method in the prior art has low accuracy and cannot accurately reflect the local motion displacement in the image sequence, resulting in poor display results when merging multiple frames of images.

Method used

By performing semi-global matching processing on the image to be processed, semi-dense optical flow is obtained, and through interpolation processing and super-pixel segmentation and other technologies, the accuracy of the motion vector is improved, and dense optical flow is generated to reflect the motion vector of each pixel.

Benefits of technology

The calculation accuracy of motion vectors is improved, allowing it to more accurately reflect the phase displacement of each position in the image, improving the display effect of multi-frame image fusion and the motion estimation capability of local moving objects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118735963A_ABST
    Figure CN118735963A_ABST
Patent Text Reader

Abstract

The invention provides an image processing method and device, electronic equipment, a chip and a storage medium. The method comprises the steps that an input image sequence is acquired, and the input image sequence comprises a reference image and at least one frame of to-be-processed image; based on the reference image, performing semi-global matching processing on a first to-be-processed image in the at least one frame of to-be-processed image to obtain a semi-dense optical flow of the first to-be-processed image; and performing interpolation processing on the semi-dense optical flow to obtain a dense optical flow. According to the method, the accuracy of the motion vector calculation result can be improved, meanwhile, the obtained motion vector can be used for carrying out motion estimation on the locally moving object in the to-be-processed image, and the display effect of the fused image can be improved in the multi-frame image fusion process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing, and in particular to an image processing method, device, electronic device, chip and storage medium. Background Art

[0002] In the technical field of video image processing, the process of calculating motion vectors is called motion estimation. The basic idea of ​​motion estimation is to divide each frame of an image sequence into many non-overlapping macroblocks, find the image block that is most similar to each macroblock from the reference frame according to certain criteria, that is, the matching block, and calculate the relative displacement between each macroblock and the corresponding matching block to obtain the motion vector.

[0003] However, the motion vector generated by the motion estimation method in the related art has low accuracy. Summary of the invention

[0004] The present disclosure provides an image processing method, device, electronic device, chip and storage medium to solve the problems in the related art and improve the accuracy of motion estimation results.

[0005] The first aspect embodiment of the present disclosure proposes an image processing method, which includes: obtaining an input image sequence, wherein the input image sequence includes a reference image and at least one frame of image to be processed; based on the reference image, performing semi-global matching processing on a first image to be processed in the at least one frame of image to be processed to obtain a semi-dense optical flow of the first image to be processed; and performing interpolation processing on the semi-dense optical flow to obtain a dense optical flow.

[0006] In some embodiments of the present disclosure, the interpolation processing of the semi-dense optical flow to obtain a dense optical flow includes: performing superpixel segmentation on the reference image to determine a plurality of superpixel regions; and interpolating the semi-dense optical flow for a first superpixel region among the plurality of superpixel regions to obtain a dense optical flow.

[0007] In some embodiments of the present disclosure, the interpolation processing of the semi-dense optical flow is performed on a first superpixel region among the multiple superpixel regions, including: initializing the motion vector of the first superpixel region; constructing an estimation model using the motion vector of the first superpixel region and the motion vectors of adjacent superpixel regions of the first superpixel region; and interpolating the semi-dense optical flow using the estimation model.

[0008] In some embodiments of the present disclosure, before interpolating the semi-dense optical flow, the method further includes: generating a mask using the reference image; and filtering the semi-dense optical flow based on the mask.

[0009] In some embodiments of the present disclosure, generating a mask using the reference image includes: generating a noise estimate and local variance information of each pixel in the reference image; and generating the mask using the noise estimate and the local variance information.

[0010] In some embodiments of the present disclosure, the method also includes: obtaining semantic information of each pixel in the first image to be processed; dividing the first image to be processed into at least one region based on the semantic information; determining whether direction information of motion vectors of multiple pixels in the at least one region is consistent based on the dense optical flow, and when the direction information is inconsistent, smoothing the motion vectors in the region.

[0011] In some embodiments of the present disclosure, the method also includes: determining the difference between the dense optical flow of the first image to be processed and the dense optical flow of the second image to be processed, wherein the second image to be processed is a previous frame image of the first image to be processed; judging whether the difference reaches a preset threshold, and smoothing the first image to be processed if the difference reaches the preset threshold.

[0012] A second aspect of the present disclosure provides an image processing device, the device comprising:

[0013] An acquisition module is used to acquire an input image sequence, wherein the input image sequence includes a reference image and at least one frame of an image to be processed;

[0014] A matching module, configured to perform a semi-global matching process on a first image to be processed in the at least one frame of images to be processed based on the reference image, so as to obtain a semi-dense optical flow of the first image to be processed;

[0015] The interpolation processing module performs interpolation processing on the semi-dense optical flow to obtain a dense optical flow.

[0016] The third aspect embodiment of the present disclosure proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the first aspect embodiment of the present disclosure.

[0017] The fourth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the method described in the first aspect embodiment of the present disclosure.

[0018] A fifth aspect embodiment of the present disclosure provides a computer program product, including a computer program, which executes the method described in the first aspect embodiment of the present disclosure when a processor is used to execute the computer program.

[0019] The sixth aspect embodiment of the present disclosure proposes a chip, which includes one or more interface circuits and one or more processors; the interface circuit is used to receive signals from a memory of an electronic device and send signals to the processor, the signals including computer instructions stored in the memory, and when the processor executes the computer instructions, the electronic device executes the method described in the first aspect embodiment of the present disclosure.

[0020] In summary, the image processing method proposed in the present disclosure obtains an input image sequence, wherein the input image sequence includes a reference image and at least one frame of image to be processed; based on the reference image, a semi-global matching process is performed on the first image to be processed in the at least one frame of image to be processed to obtain a semi-dense optical flow of the first image to be processed; and the semi-dense optical flow is interpolated to obtain a dense optical flow. This scheme obtains the motion vector of each pixel by performing a semi-global matching process on the image to be processed, so that the motion vector can more accurately reflect the phase displacement of each position in the image to be processed, thereby improving the accuracy of the motion vector calculation result; further, since the obtained motion vector can reflect the phase displacement of each position in the image to be processed, it can be used for motion estimation of objects with local motion in the image to be processed, and can improve the display effect of the fused image during the process of multi-frame image fusion.

[0021] 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

[0022] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0023] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present disclosure;

[0024] Figure 2 A flowchart of an image processing method provided by an embodiment of the present disclosure;

[0025] Figure 3 A flowchart of an image processing method provided by an embodiment of the present disclosure;

[0026] Figure 4 A flowchart of an image processing method provided by an embodiment of the present disclosure;

[0027] Figure 5 A schematic diagram of a process for generating a semi-dense optical flow in an image processing method according to an embodiment of the present disclosure;

[0028] Figure 6 A schematic block diagram of a matching cost accumulation calculation method in an image processing method according to an embodiment of the present disclosure;

[0029] Figure 7 It is a schematic diagram of the process of filtering the semi-dense optical flow in the image processing method of the embodiment of the present disclosure;

[0030] Figure 8 A schematic diagram of a reference image in filtering a semi-dense optical flow for an application example of the present disclosure;

[0031] Fig. 9 A schematic diagram of a mask used in filtering a semi-dense optical flow in an application example of the present disclosure;

[0032] Fig.10 A schematic diagram of filtering results in filtering a semi-dense optical flow in an application example of the present disclosure;

[0033] Fig.11 A schematic diagram of a process for obtaining dense optical flow in an image processing method according to an embodiment of the present disclosure;

[0034] Fig.12 A schematic diagram of a method for determining cluster centers for pixels in a superpixel segmentation method according to an example of an application of the present disclosure;

[0035] Fig.13 A schematic diagram of optical flow generated using a related image processing method;

[0036] Fig.14 A schematic diagram of optical flow generated by the image processing method according to an embodiment of the present disclosure;

[0037] Fig.15 A schematic diagram of the structure of an image processing device provided by an embodiment of the present disclosure;

[0038] Fig.16 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure;

[0039] Fig.17 A schematic diagram of the structure of a chip provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0040] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.

[0041] In the related art, in the process of motion estimation, the difference between the image block and the reference image can be calculated by block matching to generate a motion vector, and the two frames of images can be input into the optical flow estimation model, and the motion vector between the two frames of images can be generated by using multiple optical flow estimation modules connected in sequence in the optical flow estimation model. In this process, the global image alignment problem between the image sequences caused by camera motion is solved by performing global feature extraction and feature matching on the image. However, since the feature extraction is based on the global image, the extracted features cannot reflect the local phase displacement characteristics, so that the acquired motion vector cannot perform motion estimation and motion compensation for the locally moving object, and then in the process of multi-frame image fusion, it is impossible to accurately perform image fusion for the locally moving object, reducing the presentation effect of the fused image; at the same time, for the large depth of field scene application scenario with both foreground and background, since the motion vector obtained by the motion estimation method in the related art can only be used for global alignment of the foreground or background, it is impossible to align and match the foreground or background separately, so it is impossible to align and fuse the foreground and background at the same time, resulting in image quality defects in the fused image.

[0042] In order to solve the problems existing in the related technology, the present disclosure proposes an image processing method, which performs semi-global matching processing on the image to be processed to obtain the motion vector of each pixel, so that the motion vector can more accurately reflect the phase displacement of each position in the image to be processed, thereby improving the accuracy of the motion vector calculation results; further, since the obtained motion vector can reflect the phase displacement of each position in the image to be processed, it can be used to perform motion estimation on locally moving objects in the image to be processed, and can improve the display effect of the fused image during the process of multi-frame image fusion.

[0043] Before introducing the detailed solution of the present disclosure, the scenario to which the solution of the present disclosure is applied is described first. Figure 1 FIG. 1 is an application scenario diagram of an image processing method in an embodiment. Figure 1 As shown, the application scenario includes an electronic device 104, in which a camera module and several applications can be installed. The application can initiate an image acquisition instruction to acquire an image, and the camera module acquires the image 102. Among them, the camera module can include a front camera module and / or a rear camera module. Finally, the target image is sent to the target application. Among them, the electronic device 104 can be a smart phone, a tablet computer, a personal digital assistant, a wearable device, etc.

[0044] In some optional embodiments, the electronic device may also be a vehicle-mounted device or an Internet of Vehicles device, such as a smart car, etc. In the present disclosure, only a smart phone is taken as an example, but it does not limit the scope of the present disclosure.

[0045] A camera can be installed on an electronic device, and images can be acquired through the installed camera. Cameras can be divided into laser cameras, visible light cameras and other types according to the different images acquired. Laser cameras can acquire images formed by irradiating lasers onto objects, and visible light cameras can acquire images formed by irradiating visible light onto objects. Several cameras can be installed on an electronic device, and the installation locations are not limited. For example, a camera can be installed on the front panel of an electronic device, and two cameras can be installed on the back panel. The camera can also be installed inside the electronic device in an embedded manner, and then the camera can be opened by rotating or sliding. Specifically, a front camera and a rear camera can be installed on an electronic device. The front camera and the rear camera can acquire images from different perspectives. Generally, the front camera can acquire images from the front perspective of the electronic device, and the rear camera can acquire images from the back perspective of the electronic device.

[0046] It should be understood that in the present disclosure, the front camera or the rear camera is only used as an example to distinguish the shooting angles of different cameras, rather than to limit the functions of multiple cameras. The multiple cameras in the present disclosure can be rear cameras or front cameras at the same time, which is not limited in the present disclosure.

[0047] Several applications can be installed in electronic devices. Applications refer to software written for a certain application purpose in electronic devices. Electronic devices can provide services for users through applications. When an application needs to capture an image, it will initiate an image capture instruction. The electronic device will call the camera module according to the image capture instruction to capture the image. Image capture instructions refer to instructions used to trigger image capture operations.

[0048] The electronic device is also provided with a processor, and the image processing module in the processor can perform correction processing on the image captured by the camera module, for example, execute the image processing method provided in the present disclosure.

[0049] Figure 2 The following is a flow chart of an image processing method provided by an embodiment of the present disclosure. Figure 2 As shown, the method includes:

[0050] Step 201: Acquire an input image sequence, wherein the input image sequence includes a reference image and at least one frame of an image to be processed.

[0051] In the present disclosure, the at least one frame of image to be processed may be a group of images collected continuously in the time domain, for example, may be a group of images collected at a preset frequency within a certain period of time, or may be a group of images randomly selected in chronological order.

[0052] In the present disclosure, the reference image is used to calculate the displacement information of the image to be processed in the time domain; in actual application, the reference image may also be called a reference picture or a reference frame.

[0053] In the present disclosure, the reference image can be determined based on the at least one frame of the image to be processed; specifically, a reference image can be selected for each frame of the image to be processed, for example, the previous frame of each frame of the image to be processed can be used as the reference image of the image to be processed; a reference image can also be selected for all images to be processed, for example, one image can be randomly selected from images captured by a device for capturing images to be processed as a reference image, or the Nth (N≥1) frame of image before the first frame of the image to be processed can be selected as the reference image for all images to be processed, or one frame can be selected from all images to be processed as the reference image for all images to be processed.

[0054] Step 202: Based on the reference image, perform semi-global matching processing on a first image to be processed in the at least one frame of images to be processed to obtain a semi-dense optical flow of the first image to be processed.

[0055] In the present disclosure, the first image to be processed refers to the image to be processed in the current frame, that is, the image to be processed currently being processed is taken as the first image to be processed.

[0056] In the present disclosure, the first image to be processed and the reference image are used as input signals of the semi-global matching task, and the semi-dense optical flow is used as the output signal of the semi-global matching task.

[0057] In the present disclosure, semi-global matching processing is performed on the first image to be processed, and the difference between the first image to be processed and the reference image can be determined pixel by pixel, so as to obtain disparity information of each pixel. Since the disparity information between the first image to be processed and the reference image belongs to displacement information in the time domain, the obtained disparity information is also the motion vector of the first image to be processed, that is, the semi-dense optical flow.

[0058] Step 203: interpolate the semi-dense optical flow to obtain a dense optical flow.

[0059] In the present disclosure, before interpolation processing is performed on the semi-dense optical flow, a mask may be generated to screen credible pixels in the semi-dense optical flow.

[0060] In the present disclosure, the interpolation processing of the semi-dense optical flow may be performed by first performing super-pixel segmentation, and then performing interpolation processing on each super-pixel region after segmentation.

[0061] In the present disclosure, the motion vector may be estimated by constructing an estimation model.

[0062] In the embodiments of the present disclosure, after the dense optical flow is obtained, the dense optical flow can be input into a subsequent processing model, for example, input into an image distortion model, to perform deformation processing on the image.

[0063] In summary, according to the image processing method proposed in the present disclosure, an input image sequence is obtained, wherein the input image sequence includes a reference image and at least one frame of image to be processed; based on the reference image, a semi-global matching process is performed on the first image to be processed in the at least one frame of image to be processed to obtain a semi-dense optical flow of the first image to be processed; the semi-dense optical flow is interpolated to obtain a dense optical flow; by performing a semi-global matching process on the image to be processed, a motion vector of each pixel is obtained, so that the motion vector can more accurately reflect the phase displacement of each position in the image to be processed, thereby improving the accuracy of the motion vector calculation result; further, since the obtained motion vector can reflect the phase displacement of each position in the image to be processed, it can be used to perform motion estimation on objects with local motion in the image to be processed, and can improve the display effect of the fused image during multi-frame image fusion.

[0064] based on Figure 2 The embodiment shown, Figure 3 A flowchart of an image processing method proposed in the present disclosure is further shown. Figure 3 It includes steps 301 to 306. For ease of understanding, Figure 4 A flowchart of an image processing method provided by an embodiment of the present disclosure is shown.

[0065] Step 301: Obtain an input image sequence, wherein the input image sequence includes a reference image and at least one frame of an image to be processed. Figure 5 A schematic diagram of a process for generating a semi-dense optical flow in an image processing method according to an embodiment of the present disclosure is shown, that is, a schematic diagram of a process from step 301 to step 302 .

[0066] In the present disclosure, the image to be processed may also be referred to as a reference image, or may also be referred to as a reference frame; the reference image may select an image whose acquisition time is earlier than that of the image to be processed as a reference image, for example, in the image acquired by the camera, the previous frame of the first frame of the image to be processed is selected as the reference image; of course, when processing each frame of the image to be processed, the previous frame of the current frame of the image to be processed may be used as the reference image of the current frame of the image to be processed; the time difference information between the reference image and the current frame of the image to be processed can reflect the phase displacement of each pixel in the time domain, and therefore can reflect the motion change between the current frame of the image to be processed and the previous frame of the image.

[0067] Step 302: Based on the reference image, perform semi-global matching processing on the first image to be processed in the at least one frame of images to be processed to obtain a semi-dense optical flow of the first image to be processed, that is, a semi-dense motion vector.

[0068] It should be noted that the stereo matching algorithm is a computer vision algorithm that performs pixel-by-pixel matching calculations on images. Stereo matching completes the real-time calculation of disparity information by measuring the matching degree of each pixel between the dual-camera images. The semi-global matching algorithm is a type of stereo matching algorithm that can be used to estimate dense disparity maps from rectified stereo image pairs. Since the semi-global matching algorithm has predictable running time, a favorable trade-off between matching quality and calculation time, and can be implemented on application-specific integrated circuits (ASICs) and field programmable gate arrays (FPGAs), it is a good choice for the semi-global matching algorithm. Array), and therefore is widely used in the field of real-time stereo vision (e.g., robots, advanced driver assistance systems, etc.); the semi-global matching algorithm includes a data matching and a cost aggregation algorithm for a stereo matching algorithm based on a single row of image data; specifically, the application process of the semi-global matching algorithm includes two parts: the first part is to establish pixel-corresponding costs for all possible difference labels in a defined search space, that is, matching costs; the second part, the computational cost of the first part is defined as running along the scan line, and regularized in the image domain using a cumulative dynamic programming scheme; wherein, in the process of matching costs, it is necessary to accumulate, regularize, and aggregate scan lines from multiple directions, and select the best match based on a cost evaluation method (e.g., a winner-takes-all rule).

[0069] It should be noted that in the application process of the stereo matching algorithm, a given set of stereo vision image pairs includes a first image and a second image. For a pixel with coordinates (x, y) in the first image, it is necessary to determine a pixel set matching the pixel in the second image. The pixel set can be expressed as: Where D represents the maximum allowable parallax offset range; after determining the matching pixel set, the best match will be searched in the pixel set, and in this process, multiple false matches will often be generated; in order to solve the problem of false matches, a regularization penalty term can be added in the matching process. The constraint of the regularization penalty term can effectively improve the matching ability under dynamic programming and improve the robustness of the matching results, thereby avoiding matching jitter between adjacent pixels and avoiding false matches;

[0070] For example, the regularized penalty term can be expressed as:

[0071]

[0072] Among them, D(p + d p ) represents the similarity metric calculated pixel-by-pixel at the position with parallax Dp, and R(p, d p , q, d q ) represents the regularization term cost between pixels p and q at positions Dp and Dq, and N represents the matching pairs of all neighborhoods.

[0073] It should be noted that for each pixel p at the position with parallax d, by accumulating the corresponding matching costs, it is possible to achieve optimization in multiple directions and calculate the aggregation cost S(p, d) for the line data at the macro level, thereby improving the robustness of the semi-global matching result; among them, as the number of accumulation directions increases, the quality of the optimization result will improve accordingly, but the operation speed will decrease. For example, the optimization calculation with 16 directions can ensure better quality but slower operation speed; in order to balance the optimization result and the optimization speed, an 8-direction accumulation calculation method can be adopted. As Figure 6 shown, the 8-direction matching cost accumulation calculation method includes forward and backward calculations. Among them, the forward calculation is responsible for accumulating the matching costs on the left, upper left, above, and upper right of the pixel, and the backward calculation is responsible for accumulating the matching costs on the right, lower right, below, and lower left.

[0074] Here, the matching cost consists of a matching term D(p, d) and a binary regularization term R(d p , d q ). D(p, d) is characterized by any local image similarity metric, usually using the sum of absolute differences or the square of the difference, or calculating the Hamming distance after the Census transform;

[0075] Exemplarily, R(d p , d q ) can be expressed as:

[0076]

[0077]

[0078] Among them, P1 and P2 are the two outputs of the regularization term, and P1 < P2; during the calculation of the regularization term, through a three-stage calculation process, it is possible to add a small and uniform matching cost penalty term to the parallax to generate smoother parallax information and maintain the discontinuity of the parallax at the parallax jump position; here, since the discontinuity in parallax and the discontinuity in the image luminance component are usually corresponding, therefore, in order to further maintain the discontinuity of the parallax, the gradient information of the luminance component can also be added to the penalty term;

[0079] The accumulated matching cost S(p, d) can be expressed as:

[0080]

[0081]

[0082] Among them, L r (p, d) represents the matching cost of pixel p at disparity position d and along direction r, represents the minimum cost of the previous pixel; here, in the process of calculating the matching cost of pixel p, since the minimum cost of the previous pixel is the same for all current pixels, in order to ensure the stability of the calculation result, the minimum cost of the previous pixel is subtracted; the disparity d*(p) of each pixel can be expressed as d*(p)=argmindS(p,d), and the result of sub-pixel accuracy can be obtained by curve fitting of d*(p); here, considering that the image pairs from the dual cameras are not actually processed completely symmetrically in the calculation, the disparity can be calculated in the opposite direction to achieve consistency check. At the same time, the disparity information with too large difference between the first calculation and the reverse calculation is discarded, so as to optimize the texture area and fill the invalid area.

[0083] It should be noted that one-dimensional disparity information can be obtained by using the semi-global matching method, that is, in the accumulation process of semi-global matching in the dual-camera stereo matching application, the disparity information is defined for a one-dimensional search range; however, in the motion estimation process, for unconstrained optical flow, the search task needs to be set in a two-dimensional search domain. Therefore, it is necessary to convert the one-dimensional disparity information into a motion vector in a two-dimensional space, that is, to apply the semi-global matching technology to a coarse-to-fine motion estimation method to achieve stable and efficient motion vector calculation; in the embodiment of the present disclosure, since there is a time domain difference in the position between the first image to be processed and the reference image, Therefore, the position difference information between the first image to be processed and the reference image is also the displacement information of the image to be processed during the movement, that is, the motion vector; therefore, by using the semi-global matching algorithm to obtain the position difference information between the first image to be processed and the reference image, it is possible to apply the disparity information of the one-dimensional space to the two-dimensional space to obtain the motion vector. At the same time, by using the local estimation characteristics of the semi-global matching algorithm, the phase displacement characteristics of the local moving object in the first image to be processed can be obtained, thereby improving the accuracy of the acquired motion vector, and then in the process of using the acquired motion vector for image alignment, the image fusion effect is improved.

[0084] Specifically, the process of obtaining the motion vector of the first image to be processed by using the semi-global matching algorithm may include the following four parts:

[0085] Part I: Semi-global matching in two dimensions;

[0086] Here, in order to extend the semi-global matching results of one-dimensional space to two-dimensional space for optical flow search in two-dimensional space, we can use bijective discrete mapping to describe the one-dimensional dual-camera parallax matching to two-dimensional optical flow search, which can be specifically expressed by the following formula:

[0087]

[0088] Where φ(d) represents the motion vector on the two-dimensional image converted from the disparity signal on the one-dimensional signal, represents the motion vector space, which can also be called the motion vector domain; By positive integer f m Definition, f m Specify the largest possible discrete motion vector:

[0089] Motion Vector Space It can be expressed using the following formula:

[0090]

[0091] Among them, (△u,△v) represents the offset, and the offset (△u,△v) describes a pixel-level accurate flow estimation. The inverse mapping of the offset can be expressed using the following formula:

[0092]

[0093] Here, f m The defined process can be expressed using the following formula:

[0094]

[0095]

[0096] in, Represents the motion vector field The Manhattan distance between the two disparity values, i.e., the L1 distance, P κ Represents the penalty factor for scaling the slope of the linear function.

[0097] Part II: Design of matching cost.

[0098] Here, in the one-dimensional binocular disparity calculation, the matching cost consists of the matching difference part and the regularization part, which can be expressed by the following formula:

[0099]

[0100] After mapping the matching cost to two-dimensional space, it can be expressed using the following formula:

[0101]

[0102] Among them, the regularization term can be expressed by the following formula:

[0103]

[0104] Part III: Multi-scale motion estimation design.

[0105] Specifically, the input image is first downsampled to generate a multi-layer image pyramid, and then the motion vector is estimated at each layer of the image pyramid. The motion vector of the lower layer is amplified according to the image pyramid scaling ratio and then fused with the previous motion vector. Finally, the input image is divided into regions based on semantic information or superpixels. As long as one position in the region obtains a valid motion vector, the entire region has a usable motion vector.

[0106] Part 4: Initialization strategy.

[0107] Here, since the motion vector is naturally continuous on the same object, it is necessary to optimize the initialization process by combining global alignment and local alignment. Specifically, in the initialization process, a global alignment method is used to obtain prior information, that is, a global alignment homography (Homography) matrix output by global alignment, and based on the Homography matrix, a global motion vector is calculated at each pixel position as an initialization value. The Homography matrix can be obtained by feature extraction and feature matching, or by a sparse optical flow method.

[0108] Step 303: Generate a mask using the reference image. Figure 7 A schematic diagram of the flow chart of filtering the semi-dense optical flow in the image processing method in the embodiment of the present disclosure is shown, that is, a schematic diagram of the flow chart from step 303 to step 304.

[0109] It should be noted that since image content information (such as noise information) will affect the confidence and accuracy of the semi-dense optical flow, in order to improve the accuracy of the semi-dense optical flow, the obtained semi-dense optical flow can be screened according to the image information, that is, the semi-dense optical flow can be filtered. Specifically, the screening can be based on the intensity of the image information and the noise intensity. In the screening process, the position with stronger image information can be preferentially selected as the reference position of the credible semi-dense optical flow. As the gradient intensity of the image itself weakens, the confidence of the semi-dense optical flow result at the corresponding position will also decrease until it approaches the image noise level. At this time, the confidence of this type of semi-dense optical flow is not enough to support subsequent operations, or the use of neighborhood information can better characterize the motion characteristics of the position. Therefore, the optical flow at the corresponding position can be discarded.

[0110] In the present disclosure, the mask may also be referred to as a mask, or a Mask, and the embodiments of the present disclosure are not limited thereto, as long as the function thereof can be achieved.

[0111] It should be noted that in order to implement screening of the semi-dense optical flow, a mask for screening may be generated.

[0112] Based on this, in some embodiments, step 303 may include:

[0113] For each pixel in the reference image, generating a noise estimate and local variance information of the pixel;

[0114] The mask is generated using the noise estimate and the local variance information.

[0115] Exemplarily, the process of screening the semi-dense optical flow using the mask may include:

[0116] Step 1: Load a pre-calibrated noise estimation curve to perform local noise estimation;

[0117] Here, the noise estimation information can be determined based on a preset noise estimation curve, wherein the noise estimation curve can also be called a noise estimation function, which is parameter information determined based on a preset noise estimation attribute (Noise Profile). Here, Noise Profile is a configuration file asset of an imaging device, which contains relevant configuration information of noise.

[0118] Here, in order to achieve noise reduction, it is necessary to estimate the parameters of the noise model first; the parameters of the noise model include dark current D, analog gain value g, read noise (nread, read noise) and ADC noise (nADC, ADCnoise); since the mean value of the noise signal is related to the ambient illumination and the dark current, and when the ambient illumination is 0, the mean value of the noise signal is related to the dark current; therefore, the size of the noise signal generated by the dark current can be estimated by a preset noise estimation curve; specifically, first cover the lens of the camera device, then take multiple frames of images, and then calculate the average value of the noise signal of the multiple frames of images taken, and then the dark current value can be obtained; here, the analog gain g can be expressed as E(I) = g·t·(α·0+D) = g·t·D, since the analog gain value g is different for different sensitivities (ISO), therefore, in order to eliminate the influence of different analog gain values ​​g, the estimated dark current signal is removed; wherein, for nread and nADC, these two types of noise can be collectively referred to as additive noise (nadd, add noise).

[0119] After removing the dark current D, the mean and variance of the noise signal can be expressed as:

[0120] E(I) = g·t·(α·Φ) (14);

[0121] σ(I) 2 =g 2 ·t·(α·Φ)+σ(nadd) 2 (15);

[0122] σ(I) 2 =g·E(I)+σ(nadd) 2 (16);

[0123] According to formula (14) to formula (16), the variance of the noise signal σ(I) 2 The and mean E(I) can satisfy a linear relationship, and the magnification is the simulated magnification coefficient gain value g, and the intercept in the linear relationship is nadd; therefore, by shooting multiple frames of grayscale images and calculating the mean and variance of each pixel, and then performing linear fitting on the obtained results, the simulated magnification coefficient gain values ​​g and nadd can be estimated.

[0124] Step 2: Obtain pixel values ​​and use the noise estimation curve to estimate the noise at the current position;

[0125] Here, the pixel value of each pixel in the reference image is obtained first, and then the noise level sigma_noise at each pixel position is estimated using the noise estimation curve.

[0126] Step 3: Calculate the local variance information sigma of the image, that is, calculate the variance information of each pixel;

[0127] Step 4: Generate a mask based on the image local variance information sigma and the noise level sigma_noise.

[0128] For example, Figure 8 is the input reference image, Fig. 9 is a mask generated based on a reference image; wherein the highlighted area in the mask is an area with a strong signal, and can also be represented as a credible pixel area.

[0129] Step 304: Based on the mask, filter the semi-dense optical flow.

[0130] For example, Fig.10 Shows the use of Fig. 9The result of filtering the semi-dense optical flow by the mask shown; it can be seen that by filtering the semi-dense optical flow generated in step 302 by the mask, the credible part in the semi-dense optical flow can be screened out to ensure the acquisition of credible optical flow, thereby improving the accuracy of the motion vector calculation result.

[0131] Step 305: Perform superpixel segmentation on the reference image to determine multiple superpixel regions, that is, obtain superpixel information. Fig.11 The flowchart of obtaining dense optical flow in the image processing method of the embodiment of the present disclosure is shown, that is, a flowchart of step 305 to step 306.

[0132] It should be noted that superpixel segmentation is an image segmentation method that combines adjacent pixels with similar texture, color, brightness and other features into irregular pixel blocks with certain visual significance. The superpixel region retains effective information for further image segmentation and generally does not destroy the boundary information of objects in the image. The image obtained after superpixel segmentation is a collection of all superpixel regions. The superpixel region included in the segmentation result may cover the content of the entire image, or the segmentation result may include a collection of contours extracted from the image (for example, contours obtained by edge detection). Among them, since each superpixel region is a small region composed of a series of pixels with adjacent positions and similar characteristics such as color, brightness, texture, etc., for each superpixel region, all pixels are similar in terms of the measurement of some characteristics or the calculated pixel characteristics, such as color, brightness, texture, etc., while different superpixel regions are very different in terms of the measurement of these characteristics.

[0133] Here, in the calculation process of dense optical flow, it is necessary to fully consider the image content information, and optimize the interpolation and modeling process from semi-dense optical flow to dense optical flow. By adopting the superpixel segmentation method, the pixels can be grouped according to the similarity of the features between pixels, and a small number of superpixels can be used instead of a large number of pixels to express the image features, which greatly reduces the complexity of image post-processing.

[0134] In the present disclosure, simple linear iterative clustering (SLIC) can be used for superpixel segmentation. In the process of using SLIC to segment an image, the color image is first converted into a five-dimensional feature vector in Lab color space and XY coordinates, and then a distance metric is constructed for the five-dimensional feature vector, and the image pixels are locally clustered.

[0135] In the present disclosure, the color image can be converted into the Lab color space by using the Lab color model; the Lab color model is composed of three elements: brightness (L), a and b; wherein the value range of L is from 0 (black) to 100 (white), a and b are two elements related to color, a represents the color range from magenta to green (negative value indicates green and positive value indicates magenta), and b represents the color range from yellow to blue (negative value indicates blue and positive value indicates yellow);

[0136] It should be noted that converting the color image to Lab color space first has the following advantages:

[0137] 1) In the three-primary color mode (RGB) or the printing four-color mode (CMYK), it is impossible to accurately adjust the color balance or brightness. For the Lab color space, since Lab color is close to human physiological vision, the color balance can be accurately adjusted by modifying the output color levels of the a and b components, or the brightness contrast can be adjusted using the L component;

[0138] 2) Lab color describes the way color is displayed, not the amount of specific colorant required by a device (such as a monitor, printer, or digital camera) to produce color. Therefore, the Lab color module is independent of device parameters.

[0139] 3) The Lab color space has a wide color gamut. In addition to including all the color gamuts of RGB and CMYK, it can also perceive other colors, and has better color expression. At the same time, the use of the Lab color model can also solve the problem of too many transition colors between blue and green, and lack of yellow and other colors between green and red, thereby making up for the uneven color distribution of the RGB color model.

[0140] Exemplarily, the process of using SLIC to perform superpixel segmentation includes:

[0141] Step 1: Initialize the seed point (cluster center).

[0142] According to the set number of superpixels, seed points are evenly distributed in the image; assuming that the image has a total of N pixels, which are pre-divided into K superpixels of the same size, then the size of each superpixel is N / K, and the distance (step size) between adjacent seed points is approximately S=sqrt(N / K).

[0143] Step 2: Reselect a seed point within the n*n neighborhood of the seed point (n=3).

[0144] Specifically, the gradient values ​​of all pixels in the neighborhood are calculated, and the seed point is moved to the place with the smallest gradient in the neighborhood. The purpose of this is to avoid the seed point falling on the contour boundary with a large gradient, so as not to affect the subsequent clustering effect.

[0145] Step 3: Assign a class label to each pixel in the neighborhood around each seed point, that is, search for pixels, that is, determine which cluster center each pixel belongs to.

[0146] It should be noted that if Fig.12 As shown, when the desired superpixel size is S*S, the search range can be limited to 2S*2S to accelerate the convergence of the algorithm.

[0147] Step 4: Distance metric.

[0148] Here, the measured distance includes color distance and spatial distance; for each searched pixel point, the distance between the pixel point and the seed point is calculated respectively; the distance calculation method can be expressed by the following formula:

[0149]

[0150]

[0151]

[0152] Among them, d c Indicates the color distance, d s represents the spatial distance, D′ represents the distance metric, and N s Indicates the maximum spatial distance within the class, N s It can be defined as Ns = S = sqrt(N / K) and is applicable to each cluster, N c Represents the maximum color distance, and m represents a constant. Here, since Nc will be different when the image and cluster are different, a fixed constant m is used instead. Therefore, D′ can be expressed by the following formula:

[0153]

[0154] Among them, m∈[1,40], specifically, m=10.

[0155] It should be noted that, since each pixel point will be searched by multiple seed points, each pixel point will have a distance from the surrounding seed points, so the seed point corresponding to the minimum value is taken as the cluster center of the pixel point.

[0156] Step 5: Iterative optimization.

[0157] Here, the cluster center of each pixel point is determined iteratively until the error converges, that is, the cluster center of each pixel point no longer changes. Furthermore, the number of iterations is 10.

[0158] Step 6: Enhance connectivity.

[0159] Here, after iterative optimization, connectivity enhancement processing can be further performed to solve the problems that may appear after iteration, such as multiple connectivity, superpixel size is too small, and a single superpixel is cut into multiple discontinuous superpixels. Specifically, a new label table is created, and all elements in the table are -1. In a "Z"-shaped direction (i.e., from left to right, from top to bottom), discontinuous superpixels and superpixels with too small sizes are reallocated to adjacent superpixels, and the traversed pixels are assigned corresponding labels until all pixels are traversed.

[0160] When using the SLIC algorithm for image segmentation, it can not only segment color images, but also grayscale images. The superpixels generated by segmentation are as compact and neat as cells, and the neighborhood features are easier to express. At the same time, very few parameters need to be set. By default, only the number of pre-segmented superpixels needs to be set. Furthermore, compared with other superpixel segmentation methods, it runs faster, and the generated superpixels have higher compactness and contour preservation.

[0161] Step 306: For the first superpixel area among the multiple superpixel areas, interpolate the semi-dense optical flow, that is, interpolate based on superpixels to obtain a dense optical flow, that is, a dense motion vector.

[0162] In the embodiment of the present disclosure, the step 306 specifically includes:

[0163] Initializing a motion vector of the first superpixel region;

[0164] constructing an estimation model using the motion vector of the first superpixel region and the motion vectors of the adjacent superpixel regions of the first superpixel region;

[0165] The semi-dense optical flow is interpolated using the estimation model.

[0166] Specifically, the process of interpolating the semi-dense optical flow may include:

[0167] Step 1: Superpixel motion vector initialization.

[0168] It should be noted that since superpixels are segmented based on image content, each continuous image content undergoes the same translation motion and has the same motion vector; therefore, a superpixel motion vector can be generated from the input match (motion vector) as an initialization value to improve the model estimation efficiency; specifically, for each superpixel in the defined multiple superpixels, a matching motion vector is generated as the superpixel motion vector; when there are multiple matching motion vectors, the median is selected from the multiple motion vectors as the superpixel motion vector; for invalid superpixels, that is, superpixels without matching motion vectors, the superpixel motion vector can be set to the flow initialization of the nearest valid superpixel.

[0169] Step 2: Dense motion vector estimation.

[0170] In the present disclosure, it is necessary to construct an estimation model to estimate dense motion vectors from superpixel points and semi-dense motion vectors; specifically, the estimation model can be constructed using superpixel information and motion vector information of each superpixel and adjacent superpixel areas.

[0171] It should be noted that since the motion vector is usually not completely constrained by the superpixel, but will spread to the positions of surrounding superpixels that do not belong to the neighborhood, the RANSAC algorithm can be used to obtain valid sample data when estimating the model of each superpixel.

[0172] In the present disclosure, the estimation model can also be optimized by an iterative method. Specifically, a plurality of sets adjacent to superpixels can be called the support neighborhood of the superpixel. In each iteration, a subset of the superpixel support neighborhood is randomly selected and a corresponding model is generated. The generated model is used to evaluate the current estimation model to optimize the current model parameters. The estimation model can be expressed by the following formula:

[0173]

[0174] in, Represents the cost function of the model estimation.

[0175] It should be noted that when estimating a piecewise linear estimation model for each superpixel, in order to ensure spatial continuity, it is necessary to optimize the estimation model based on the transfer strategy, that is, to use the model of the spatial adjacent position to optimize the model. Further, the weighted least square method (WLS) can be used to estimate the affine transformation model; specifically, the superpixel information is split into odd and even parts according to the scan line order, and when performing forward processing and reverse processing of the scan line, hypothesis propagation is performed first, and then random sampling based on adjacent superpixels is performed to achieve random initialization of the estimation model. In this process, each superpixel position is initialized as a translation model, that is, a simplified affine transformation model; hypothesis transfer is the core mechanism of the affine transformation model. For a superpixel, the affine transformation model transfers the model information of its neighborhood to the estimation model at the current position.

[0176] It should be noted that after completing the motion vector interpolation and obtaining the dense optical flow, in order to further improve the accuracy and robustness of the dense optical flow and avoid problems such as jitter when the motion vector occurs in the application, the dense optical flow can be further post-processed between frames or within frames.

[0177] On the one hand, different superpixel regions within the frame can be smoothed in combination with image content information to achieve further optimization of the image and motion vector.

[0178] Based on this, in some embodiments, the method may also include: obtaining semantic information of each pixel in the first image to be processed; dividing the first image to be processed into at least one region based on the semantic information; determining whether the direction information of motion vectors of multiple pixels in the at least one region is consistent based on the dense optical flow, and when the direction information is inconsistent, smoothing the motion vectors in the region.

[0179] On the other hand, based on the continuity of the motion vector information of the previous and next frames, the motion vector can be smoothed in the time domain to avoid jitter and other problems caused by the motion vector being applied to the time domain processing of the video.

[0180] Based on this, in some embodiments, the method may also include: determining the difference between the dense optical flow of the first image to be processed and the dense optical flow of the second image to be processed, wherein the second image to be processed is the previous frame image of the first image to be processed; judging whether the difference value reaches a preset threshold, and when the difference value reaches the preset threshold, smoothing the first image to be processed.

[0181] Here, the smoothing process can be expressed by the following formula:

[0182] Pre_frame_MV*Alpla+Cur_frame_MV*(1-Alpla) (20);

[0183] It should be noted that in order to achieve better smoothing effect and ensure the stability of the background area in the image with little scene change, the smoothing window size can be increased as needed, for example, the smoothing window value can be set to 30.

[0184] Fig.13 A schematic diagram of optical flow generated by using a related art image processing method is shown. Fig.14 An optical flow schematic diagram generated by the image processing method of an embodiment of the present disclosure is shown. By comparison, it can be seen that the motion vector generated by the image processing method of the present disclosure can more accurately reflect the local features and has higher density and smoothness. On this basis, in the process of performing multi-frame image denoising, inter-frame smoothing and fusion of videos using the motion vector generated by the image processing method of the present disclosure, the image and video quality can be effectively improved.

[0185] Fig.15 FIG. 1 is a schematic diagram of the structure of an image processing device 1500 provided in an embodiment of the present disclosure. Fig.15 As shown, the image processing device includes: an acquisition module 1510, which acquires an input image sequence, wherein the input image sequence includes a reference image and at least one frame of an image to be processed; a matching module 1520, which is used to perform a semi-global matching process on a first image to be processed in the at least one frame of images to be processed based on the reference image, so as to obtain a semi-dense optical flow of the first image to be processed; and an interpolation module 1530, which performs an interpolation process on the semi-dense optical flow to obtain a dense optical flow.

[0186] In some embodiments, the interpolation module 1530 is specifically used to: perform superpixel segmentation on the reference image to determine multiple superpixel regions; and interpolate the semi-dense optical flow for a first superpixel region among the multiple superpixel regions to obtain a dense optical flow.

[0187] In some embodiments, the interpolation module 1530 is specifically used to: initialize the motion vector of the first superpixel region; construct an estimation model using the motion vector of the first superpixel region and the motion vectors of adjacent superpixel regions of the first superpixel region; and interpolate the semi-dense optical flow using the estimation model.

[0188] In some embodiments, the apparatus may further include: a filtering module, configured to generate a mask using the reference image before interpolating the semi-dense optical flow; and perform filtering on the semi-dense optical flow based on the mask.

[0189] In some embodiments, the filtering module is specifically used to: generate a noise estimate and local variance information of each pixel in the reference image; and generate the mask using the noise estimate and the local variance information.

[0190] In some embodiments, the device may also include: a post-processing module for obtaining semantic information of each pixel in the first image to be processed; based on the semantic information, dividing the first image to be processed into at least one region; based on the dense optical flow, determining whether the direction information of the motion vectors of multiple pixels in the at least one region is consistent, and when the direction information is inconsistent, smoothing the motion vectors in the region.

[0191] In some embodiments, the device may also include: a post-processing module, used to determine the difference between the dense optical flow of the first image to be processed and the dense optical flow of the second image to be processed, wherein the second image to be processed is the previous frame image of the first image to be processed; determine whether the difference value reaches a preset threshold, and when the difference value reaches the preset pre-threshold, smooth the first image to be processed.

[0192] Since the device provided in the embodiment of the present disclosure corresponds to the methods provided in the above-mentioned embodiments, the implementation of the method is also applicable to the device provided in the embodiment and will not be described in detail in this embodiment.

[0193] In the embodiments provided in the present application, the methods and devices provided in the embodiments of the present application are introduced. In order to implement the functions in the methods provided in the embodiments of the present application, the electronic device may include a hardware structure and a software module, and implement the functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. A function of the functions may be executed in the form of a hardware structure, a software module, or a hardware structure plus a software module.

[0194] Fig.16 1 is a block diagram of an electronic device 1600 for implementing the above-mentioned image processing method according to an exemplary embodiment. For example, the electronic device 1600 may be a mobile phone, a computer, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0195] Reference Fig.16 , the electronic device 1600 may include one or more of the following components: a processing component 1602 , a memory 1604 , a power component 1606 , a multimedia component 1608 , an audio component 1610 , an input / output (I / O) interface 1612 , a sensor component 1614 , and a communication component 1616 .

[0196] The processing component 1602 generally controls the overall operation of the electronic device 1600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1602 may include one or more processors 1620 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 1602 may include one or more modules to facilitate the interaction between the processing component 1602 and other components. For example, the processing component 1602 may include a multimedia module to facilitate the interaction between the multimedia component 1608 and the processing component 1602.

[0197] The memory 1604 is configured to store various types of data to support operations on the electronic device 1600. Examples of such data include instructions for any application or method operating on the electronic device 1600, contact data, phone book data, messages, pictures, videos, etc. The memory 1604 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.

[0198] The power supply component 1606 provides power to the various components of the electronic device 1600. The power supply component 1606 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 1600.

[0199] The multimedia component 1608 includes a screen that provides an output interface between the electronic device 1600 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 1608 includes a front camera and / or a rear camera. When the electronic device 1600 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.

[0200] The audio component 1610 is configured to output and / or input audio signals. For example, the audio component 1610 includes a microphone (MIC), and when the electronic device 1600 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1604 or sent via the communication component 1616. In some embodiments, the audio component 1610 also includes a speaker for outputting audio signals.

[0201] I / O interface 1612 provides an interface between processing component 1602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0202] The sensor assembly 1614 includes one or more sensors for providing various aspects of status assessment for the electronic device 1600. For example, the sensor assembly 1614 can detect the open / closed state of the electronic device 1600, the relative positioning of components, such as the display and keypad of the electronic device 1600, and the sensor assembly 1614 can also detect the position change of the electronic device 1600 or a component of the electronic device 1600, the presence or absence of user contact with the electronic device 1600, the orientation or acceleration / deceleration of the electronic device 1600, and the temperature change of the electronic device 1600. The sensor assembly 1614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 1614 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 1614 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0203] The communication component 1616 is configured to facilitate wired or wireless communication between the electronic device 1600 and other devices. The electronic device 1600 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G LTE, 5G NR (NewRadio) or a combination thereof. In an exemplary embodiment, the communication component 1616 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 1616 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.

[0204] In an exemplary embodiment, the electronic device 1600 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 perform the above methods.

[0205] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1604 including instructions, and the instructions can be executed by a processor 1620 of the electronic device 1600 to perform the above 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.

[0206] An embodiment of the present disclosure further proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the image processing method described in the above embodiment of the present disclosure.

[0207] An embodiment of the present disclosure further provides a computer program product, including a computer program, which executes the image processing method described in the above embodiment of the present disclosure when a processor is used.

[0208] The embodiment of the present disclosure also provides a chip, which can be seen in Fig.17 Schematic diagram of the chip structure shown. Fig.17 The chip shown includes a processor 1701 and an interface 1702. The number of the processor 1701 can be one or more, and the number of the interface 1702 can be multiple.

[0209] Optionally, the chip further includes a memory 1703, and the memory 1703 is used to store necessary computer programs and data.

[0210] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. 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.

[0211] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0212] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.

[0213] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processing module, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (control method), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.

[0214] It should be understood that the various parts of the embodiments of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0215] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0216] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0217] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. An image processing method, characterized in that: The method comprises: Acquire an input image sequence, wherein the input image sequence includes a reference image and at least one frame of an image to be processed; Based on the reference image, performing semi-global matching processing on a first image to be processed in the at least one frame of images to be processed to obtain a semi-dense optical flow of the first image to be processed; The semi-dense optical flow is interpolated to obtain a dense optical flow.

2. The method according to claim 1, characterized in that: The interpolation processing of the semi-dense optical flow to obtain a dense optical flow includes: Performing superpixel segmentation on the reference image to determine a plurality of superpixel regions; For a first superpixel area among the multiple superpixel areas, interpolation processing is performed on the semi-dense optical flow to obtain a dense optical flow.

3. The method according to claim 2, characterized in that The interpolation process of the semi-dense optical flow for a first super-pixel region among the multiple super-pixel regions includes: Initializing a motion vector of the first superpixel region; constructing an estimation model using the motion vector of the first superpixel region and the motion vectors of the adjacent superpixel regions of the first superpixel region; The semi-dense optical flow is interpolated using the estimation model.

4. The method according to claim 1, characterized in that: Before performing interpolation processing on the semi-dense optical flow, the method further includes: Using the reference image, generating a mask; Based on the mask, filtering is performed on the semi-dense optical flow.

5. The method according to claim 4, characterized in that The step of generating a mask by using the reference image comprises: For each pixel in the reference image, generating a noise estimate and local variance information of the pixel; The mask is generated using the noise estimate and the local variance information.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Acquire semantic information of each pixel in the first image to be processed; Based on the semantic information, dividing the first image to be processed into at least one region; Based on the dense optical flow, it is determined whether direction information of motion vectors of a plurality of pixels in the at least one region is consistent, and when the direction information is inconsistent, the motion vectors in the region are smoothed.

7. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Determine a difference value between a dense optical flow of the first image to be processed and a dense optical flow of a second image to be processed, wherein the second image to be processed is a previous frame image of the first image to be processed; It is determined whether the difference value reaches a preset threshold value, and when the difference value reaches the preset threshold value, the first image to be processed is smoothed.

8. An image processing device, characterized in that: The device comprises: An acquisition module is used to acquire an input image sequence, wherein the input image sequence includes a reference image and at least one frame of an image to be processed; A matching module, configured to perform a semi-global matching process on a first image to be processed in the at least one frame of images to be processed based on the reference image, so as to obtain a semi-dense optical flow of the first image to be processed; The interpolation processing module performs interpolation processing on the semi-dense optical flow to obtain a dense optical flow.

9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.

11. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 7.

12. A chip, characterized in that: It comprises one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from a memory of an electronic device and send the signal to the processor, the signal includes a computer instruction stored in the memory, and when the processor executes the computer instruction, the electronic device executes the method described in any one of claims 1 to 7.

Citation Information

Cited By

  • Motion vector estimation method and system and readable storage medium

    CN119854521A