Image processing device, chip and user equipment

By combining distortion correction and spatiotemporal noise reduction processing in the image processing device, an online continuous processing flow is formed, which solves the problem in the existing technology that the distortion correction and spatiotemporal noise reduction processing cannot be directly continuous, and improves the efficiency and real-time performance of image processing. , improving the signal-to-noise ratio.

CN118735825APending Publication Date: 2024-10-01归芯科技(深圳)有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410729718.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-06
Publication Date
2024-10-01

Smart Images

  • Figure CN118735825A_ABST
    Figure CN118735825A_ABST
Patent Text Reader

Abstract

The invention provides an image processing device which comprises an online processing module, and the online processing module comprises a distortion correction unit which is used for responding to a first configuration mode, carrying out distortion correction processing of distortion blocks on more than one layer of image pyramids corresponding to a current frame image layer by layer, and forming output correction blocks; and the rear-end post-processing unit is in communication connection with the distortion correction unit, and the rear-end post-processing unit is used for responding to a first configuration mode and carrying out space-time noise reduction processing on an output correction block formed by the distortion correction unit line by line by taking pixels as units so as to obtain an output image corresponding to the current frame image. According to the invention, the image processing efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an image processing device, a chip and a user equipment. Background Art

[0002] In a typical design of an existing image signal processor (ISP), the distortion correction unit is generally placed at the very end of the image signal processor ISP as a separate stage. Distortion correction usually adopts a block correction approach. According to the distortion parameters of the lens calibrated in advance, a distortion correction grid covering the entire image is generated, and the distortion range is determined by the reverse mapping method. After the distortion range is determined, the distortion block is obtained and interpolation distortion correction is performed on it to obtain the corrected image block. Because the degree of distortion varies at different positions of the image, and the range of distortion diffusion also varies, the closer to the edge, the more obvious the distortion is. The distortion correction unit needs to search and determine the distortion range block that matches the current correction block on the entire input image, rather than one or several lines of image data. Therefore, the distortion correction unit is not suitable for using line scanning pixel-by-pixel processing similar to ISP_FE / image signal processor backend processing ISP_BE, but adopts block correction, that is, obtaining distorted image blocks from the memory block by block and correcting them block by block. This is also one of the reasons why the distortion correction unit is placed at the very end of the ISP as a separate stage, because it is impossible to directly connect the image signal processor back-end processing ISP_BE and the distortion correction WAPRE. Of course, if the image signal processor back-end processing ISP_BE and the distortion correction are forced to be processed continuously, the cache required for the intermediate row conversion will be very large, which will undoubtedly take up a large hardware area, which is not worth the loss. The image signal processor back-end processing ISP_BE and the distortion correction WAPRE cannot be directly connected. The problem is that the image data needs to pass through the memory again, which increases the system bandwidth and reduces the real-time processing. It is especially unfriendly to some scenarios with high real-time requirements, such as autonomous driving. In addition, the offset in pixel position caused by distortion is not friendly to motion detection in time domain noise reduction. It becomes more difficult to distinguish between the physical movement of pixels and the pixel position offset caused by lens distortion, thereby reducing the signal-to-noise ratio benefit brought by time domain noise reduction. Summary of the invention

[0003] The image processing device, chip and user equipment provided by the present invention can form an online continuous processing flow for distortion correction processing and spatiotemporal noise reduction processing, thereby improving image processing efficiency.

[0004] In a first aspect, the present invention provides an image processing device, comprising: an online processing module, wherein the online processing module comprises:

[0005] A distortion correction unit, configured to perform distortion correction processing on distortion blocks of one or more layers of the image pyramid corresponding to the current frame image layer by layer in response to the first configuration mode, to form an output correction block;

[0006] A back-end post-processing unit is communicatively connected to the distortion correction unit, and the back-end post-processing unit is used to perform spatiotemporal noise reduction processing on the output correction block formed by the distortion correction unit row by row in units of pixels in response to the first configuration mode to obtain an output image corresponding to the current frame image.

[0007] Optionally, the distortion correction unit is used to:

[0008] Obtain the first image to be processed in the current layer of the image pyramid;

[0009] Dividing the first to-be-processed image into a plurality of distorted blocks according to a first preset size, wherein the plurality of distorted blocks form an image matrix;

[0010] The distortion blocks in the image matrix are subjected to distortion correction row by row, and an output correction block corresponding to the distortion block in the current row is formed.

[0011] Optionally, the online processing module further includes an on-chip random access storage module, the on-chip random access storage module is communicatively connected with the distortion correction unit and the back-end post-processing unit, and the on-chip random access storage module is used to store the output correction block output by the distortion correction unit;

[0012] The back-end post-processing unit is used to perform spatiotemporal noise reduction processing on the output correction block formed by the distortion correction unit row by row in units of pixels when the output correction block stored in the on-chip random access memory module corresponds to a whole row of distortion blocks of the image matrix and the number of pixel rows corresponding to the output correction block stored in the on-chip random access memory module is greater than a predetermined number of pixel rows.

[0013] Optionally, the distortion correction unit is further used to, in response to the second configuration mode, obtain a current frame image from the memory, divide the current frame image into a plurality of distortion blocks according to a first preset size, and the plurality of distortion blocks form an image matrix; perform distortion correction on the distortion blocks in the image matrix row by row, and form an output correction block corresponding to the distortion block in the current row;

[0014] The online processing cache is also used to receive and store the output correction block output by the distortion correction unit in response to the second configuration mode.

[0015] Optionally, the distortion correction unit is used to:

[0016] Obtaining a second preset size of the distortion block in the current frame image;

[0017] The second preset size is scaled according to a sampling ratio between the first image to be processed and the current frame image to obtain the first preset size.

[0018] Optionally, the distortion correction unit is used to:

[0019] Obtaining a distortion correction grid, and interpolating the distortion coordinates corresponding to the four vertices of the output correction block according to the coordinates of the four vertices of the output correction block and the distortion correction grid;

[0020] The distortion range of the input distortion block is determined according to the distortion coordinates corresponding to the four vertices of the output correction block, and the second preset size is determined according to the distortion range.

[0021] Optionally, the distortion correction unit is used to:

[0022] According to the second preset size, obtaining an input distortion block;

[0023] According to the coordinates of the corrected pixel point in the output corrected block and the distorted coordinates corresponding to the four vertices of the output corrected block, the distorted coordinates of the corrected pixel point corresponding to the input distorted block are interpolated;

[0024] According to the distorted coordinates of the corrected pixel corresponding to the input distorted block, pixel interpolation is performed within the range of the input distorted block to obtain the pixel value of the corrected pixel;

[0025] The pixel value of the correction pixel point is filled into the coordinate position of the correction pixel point in the output correction block to obtain the output correction block.

[0026] Optionally, the back-end post-processing unit is used to:

[0027] When the first image to be processed is an image below the second layer in the pyramid;

[0028] Down-sampling and up-sampling the first partial image composed of the output correction blocks stored in the online processing cache in sequence to obtain a second image to be processed;

[0029] Acquire a first difference image between the second image to be processed and the first partial image;

[0030] Obtain the previous layer output image of the previous layer in the image pyramid after the previous layer is subjected to spatiotemporal noise reduction processing;

[0031] Upsampling the previous output image to obtain a first image to be fused;

[0032] The region of the first image to be fused corresponding to the first difference image is fused with the first difference image to obtain a first fused image.

[0033] Optionally, the back-end post-processing unit is used to:

[0034] When the first image to be processed is an image of the first layer in the pyramid, the image of the first layer in the pyramid is directly used as the first fused image.

[0035] Optionally, the back-end post-processing unit is used to:

[0036] Performing spatial denoising processing on the first fused image to obtain a first spatial denoised image;

[0037] A first weight is assigned to the first spatial denoised image, a second weight is assigned to the first fused image, and the first spatial denoised image and the second fused image are weighted-fused to obtain a second fused image.

[0038] Optionally, the back-end post-processing unit is used to:

[0039] Determine an image corresponding to the number of layers of the current layer in the image pyramid of the previous frame image as a second image to be processed;

[0040] Obtaining a previous frame of output image output after performing distortion correction and spatiotemporal noise reduction on the second image to be processed;

[0041] The previous frame output image is fused with the second fused image to form a current layer output image.

[0042] Optionally, the back-end post-processing unit is used to:

[0043] The output image of the previous frame is assigned a third weight, the second fused image is assigned a fourth weight, and the output image of the previous frame and the second fused image are weightedly fused to obtain an output image of the current layer.

[0044] Optionally, the device further comprises a memory module, and the memory module is communicatively connected with the online processing module; wherein,

[0045] The back-end post-processing unit is further used to perform spatiotemporal noise reduction processing on one or more layers of the image pyramid corresponding to the current frame image layer by layer in response to the third configuration mode, and store the image after the spatiotemporal noise reduction processing in the memory module;

[0046] The distortion correction unit is also used to respond to the third configuration mode, read the image after the spatiotemporal noise reduction processing from the memory module, perform distortion correction processing on the image after the spatiotemporal noise reduction processing, and store the image after the distortion correction processing in the memory module.

[0047] Optionally, the back-end post-processing unit is further used to respond to the fourth configuration mode, obtain one or more image pyramids corresponding to the current frame from the memory, perform spatiotemporal noise reduction processing on the one or more image pyramids corresponding to the current frame image layer by layer, and store the image after the spatiotemporal noise reduction processing in the memory module.

[0048] Optionally, the device also includes a back-end pre-processing module, which is communicatively connected to the memory module, and is used to perform one or more pre-processing of de-mosaicing, color correction, gamma correction, color space conversion, and global motion estimation on the current frame image, and pyramid decompose the pre-processed image according to preset conditions and store it in the memory module.

[0049] Optionally, the device also includes a front-end processing module, which is communicatively connected to the memory module, and is used to pre-process the current frame image by performing one or more of black level correction processing, digital gain processing, bad pixel correction processing, and white balance processing.

[0050] In a second aspect, the present invention provides a chip, comprising an image processing device as described in any one of the above.

[0051] In a third aspect, the present invention provides a user equipment, wherein the user equipment comprises an image processing apparatus as described in any one of the above.

[0052] In the implementation provided by the present invention, the distortion correction of the image is performed in advance before performing the spatiotemporal noise reduction. Since the output size of the distortion correction is deterministic, the online cache space required for the distortion correction can be known in advance, thereby enabling online continuous processing of the distortion correction and spatiotemporal noise reduction. In this processing mode, the data output by the distortion correction does not need to be stored in the memory, but is directly output to the online cache, thereby effectively reducing the number of read and write times to the memory and improving the efficiency of image processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 A schematic diagram of an image processing device according to an embodiment of the present invention;

[0054] Figure 2 A flowchart of the image processing device according to an embodiment of the present invention performing distortion correction and spatiotemporal noise reduction processing step by step;

[0055] Figure 3 A schematic diagram of distorted grid interpolation of an image processing device according to another embodiment of the present invention;

[0056] Figure 4 FIG. 4 is a schematic diagram of distortion correction reverse mapping of an image processing device according to another embodiment of the present invention. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0058] An embodiment of the present invention provides an image processing device, such as Figure 1 As shown, it includes: an online processing module, and the online processing module includes:

[0059] A distortion correction unit, configured to perform distortion correction processing on distortion blocks of one or more layers of the image pyramid corresponding to the current frame image layer by layer in response to the first configuration mode, to form an output correction block;

[0060] The back-end post-processing unit is communicatively connected with the distortion correction unit, and the back-end post-processing unit is used to perform spatiotemporal noise reduction processing on the output correction block formed by the distortion correction unit row by row in units of pixels in response to the first configuration mode, so as to obtain an output image corresponding to the current frame image. In some embodiments, for images with different input resolutions, the number of layers of the image pyramid can be adjusted. Generally speaking, a larger number of pyramid layers can be configured for a larger image, and a smaller number of pyramid layers can be configured for a smaller image. When the resolution of the current frame image is small enough, a layer of pyramid can be used, that is, the current frame image is not decomposed, and the current frame image is directly used as a layer of pyramid. Distortion correction refers to correcting the distorted pixels in the image to the correct position. In the traditional distortion correction and spatiotemporal noise reduction processing process, the image is usually stored in the memory after the spatiotemporal noise reduction processing, and the image is read out from the memory during the distortion correction process. This is because the position of the pixels that need to be corrected is unpredictable during the distortion correction process. Therefore, in the process of processing spatiotemporal noise reduction by row, it is not possible to support online processing of distortion correction by block. In this embodiment, based on the characteristic that the pixels in the output correction block of the distortion correction have deterministic positions, the distortion correction process is set before the spatiotemporal noise reduction. In this case, after the distortion correction completes the correction of the entire row, the local image in the cache can start the spatiotemporal noise reduction processing by row.

[0061] A back-end post-processing unit is communicatively connected to the distortion correction unit, and the back-end post-processing unit is used to perform spatiotemporal noise reduction processing on the output correction block formed by the distortion correction unit row by row in units of pixels in response to the first configuration mode to obtain an output image corresponding to the current frame image.

[0062] In some embodiments, spatiotemporal noise reduction refers to eliminating noise signals of an image through image fusion and reconstruction in space and time. When an output correction block corresponding to one or more entire rows in the image matrix has been stored in the online processing cache; the image signal processor is used to perform spatiotemporal noise reduction processing on the output correction block corresponding to each row in the image matrix row by row in units of pixels to obtain each layer of output image.

[0063] In the implementation provided by the present invention, the distortion correction of the image is performed in advance before performing the spatiotemporal noise reduction. Since the output size of the distortion correction is deterministic, the online cache space required for the distortion correction can be known in advance, thereby enabling online continuous processing of the distortion correction and spatiotemporal noise reduction. In this processing mode, the data output by the distortion correction does not need to be stored in the memory, but is directly output to the online cache, thereby effectively reducing the number of read and write times to the memory and improving the efficiency of image processing.

[0064] In the prior art, the Raw image data captured by the image sensor is usually processed by the image signal processor front-end processing ISP_FE, the image signal processor back-end processing ISP_BE and the distortion correction WARPE, and is compressed and stored as the data of the image that is directly visible to human vision. Generally speaking, ISP_FE mainly includes black level correction / digital gain (BLC / GAIN), bad pixel correction (BAD PIXEL CORRECTION), white balance (WHITE BALLANCE) and other modules. ISP_BE mainly includes demosaicing (DEMOSICA), color correction (COLOR CORRECTION), GAMMA correction (GAMMACORRECTION), color space conversion (RGB2YCBCR), global motion estimation (GME), pyramid decomposition (PYD_DEC), multi-band spatiotemporal noise reduction (MSTNR, SNR+TNR) and other modules, among which the motion vector obtained by global motion estimation (GME) is used for motion compensation of the current frame in TNR. In order to achieve multi-band spatiotemporal denoising, ISP_BE is generally divided into two sections: back-end pre-processing ISP_BE1ST and back-end post-processing ISP_BE2ND, where pyramid decomposition (PYD_DEC) is at the end of ISP_BE1ST and multi-band spatiotemporal denoising (MSTNR) is at the beginning of ISP_BE2ND. The image data output by the pyramid decomposition (PYD_DEC) module needs to be stored in the memory DDR first. The multi-band spatiotemporal denoising (MSTNR) module obtains image data of different frequency bands, performs spatiotemporal denoising on different frequency bands according to the coarse-to-fine strategy, and continuously performs pyramid reconstruction to finally synthesize an image. WARPE is located after ISP_BE2ND. As a separate stage, it obtains the image data output by ISP_BE2ND from the memory DDR for distortion correction. After completion, the entire process ends.

[0065] It can be seen from the above process that the entire image processing process is divided into four parts according to the number of times it enters and exits the memory DDR, namely ISP_FE, ISP_BE1ST, ISP_BE2ND and WARPE. From the system's perspective, every additional time it enters and exits the memory DDR, the system bandwidth will increase the reading and writing of an image size, and the real-time performance of the system processing will be reduced. The reason why ISP_BE2ND is not directly connected to WARPE is that the distortion correction unit needs to search and determine the distortion range of the current correction block on the entire input image, rather than one or several rows of the input image. In other words, one or several rows of image data cannot guarantee that it can necessarily cover the distortion range of the current correction block. Therefore, the distortion correction unit is not suitable for using row scanning pixel-by-pixel processing similar to ISP_FE / ISP_BE, which makes it impossible to directly connect for continuous processing. Of course, if forced to directly connect for continuous processing, the cache of the intermediate row conversion block will be very large, which will undoubtedly occupy a large hardware area, which is not worth the loss. The processing device in the embodiment of the present invention is as follows Figure 1 As shown, WARPE is placed before ISP_BE2ND and directly connected to ISP_BE2ND, so that the system is divided into three parts, ISP_FE, ISP_BE1ST and WARPE+ISP_BE2ND, thereby saving a pair of DDR reading and writing, saving system bandwidth, and improving the real-time performance of system processing. In the technical solution provided by the implementation of the present invention, WARPE can be placed before ISP_BE2ND, so that continuous processing of WARPE and ISP_BE2ND can be achieved. The reason is that although the size and position of the distortion block input by WARPE are uncertain, the size and position of the output correction block are determined, so the row scanning pixel-by-pixel processing of the subsequent module can be achieved by block-to-row conversion.

[0066] As an optional implementation manner, the distortion correction unit is used to:

[0067] Obtain the first image to be processed in the current layer of the image pyramid;

[0068] Dividing the first to-be-processed image into a plurality of distorted blocks according to a first preset size, wherein the plurality of distorted blocks form an image matrix;

[0069] The distortion blocks in the image matrix are subjected to distortion correction row by row, and an output correction block corresponding to the distortion block in the current row is formed.

[0070] In some embodiments, in the traditional distortion correction and spatiotemporal noise reduction processing, the image is usually stored in the memory after the spatiotemporal noise reduction processing, and the image is read out from the memory during the distortion correction process. This is because in the distortion correction process, the pixel positions that need to be corrected are unpredictable. Therefore, in the spatiotemporal noise reduction process performed by row, it is not possible to support online processing of distortion correction performed by block. In this embodiment, based on the characteristic that the pixels in the output correction block of the distortion correction have deterministic positions, the distortion correction process is set before the spatiotemporal noise reduction. In this case, after the distortion correction completes the correction of the entire row, the local image in the cache can start the spatiotemporal noise reduction process by row.

[0071] As an optional implementation, the online processing module further includes an on-chip random access storage module, the on-chip random access storage module is communicatively connected with the distortion correction unit and the back-end post-processing unit, and the on-chip random access storage module is used to store the output correction block output by the distortion correction unit;

[0072] The back-end post-processing unit is used to perform spatiotemporal noise reduction processing on the output correction block formed by the distortion correction unit row by row in units of pixels when the output correction block stored in the on-chip random access memory module corresponds to a whole row of distortion blocks of the image matrix and the number of pixel rows corresponding to the output correction block stored in the on-chip random access memory module is greater than a predetermined number of pixel rows.

[0073] In some embodiments, usually, due to the considerable difference in the reading and writing efficiency of the memory and the cache, this embodiment is suitable for using an online processing method when the real-time requirement is high, that is, the data is stored in the cache for processing. At the same time, since in this embodiment, the pixel position output by the distortion correction unit has a fixed position, under this premise, it is not necessary to cache the output correction block with too large a cache area. It is only necessary to calculate according to the demand to meet the filter size required for the spatiotemporal noise reduction processing.

[0074] As an optional implementation manner, the distortion correction unit is further used to, in response to the second configuration mode, obtain a current frame image from the memory, divide the current frame image into a plurality of distortion blocks according to a first preset size, and the plurality of distortion blocks form an image matrix; perform distortion correction on the distortion blocks in the image matrix row by row, and form an output correction block corresponding to the distortion block in the current row;

[0075] The online processing cache is also used to receive and store the output correction block output by the distortion correction unit in response to the second configuration mode.

[0076] In some embodiments, for scenarios that only require distortion correction, such as EIS (electronic image stabilization, video stabilization), fisheye cameras, etc., the system can be configured to bypass the denoising module (SNR module and TNR module), the current frame image is processed by distortion correction, and the distortion-corrected data is output. In this scenario, the input image is not limited to YUV images, and images in RGB / RGBA format can also be supported. In this scenario, the online cache of block transfers between WARPE and ISP_BE2ND can be reused to improve the memory access performance of WARPE.

[0077] As an optional implementation manner, the distortion correction unit is used to:

[0078] Obtaining a second preset size of the distortion block in the current frame image;

[0079] The second preset size is scaled according to a sampling ratio between the first image to be processed and the current frame image to obtain the first preset size.

[0080] In some embodiments, WARPE is placed before ISP_BE2ND and directly connected to it, and multi-band pyramid image data is obtained from the memory DDR. This is significantly different from the existing image processing flow, which requires that the design of the embodiments of the present invention must be able to support multi-band distortion correction and ensure that the same correction effect as directly performing distortion correction on the entire image is achieved.

[0081] Multi-band distortion correction, as the name implies, is to perform distortion correction on a multi-band pyramid. Specifically, each layer of the image pyramid (g_0, g_1, g_2, g_3) is subjected to distortion correction. After the correction is completed, they are fused into a new image according to the multi-band pyramid reconstruction process, which is the image after multi-band distortion correction.

[0082] How to ensure that the distortion correction is the same as that of the whole image when the distortion correction is performed on each layer of the image pyramid (g_0, g_1, g_2, g_3) is the focus of this embodiment. In this embodiment, the coordinate position of the pixel point on the multi-band can be converted to the corresponding position on the original image according to the scaling ratio. Taking the horizontal direction as an example, it can be seen that the points on each layer of the pyramid can find the corresponding position on the original image, and the vertical direction is similar. For example, for a point with coordinates p_L = (x_L, y_L) on the L layer, its corresponding coordinates on the original image are p_0 = (x_L×2^L, y_L×2^L). Similarly, for the four vertices of the output correction block on an L-layer (c0_L, c1_L, c2_L, c3_L), they can correspond to the four vertices of the output correction block of the original image (c0_L×2^L, c1_L×2^L, c2_L×2^L, c3_L×2^L). The four coordinates of the input distortion block on the original image are interpolated using the distortion calibration grid of the original image, recorded as (c0_0_w, c1_0_w, c2_0_w, c3_0_w), and then converted into the distortion coordinates on the l-layer according to the ratio, that is, (c0_L_w, c1_L_w, c2_L_w, c3_L_w) = (c0_L_w ÷ 2^L, c1_L_w ÷ 2^L, c2_L_w ÷ 2^L, c3_L_w ÷ 2^L). In this way, the distortion correction of points on multiple frequency bands can be performed similar to that of the entire image. Because multiple frequency bands use the same distortion calibration grid, and the reverse mapping on multiple frequency bands is performed on the original image scale, the accuracy of the distortion calculation is strictly guaranteed. Experimental verification shows that the proposed multi-band distortion correction can ensure the same correction effect as the distortion correction of the entire image.

[0083] As an optional implementation, Figure 3-4 As shown, the distortion correction unit is used for:

[0084] Obtaining a distortion correction grid, and interpolating the distortion coordinates corresponding to the four vertices of the output correction block according to the coordinates of the four vertices of the output correction block and the distortion correction grid;

[0085] The distortion range of the input distortion block is determined according to the distortion coordinates corresponding to the four vertices of the output correction block, and the second preset size is determined according to the distortion range.

[0086] In some embodiments, before distortion correction, it is necessary to pre-calibrate the camera lens, obtain the internal and external parameters and distortion coefficients of the camera, and generate a distortion correction grid covering the entire image. The distortion correction grid represents the coordinate offset of the distorted image relative to the undistorted image. The size of the distortion correction grid can be 16x16, 32x32, 64x64, etc. Distortion correction (WARPE) usually adopts the method of block-by-block distortion correction to complete the distortion correction of the entire image. The size of the block can be 4x4, 4x8, 8x8, etc. On the input distorted image, the degree of distortion at different positions varies, and the range of distortion diffusion also varies. Generally, the closer to the edge, the more obvious the distortion. Since the distortion of the input image is not uniformly distributed, it is difficult to perform forward block correction. Generally, the reverse mapping method is used to determine the distortion range of the block to be corrected. After the distortion range is determined, the distorted block is obtained and interpolation distortion correction is performed on it to obtain the corrected image block. When determining the distortion range of the correction block, such as Figure 3-4 As shown, for an output correction block of the Lth layer in the image pyramid, the four corner vertices (c0_L, c1_L, c2_L, c3_L) of the correction block are reversely mapped to obtain (c0_L_w, c1_L_w, c2_L_w, c3_L_w) and then the maximum rectangular range covered by (c0_L_w, c1_L_w, c2_L_w, c3_L_w) is calculated to determine the distortion range of the output correction block, that is, the input distortion block. In order to ensure the accuracy of the reverse mapping, bicubic interpolation is generally used. Without restriction, bilinear interpolation can also be used, such as Figure 3-4 As shown in the figure, the rectangle surrounded by circular black dots is a distortion correction grid, and the rectangle surrounded by diamond black dots is an output correction block. For the four corner vertices (c0_L, c1_L, c2_L, c3_L) of the output correction block, the 16 points (t00, t01, ..., t33) of the distortion correction grid are used, and bicubic interpolation is used to obtain the four high-precision input distortion points (c0_L_w, c1_L_w, c2_L_w, c3_L_w).

[0087] As an optional implementation manner, the distortion correction unit is used to:

[0088] According to the second preset size, obtaining an input distortion block;

[0089] According to the coordinates of the corrected pixel point in the output corrected block and the distorted coordinates corresponding to the four vertices of the output corrected block, the distorted coordinates of the corrected pixel point corresponding to the input distorted block are interpolated;

[0090] According to the distorted coordinates of the corrected pixel corresponding to the input distorted block, pixel interpolation is performed within the range of the input distorted block to obtain the pixel value of the corrected pixel;

[0091] The pixel value of the correction pixel point is filled into the coordinate position of the correction pixel point in the output correction block to obtain the output correction block.

[0092] In some embodiments, when correcting the distortion range, two interpolation processes are included, one of which is to interpolate the distortion correction grid to obtain the distorted coordinates of each pixel point within the distortion range, and the other interpolation is to interpolate the pixel values ​​at the distorted coordinates based on the adjacent pixel values, thereby obtaining the pixel values ​​at the corresponding positions in the output correction block. Figure 3-4 As shown in the figure, for an output correction block, the distortion coordinates of the four corner vertices have been obtained in the first step, and there is no need to repeat the calculation. The distortion coordinates (such as p_L_w) of other points (such as p_L) in the output correction block can be directly obtained by bilinear interpolation using (c0_L_w, c1_L_w, c2_L_w, c3_L_w). So far, the distortion coordinates corresponding to each point in the output correction block have been obtained. According to the distortion coordinates, the corresponding pixel value can be found in the input distortion block. In order to improve the accuracy of pixel distortion correction, bicubic interpolation or bilinear interpolation can be used to complete the interpolation correction of image pixels.

[0093] From the description of the distortion correction process above, it can be seen that the size of the input distortion block is mainly determined by the degree of image distortion and the size of the output correction block. When the degree of image distortion is determined, the larger the output correction block, the larger the input distortion block may be. In extreme cases, it may even be the same as the input original block. Figure 1 That is to say, the distortion correction unit needs to search and determine the distortion range of the current correction block on the entire input image. One or several lines of image data cannot guarantee that they can necessarily cover the distortion range of the current correction block. This is why it is difficult for ISP_BE to be directly connected to WARPE. The design scheme in the embodiment of the present invention places WARPE before ISP_BE2ND and connects it directly. Benefiting from the fixed size of the output correction block of WARPE, the optional size is 4x4 or 4x8, and only 4 lines of linebuffer are required. The input linebuffer of ISP_BE2ND is generally greater than or equal to 4 lines, so the block conversion from WARPE to ISP_BE2ND can completely reuse the linebuffer of ISP_BE2ND to realize the row scanning and pixel-by-pixel processing of subsequent modules.

[0094] As an optional implementation manner, the back-end post-processing unit is used to:

[0095] When the first image to be processed is an image below the second layer in the pyramid;

[0096] Down-sampling and up-sampling the first partial image composed of the output correction blocks stored in the online processing cache in sequence to obtain a second image to be processed;

[0097] Acquire a first difference image between the second image to be processed and the first partial image;

[0098] Obtain the previous layer output image of the previous layer in the image pyramid after the previous layer is subjected to spatiotemporal denoising processing;

[0099] Upsampling the previous output image to obtain a first image to be fused;

[0100] The region of the first image to be fused corresponding to the first difference image is fused with the first difference image to obtain a first fused image.

[0101] As an optional implementation manner, the back-end post-processing unit is used to:

[0102] When the first image to be processed is an image of the first layer in the pyramid, the image of the first layer in the pyramid is directly used as the first fused image.

[0103] In some embodiments, for an input image I, after continuous downsampling operations, an image pyramid of different frequency bands can be generated (for example, a pyramid of four layers g_0, g_1, g_2, and g_3). It is worth noting that the lowest layer of the pyramid g_0 = I. REDUCE is an image downsampling operation to reduce the image size by half, which is generally composed of a low-pass filter convolution operation and a downsampling 2 operation. The decomposition function of the pyramid from layer L to layer L+1 is achieved by the following operations:

[0104] g_(L+1)=REDUCE(g_L)

[0105] Multi-band pyramid reconstruction is a reverse process of multi-band pyramid decomposition, and its purpose is to fuse the decomposed image pyramid (g_0, g_1, g_2, g_3) into one image. Starting from the highest level of the pyramid (such as g_3), reconstruct layer by layer until the lowest level is reconstructed and a new image g_0_cout is fused. It is worth noting that the highest level of the pyramid does not need to be reconstructed. For example, when the highest level image of the pyramid is g_3, g_3_cout = g_3. Among them, EXPAND is an image upsampling operation to achieve a 2-fold magnification of the image. The general practice is to first expand it to twice the original size in each dimension, fill the newly added rows and columns (even rows and columns) with 0, and then use the specified low-pass filter for convolution to estimate the approximate value of the "lost" pixel. The reconstruction function of the pyramid from layer L+1 to layer L is achieved through the following combination of operations,

[0106] g_L_Rout=g_L-EXPAND(REDUCE(g_L))+EXPAND(g_L+1_Cout)

[0107] Among them, g_L_Rout is the first fused image, g_L is the image to be processed in the current layer, and g_L+1_Cout is the output image of the previous layer.

[0108] As an optional implementation manner, the back-end post-processing unit is used to:

[0109] Performing spatial denoising processing on the first fused image to obtain a first spatial denoised image;

[0110] A first weight is assigned to the first spatial denoised image, a second weight is assigned to the first fused image, and the first spatial denoised image and the second fused image are weighted-fused to obtain a second fused image.

[0111] As an optional implementation manner, the back-end post-processing unit is used to:

[0112] Determine an image corresponding to the number of layers of the current layer in the image pyramid of the previous frame image as a second image to be processed;

[0113] Obtaining a previous frame of output image output after performing distortion correction and spatiotemporal noise reduction on the second image to be processed;

[0114] The previous frame output image is fused with the second fused image to form a current layer output image.

[0115] As an optional implementation manner, the back-end post-processing unit is used to:

[0116] The output image of the previous frame is assigned a third weight, the second fused image is assigned a fourth weight, and the output image of the previous frame and the second fused image are weightedly fused to obtain an output image of the current layer.

[0117] In some embodiments, the multi-band denoising algorithm generally follows a coarse-to-fine strategy, starting from the highest level of the pyramid (e.g., g_3 level), denoising layer by layer, and reconstructing to the next level after completion, and continuing to participate in the denoising of the next level. Until the denoising of the bottom pyramid (g_0 level) is completed, it indicates that the entire multi-band denoising algorithm is completed, and the denoised image data is sent to the next level module for further processing.

[0118] Different from the traditional multi-band noise reduction algorithm that only performs spatial noise reduction (SNR) on multiple frequency bands but does not perform temporal noise reduction (TNR), the multi-band spatiotemporal noise reduction (MSTNR) proposed in the embodiment combines spatial noise reduction (SNR) and temporal noise reduction (TNR), first performs spatial noise reduction (SNR) on each frequency band, and then performs temporal noise reduction (TNR), which greatly improves the performance of noise removal on different frequencies. Optionally, spatial noise reduction (SNR) can use algorithms such as sigma filtering, bilateral filtering (BF), and non-local mean filtering (NLM). Temporal noise reduction (TNR) uses multi-frame fusion to achieve noise reduction, which is specifically expressed as follows: g_L_Cout = α_1×g_L_Fout+(1-α_1)×(α_2×g_L_SNR+(1-α_2)×g_L)

[0119] Among them, g_L is the current frame of the L band, g_L_Fout is the time domain filtering result of the previous frame of the L band, g_L_SNR is the spatial noise reduction (SNR) result of the current frame of the L band, g_L_Cout is the time domain filtering (TNR) result of the current frame of the L band, α_1, α_2 are fusion strength factors, which are related to the motion intensity of the current frame g_L relative to the previous frame g_L_F. In the aforementioned embodiment, α_2 is the first weight, (1-α_2) is the second weight, α_1 is the third weight, and 1-α_1 is the fourth weight.

[0120] The multi-band distortion correction combined with the multi-band spatiotemporal noise reduction algorithm proposed in the embodiment of the invention requires first WARPE of the image of the current band, and then reconstruct the image to be denoised that has been subjected to distortion correction in the current layer by combining the image of the previous layer of bands (which has undergone distortion correction and spatiotemporal noise reduction in the previous layer), which is used for spatiotemporal noise reduction in the current band, until the spatiotemporal noise reduction is completed in the lowest layer of bands, marking that the multi-band distortion correction combined with the multi-band spatiotemporal noise reduction algorithm is completed. Furthermore, the multi-band distortion correction and the multi-band spatiotemporal noise reduction are combined, so that the spatiotemporal noise reduction can be implemented on the image after distortion correction, thereby improving the problem of decreased TNR signal-to-noise ratio benefit caused by inaccurate motion detection due to distortion.

[0121] As an optional implementation, the device further includes a memory module, and the memory module is communicatively connected to the online processing module; wherein,

[0122] The back-end post-processing unit is further used to perform spatiotemporal noise reduction processing on one or more layers of the image pyramid corresponding to the current frame image layer by layer in response to the third configuration mode, and store the image after the spatiotemporal noise reduction processing in the memory module;

[0123] The distortion correction unit is also used to respond to the third configuration mode, read the image after the spatiotemporal noise reduction processing from the memory module, perform distortion correction processing on the image after the spatiotemporal noise reduction processing, and store the image after the distortion correction processing in the memory module.

[0124] In some embodiments, this implementation is suitable for scenarios where real-time requirements are not high. If the system configuration first performs multi-band spatiotemporal noise reduction and then performs distortion correction, in this process, the data completed by the spatiotemporal noise reduction processing is stored in the memory, and during the distortion correction process, the corresponding data is read from the memory.

[0125] As an optional implementation, the back-end post-processing unit is also used to respond to the fourth configuration mode, obtain one or more image pyramids corresponding to the current frame from the memory, perform spatiotemporal noise reduction processing on the one or more image pyramids corresponding to the current frame image layer by layer, and store the image after the spatiotemporal noise reduction processing in the memory module.

[0126] In some embodiments, for scenarios where only denoising is required, such as non-ultra-wide-angle sensors and where the system imaging distortion is not obvious, the system can be configured to bypass the distortion correction unit (WARPE module), and the back-end post-processing unit directly reads one or more layers of the image pyramid corresponding to the current frame from the memory, and performs spatiotemporal denoising layer by layer.

[0127] As an optional implementation, the device also includes a back-end pre-processing module, which is communicatively connected to the memory module. The back-end pre-processing module is used to perform one or more pre-processing of de-mosaicing, color correction, gamma correction, color space conversion, and global motion estimation on the current frame image, and pyramid decomposes the pre-processed image according to preset conditions and stores it in the memory module.

[0128] As an optional embodiment, the device also includes a front-end processing module, which is communicatively connected to the memory module, and is used to pre-process the current frame image by performing one or more of black level correction processing, digital gain processing, bad pixel correction processing, and white balance processing.

[0129] An embodiment of the present invention further provides a chip, the chip comprising any one of the above-mentioned image processing apparatuses. An embodiment of the present invention further provides a user equipment, the user equipment comprising any one of the above-mentioned image processing apparatuses.

[0130] Those skilled in the art can understand that all or part of the processes in the above method embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes in the above method embodiments. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0131] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. An image processing device, characterized in that: include: An online processing module, the online processing module comprising: A distortion correction unit, configured to perform distortion correction processing on distortion blocks of one or more layers of the image pyramid corresponding to the current frame image layer by layer in response to the first configuration mode, to form an output correction block; A back-end post-processing unit is communicatively connected to the distortion correction unit, and the back-end post-processing unit is used to perform spatiotemporal noise reduction processing on the output correction block formed by the distortion correction unit row by row in units of pixels in response to the first configuration mode to obtain an output image corresponding to the current frame image.

2. The image processing device according to claim 1, characterized in that The distortion correction unit is used for: Obtain the first image to be processed in the current layer of the image pyramid; Dividing the first to-be-processed image into a plurality of distorted blocks according to a first preset size, wherein the plurality of distorted blocks form an image matrix; The distortion blocks in the image matrix are subjected to distortion correction row by row, and an output correction block corresponding to the distortion block in the current row is formed.

3. The image processing device according to claim 2, characterized in that: The online processing module further includes an on-chip random access storage module, which is communicatively connected with the distortion correction unit and the back-end post-processing unit, and is used to store the output correction block output by the distortion correction unit; The back-end post-processing unit is used to perform spatiotemporal noise reduction processing on the output correction block formed by the distortion correction unit row by row in units of pixels when the output correction block stored in the on-chip random access memory module corresponds to a whole row of distortion blocks of the image matrix and the number of pixel rows corresponding to the output correction block stored in the on-chip random access memory module is greater than a predetermined number of pixel rows.

4. The image processing device according to claim 3, characterized in that: The distortion correction unit is further used to, in response to the second configuration mode, obtain a current frame image from the memory, divide the current frame image into a plurality of distortion blocks according to a first preset size, and the plurality of distortion blocks form an image matrix; perform distortion correction on the distortion blocks in the image matrix row by row, and form an output correction block corresponding to the distortion block in the current row; The online processing cache is also used to receive and store the output correction block output by the distortion correction unit in response to the second configuration mode.

5. The image processing device according to claim 2, characterized in that: The distortion correction unit is used for: Obtaining a second preset size of the distortion block in the current frame image; The second preset size is scaled according to a sampling ratio between the first image to be processed and the current frame image to obtain the first preset size.

6. The image processing device according to claim 5, characterized in that: The distortion correction unit is used for: Obtaining a distortion correction grid, and interpolating the distortion coordinates corresponding to the four vertices of the output correction block according to the coordinates of the four vertices of the output correction block and the distortion correction grid; The distortion range of the input distortion block is determined according to the distortion coordinates corresponding to the four vertices of the output correction block, and the second preset size is determined according to the distortion range.

7. The image processing device according to claim 6, characterized in that: The distortion correction unit is used for: According to the second preset size, obtaining an input distortion block; According to the coordinates of the corrected pixel point in the output corrected block and the distorted coordinates corresponding to the four vertices of the output corrected block, the distorted coordinates of the corrected pixel point corresponding to the input distorted block are interpolated; According to the distorted coordinates of the corrected pixel corresponding to the input distorted block, pixel interpolation is performed within the range of the input distorted block to obtain the pixel value of the corrected pixel; The pixel value of the correction pixel point is filled into the coordinate position of the correction pixel point in the output correction block to obtain the output correction block.

8. The image processing device according to claim 2, characterized in that: The back-end post-processing unit is used for: When the first image to be processed is an image below the second layer in the pyramid; Down-sampling and up-sampling the first partial image composed of the output correction blocks stored in the online processing cache in sequence to obtain a second image to be processed; Acquire a first difference image between the second image to be processed and the first partial image; Obtain the previous layer output image of the previous layer in the image pyramid after the previous layer is subjected to spatiotemporal noise reduction processing; Upsampling the previous output image to obtain a first image to be fused; The region of the first image to be fused corresponding to the first difference image is fused with the first difference image to obtain a first fused image.

9. The image processing device according to claim 8, characterized in that: The back-end post-processing unit is used for: When the first image to be processed is an image of the first layer in the pyramid, the image of the first layer in the pyramid is directly used as the first fused image.

10. The image processing device according to claim 8 or 9, characterized in that: The back-end post-processing unit is used for: Performing spatial denoising processing on the first fused image to obtain a first spatial denoised image; A first weight is assigned to the first spatial denoised image, a second weight is assigned to the first fused image, and the first spatial denoised image and the second fused image are weighted-fused to obtain a second fused image.

11. The image processing device according to claim 10, characterized in that: The back-end post-processing unit is used for: Determine an image corresponding to the number of layers of the current layer in the image pyramid of the previous frame image as a second image to be processed; Obtaining a previous frame of output image output after performing distortion correction and spatiotemporal noise reduction on the second image to be processed; The previous frame output image is fused with the second fused image to form a current layer output image.

12. The image processing device according to claim 11, characterized in that: The back-end post-processing unit is used for: The output image of the previous frame is assigned a third weight, the second fused image is assigned a fourth weight, and the output image of the previous frame and the second fused image are weightedly fused to obtain an output image of the current layer.

13. The image processing device according to claim 1, characterized in that: The device also includes a memory module, which is communicatively connected to the online processing module; wherein, The back-end post-processing unit is further used to perform spatiotemporal noise reduction processing on one or more layers of the image pyramid corresponding to the current frame image layer by layer in response to the third configuration mode, and store the image after the spatiotemporal noise reduction processing in the memory module; The distortion correction unit is also used to respond to the third configuration mode, read the image after the spatiotemporal noise reduction processing from the memory module, perform distortion correction processing on the image after the spatiotemporal noise reduction processing, and store the image after the distortion correction processing in the memory module.

14. The image processing device according to claim 13, characterized in that: The back-end post-processing unit is further used to, in response to the fourth configuration mode, obtain one or more layers of image pyramid corresponding to the current frame from the memory, perform spatiotemporal noise reduction processing on the one or more layers of image pyramid corresponding to the current frame image layer by layer, and store the image after the spatiotemporal noise reduction processing in the memory module.

15. The image processing device according to claim 13, characterized in that: The device also includes a back-end pre-processing module, which is communicatively connected to the memory module. The back-end pre-processing module is used to perform one or more pre-processing of de-mosaicing, color correction, gamma correction, color space conversion, and global motion estimation on the current frame image, and pyramid decompose the pre-processed image according to preset conditions and store it in the memory module.

16. The image processing device according to claim 15, characterized in that: The device also includes a front-end processing module, which is communicatively connected to the memory module and is used to pre-process the current frame image by performing one or more of black level correction processing, digital gain processing, bad pixel correction processing and white balance processing.

17. A chip, comprising the image processing device according to any one of claims 1 to 16.

18. A user equipment, comprising the image processing apparatus according to any one of claims 1 to 16.