Image correction method, device and image processing apparatus

By using the same buffer for bad pixel and green balance processing in image processing, the latency and complexity issues caused by transferring image data between different buffers are resolved, improving image processing efficiency and saving storage resources.

CN122269154APending Publication Date: 2026-06-23SHANGHAI INTEGRATED CIRCUIT RESEARCH & DEVELOPMENT CENTER CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI INTEGRATED CIRCUIT RESEARCH & DEVELOPMENT CENTER CO LTD
Filing Date
2024-12-20
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

In existing technologies, the transmission and storage of image data between different buffers increases latency and interface control complexity, thereby reducing image processing efficiency.

Method used

The same buffer is used for bad pixel detection and green balance processing. By identifying the pixel category, the corresponding bad pixel detection data, bad pixel correction data, green balance detection data and green balance correction data are obtained, and bad pixels and green channel imbalance points are corrected respectively.

Benefits of technology

This avoids the transfer of image data between different buffers, improves the efficiency of image data transfer, thereby improving image processing efficiency and saving buffer storage resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122269154A_ABST
    Figure CN122269154A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide an image correction method, device and image processing equipment. The method comprises: obtaining a to-be-corrected image, identifying the category of each pixel point on the to-be-corrected image, when the pixel point is of a first category, obtaining corresponding bad point judgment data and bad point correction data of each pixel point based on a target buffer, when the pixel point is of a second category, obtaining corresponding bad point judgment data, bad point correction data, green balance judgment data and green balance correction data of each pixel point based on the target buffer, when the pixel point is a bad point, correcting the bad point based on the bad point correction data, when the pixel point is a green channel imbalance point, correcting the pixel point based on the green balance correction data, to obtain and output a corrected image. Based on the method provided in the present application, the image processing efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of digital image processing, and in particular to an image correction method, apparatus and image processing device. Background Technology

[0002] In the field of digital image processing (Image Signal Processor, or ISP), DefeatPixels Correction (DPC) and Green Balance (GB) are two very important processing steps in ISP. DPC is used to detect and correct bad pixels in the image sensor, while GB is responsible for balancing the brightness value of the green channel.

[0003] In existing technologies, the DPC (Digital Processing Control) process for image processing requires one buffer to store image data, while the GB (Graphical Processing Control) process requires another buffer to store image data. These two buffers operate independently. During the DPC and GB processing steps, image data needs to be transferred and stored between the two buffers.

[0004] Currently, the processing of DPC and GB for images involves transferring and storing image data between two buffers. This not only increases latency but may also introduce additional interface control complexity related to the buffers, thereby reducing the efficiency of image processing. Summary of the Invention

[0005] This application provides an image correction method, apparatus, and image processing device, which can improve image processing efficiency.

[0006] In a first aspect, embodiments of this application provide an image correction method, including:

[0007] Obtain the image to be corrected;

[0008] Identify the category of each pixel in the image to be corrected;

[0009] If the pixel belongs to the first category, then the bad pixel judgment data and bad pixel correction data corresponding to the pixel are obtained based on the target buffer;

[0010] If the pixel belongs to the second category, then based on the target buffer, obtain the bad pixel judgment data, bad pixel correction data, green balance judgment data, and green balance correction data corresponding to the pixel.

[0011] Based on the bad pixel judgment data corresponding to each pixel, determine whether each pixel is a bad pixel in turn;

[0012] If the pixel is a bad pixel, then the pixel is corrected based on the bad pixel correction data;

[0013] Based on the green balance judgment data corresponding to each second category of pixel, determine in turn whether each second category of pixel is a green channel imbalance point;

[0014] If the pixels in the second category are unbalanced points in the green channel, then the pixels in the second category are corrected based on the green balance correction data;

[0015] Based on the correction of each bad pixel and each unbalanced point in the green channel on the image to be corrected, the corrected image corresponding to the image to be corrected is output.

[0016] In one possible implementation, the step of obtaining the bad pixel judgment data and bad pixel correction data corresponding to the pixel based on the target buffer includes:

[0017] Extract a first window of a first size from the target buffer;

[0018] For each pixel, the pixel value of the pixel and the average pixel value of the pixels in the first outer ring corresponding to the pixel are obtained based on the first window;

[0019] The first difference between the pixel value of the pixel and the average pixel value of the corresponding outer first ring of pixels is determined as the defective pixel judgment data of the pixel.

[0020] The sum of the average pixel value of the first outer ring of pixels corresponding to the pixel and the preset correction parameter value is determined as the bad pixel correction data of the pixel.

[0021] In one possible implementation, the step of sequentially determining whether each pixel is a bad pixel based on the bad pixel judgment data corresponding to each pixel includes:

[0022] For each pixel, determine whether the first difference exceeds a preset first threshold;

[0023] If the first difference exceeds the first threshold, the pixel is determined to be a bad pixel;

[0024] If the first difference does not exceed the first threshold, then the pixel is determined to be a non-defective pixel.

[0025] In one possible implementation, correcting the pixel based on the bad pixel correction data includes:

[0026] The defective pixel correction data is replaced with the pixel value of the pixel to correct the pixel.

[0027] In one possible implementation, obtaining the green balance judgment data and green balance correction data corresponding to the pixel based on the target buffer includes:

[0028] Extract a second window of a second size from the target buffer;

[0029] For each pixel of the second category, the first average pixel value of the green channel pixels in the outer first ring and the second average pixel value of the green channel pixels in the outer second ring are obtained based on the second window.

[0030] The second difference between the first average pixel value and the second average pixel value is determined as the green balance judgment data;

[0031] Determine the magnitude of the first average pixel value and the second average pixel value;

[0032] The third difference between the larger of the first and second average pixel values ​​and a preset value is determined as the green balance correction data, wherein the preset value is the product of the second difference and a preset ratio.

[0033] In one possible implementation, the step of sequentially determining whether each pixel in the second category is a green channel imbalance point based on the green balance judgment data corresponding to each second category of pixels includes:

[0034] For each pixel in the second category, determine whether the second difference exceeds a preset second threshold;

[0035] If the second difference exceeds the second threshold, the pixel is determined to be an unbalanced point in the green channel;

[0036] If the second difference does not exceed the second threshold, then the pixel is determined to be a non-green channel imbalance point.

[0037] In one possible implementation, the correction of the pixels of the second category based on the green balance correction data includes:

[0038] The green balance correction data is replaced with the pixel value of the pixel in the green channel to correct the pixel.

[0039] In one possible implementation, it also includes:

[0040] If the pixel is not a bad pixel, then delete the bad pixel correction data corresponding to the pixel.

[0041] If a pixel in the second category is not an unbalanced point in the green channel, then delete the green balance correction data corresponding to that pixel.

[0042] Secondly, this application provides an image correction apparatus, comprising:

[0043] An image input unit is used to acquire the image to be corrected.

[0044] A preprocessing unit is used to identify the category of each pixel in the image to be corrected;

[0045] The preprocessing unit is also used to obtain the bad pixel judgment data and bad pixel correction data corresponding to the pixel based on the target buffer if the category of the pixel is the first category.

[0046] The preprocessing unit is further configured to, if the category of the pixel is the second category, obtain the bad pixel judgment data, bad pixel correction data, green balance judgment data and green balance correction data corresponding to the pixel based on the target buffer;

[0047] The logic judgment unit is used to sequentially judge whether each pixel is a bad pixel based on the bad pixel judgment data corresponding to each pixel.

[0048] A comprehensive correction unit is used to correct the pixel based on the bad pixel correction data if the pixel is a bad pixel.

[0049] The logic judgment unit is also used to sequentially judge whether each pixel in the second category is a green channel imbalance point based on the green balance judgment data corresponding to each pixel in the second category.

[0050] The integrated correction unit is also used to correct the pixels of the second category based on the green balance correction data if the pixels of the second category are unbalanced points in the green channel.

[0051] An image output unit is used to output a corrected image corresponding to the image to be corrected, based on the correction of each bad pixel and each unbalanced point in the green channel on the image to be corrected.

[0052] Thirdly, this application provides an image processing apparatus, including: the image correction device as described above.

[0053] The image correction method, apparatus, and image processing device provided in this application obtain bad pixel judgment data and bad pixel correction data corresponding to the pixel based on a target buffer when the pixel belongs to a first category. When the pixel belongs to a second category, the method obtains bad pixel judgment data, bad pixel correction data, green balance judgment data, and green balance correction data corresponding to the pixel based on the target buffer. When the pixel is a bad pixel, it is corrected based on the bad pixel correction data. When the pixel is an unbalanced point in the green channel, it is corrected based on the green balance correction data, finally obtaining the corrected image. The image correction method provided in this application fuses the two processing steps of bad pixel correction and green balance using the same buffer, avoiding the operation of transmitting image data between different buffers, improving the transmission efficiency of image data, and thus improving the efficiency of image processing. Attached Figure Description

[0054] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0055] Figure 1 Flowchart of the image correction method provided in this application Figure 1 ;

[0056] Figure 2 Flowchart of the image correction method provided in this application Figure 2 ;

[0057] Figure 3 This is a schematic diagram of the first window as an example;

[0058] Figure 4 Flowchart of the image correction method provided in this application Figure 3 ;

[0059] Figure 5 Flowchart of the image correction method provided in this application Figure 4 ;

[0060] Figure 6 This is a schematic diagram of the second window as an example;

[0061] Figure 7 Flowchart of the image correction method provided in this application Figure 5 ;

[0062] Figure 8 Flowchart of the image correction method provided in this application Figure 6 ;

[0063] Figure 9 A schematic diagram of the image correction device provided in this application;

[0064] Figure 10 The following is a flowchart illustrating the interaction between the units in an example image correction device.

[0065] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0066] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0067] First, let me explain the terms used in this application:

[0068] Bad pixels: These are pixels in an image that contain inaccurate information or have defects.

[0069] Green balance: refers to the process used to correct color imbalance problems in images.

[0070] GRBG and RYYB are both common Bayer pattern layouts that can be used to determine the color distribution of an image.

[0071] The image correction process includes two steps: DPC and GB. DPC is used to detect and correct bad pixels on the image sensor, while GB is responsible for balancing the brightness value of the green channel.

[0072] Currently, DPC (Direct Process Control) requires one buffer to store image data during image processing, while GB (Browser Grading) requires another buffer. These two buffers operate independently. During the DPC and GB processing steps, image data needs to be transferred and stored between the two buffers, increasing latency and potentially introducing additional interface control complexity, thus reducing image processing efficiency.

[0073] The image correction method provided in this application uses the same buffer to store image data for both the DPC and GB processing steps. When the pixel category is a first category, bad pixel judgment data and bad pixel correction data corresponding to the pixel are obtained based on the target buffer. When the pixel category is a second category, bad pixel judgment data, bad pixel correction data, green balance judgment data, and green balance correction data corresponding to the pixel are obtained based on the target buffer. When the pixel is a bad pixel, it is corrected based on the bad pixel correction data. When the pixel is a green channel imbalance point, it is corrected based on the green balance correction data, finally obtaining the corrected image. This application avoids the operation of transferring image data between different buffers, improving the transmission efficiency of image data, and thus improving the efficiency of image processing.

[0074] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0075] Figure 1 Flowchart of the image correction method provided in this application Figure 1 ,like Figure 1 As shown, it includes:

[0076] S101. Obtain the image to be corrected.

[0077] The entity responsible for implementing this application is Figure 1 The server in the example can be a computer or server that provides the service.

[0078] Using a scenario example, image signals are collected to obtain the image to be corrected. The image to be corrected is an example image that needs to be corrected for bad pixels and green balance using DPC and GB.

[0079] S102. Identify the category of each pixel in the image to be corrected.

[0080] Based on the scenario example, pixels can be divided into two categories: non-green channel pixels and green channel pixels. Identifying the category of pixels in the image to be corrected can be done by obtaining image information from an image description file. Image description files come in various formats, such as JSON, CSV, TXT, and TSV files. Image information includes color category and color distribution. Specifically, if the color category is black and white, all pixels can be directly identified as pixels of the first category. If the color category is color, it indicates that pixels are arranged periodically in odd-numbered rows according to the green-red-green-red channel pattern, and in even-numbered rows according to the blue-green-blue-green channel pattern. Furthermore, pixels in odd-numbered rows with even-numbered columns and even-numbered rows with odd-numbered columns can also be considered pixels of the first category. Similarly, if the color category is color and the color distribution is RYYB, all pixels can also be directly identified as pixels of the first category.

[0081] S103. If the category of the pixel is the first category, then obtain the bad pixel judgment data and bad pixel correction data corresponding to the pixel based on the target buffer.

[0082] Based on scenario examples, non-green channel pixels are identified as pixels in the first category, such as all pixels in a black and white image or red, blue, yellow, and white channel pixels in a color image.

[0083] Therefore, there is no green balance correction for pixels in the first category. For each pixel in the first category, the bad pixel judgment data and bad pixel correction data corresponding to each pixel are obtained. The target buffer can be used to store the bad pixel judgment data and bad pixel correction data corresponding to each pixel in the first category.

[0084] S104. If the category of the pixel is the second category, then obtain the bad pixel judgment data, bad pixel correction data, green balance judgment data and green balance correction data corresponding to the pixel based on the target buffer.

[0085] Based on a scenario example, green channel pixels are identified as pixels in the second category, such as green channel pixels in a color image. For pixels in the second category, it is necessary to correct not only bad pixels but also pixels with imbalanced green channels. Therefore, for each pixel in the second category, it is necessary to obtain not only the corresponding bad pixel judgment data and bad pixel correction data, but also the corresponding green balance judgment data and green balance correction data. The target buffer can be used to store the bad pixel judgment data, bad pixel correction data, green balance judgment data, and green balance correction data corresponding to each pixel in the second category.

[0086] S105. Based on the bad pixel judgment data corresponding to each pixel, determine whether each pixel is a bad pixel in turn.

[0087] Based on a scenario example, the defective pixel judgment data corresponding to each pixel can be denoted as DPC-A. For each pixel, the defective pixel judgment data can be used to determine whether the pixel value of that pixel is abnormal. Specifically, if the pixel value of a pixel is abnormal, it can be determined that the pixel is a defective pixel; conversely, if the pixel value of a pixel is not abnormal, it can be determined that the pixel is not a defective pixel.

[0088] S106. If the pixel is a bad pixel, then the pixel is corrected based on the bad pixel correction data.

[0089] Based on the scenario example, the bad pixel correction data can be denoted as DPC-fix. If a pixel is a bad pixel, the pixel value of that pixel can be replaced with the bad pixel correction data corresponding to that pixel.

[0090] S107. Based on the green balance judgment data corresponding to each second category pixel, determine in turn whether each second category pixel is a green channel imbalance point.

[0091] Based on the scenario example, the green balance judgment data can be denoted as GB-B. For each pixel in the second category, the green channel data of the pixel can be used to determine whether the data of the pixel is balanced. That is, to determine whether the pixel values ​​in the green channel of the pixel are balanced. If they are unbalanced, the pixel can be identified as an unbalanced point in the green channel. If they are balanced, the pixel can be identified as a balanced point in the green channel.

[0092] S108. If the pixels of the second category are unbalanced points in the green channel, then the pixels of the second category are corrected based on the green balance correction data.

[0093] Based on the scenario example, the green channel correction data can be denoted as GB-fix. If the pixel in the second category is an unbalanced point in the green channel, the green channel correction data can be replaced with the pixel value in the green channel of the pixel.

[0094] S109. Based on the correction of each bad pixel and each unbalanced point in the green channel on the image to be corrected, output the corrected image corresponding to the image to be corrected.

[0095] Based on the scenario example, for each first pixel, after correcting each bad pixel, we obtain the corrected first type of pixel. For the second type of pixel, after correcting each bad pixel and green channel imbalance point, we obtain the corrected second type of pixel. Finally, based on the corrected first type of pixel, the second type of pixel, and the non-bad pixels and non-green channel imbalance points, we output the corrected image.

[0096] In this example, when performing DPC and GB steps on the image to be corrected, the same target buffer is used, avoiding the transfer of image data between different buffers, thus improving the efficiency of image data transfer and consequently improving the efficiency of image processing.

[0097] Optional, Figure 2 Flowchart of the image correction method provided in this application Figure 2 ,like Figure 2 As shown, S103 includes:

[0098] S201. Extract a first window of a first size on the target buffer.

[0099] Based on the scenario example, the first size can be selected as 7 pixels in both length and width, so a 7*7 window can be extracted from the target buffer as the first window.

[0100] S202. For each pixel, obtain the pixel value of the pixel and the average pixel value of the pixels in the first outer ring corresponding to the pixel based on the first window.

[0101] Based on the scenario example, for pixels of the first category, each pixel is taken as the center pixel based on the first window. Figure 3 This is a schematic diagram of the first window as an example, such as... Figure 3 As shown, point A, which is located in the center of the first window, can be taken as the center pixel, and points A11-A18, which are adjacent to point A, can be taken as the first ring of pixels around point A. The pixel values ​​of A11-A18 can be obtained respectively to obtain the average pixel value between points A11-A18.

[0102] S203. The first difference between the pixel value of the pixel and the average pixel value of the corresponding outer first ring of pixels is determined as the bad pixel judgment data of the pixel.

[0103] Using a scenario example, the first difference between the pixel value of point A and the average pixel value of A11-A18 is taken as the bad pixel judgment data corresponding to point A. In this way, each pixel in the first category of the image to be corrected is taken as the center pixel in turn to obtain the bad pixel judgment data corresponding to each pixel in the first category.

[0104] S204. The sum of the average pixel value of the first outer ring of pixels corresponding to the pixel and the preset correction parameter value is determined as the bad pixel correction data of the pixel.

[0105] Based on the scenario example, the correction parameter value can be a preset value determined according to the actual situation. Taking point A as the center pixel, the average pixel value of A11-A18 is added to the preset correction parameter value to obtain the bad pixel correction data corresponding to point A. In this way, the pixels of the first category are successively used as the center pixels to obtain the bad pixel correction data corresponding to each pixel of the first category.

[0106] Based on the method provided in this example, the defective pixel judgment data and defective pixel correction data corresponding to each pixel can be obtained based on the first window.

[0107] Optional, Figure 4 Flowchart of the image correction method provided in this application Figure 3 ,like Figure 4 As shown, S105 includes:

[0108] S401. For each pixel, determine whether the first difference exceeds a preset first threshold.

[0109] Based on the scenario example, the size of the first threshold can be determined according to the actual situation. For each pixel, the first difference corresponding to the pixel, that is, the bad pixel judgment data corresponding to the pixel, is compared with the first threshold to determine whether the pixel is a bad pixel.

[0110] S402. If the first difference exceeds the first threshold, the pixel is determined to be a bad pixel.

[0111] In the context of a scenario example, if the first difference corresponding to a pixel, which is the bad pixel judgment data corresponding to the pixel, exceeds the first threshold, it means that the pixel value of the pixel is significantly different from the average pixel value of the surrounding pixels. Therefore, the pixel can be judged as a bad pixel and can be marked.

[0112] S403. If the first difference does not exceed the first threshold, then the pixel is determined to be a non-defective pixel.

[0113] In the context of a scenario example, if the first difference corresponding to a pixel, which is the bad pixel judgment data corresponding to the pixel, does not exceed the first threshold, it means that the pixel value of the pixel is close to the average pixel value of the surrounding pixels, and the pixel can be determined to be a non-bad pixel.

[0114] Based on the method provided in this example, each pixel of the first type can be judged sequentially to obtain the corresponding bad pixel.

[0115] Optionally, in S106, the step of correcting the pixel based on the bad pixel correction data includes:

[0116] The defective pixel correction data is replaced with the pixel value of the pixel to correct the pixel.

[0117] Using scenario examples, the method identifies bad pixels based on their markings and corrects them using the corresponding correction data. Specifically... Figure 3 Taking pixel A as the center pixel, if pixel A is a bad pixel, then the average pixel value of A11-A18 is replaced with the pixel value of pixel A. Based on the method provided in this example, bad pixels can be corrected.

[0118] Optional, Figure 5 Flowchart of the image correction method provided in this application Figure 4 ,like Figure 5 As shown, in S104, obtaining the green balance judgment data and green balance correction data corresponding to each pixel in the image to be corrected based on the target buffer includes:

[0119] S501, Extract a second window of the second size on the target buffer.

[0120] Based on the scenario example, the second size can be selected as 5 pixels in both length and width, so a 5*5 window can be extracted from the target buffer as the second window.

[0121] S502. For each pixel of the second category, obtain the first average pixel value of the green channel pixels in the outer first ring and the second average pixel value of the green channel pixels in the outer second ring based on the second window.

[0122] Based on the scenario example, for pixels of the second category, the same method as for pixels of the first category is used to obtain the defective pixel judgment data and defective pixel correction data for each pixel of the second category. When a pixel of the second category is a defective pixel, it is corrected based on the defective pixel correction data corresponding to the pixel.

[0123] In addition, for pixels in the second category, it is also necessary to obtain additional green balance judgment data and green balance correction data for each pixel in the second category. Specifically, each pixel in the second category is used as the center pixel based on the second window. Figure 6 This is a schematic diagram of the second window as an example, such as... Figure 6As shown, point C, located at the center of the second window, can be taken as the center pixel. Points C11-C18 adjacent to point C are taken as the first ring of pixels surrounding point C, and points C21-C216 adjacent to the first ring of pixels are taken as the second ring of pixels surrounding point C. Since the second category is a Bayer color image and includes a green channel, each pixel has a corresponding color channel. Taking point C as the G channel (green channel) as an example, the first ring of pixels C11-C18 are, in order: G channel, B channel (blue channel), G channel, R channel (red channel), G channel, B channel, G channel, and R channel. The second ring of pixels C21-C216 are, in order: G channel, R channel, G channel, R channel, G channel, B channel, G channel, B channel, G channel, R channel, G channel, B channel, and B channel. Green balance does not require additional consideration of pixel values ​​belonging to the R and B channels. Therefore, the first average pixel value of the green channel pixels in the first outer ring refers to the average pixel value among the green channel pixels in the first outer ring, namely C11, C13, C15 and C17. Similarly, the second average pixel value of the green channel pixels in the second outer ring refers to the average pixel value among C21, C23, C25, C27, C29, C211, C213 and C215.

[0124] S503, The second difference between the first average pixel value and the second average pixel value is determined as the green balance judgment data.

[0125] Combined with scenario examples, Figure 6 The average pixel value between points C11, C13, C15, and C17 is subtracted from the average pixel value between points C21, C23, C25, C27, C29, C211, C213, and C215 to obtain a second difference value. This difference value is used as the green balance judgment data for the center pixel C. In this way, each pixel in the second category is sequentially used as the center pixel to obtain the green balance judgment data corresponding to each pixel in the second category.

[0126] S504. Determine the magnitude of the first average pixel value and the second average pixel value.

[0127] Combined with scenario examples, Figure 6 The first average pixel value is compared with the second average pixel value, and the larger average pixel value is obtained.

[0128] S505, the third difference between the larger of the first average pixel value and the second average pixel value and a preset value is determined as the green balance correction data, wherein the preset value is the product of the second difference and a preset ratio.

[0129] Combined with scenario examples, Figure 6 The preset ratio can be determined according to the actual situation. For example, when the preset ratio is 10%, 10% of the second difference is used as the preset value. The preset value is obtained by subtracting the larger of the first average pixel value and the second average pixel value to obtain the green balance correction data corresponding to point C. In this way, the green balance correction data of each pixel in the second category is obtained.

[0130] Based on the method provided in this example, the green balance judgment data and green balance correction data corresponding to each pixel of the second category can be obtained using the second window.

[0131] Optional, Figure 7 Flowchart of the image correction method provided in this application Figure 5 ,like Figure 7 As shown, S107 includes:

[0132] S701. For each pixel of the second category, determine whether the second difference exceeds a preset second threshold.

[0133] Based on the scenario example, the size of the second threshold can be determined according to the actual situation. For each pixel of the second category, the second difference corresponding to the pixel of the second category, that is, the green balance judgment data corresponding to the pixel of the second category, is compared with the second threshold to determine whether the pixel of the second category is a green channel imbalance point.

[0134] S702. If the second difference exceeds the second threshold, the pixel is determined to be an unbalanced point in the green channel.

[0135] In the context of a scenario example, if the second difference corresponding to a pixel of the second category, which is the green balance judgment data corresponding to a pixel of the second category, exceeds the second threshold, it means that the pixel value of the second category pixel in the green channel differs significantly from that of the surrounding pixels. Therefore, the pixel of the second category can be identified as a green channel imbalance point, and the green channel imbalance point can be marked.

[0136] S703. If the second difference does not exceed the second threshold, then the pixel is determined to be a non-green channel imbalance point.

[0137] In the context of a scenario example, if the second difference corresponding to the second category of pixels, which is the green balance judgment data corresponding to the second category of pixels, does not exceed the second threshold, it means that the pixel value of the second category of pixels in the green channel is relatively close to that of the surrounding pixels. Therefore, it can be determined that the second category of pixels is not an unbalanced point in the green channel.

[0138] Based on the method provided in this example, each pixel on the image to be corrected can be determined sequentially to obtain the green channel imbalance point on the image to be corrected.

[0139] Optionally, in S108, the step of correcting the pixel based on the green balance correction data includes:

[0140] The green balance correction data is replaced with the pixel value of the pixel in the green channel to correct the pixel.

[0141] Using scenario examples, the system identifies green channel imbalance points based on their markings and corrects these imbalances using the corresponding green channel balance correction data. Specifically, it combines... Figure 6 Taking pixel C as the center pixel as an example, if pixel C is an imbalance point in the green channel, then the green balance correction data corresponding to pixel C is replaced with the pixel value of pixel C in the green channel. Based on the method provided in this example, the imbalance point in the green channel can be corrected.

[0142] Optional, Figure 8 Flowchart of the image correction method provided in this application Figure 6 ,like Figure 8 As shown, it also includes:

[0143] S801. If the pixel is not a bad pixel, then delete the bad pixel correction data corresponding to the pixel.

[0144] Based on the scenario example, pixels that are not defective do not need to be corrected, so the defective pixel correction data corresponding to the non-defective pixels can be deleted.

[0145] S802. If the pixel of the second category is not an unbalanced point in the green channel, then delete the green balance correction data corresponding to the pixel.

[0146] Similarly, in the second category of pixels, pixels that are not unbalanced in the green channel do not need to be corrected, so the green balance correction data corresponding to the unbalanced pixels in the non-green channel can be deleted.

[0147] The method provided in this example can be used to delete redundant data to save storage space.

[0148] This embodiment fuses the two image processing steps of bad pixel correction and green balance using the same buffer, avoiding the transfer of image data between different buffers, thus improving the efficiency of image data transmission and consequently improving the efficiency of image processing. Furthermore, in existing technologies, DPC requires 7 lines of buffer space, and GB requires 5 lines, totaling 12 lines. This embodiment, using the same buffer for fusion processing, only requires 7 lines, saving buffer storage resources.

[0149] Figure 9 A schematic diagram of the image correction device provided in this application is shown below. Figure 9 As shown, it includes:

[0150] Image input unit 91 is used to acquire the image to be corrected;

[0151] The preprocessing unit 92 is used to identify the category of each pixel in the image to be corrected;

[0152] The preprocessing unit 92 is further configured to, if the category of the pixel is the first category, obtain the bad pixel judgment data and bad pixel correction data corresponding to the pixel based on the target buffer;

[0153] The preprocessing unit 92 is further configured to, if the category of the pixel is the second category, obtain the bad pixel judgment data, bad pixel correction data, green balance judgment data and green balance correction data corresponding to the pixel based on the target buffer;

[0154] The logic judgment unit 93 is used to sequentially judge whether each pixel is a bad pixel based on the bad pixel judgment data corresponding to each pixel.

[0155] The integrated correction unit 94 is used to correct the pixel based on the bad pixel correction data if the pixel is a bad pixel.

[0156] The logic judgment unit 93 is also used to sequentially judge whether each pixel in the second category is a green channel imbalance point based on the green balance judgment data corresponding to each pixel in the second category.

[0157] The integrated correction unit 94 is also used to correct the pixels of the second category based on the green balance correction data if the pixels of the second category are unbalanced points in the green channel.

[0158] Image output unit 95 is used to output a corrected image corresponding to the image to be corrected based on the correction of each bad pixel and each unbalanced point in the green channel on the image to be corrected.

[0159] Figure 10 The following is a flowchart illustrating the interaction between the units in an example image correction device, such as... Figure 10As shown, the image input unit collects image signals, obtains pixels of either the first or second category, and divides a seven-row buffer along with the image category to the pre-processing unit. The pre-processing unit extracts a 7x7 first window and a 5x5 second window from the buffer. If the pixel is of the first category, it obtains the defective pixel judgment data and defective pixel correction data corresponding to each pixel based on the first window. If the pixel is of the second category, it obtains the defective pixel judgment data, defective pixel correction data, green balance judgment data, and green balance correction data corresponding to each pixel based on the second window. The obtained defective pixel judgment data, green balance judgment data, and image category are then transmitted to the logic judgment unit, and the defective pixel correction data and green balance correction data are transmitted to the comprehensive correction unit. When a pixel belongs to the first category, the logic judgment unit determines whether the pixel is a bad pixel based on bad pixel judgment data. When a pixel belongs to the second category, it not only determines whether the pixel is a bad pixel based on bad pixel judgment data, but also determines whether the pixel is a green channel imbalance point based on green balance judgment data. Bad pixels and green channel imbalance points are marked and then transmitted to the integrated correction unit. The integrated correction unit corrects the pixel values ​​of bad pixels based on the marked bad pixels and their corresponding bad pixel correction data, and corrects the pixel values ​​of green channel imbalance points based on the marked green channel imbalance points and their corresponding green balance correction data, obtaining corrected pixels that are then transmitted to the image output unit. Finally, the image output unit outputs the corrected image based on the final pixel value of each pixel.

[0160] The image correction device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0161] This application also provides an image processing apparatus, including: the image correction device as described above.

[0162] The image processing device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0163] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. An image correction method characterized by, include: Obtain the image to be corrected; Identify the category of each pixel in the image to be corrected; If the pixel belongs to the first category, then the bad pixel judgment data and bad pixel correction data corresponding to the pixel are obtained based on the target buffer; If the pixel belongs to the second category, then based on the target buffer, obtain the bad pixel judgment data, bad pixel correction data, green balance judgment data, and green balance correction data corresponding to the pixel. Based on the bad pixel judgment data corresponding to each pixel, determine whether each pixel is a bad pixel in turn; If the pixel is a bad pixel, then the pixel is corrected based on the bad pixel correction data; Based on the green balance judgment data corresponding to each second category of pixel, determine in turn whether each second category of pixel is a green channel imbalance point; If the pixels in the second category are unbalanced points in the green channel, then the pixels in the second category are corrected based on the green balance correction data; Based on the correction of each bad pixel and each unbalanced point in the green channel on the image to be corrected, the corrected image corresponding to the image to be corrected is output.

2. The method of claim 1, wherein, The step of obtaining the bad pixel judgment data and bad pixel correction data corresponding to the pixel based on the target buffer includes: Extract a first window of a first size from the target buffer; For each pixel, the pixel value of the pixel and the average pixel value of the pixels in the first outer ring corresponding to the pixel are obtained based on the first window; The first difference between the pixel value of the pixel and the average pixel value of the corresponding outer first ring of pixels is determined as the defective pixel judgment data of the pixel. The sum of the average pixel value of the first outer ring of pixels corresponding to the pixel and the preset correction parameter value is determined as the bad pixel correction data of the pixel.

3. The method of claim 2, wherein, The step of determining whether each pixel is a bad pixel based on the bad pixel judgment data corresponding to each pixel includes: For each pixel, determine whether the first difference exceeds a preset first threshold; If the first difference exceeds the first threshold, the pixel is determined to be a bad pixel; If the first difference does not exceed the first threshold, then the pixel is determined to be a non-defective pixel.

4. The method of claim 2, wherein, The step of correcting the pixel based on the bad pixel correction data includes: The defective pixel correction data is replaced with the pixel value of the pixel to correct the pixel.

5. The method of claim 1, wherein, The step of obtaining the green balance judgment data and green balance correction data corresponding to the pixel based on the target buffer includes: Extract a second window of a second size from the target buffer; For each pixel of the second category, the first average pixel value of the green channel pixels in the outer first ring and the second average pixel value of the green channel pixels in the outer second ring are obtained based on the second window. The second difference between the first average pixel value and the second average pixel value is determined as the green balance judgment data; Determine the magnitude of the first average pixel value and the second average pixel value; The third difference between the larger of the first and second average pixel values ​​and a preset value is determined as the green balance correction data, wherein the preset value is the product of the second difference and a preset ratio.

6. The method according to claim 5, characterized in that, The step of determining whether each pixel in the second category is an unbalanced point in the green channel based on the green balance judgment data corresponding to each pixel in the second category includes: For each pixel in the second category, determine whether the second difference exceeds a preset second threshold; If the second difference exceeds the second threshold, the pixel is determined to be an unbalanced point in the green channel; If the second difference does not exceed the second threshold, then the pixel is determined to be a non-green channel imbalance point.

7. The method according to claim 5, characterized in that, The step of correcting the pixels of the second category based on the green balance correction data includes: The green balance correction data is replaced with the pixel value of the pixel in the green channel to correct the pixel.

8. The method according to any one of claims 1-7, characterized in that, Also includes: If the pixel is not a bad pixel, then delete the bad pixel correction data corresponding to the pixel. If a pixel in the second category is not an unbalanced point in the green channel, then delete the green balance correction data corresponding to that pixel.

9. An image correction device, characterized in that, include: An image input unit is used to acquire the image to be corrected. A preprocessing unit is used to identify the category of each pixel in the image to be corrected; The preprocessing unit is also used to obtain the bad pixel judgment data and bad pixel correction data corresponding to the pixel based on the target buffer if the category of the pixel is the first category. The preprocessing unit is further configured to, if the category of the pixel is the second category, obtain the bad pixel judgment data, bad pixel correction data, green balance judgment data and green balance correction data corresponding to the pixel based on the target buffer; The logic judgment unit is used to sequentially judge whether each pixel is a bad pixel based on the bad pixel judgment data corresponding to each pixel. A comprehensive correction unit is used to correct the pixel based on the bad pixel correction data if the pixel is a bad pixel. The logic judgment unit is also used to sequentially judge whether each pixel in the second category is a green channel imbalance point based on the green balance judgment data corresponding to each pixel in the second category. The integrated correction unit is also used to correct the pixels of the second category based on the green balance correction data if the pixels of the second category are unbalanced points in the green channel. An image output unit is used to output a corrected image corresponding to the image to be corrected, based on the correction of each bad pixel and each unbalanced point in the green channel on the image to be corrected.

10. An image processing device, characterized in that, include: The image correction apparatus as described in claim 9.