Image processing method, image processing chip and image acquisition equipment
By performing motion estimation and fusion processing on multiple frames of images collected by image acquisition equipment, the problem of poor image quality in low-light scenes at night is solved, improving image quality, reducing noise, and enhancing image details and contrast.
Patent Information
- Application Number
- CN202410631187.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2024-09-06
AI Technical Summary
In scenes such as low light at night, the image quality collected by the image acquisition equipment is poor and has a lot of noise, making it difficult to improve the image quality of the image acquisition equipment.
By acquiring multiple frames of images continuously collected by the image acquisition device for the same scene, motion estimation is performed to obtain motion compensation data, the fusion weight of each frame of image is determined based on the motion compensation data, and the image fusion network is used to fuse the images to obtain the processed image.
By comprehensively considering multi-frame images and motion compensation data, the fusion weight is accurately determined to improve the image quality collected by the image acquisition device, reduce noise, and enhance image details and contrast.
Smart Images

Figure CN118612561A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image technology, and in particular to an image processing method, an image processing chip and an image acquisition device. Background Art
[0002] As people use image information more and more widely, the requirements for the image quality of image acquisition devices are gradually increasing. However, in scenes such as nighttime dim light, due to poor lighting conditions, the images captured by image acquisition devices often contain a lot of noise, resulting in poor image quality.
[0003] Therefore, how to improve the image quality of images captured by image acquisition devices is an issue that needs to be addressed urgently. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide an image processing method, an image processing chip and an image acquisition device to achieve the technical effect of improving the image quality of images acquired by the image acquisition device. The specific technical solution is as follows:
[0005] In one aspect of an embodiment of the present invention, an image processing method is provided, the method comprising:
[0006] Acquire multiple frames of captured images continuously captured by an image acquisition device for the same scene;
[0007] Acquiring motion compensation data obtained by performing motion estimation on each captured image;
[0008] Determining a fusion weight of each acquired image based on each acquired image and the acquired motion compensation data;
[0009] Based on the fusion weights of the collected images, the collected images are fused to obtain a processed image.
[0010] Optionally, the acquiring of multiple frames of captured images continuously captured by the image acquisition device for the same scene includes:
[0011] Acquire the image currently acquired by the image acquisition device as the current image to be processed, and acquire the historical image corresponding to the current image to be processed; wherein the historical image corresponding to each image to be processed is: an image acquired before the image to be processed and adjacent to the image to be processed;
[0012] The acquiring of motion compensation data obtained by performing motion estimation on each collected image includes:
[0013] Acquire motion compensation data obtained by performing motion estimation on a current image to be processed and a corresponding historical image; the obtained motion compensation data is determined based on a previous image to be processed and a historical image corresponding to the previous image to be processed.
[0014] Optionally, determining a fusion weight of each collected image based on each collected image and the acquired motion compensation data includes:
[0015] Using the weight output subnetwork in the pre-trained image fusion network, based on the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data, the fusion weight of the current image to be processed and the corresponding historical image is determined; wherein the image fusion network also includes: a motion compensation subnetwork and a fusion subnetwork; the image fusion network is obtained by training based on multiple frames of sample images and the true value of the fusion image corresponding to the multiple frames of sample images;
[0016] The step of fusing the collected images based on the fusion weights of the collected images to obtain a processed image includes:
[0017] Using the fusion subnetwork, based on the obtained fusion weights of each image, image fusion is performed on the current image to be processed and the corresponding image to be processed to obtain a processed image;
[0018] The method further comprises:
[0019] Using the motion compensation subnetwork, based on the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data, motion estimation is performed on the next image to be processed and the corresponding historical image to obtain the motion compensation data of the next image to be processed.
[0020] Optionally, the true value of the fused image is a low-noise image; the multiple frames of sample images include: a sample current frame and a sample history frame; the sample history frame is obtained by adding noise to the true value of the fused image; the sample current frame is obtained by performing an affine transformation on the true value of the fused image and adding noise.
[0021] Optionally, the fusion sub-network includes: a transformation unit and a fusion unit;
[0022] The method of using the fusion subnetwork to fuse the current image to be processed and the corresponding image to be processed based on the obtained fusion weights of each image to obtain a processed image includes:
[0023] Using the transformation unit, based on the acquired motion compensation data, an affine transformation is performed on the current image to be processed to obtain a transformed image;
[0024] The fusion weight of the current image to be processed is used as the fusion weight of the transformed image, and the fusion unit is used to perform image fusion on the transformed image and the historical image corresponding to the current image to be processed based on the fusion weight of the transformed image and the fusion weight of the historical image corresponding to the current image to be processed, so as to obtain a processed image.
[0025] Optionally, the weight output subnetwork includes: a feature extraction unit and a weight output unit; the weight output subnetwork in the pre-trained image fusion network determines the fusion weight of the current image to be processed and the corresponding historical image based on the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data, including:
[0026] Using the feature extraction unit, extract features from the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data to obtain features to be used;
[0027] Using the weight output unit, determining the fusion weight of the current image to be processed and the corresponding historical image based on the feature to be utilized;
[0028] The method of using the motion compensation subnetwork to perform motion estimation on the next image to be processed and the corresponding historical image based on the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data to obtain the motion compensation data of the next image to be processed includes:
[0029] The motion compensation subnetwork is used to perform motion estimation on the next image to be processed and the corresponding historical image based on the features to be utilized, so as to obtain motion compensation data of the next image to be processed.
[0030] Optionally, the feature extraction unit includes: a first feature extraction subunit, a first merging subunit, a second feature extraction subunit, a second merging subunit and a third feature extraction subunit;
[0031] The feature extraction unit is used to extract features from the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data to obtain features to be used, including:
[0032] Using the first feature extraction subunit to perform feature extraction on the acquired motion compensation data to obtain a first intermediate feature;
[0033] Using the first merging subunit to merge the current image to be processed, that is, the corresponding historical image, to obtain a merged image;
[0034] Using the second feature extraction subunit to extract features from the merged image to obtain a second intermediate feature;
[0035] Using the second merging subunit to merge the first intermediate feature and the second intermediate feature to obtain a merged feature;
[0036] The third feature extraction subunit is used to further extract features from the combined features to obtain features to be used.
[0037] Optionally, the acquiring of multiple frames of captured images continuously captured by the image acquisition device for the same scene includes:
[0038] Acquire raw image data continuously captured by the image acquisition device for the same scene;
[0039] The original image data is preprocessed using a predetermined black frame image to be used to obtain a captured image; wherein the black frame image to be used is captured by the image capture device under a dark condition.
[0040] Optionally, each collected image and the processed image obtained are original raw images;
[0041] The method further comprises:
[0042] The processed image is color reconstructed using a pre-trained color reconstruction network to obtain a corresponding red, green, and blue (RGB) image; wherein the color reconstruction network is trained based on a sample raw image and the true value of an RGB image corresponding to the sample raw image.
[0043] Optionally, the color reconstruction network includes: a denoising subnetwork and a color reconstruction subnetwork; the color reconstruction of the processed image obtained by using the pre-trained color reconstruction network to obtain a corresponding red, green, and blue (RGB) image includes:
[0044] Performing denoising on the processed image using the denoising subnetwork to obtain a denoised image;
[0045] The color reconstruction subnetwork is used to perform color reconstruction on the denoised image to obtain a corresponding RGB image.
[0046] Optionally, the denoising subnetwork includes: multiple layers of first encoding units, and first decoding units corresponding to each layer of the first encoding units, and a spatial attention unit is arranged between each layer of the first encoding units and the corresponding first decoding units; each layer of the spatial attention unit is used to fuse the output of the first encoding unit of this layer with the output of the first decoding unit of the next layer based on the spatial attention mechanism to obtain a fused feature; the fused feature obtained by the spatial attention unit of each layer is used to merge with the output of the first decoding unit of the next layer as the input of the first decoding unit of this layer.
[0047] Optionally, the color reconstruction sub-network includes: multiple layers of second encoding units, and a second decoding unit corresponding to each second encoding unit;
[0048] A first channel attention unit is arranged between every two second coding units; each first channel attention unit is used to determine the channel weight of each channel in the multi-channel data output by the second coding unit of the previous layer based on the channel attention mechanism; the input of the second coding unit of the next layer is: the result obtained by multiplying the data of each channel output by the second coding unit of the previous layer by the corresponding channel weight;
[0049] A second channel attention unit is arranged between every two second decoding units; each second channel attention unit is used to determine the channel weight of each channel in the multi-channel data output by the second decoding unit of the next layer based on the channel attention mechanism; the input of the second decoding unit of the previous layer is: the result obtained by multiplying the data of each channel output by the second encoding unit of the next layer by the corresponding channel weight.
[0050] In another aspect of an embodiment of the present invention, an image processing chip is provided, which is used to obtain multiple frames of acquired images continuously acquired by an image acquisition device for the same scene; obtain motion compensation data obtained by motion estimation of each acquired image; determine the fusion weight of each acquired image based on each acquired image and the acquired motion compensation data; and perform image fusion on each acquired image based on the fusion weight of each acquired image to obtain a processed image.
[0051] Optionally, the image processing chip is specifically used to obtain the image currently captured by the image capture device as the current image to be processed, and to obtain the historical image corresponding to the current image to be processed; wherein the historical image corresponding to each image to be processed is: an image captured before the image to be processed and adjacent to the image to be processed; obtain motion compensation data obtained by motion estimation of the current image to be processed and the corresponding historical image; the obtained motion compensation data is determined based on the previous image to be processed and the historical image corresponding to the previous image to be processed.
[0052] Optionally, the image processing chip includes: a preprocessing module and an algorithm module; wherein:
[0053] The preprocessing module is used to obtain the first network parameters from the non-volatile memory of the image acquisition device, and load the first network parameters into the image fusion network in the algorithm module; wherein the image fusion network includes: a weight output subnetwork, a motion compensation subnetwork and a fusion subnetwork; the image fusion network is obtained by training based on multiple frames of sample images and true values of fused images corresponding to the multiple frames of sample images;
[0054] The algorithm module is used to obtain the image currently captured by the image capture device as the current image to be processed, and to obtain the historical image corresponding to the current image to be processed; to obtain motion compensation data obtained by performing motion estimation on the current image to be processed and the corresponding historical image; to determine the fusion weight of the current image to be processed and the corresponding historical image based on the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data using the weight output subnetwork; to perform image fusion on the current image to be processed and the corresponding image to be processed based on the obtained fusion weights of each image using the fusion subnetwork to obtain a processed image; to perform motion estimation on the next image to be processed and the corresponding historical image based on the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data to obtain the motion compensation data of the next image to be processed.
[0055] Optionally, the preprocessing module is further used to obtain the black frame image to be used from the non-volatile memory, and write the black frame image to be used into the random access memory of the image acquisition device; wherein the black frame image to be used is obtained by the image acquisition device under light-free conditions; obtain the original image data collected by the image acquisition device; use the black frame image to be used to preprocess the original image data to obtain a captured image, and cache the obtained captured image into the random access memory;
[0056] The algorithm module is specifically used to obtain the current image to be processed and the corresponding historical image from the random access memory.
[0057] Optionally, the acquired image and the processed image output by the image fusion network are both original raw images;
[0058] The preprocessing module is further used to obtain a second network parameter from the non-volatile memory of the image acquisition device, and load the second network parameter into the algorithm module; wherein the second network parameter is obtained by training the color reconstruction network in the algorithm module based on the true value of the sample raw image and the RGB image corresponding to the sample raw image;
[0059] The algorithm module is also used to use the color reconstruction network to perform color reconstruction on the processed image based on the second network parameters to obtain a red, green, and blue (RGB) image.
[0060] Optionally, the color reconstruction network includes: a denoising subnetwork and a color reconstruction subnetwork; the algorithm module is specifically used to use the denoising subnetwork to denoise the processed image to obtain a denoised image; and use the color reconstruction subnetwork to perform color reconstruction on the denoised image to obtain a corresponding RGB image.
[0061] Optionally, the image processing chip includes: a first interface for receiving images captured by the image capture device.
[0062] Optionally, the image processing chip further includes: a second interface, used to output the obtained RGB image to a display for display.
[0063] An embodiment of the present invention further provides an image acquisition device, the image acquisition device comprising: an image sensor, a non-volatile memory, a random access memory, a display, and any one of the above-mentioned image processing chips;
[0064] The image sensor is used to capture an image of the current scene and send the captured image to the image processing chip.
[0065] Beneficial effects of the embodiments of the present invention:
[0066] The image processing method provided by the embodiment of the present invention obtains multiple frames of captured images continuously captured by an image acquisition device for the same scene; obtains motion compensation data obtained by performing motion estimation on each captured image; determines the fusion weight of each captured image based on each captured image and the acquired motion compensation data; and performs image fusion on each captured image based on the fusion weight of each captured image to obtain a processed image.
[0067] In this embodiment, motion estimation is performed on multiple frames of captured images to obtain motion compensation data, and then the fusion weight of each captured image is determined based on each captured image and the acquired motion compensation data. The fusion weight of each captured image can be determined more accurately by comprehensively considering each captured image and the acquired motion compensation data, and then image fusion is performed on multiple frames of images captured by the image capture device, which can improve the image quality of the processed image obtained by fusion. Therefore, the image quality of the image captured by the image capture device can be improved through this solution.
[0068] Of course, it is not necessary to achieve all of the advantages described above at the same time to implement any product or method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the embodiments of the present invention 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 in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0070] Figure 1 A schematic diagram of a flow chart of an image processing method provided by an embodiment of the present invention;
[0071] Figure 2 Another schematic diagram of a flow chart of an image processing method provided by an embodiment of the present invention;
[0072] Figure 3 A schematic diagram of the structure of an image fusion network provided by an embodiment of the present invention;
[0073] Figure 4 A schematic diagram of another flow chart of the image processing method provided by an embodiment of the present invention;
[0074] Figure 5 A schematic diagram of the structure of a denoising sub-network provided in an embodiment of the present invention;
[0075] Figure 6 A schematic diagram of the structure of a spatial attention unit provided in an embodiment of the present invention;
[0076] Figure 7 A schematic diagram of the structure of a color reconstruction subnetwork provided by an embodiment of the present invention;
[0077] Figure 8 A schematic diagram of the structure of a channel attention unit provided in an embodiment of the present invention;
[0078] Fig. 9 A schematic diagram of the structure of an image processing chip provided by an embodiment of the present invention;
[0079] Fig.10 A logic block diagram of an image processing chip provided by an embodiment of the present invention;
[0080] Fig.11 A flowchart of an image processing method executed by an image processing chip provided by an embodiment of the present invention;
[0081] Fig.12 A schematic diagram of the structure of an image acquisition device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0082] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field based on this application belong to the scope of protection of the present invention.
[0083] In order to improve the image quality of images captured by an image acquisition device, an embodiment of the present invention provides an image processing method, which can be applied to electronic devices, such as computers, smart phones, image acquisition devices, etc. In specific scenarios, the method can be applied to image processing chips in electronic devices. The method includes:
[0084] Acquire multiple frames of captured images continuously captured by an image acquisition device for the same scene;
[0085] Acquiring motion compensation data obtained by performing motion estimation on each captured image;
[0086] Determining a fusion weight of each acquired image based on each acquired image and the acquired motion compensation data;
[0087] Based on the fusion weights of the collected images, the collected images are fused to obtain a processed image.
[0088] In this embodiment, motion estimation is performed on multiple frames of captured images to obtain motion compensation data, and then the fusion weight of each captured image is determined based on each captured image and the acquired motion compensation data. The fusion weight of each captured image can be determined more accurately by comprehensively considering each captured image and the acquired motion compensation data, and then image fusion is performed on multiple frames of images captured by the image capture device, which can improve the image quality of the processed image obtained by fusion. Therefore, the image quality of the image captured by the image capture device can be improved through this solution.
[0089] The image processing method provided by the embodiment of the present invention is introduced below in conjunction with the accompanying drawings. Figure 1 As shown, the method may include the following steps:
[0090] S101, obtaining multiple frames of captured images continuously captured by an image acquisition device for the same scene;
[0091] In this step, the same image acquisition device can continuously acquire multiple frames of images for the same scene at the same position to obtain the acquired images. The above scene may include: the position of the image acquisition device, the acquisition angle, etc. The multiple frames of acquired images may be two frames or more frames. The above multiple frames of acquired images may also be continuous video frames obtained when the image acquisition device is recording.
[0092] In one implementation, this step may specifically include:
[0093] S1011, obtaining original image data continuously captured by an image acquisition device for the same scene;
[0094] The initial image data may be image data initially output by an image sensor of an image acquisition device.
[0095] S1012, preprocessing the initial image data using a predetermined black frame image to be used to obtain a captured image; wherein the black frame image to be used is captured by an image capture device under a dark condition.
[0096] Black frames refer to images captured when no light hits the image sensor, and they contain the image sensor's own noise, dark current noise, and fixed pattern noise, etc. By subtracting the black frames from the images actually captured by the image sensor (especially those captured under low-light conditions), these inherent noises can be effectively eliminated to obtain a cleaner image. At the same time, random noise in the image can also be reduced, thereby improving the signal-to-noise ratio, making the image details clearer and the contrast better.
[0097] The black frame image to be used in this embodiment can be obtained by compressing the original black frame, and the compression process is as follows:
[0098] First, a preset value is subtracted from each pixel on the original black frame, that is, it is processed according to the following formula:
[0099] Y0 (i,j) =X (i,j) -BL
[0100] Wherein, BL represents the above-mentioned preset value, which can be set according to experience and needs, and X (i,j) Indicates the original black frame, Y0 (i,j) represents the black frame after subtracting the preset value, and (i, j) represents the pixel position. Furthermore, each pixel value of the black frame after subtracting the preset value can be clamped according to the following formula to obtain the black frame after clamping:
[0101]
[0102] Wherein, A represents any pixel value in the black frame after subtracting the preset value, and clamp(A,0,255) represents the pixel value after clamping.
[0103] The black frame after the clamping process can then be Huffman encoded to further compress it and reduce the amount of data.
[0104] When the embodiment of the present application is applied to the SoC (System on Chips) of the image acquisition device, the black frame image to be used obtained after the above compression processing can be directly stored in an off-chip non-volatile memory, such as Flash (flash memory), thereby reducing the space occupied by the non-volatile memory.
[0105] Correspondingly, such as Figure 2 As shown, when the initial image data collected by the image sensor needs to be processed, the compressed black frame data, that is, the black frame image to be used, can be read; the compressed black frame data is decompressed, that is, Huffman decoding is performed on the black frame image to be used, and each pixel value of the decoded black frame data is added to the above preset value to obtain the target black frame; after the initial image data collected by the image sensor is input, the pixel value of each pixel position of the initial image data is subtracted from the corresponding pixel value of the target black frame according to the positional relationship between the pixel positions of the initial image data and the target black frame, thereby obtaining the subtracted image data, that is, the above-mentioned collected image, and then the data is written into the off-chip random access memory (Random Access Memory) for cache, and the SoC of the image acquisition device can obtain the collected image from the random access memory for subsequent processing.
[0106] S102, acquiring motion compensation data obtained by performing motion estimation on each collected image;
[0107] In this step, a motion estimation algorithm may be used to determine the pixel difference between each captured image. For example, the motion estimation algorithm may be an optical flow estimation method. When the number of each captured image is greater than 2 frames, motion estimation may be performed on each two adjacent captured images to obtain multiple motion compensation data.
[0108] In one implementation, the above step S101 may include:
[0109] Acquire the image currently acquired by the image acquisition device as the current image to be processed, and acquire the historical image corresponding to the current image to be processed; wherein the historical image corresponding to each image to be processed is: an image acquired before the image to be processed and adjacent to the image to be processed;
[0110] This embodiment can be applied to a scenario where an image acquisition device is performing video recording. When the image acquisition device acquires each frame of image, the frame of image can be obtained as the current image to be processed. The image recorded one frame or multiple frames before the current image to be processed can be used as the historical image corresponding to the current image to be processed. Thus, for the current image to be processed, the current image to be processed and the corresponding historical image, as well as the corresponding motion compensation data, can be used to perform image fusion to obtain a processed image corresponding to the current image to be processed. The processed image is used to ultimately be displayed to the user.
[0111] In this case, the motion compensation data obtained by performing motion estimation on each captured image may include:
[0112] Acquire motion compensation data obtained by performing motion estimation on a current image to be processed and a corresponding historical image; the obtained motion compensation data is determined based on a previous image to be processed and a historical image corresponding to the previous image to be processed.
[0113] For example, when the image acquisition device acquires image 1, image 2, image 3, ... in chronological order, motion compensation data can be calculated based on image 1 and image 2 as the motion compensation data obtained for motion estimation of image 3, so that the obtained motion compensation data can better reflect the motion trend of the image, and when the current image to be processed is obtained, the current image to be processed can be processed quickly without calculating the motion compensation data again, thereby improving processing efficiency.
[0114] Through the above processing, each time the image acquisition device acquires a frame of image, the image quality of the image can be improved. In this way, in the scenario where the image acquisition device records video in real time, high-quality video can be displayed to the user in real time.
[0115] S103, determining a fusion weight of each collected image based on each collected image and the acquired motion compensation data;
[0116] In order to determine the fusion weight of each collected image, an image fusion network can be pre-trained, and the image fusion network can include a weight output subnetwork and a fusion subnetwork, and the image fusion network can be trained based on multiple sample frames, motion compensation data obtained by motion estimation of the multiple sample frames, and the true value of the corresponding fusion image of the multiple sample frames. The weight output subnetwork can output the fusion weight of each image based on the input multiple frames and the motion compensation data of the input multiple frames, and the fusion subnetwork can perform image fusion on the input multiple frames based on the fusion weight output by the weight output subnetwork to obtain the fusion image corresponding to the multiple frames.
[0117] For example, the true value of the above-mentioned fused image can be a low-noise image. The low-noise image is subjected to noise processing, such as adding Gaussian noise, salt and pepper noise, etc., to obtain a frame of sample image, and the true value is subjected to affine transformation and noise processing to obtain another frame of sample image.
[0118] After the image fusion network is trained, the weight output subnetwork in the image fusion network can be used to determine the fusion weight of each acquired image based on each acquired image and the acquired motion compensation data.
[0119] In this embodiment, the fusion weight of each image may include the weight of each pixel in the image. Specifically, the fusion weight of each image may be a matrix, and the size of the matrix is the same as the pixel size of the image.
[0120] In one implementation, at least one frame of each captured image can be first warped (affine transformation) based on the determined motion compensation data so that the moving areas in each captured image are aligned as much as possible. Motion compensation data plays a vital role in processing multiple image frames. In continuously shot images, motion blur may occur due to jitter or object movement. Motion compensation data can reduce or eliminate the effects of motion blur by estimating the motion between images, and thus aligning these images accordingly based on the motion compensation data. In this way, after the fusion of multiple frames of images, clearer details and better visual quality can be obtained. Motion compensation data can not only correct motion blur, improve image alignment accuracy, and enhance image details, but also support the processing of high dynamic scenes, thereby improving the robustness of the image processing method of this embodiment.
[0121] S104: performing image fusion on each collected image based on the fusion weight of each collected image to obtain a processed image.
[0122] After determining the fusion weights of each collected image, the pixel values of each collected image at each pixel position can be weighted added to obtain a fused image. For example, when each collected image is two frames, the fused image can be obtained according to the following formula:
[0123] Y (i,j) =(X0 (i,j) ×W0 (i,j) )+(X1 (i,j) ×W1 (i,j) )
[0124] Among them, X0 and X1 represent the acquired images, W0 and W1 represent the fusion weights of X0 and X1 respectively, Y represents the fused image, and (i, j) represents the pixel position.
[0125] After obtaining the fused image, each pixel value in the fused image can be compressed within a specified range. For example, each pixel value can be clamped so that each pixel value of the fused image can be represented by data of a specified bit size to obtain a processed image.
[0126] For example, when 8-bit data is required to represent each pixel value, the specified range is (0-255), and each pixel value of the fused image can be clamped according to the following formula:
[0127]
[0128] Among them, x represents any pixel value in the fused image, and clamp(x,0,255) represents the pixel value after clamping.
[0129] In this embodiment, motion estimation is performed on multiple frames of captured images to obtain motion compensation data, and then the fusion weight of each captured image is determined based on each captured image and the acquired motion compensation data. By comprehensively considering each captured image and the acquired motion compensation data, the fusion weight of each captured image can be more accurately determined, and then image fusion is performed on multiple frames of images captured by the image capture device, which can improve the image quality of the processed image obtained by fusion. Therefore, the image quality of the image captured by the image capture device can be improved through this solution.
[0130] In one embodiment of the present invention, the above steps S102-S104 can be completed by a pre-trained image fusion network, that is, the above steps of determining the fusion weight of each collected image based on each collected image and the acquired motion compensation data include:
[0131] The weight output subnetwork in the pre-trained image fusion network is used to determine the fusion weight of the current image to be processed and the corresponding historical image based on the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data; wherein the image fusion network also includes: a motion compensation subnetwork and a fusion subnetwork; the image fusion network is obtained by training based on multiple frames of sample images and the true value of the fusion image corresponding to the multiple frames of sample images;
[0132] In one implementation, the true value of the above-mentioned fused image can be a low-noise image; the multiple frames of sample images include: a sample current frame and a sample history frame; the sample history frame is obtained by adding noise to the true value of the fused image; the sample current frame is obtained by performing an affine transformation on the true value of the fused image and adding noise.
[0133] Specifically, two low-noise images may be selected first: a first image and a second image, and an area may be selected from the first image as the area to be used; the area to be used is covered in the second image to obtain the true value of the fused image; the true value is subjected to noise processing to obtain the sample history frame. The process of performing an affine transformation on the true value of the fused image may include: performing affine transformation processing operations such as translation and / or rotation on the area to be used in the true value of the fused image, and then covering the processed area to be used in the second image, and finally performing noise processing to obtain the sample current frame.
[0134] When training the image fusion network, the image fusion network can output a predicted image based on the input multiple frames of sample images, and then calculate the loss function based on the predicted image and the true value, and adjust the parameters of the image fusion network based on the loss function until convergence is achieved to obtain a trained image fusion network. The above loss function can be the mean absolute error MAE (Mean Absolute Error), that is, calculate the L1 distance (absolute difference) between the pixel value of the predicted image and the true value at each pixel position, and then average the L1 distances of each pixel position to obtain the mean absolute error.
[0135] By training the image fusion network using the above sample current frame, sample historical frame, and the true value of the corresponding fused image, the image fusion network can learn the relationship between the low-noise image and the multi-frame noisy image, so that the image fusion network has the ability to use multi-frame images for fusion denoising.
[0136] In this embodiment, the image fusion is performed on each collected image based on the fusion weight of each collected image to obtain a processed image, including:
[0137] Using the fusion subnetwork, based on the obtained fusion weights of each image, the current image to be processed and the corresponding image to be processed are fused to obtain a processed image;
[0138] In this embodiment, the image processing method further includes:
[0139] Using the motion compensation subnetwork, based on the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data, motion estimation is performed on the next image to be processed and the corresponding historical image to obtain the motion compensation data of the next image to be processed.
[0140] By realizing the determination of motion compensation data, weight output and image fusion in an image fusion network, when training the image fusion network, the data in the motion compensation subnetwork, the weight output subnetwork and the fusion subnetwork can support each other, so that the performance of the obtained image fusion network is better, and the obtained motion compensation data and fusion weights are more accurate, thereby further improving the image quality of the fused image.
[0141] like Figure 3 As shown, the above fusion sub-network may further include: a transformation unit and a fusion unit;
[0142] The above-mentioned fusion sub-network is used to perform image fusion on the current image to be processed and the corresponding image to be processed based on the obtained fusion weights of each image to obtain a processed image, including:
[0143] Step A1, using a transformation unit, performing an affine transformation on the current image to be processed based on the acquired motion compensation data to obtain a transformed image;
[0144] Step A2, using the fusion weight of the current image to be processed as the fusion weight of the transformed image, and using the fusion unit, based on the fusion weight of the transformed image and the fusion weight of the historical image corresponding to the current image to be processed, to perform image fusion on the transformed image and the historical image corresponding to the current image to be processed, to obtain a processed image.
[0145] Through the above processing, the moving areas in each acquired image can be aligned as much as possible, so that the subsequent fusion unit can fuse the transformed image and the historical image corresponding to the current image to be processed based on the fusion weight of the transformed image and the fusion weight of the historical image corresponding to the current image to be processed, and use the obtained fusion output as the processed image, which can further improve the image quality of the processed image.
[0146] The weight output subnetwork may include: a feature extraction unit and a weight output unit; using the weight output subnetwork in the pre-trained image fusion network, based on the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data, determining the fusion weight of the current image to be processed and the corresponding historical image, including:
[0147] Using a feature extraction unit, extract features from a current image to be processed, a historical image corresponding to the current image to be processed, and the acquired motion compensation data to obtain features to be used; using a weight output unit, determine a fusion weight of the current image to be processed and the corresponding historical image based on the features to be used;
[0148] like Figure 3As shown, the weight output unit may include multiple sub-units, each sub-unit is used to upsample the input data and perform convolution processing on the upsampled data using a 3×3 convolution kernel.
[0149] The above-mentioned motion compensation subnetwork performs motion estimation on the next image to be processed and the corresponding historical image based on the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data to obtain the motion compensation data of the next image to be processed, including:
[0150] The motion compensation subnetwork is used to perform motion estimation on the next image to be processed and the corresponding historical image based on the above-mentioned features to be utilized, so as to obtain motion compensation data of the next image to be processed.
[0151] The motion compensation sub-network may also include multiple sub-units, each of which is used to upsample the input data and perform convolution processing on the upsampled data using a 3×3 convolution kernel.
[0152] Through the above processing, the motion compensation subnetwork and the weight output unit can obtain the extracted features from the feature extraction unit as features to be used, so as to output motion compensation data and fusion weights respectively. Such a design can reduce the complexity of the network and improve the computational efficiency.
[0153] The feature extraction unit comprises: a first feature extraction subunit, a first merging subunit, a second feature extraction subunit, a second merging subunit and a third feature extraction subunit;
[0154] In this case, the feature extraction unit is used to extract features from the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data to obtain the features to be used, which may include:
[0155] Step B1, using a first feature extraction subunit to extract features from the acquired motion compensation data to obtain a first intermediate feature;
[0156] like Figure 3 As shown, the first feature extraction subunit may include multiple encoding layers, each encoding layer is used to perform convolution processing on input data using a 3×3 convolution kernel, and downsample the convolution-processed data.
[0157] Step B2, using the first merging subunit to merge (concat) the current image to be processed, that is, the corresponding historical image, to obtain a merged image;
[0158] Step B3, using the second feature extraction subunit to extract features from the merged image to obtain a second intermediate feature;
[0159] The second feature extraction subunit may also include multiple encoding layers, which are used to perform convolution processing on the input data using a 3×3 convolution kernel and downsample the convolution-processed data.
[0160] Step B4, using a second merging subunit to merge (concat) the first intermediate feature and the second intermediate feature to obtain a merged feature;
[0161] Step B5: Use the third feature extraction subunit to further extract features from the combined features to obtain features to be used.
[0162] like Figure 3 As shown, the third feature extraction subunit can be a U-shaped network with two encoding layers and two decoding layers, each encoding layer is used to convolve the input data using a 3×3 convolution kernel and downsample the convolution data; each decoding layer can first upsample the output of the next layer; merge the upsampled data with the output of the 3×3 convolution kernel of the encoding layer at the same layer; and then convolve the merged data using the 3×3 convolution kernel.
[0163] In this embodiment, the current image to be processed and the corresponding historical image are first merged, and then the image features of the merged image and the features of the motion compensation data are extracted respectively. After the obtained features are merged, further feature extraction is performed, which can fuse the information of the motion compensation data, the current image to be processed and the corresponding historical image, thereby providing a basis for subsequently determining the motion compensation data of the next image to be processed and determining the fusion weight.
[0164] In one embodiment of the present invention, the above-mentioned collected images and processed images are all raw images. Figure 4 As shown, this embodiment may also include the following steps:
[0165] S401, using a pre-trained color reconstruction network to perform color reconstruction on the processed image to obtain a corresponding red, green, and blue RGB (Red Green Blue) image; wherein the color reconstruction network is trained based on a sample raw image and a true value of an RGB image corresponding to the sample raw image.
[0166] The process of converting a raw image into an RGB image is usually called color reconstruction, because the raw image is usually captured by a Bayer array, which only records one color information (red, green or blue) at each pixel, rather than the complete RGB information. The present application can effectively perform color reconstruction processing by learning the patterns and structures in the raw image through a deep learning-based color reconstruction network, thereby reconstructing a high-quality RGB image.
[0167] In one implementation, the color reconstruction network includes: a denoising subnetwork and a color reconstruction subnetwork; the denoising subnetwork is used to perform denoising on the input raw image to obtain a denoised raw image; the color reconstruction subnetwork is used to perform color reconstruction on the denoised raw image to obtain a corresponding RGB image. Then, the above-mentioned color reconstruction network that has been pre-trained is used to perform color reconstruction on the processed image to obtain a corresponding red, green, and blue RGB image, which may include:
[0168] Step C1, using a denoising sub-network to denoise the processed image to obtain a denoised image;
[0169] Step C2, using the color reconstruction sub-network to perform color reconstruction on the denoised image to obtain the corresponding RGB image.
[0170] In this implementation, the processed image can be denoised using a denoising subnetwork to obtain a denoised raw image, and then the denoised raw image is color reconstructed to further reduce the noise of the obtained RGB image and improve the image quality. In this case, the true value of the RGB image can be obtained by processing a low-noise raw image using a demosaicing algorithm, and the sample raw image can be obtained by adding noise to the low-noise raw image.
[0171] In the related art, for the raw image captured by the image acquisition device, the ISP (Image Signal Processing) module in the image acquisition device is usually used to process the raw image using a demosaicing algorithm to obtain an RGB image, and then the obtained RGB image is denoised to obtain the final RGB image for display. In this embodiment, a color reconstruction network includes a denoising subnetwork and a color reconstruction subnetwork, which can perform image denoising and color reconstruction. The raw image before denoising and the RGB image after color reconstruction are end-to-end, so that the data in the denoising subnetwork and the color reconstruction subnetwork can support each other during training, so that the performance of the obtained color reconstruction network is better. Compared with the method of performing image denoising and color reconstruction separately and independently, this solution can further improve the image quality of the RGB image obtained by color reconstruction.
[0172] In one implementation, Figure 5As shown, the denoising sub-network may be a U-shaped network with an attention mechanism, and the denoising sub-network may include: multiple layers of first encoding units, and first decoding units corresponding to the first encoding units of each layer, and a spatial attention (SA, SpatialAttention) unit is arranged between each layer of the first encoding unit and the corresponding first decoding unit, that is, the spatial attention unit is arranged in the part of the jump connection of each layer of the denoising sub-network;
[0173] The number of layers of the denoising sub-network may be 4, and the first encoding unit of each layer is used to perform convolution processing on the input data using a 3×3 convolution kernel, and downsample the convolution processed data. Downsampling can be achieved by average pooling.
[0174] The spatial attention unit of each layer is used to fuse the output of the first encoding unit of this layer with the output of the first decoding unit of the next layer based on the spatial attention mechanism to obtain a fused feature; the fused feature obtained by the spatial attention unit of each layer is used to merge with the output of the first decoding unit of the next layer as the input of the first decoding unit of this layer.
[0175] The output of the first encoding unit fused with the spatial attention unit can specifically be the output data of the convolution kernel of the first encoding unit, and the output of the first decoding unit of the next layer can specifically be: data obtained by upsampling the output of the first decoding unit of the next layer. The first decoding unit of each layer can upsample the output of the first decoding unit of the next layer, merge it with the fusion features output by the spatial attention unit of this layer, and then use the 3×3 convolution kernel to convolve the merged data. Upsampling can be achieved by deconvolution. And the output of the first decoding unit of the highest layer can also be fused with the noisy data initially input to obtain the final denoised data.
[0176] The structure of the above spatial attention unit can be expressed as Figure 6 As shown, the spatial attention unit can first concat (merge) the two input data, and then convolve the merged data through a 1×1 convolution kernel, and then use Softmax (normalized exponential function) to process the convolved data to obtain the output.
[0177] In this embodiment, by adding a spatial attention unit to the jump-connected part of each layer of the network, the low-level feature data in the encoding stage and the high-level feature data in the decoding stage are used as the input of the spatial attention unit, and the information exchange between the two feature data channels can be realized through the 1X1 convolution kernel in the spatial attention unit. Since the large-size low-level feature data contains more detailed information of the original image, the spatial attention unit can use the high-level feature data in the decoding stage to guide the low-level feature data from the jump connection to be projected into the signal subspace. The projected feature data is concat with the original high-level feature data in the decoding stage, and then decoded. This can improve the feature data extracted by the network, so that the color reconstruction network can better capture and understand the color content of the image, and can highlight the pixel values at important spatial positions, thereby improving the image denoising effect and improving the image quality of the resulting RGB image.
[0178] In one implementation, Figure 7 As shown, the color reconstruction sub-network includes: multiple layers of second encoding units, and a second decoding unit corresponding to each second encoding unit;
[0179] A first channel attention unit is arranged between every two second coding units; each first channel attention unit is used to determine the channel weight of each channel in the multi-channel data output by the second coding unit of the previous layer based on the channel attention mechanism; the input of the second coding unit of the next layer is: the result obtained by multiplying the data of each channel output by the second coding unit of the previous layer by the corresponding channel weight;
[0180] A second channel attention unit is arranged between every two second decoding units; each second channel attention unit is used to determine the channel weight of each channel in the multi-channel data output by the second decoding unit of the next layer based on the channel attention mechanism; the input of the second decoding unit of the previous layer is: the result obtained by multiplying the data of each channel output by the second encoding unit of the next layer by the corresponding channel weight.
[0181] The structure of the above channel attention unit can be as follows Figure 8 As shown in the figure, the channel attention unit can first use 1×1 convolution and convolution to process the input data to obtain the data after the first convolution; then use ReLU (Rectified Linear Unit) to correct the data after the first convolution to obtain the corrected data; then use another 1×1 convolution kernel to convolve the corrected data to obtain the data after the second convolution, so as to realize the information exchange between channels; finally, use the Sigmoid (S-shaped growth curve) function to process the data after the second convolution to obtain the output.
[0182] In this embodiment, in the encoding stage, a channel attention module is added after each convolution kernel to help the network focus on important features in the feature extraction stage. In the decoding stage, the channel attention module is added before each upsampling operation to help the network reconstruct details when restoring image resolution. The channel attention unit can determine the importance of each channel in the multi-channel data by learning, thereby weighting the data of each channel, which can improve the features extracted by the network, so that the color reconstruction network can better capture and understand the color content of the image, and by highlighting important feature channels, the color reconstruction network can generate RGB images with clearer and more coherent colors, thereby improving image quality, especially when processing high-resolution images, it can generate high-resolution RGB images with better image quality.
[0183] In an embodiment of the present invention, after the training of the above-mentioned image fusion network and color reconstruction network is completed, INT (shaping) 8 quantization processing can be performed to reduce the data complexity of the model and improve the efficiency of the image processing method provided by the embodiment of the present invention.
[0184] In another aspect of the embodiment of the present invention, an image processing chip is also provided, which may be a SoC. The image processing chip may be used to perform any of the above-mentioned image processing methods, namely, obtaining multiple frames of acquired images continuously acquired by an image acquisition device for the same scene; obtaining motion compensation data obtained by performing motion estimation on each acquired image; determining the fusion weight of each acquired image based on each acquired image and the acquired motion compensation data; performing image fusion on each acquired image based on the fusion weight of each acquired image to obtain a processed image.
[0185] In one embodiment, the image processing chip is specifically used to obtain an image currently captured by an image capturing device as a current image to be processed, and to obtain a historical image corresponding to the current image to be processed; wherein each historical image corresponding to the image to be processed is: an image captured before the image to be processed and adjacent to the image to be processed; and motion compensation data obtained by motion estimation of the current image to be processed and the corresponding historical image is obtained; and the obtained motion compensation data is determined based on a previous image to be processed and the historical image corresponding to the previous image to be processed.
[0186] In one embodiment, if Fig. 9 As shown, the image processing chip includes: a preprocessing module 901 and an algorithm module 902; wherein:
[0187] The preprocessing module 901 is used to obtain the first network parameters from the non-volatile memory 10 of the image acquisition device, and load the first network parameters into the image fusion network in the algorithm module 902; wherein the image fusion network includes: a weight output subnetwork, a motion compensation subnetwork and a fusion subnetwork; the image fusion network is obtained by training based on multiple frames of sample images and the true values of the fusion images corresponding to the multiple frames of sample images;
[0188] The non-volatile memory 10 (non-volatile memory) in this embodiment can be ROM (Read-only memory), Flash, etc.
[0189] Algorithm module 902 is used to obtain the image currently captured by the image capture device as the current image to be processed, and to obtain the historical image corresponding to the current image to be processed; to obtain motion compensation data obtained by performing motion estimation on the current image to be processed and the corresponding historical image; to determine the fusion weight of the current image to be processed and the corresponding historical image based on the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data using a weight output subnetwork; to perform image fusion on the current image to be processed and the corresponding image to be processed based on the obtained fusion weights of each image using a fusion subnetwork to obtain a processed image; to perform motion estimation on the next image to be processed and the corresponding historical image based on the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data to obtain motion compensation data for the next image to be processed.
[0190] The image fusion network in this embodiment is similar to that in the above embodiment and will not be described in detail here.
[0191] In one embodiment, the preprocessing module 901 is further used to obtain the black frame image to be used from the non-volatile memory 10, and write the black frame image to be used into the random access memory 20 of the image acquisition device; wherein the black frame image to be used is obtained by the image acquisition device under a lightless condition; obtain the original image data collected by the image acquisition device; use the black frame image to be used to preprocess the original image data to obtain a captured image, and cache the obtained captured image into the random access memory 20;
[0192] Random Access Memory is also called internal memory. The random access memory 20 in this embodiment may be DDR (Double Data Rate synchronous dynamic random-access memory).
[0193] The algorithm module 902 is specifically used to obtain the current image to be processed and the corresponding historical image from the random access memory 20.
[0194] In one embodiment, the collected image and the processed image output by the image fusion network are both original raw images;
[0195] The preprocessing module 901 is further used to obtain a second network parameter from the non-volatile memory 10 of the image acquisition device, and load the second network parameter into the algorithm module 902; wherein the second network parameter is obtained by training the color reconstruction network in the algorithm module 902 based on the true value of the sample raw image and the RGB image corresponding to the sample raw image;
[0196] The algorithm module 902 is further used to use the color reconstruction network to perform color reconstruction on the processed image based on the second network parameters to obtain a red, green, and blue (RGB) image.
[0197] In one embodiment, the color reconstruction network includes: a denoising subnetwork and a color reconstruction subnetwork; an algorithm module 902, which is specifically used to use the denoising subnetwork to denoise the processed image to obtain a denoised image; and use the color reconstruction subnetwork to perform color reconstruction on the denoised image to obtain a corresponding RGB image.
[0198] The color reconstruction network in this embodiment is similar to that in the above embodiment and will not be described again here.
[0199] In one embodiment, the image processing chip includes: a first interface 903 for receiving an image captured by an image capture device.
[0200] The first interface 903 may be MIPI-CSI (Mobile Industry Processor Interface Camera Serial Interface), and the image processing chip is connected to the image sensor via the MIPI-CSI protocol. MIPI-CSI includes a MIPID-PHY (D-Physical) module, a MIPI Receive logic, and an original raw image buffer logic, and its workflow is as follows:
[0201] Step 1: The MIPID-PHY module uses a pair of source-synchronous differential clocks and four pairs of differential data lines for data transmission to complete the conversion of the differential signal input by the image sensor into a serial digital signal.
[0202] Step 2: The MIPI Receive logic completes the frame synchronization of the serial data stream and extracts the complete image frame data: First, the starting position of a frame of data is searched in the serial data, and then the serial data stream is aligned according to the starting position and converted into a complete frame of raw image.
[0203] Step 3: The raw image cache logic writes the extracted raw image data into the random access memory 20 through the internal bus for cache according to the cache address space allocated by the image processing chip, and notifies the algorithm module 902 for subsequent processing through an interrupt signal.
[0204] In one embodiment, the image processing chip further includes: a second interface 904, which is used to output the obtained RGB image to a display for display.
[0205] The second interface 904 may be an HDMI (High Definition Multimedia Interface), and the image processing chip is connected to the display via the HDMI protocol. The second interface 904 may include: an HDMI TX PHY (transmit physical layer) module, an HDMI TX (transmit) control logic, and an RGB image reading logic, and its working process is as follows:
[0206] Step 1: After the algorithm module 902 completes the color reconstruction of a frame of raw image and obtains the RGB image, it notifies the RGB image reading logic of the HDMI interface through an interrupt signal. The RGB image reading logic reads the RGB image from the random access memory 20 through the internal bus according to the cache address carried in the interrupt signal.
[0207] Step 2: The HDMI TX control logic controls the serialization of the RGB image: first, the frame synchronization information is inserted into the header of the RGB image, and then the RGB image is serialized.
[0208] Step 3: The HDMI TX PHY module uses a pair of source-synchronous differential clocks and four pairs of differential data lines for data transmission, completes the conversion of serial digital signals to differential signals, and outputs the signals to the display.
[0209] The image processing chip in this embodiment obtains motion compensation data by performing motion estimation on multiple frames of acquired images, and then determines the fusion weight of each acquired image based on each acquired image and the acquired motion compensation data. It can comprehensively consider each acquired image and the acquired motion compensation data to more accurately determine the fusion weight of each acquired image, and then perform image fusion on multiple frames of images acquired by the image acquisition device, which can improve the image quality of the processed image obtained by fusion. Therefore, the image quality of the image acquired by the image acquisition device can be improved through this solution.
[0210] For ease of understanding, the following Figure 10-11 An example introduction to the working logic of the image processing chip is given. Fig.10 This is the logic block diagram of the image processing chip. Fig.11 The present invention is a flowchart of an image processing chip executing an image processing method.
[0211] like Figure 10-11 As shown, each module in the image processing chip communicates with each other through an internal bus, and the first interface and the second interface can be collectively referred to as an interface module. First, after the image processing chip is powered on, the pre-processing module can read the black frame image to be used from the Flash outside the chip, and load the black frame image to be used into the random access memory DDR, and read the network parameters of each network from the Flash and load them into the algorithm module to initialize the network parameters, and then wait for the raw image input of the image sensor.
[0212] The image processing chip receives the raw image through the first interface MIPI-CSI, performs black frame preprocessing on the raw image in the preprocessing module, and stores the preprocessed raw image into the random access memory DDR.
[0213] After receiving multiple frames of raw images, the algorithm module can load 2 or more consecutive frames of raw images into the image fusion network, so that the algorithm module can perform weighted fusion on multiple frames of raw images; the fused raw image is loaded into the denoising subnetwork with attention mechanism for denoising; after the denoising process is completed, an interrupt signal is generated to notify the color reconstruction subnetwork for subsequent processing, that is, the denoised raw image is continued to be loaded into the color reconstruction subnetwork for color reconstruction; after the color reconstruction is completed, the obtained RGB image can be stored in the random access memory DDR according to the cache address assigned by the image processing chip, and an interrupt signal of the completion of the color reconstruction process is generated to notify the interface module; finally, the interface module outputs the color reconstructed RGB image to the display through the second interface HDMI, and the RGB image can be displayed on the display.
[0214] The embodiment of the present invention also provides an image acquisition device, such as Fig.12 As shown, the image acquisition device includes: an image sensor 1201, a non-volatile memory 1202, a random access memory 1203, a display 1204, and any one of the above image processing chips 1205;
[0215] The image sensor 1201 is used to capture images of the current scene and send the captured images to the image processing chip.
[0216] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0217] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0218] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. An image processing method, characterized in that: The method comprises: Acquire multiple frames of captured images continuously captured by an image acquisition device for the same scene; Acquiring motion compensation data obtained by performing motion estimation on each captured image; Determining a fusion weight of each acquired image based on each acquired image and the acquired motion compensation data; Based on the fusion weights of the collected images, the collected images are fused to obtain a processed image.
2. The method according to claim 1, characterized in that The acquisition of multiple frames of captured images continuously captured by the image acquisition device for the same scene comprises: Acquire the image currently acquired by the image acquisition device as the current image to be processed, and acquire the historical image corresponding to the current image to be processed; wherein the historical image corresponding to each image to be processed is: an image acquired before the image to be processed and adjacent to the image to be processed; The acquiring of motion compensation data obtained by performing motion estimation on each collected image includes: Acquire motion compensation data obtained by performing motion estimation on a current image to be processed and a corresponding historical image; the obtained motion compensation data is determined based on a previous image to be processed and a historical image corresponding to the previous image to be processed.
3. The method according to claim 2, characterized in that The step of determining the fusion weight of each collected image based on each collected image and the acquired motion compensation data includes: Using the weight output subnetwork in the pre-trained image fusion network, based on the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data, the fusion weight of the current image to be processed and the corresponding historical image is determined; wherein the image fusion network also includes: a motion compensation subnetwork and a fusion subnetwork; the image fusion network is obtained by training based on multiple frames of sample images and the true value of the fusion image corresponding to the multiple frames of sample images; The step of fusing the collected images based on the fusion weights of the collected images to obtain a processed image includes: Using the fusion subnetwork, based on the obtained fusion weights of each image, image fusion is performed on the current image to be processed and the corresponding image to be processed to obtain a processed image; The method further comprises: Using the motion compensation subnetwork, based on the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data, motion estimation is performed on the next image to be processed and the corresponding historical image to obtain the motion compensation data of the next image to be processed.
4. The method according to claim 3, characterized in that: The true value of the fused image is a low-noise image; The multiple frames of sample images include: a sample current frame and a sample history frame; the sample history frame is obtained by adding noise to the true value of the fused image; the sample current frame is obtained by performing affine transformation on the true value of the fused image and adding noise.
5. The method according to claim 3, characterized in that: The fusion sub-network includes: a transformation unit and a fusion unit; The method of using the fusion subnetwork to fuse the current image to be processed and the corresponding image to be processed based on the obtained fusion weights of each image to obtain a processed image includes: Using the transformation unit, based on the acquired motion compensation data, an affine transformation is performed on the current image to be processed to obtain a transformed image; The fusion weight of the current image to be processed is used as the fusion weight of the transformed image, and the fusion unit is used to perform image fusion on the transformed image and the historical image corresponding to the current image to be processed based on the fusion weight of the transformed image and the fusion weight of the historical image corresponding to the current image to be processed, so as to obtain a processed image.
6. The method according to claim 3, characterized in that The weight output subnetwork includes: a feature extraction unit and a weight output unit; the weight output subnetwork in the pre-trained image fusion network determines the fusion weight of the current image to be processed and the corresponding historical image based on the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data, including: Using the feature extraction unit, extract features from the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data to obtain features to be used; Using the weight output unit, determining the fusion weight of the current image to be processed and the corresponding historical image based on the feature to be utilized; The method of using the motion compensation subnetwork to perform motion estimation on the next image to be processed and the corresponding historical image based on the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data to obtain the motion compensation data of the next image to be processed includes: The motion compensation subnetwork is used to perform motion estimation on the next image to be processed and the corresponding historical image based on the features to be utilized, so as to obtain motion compensation data of the next image to be processed.
7. The method according to claim 6, characterized in that The feature extraction unit comprises: a first feature extraction subunit, a first merging subunit, a second feature extraction subunit, a second merging subunit and a third feature extraction subunit; The feature extraction unit is used to extract features from the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data to obtain features to be used, including: Using the first feature extraction subunit to perform feature extraction on the acquired motion compensation data to obtain a first intermediate feature; Using the first merging subunit to merge the current image to be processed, that is, the corresponding historical image, to obtain a merged image; Using the second feature extraction subunit to extract features from the merged image to obtain a second intermediate feature; Using the second merging subunit to merge the first intermediate feature and the second intermediate feature to obtain a merged feature; The third feature extraction subunit is used to further extract features from the combined features to obtain features to be used.
8. The method according to claim 1, characterized in that The acquisition of multiple frames of captured images continuously captured by the image acquisition device for the same scene comprises: Acquire raw image data continuously captured by the image acquisition device for the same scene; The original image data is preprocessed using a predetermined black frame image to be used to obtain a captured image; wherein the black frame image to be used is captured by the image capture device under a dark condition.
9. The method according to any one of claims 1 to 8, characterized in that: Each collected image and the processed image obtained are original raw images; The method further comprises: The processed image is color reconstructed using a pre-trained color reconstruction network to obtain a corresponding red, green, and blue (RGB) image; wherein the color reconstruction network is trained based on a sample raw image and the true value of an RGB image corresponding to the sample raw image.
10. The method according to claim 9, characterized in that The color reconstruction network includes: a denoising subnetwork and a color reconstruction subnetwork; the color reconstruction network trained in advance is used to perform color reconstruction on the processed image to obtain a corresponding red, green, and blue (RGB) image, including: Performing denoising on the processed image using the denoising subnetwork to obtain a denoised image; The color reconstruction subnetwork is used to perform color reconstruction on the denoised image to obtain a corresponding RGB image.
11. The method according to claim 10, characterized in that The denoising sub-network comprises: multiple layers of first encoding units, and first decoding units corresponding to each layer of the first encoding units, and a spatial attention unit is arranged between each layer of the first encoding units and the corresponding first decoding units; The spatial attention unit of each layer is used to fuse the output of the first encoding unit of the layer with the output of the first decoding unit of the next layer based on the spatial attention mechanism to obtain a fused feature; The fused features obtained by the spatial attention unit in each layer are used to merge with the output of the first decoding unit in the next layer as the input of the first decoding unit in this layer.
12. The method according to claim 10, characterized in that The color reconstruction sub-network includes: multiple layers of second encoding units, and a second decoding unit corresponding to each second encoding unit; A first channel attention unit is arranged between every two second coding units; each first channel attention unit is used to determine the channel weight of each channel in the multi-channel data output by the second coding unit of the previous layer based on the channel attention mechanism; the input of the second coding unit of the next layer is: the result obtained by multiplying the data of each channel output by the second coding unit of the previous layer by the corresponding channel weight; A second channel attention unit is arranged between every two second decoding units; each second channel attention unit is used to determine the channel weight of each channel in the multi-channel data output by the second decoding unit of the next layer based on the channel attention mechanism; The input of the second decoding unit of the previous layer is: the result obtained by multiplying the data of each channel output by the second encoding unit of the next layer by the corresponding channel weight.
13. An image processing chip, characterized in that: The image processing chip is used to obtain multiple frames of collected images continuously collected by the image acquisition device for the same scene; obtain motion compensation data obtained by performing motion estimation on each collected image; and determine the fusion weight of each collected image based on each collected image and the obtained motion compensation data; Based on the fusion weights of the collected images, the collected images are fused to obtain a processed image.
14. The image processing chip according to claim 13, characterized in that: The image processing chip is specifically used to obtain the image currently captured by the image capture device as the current image to be processed, and to obtain the historical image corresponding to the current image to be processed; wherein the historical image corresponding to each image to be processed is: an image captured before the image to be processed and adjacent to the image to be processed; obtain motion compensation data obtained by motion estimation of the current image to be processed and the corresponding historical image; the obtained motion compensation data is determined based on the previous image to be processed and the historical image corresponding to the previous image to be processed.
15. The image processing chip according to claim 14, characterized in that: The image processing chip includes: a preprocessing module and an algorithm module; wherein: The preprocessing module is used to obtain the first network parameters from the non-volatile memory of the image acquisition device, and load the first network parameters into the image fusion network in the algorithm module; wherein the image fusion network includes: a weight output subnetwork, a motion compensation subnetwork and a fusion subnetwork; the image fusion network is obtained by training based on multiple frames of sample images and true values of fused images corresponding to the multiple frames of sample images; The algorithm module is used to obtain the image currently captured by the image capture device as the current image to be processed, and to obtain the historical image corresponding to the current image to be processed; to obtain motion compensation data obtained by performing motion estimation on the current image to be processed and the corresponding historical image; to determine the fusion weight of the current image to be processed and the corresponding historical image based on the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data using the weight output subnetwork; to perform image fusion on the current image to be processed and the corresponding image to be processed based on the obtained fusion weights of each image using the fusion subnetwork to obtain a processed image; to perform motion estimation on the next image to be processed and the corresponding historical image based on the current image to be processed, the historical image corresponding to the current image to be processed, and the acquired motion compensation data to obtain the motion compensation data of the next image to be processed.
16. The image processing chip according to claim 15, characterized in that: The preprocessing module is further used to obtain the black frame image to be used from the non-volatile memory, and write the black frame image to be used into the random access memory of the image acquisition device; wherein the black frame image to be used is obtained by the image acquisition device under lightless conditions; obtain the original image data collected by the image acquisition device; use the black frame image to be used to preprocess the original image data to obtain a captured image, and cache the obtained captured image into the random access memory; The algorithm module is specifically used to obtain the current image to be processed and the corresponding historical image from the random access memory.
17. The image processing chip according to claim 15, characterized in that: The collected image and the processed image output by the image fusion network are both original raw images; The preprocessing module is further used to obtain a second network parameter from the non-volatile memory of the image acquisition device, and load the second network parameter into the algorithm module; wherein the second network parameter is obtained by training the color reconstruction network in the algorithm module based on the true value of the sample raw image and the RGB image corresponding to the sample raw image; The algorithm module is also used to use the color reconstruction network to perform color reconstruction on the processed image based on the second network parameters to obtain a red, green, and blue (RGB) image.
18. The image processing chip according to claim 17, characterized in that: The color reconstruction network includes: a denoising subnetwork and a color reconstruction subnetwork; the algorithm module is specifically used to use the denoising subnetwork to denoise the processed image to obtain a denoised image; and use the color reconstruction subnetwork to perform color reconstruction on the denoised image to obtain a corresponding RGB image.
19. The image processing chip according to claim 13, characterized in that: The image processing chip comprises: a first interface for receiving the image captured by the image capture device.
20. The image processing chip according to claim 17, characterized in that: The image processing chip also includes: a second interface, which is used to output the obtained RGB image to a display for display.
21. An image acquisition device, characterized in that: The image acquisition device comprises: an image sensor, a non-volatile memory, a random access memory, a display, and an image processing chip as described in any one of claims 13-20; The image sensor is used to capture an image of the current scene and send the captured image to the image processing chip.
