A pixel processing method, device, equipment and storage medium of an image

By dividing the pixel set and setting a virtual black level in image processing, the problem of detail loss caused by cropping pixel values ​​to 0 in extremely dark areas is solved, thereby improving image quality and processing efficiency.

CN119991533BActive Publication Date: 2026-07-03GUANGZHOU XIAOPENG MOTORS TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU XIAOPENG MOTORS TECH CO LTD
Filing Date
2025-02-21
Publication Date
2026-07-03

Smart Images

  • Figure CN119991533B_ABST
    Figure CN119991533B_ABST
Patent Text Reader

Abstract

This invention relates to the field of image processing technology, specifically to a pixel processing method, apparatus, device, and storage medium for images. The method includes: receiving image data of an original image captured by a sensor; dividing the n pixels into a first set and a second set by detecting whether n first pixel values ​​are 0; determining a first virtual black level in the first set based on the first pixel values, the true black level, and the bit width; setting the black level of each pixel in the second set to a second virtual black level; and statistically obtaining n virtual black levels corresponding to the n pixels; cropping the n first pixel values ​​to obtain n second pixel values; and performing post-processing on the image using the n second pixel values ​​to obtain the original image. After virtual black level cropping, this method retains some pixel values ​​that are not 0, preserving smaller values, thereby retaining pixel color or detail in extremely dark areas and optimizing image contrast and detail.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and more specifically to a pixel processing method, apparatus, device, and storage medium for images. Background Technology

[0002] In the field of image processing, the processing of extremely dark areas in an image has always been an important topic. When processing image pixels in extremely dark areas, the pixel values ​​of each pixel in these areas are small. However, in order to obtain image details in these extremely dark areas, an Image Signal Processor (ISP) is generally used to subtract the black level value from the black level correction module and then crop the negative values ​​to 0. Therefore, the pixel values ​​of many pixels in extremely dark areas are basically cropped to 0. Although this approach is simple and direct, it leads to the loss of details in the extremely dark areas of the image because the pixel values ​​in these areas are forcibly set to 0, thus losing the original grayscale or color differences. Summary of the Invention

[0003] This application provides a pixel processing method, apparatus, device, and storage medium for images to solve the problem of image pixel distortion during subsequent image pixel restoration when pixel values ​​in extremely dark areas of an image are cropped to 0.

[0004] In a first aspect, this application provides a pixel processing method for an image, the method comprising:

[0005] Receive image data of the original image captured by the sensor. The original image includes n pixels. The image data includes: n first pixel values ​​of the n pixels after true black level correction and the bit width of the original image, where n≥1 and is a positive integer.

[0006] By detecting whether the n first pixel values ​​are 0, the n pixels are divided into a first set and a second set, where the first pixel values ​​of the pixels in the first set are all greater than or equal to 1, and the first pixel values ​​of the pixels in the second set are all 0.

[0007] Based on the first pixel value, the true black level, and the bit width, determine the first virtual black level corresponding to each pixel in the first set, and set the black level of each pixel in the second set to the second virtual black level, and count the n virtual black levels corresponding to n pixels; wherein the value of the first virtual black level is less than or equal to the true black level, and the value of the second virtual black level is a constant less than the true black level;

[0008] Based on n virtual black levels, the n first pixel values ​​are cropped to obtain n second pixel values;

[0009] The original image is obtained by performing post-processing on n second pixel values.

[0010] In conjunction with the first aspect, in one possible implementation, determining the first virtual black level corresponding to each pixel in the first set based on the first pixel value, the true black level, and the bit width includes: calculating the average and standard deviation of n first pixel values; performing normalization processing based on the standard deviation and bit width to obtain intermediate parameter values; calculating the third virtual black level corresponding to each first pixel value based on the intermediate parameter value, the average value, the true black level, and each first pixel value in the first set; comparing the magnitude of each third virtual black level with the true black level, and taking the smaller value as the first virtual black level.

[0011] In conjunction with the first aspect, in another possible implementation, calculating the third virtual black level corresponding to each first pixel value based on the intermediate parameter value, average value, true black level, and each first pixel value in the first set includes: calculating the third virtual black level corresponding to each first pixel value according to a preset formula based on the intermediate parameter value, average value, true black level, and each first pixel value in the first set, wherein the preset formula is:

[0012]

[0013] Where BL3 is the third virtual black level, α is the intermediate parameter value, μ is the average value, and BL... 真值 The true value is black level. pixel It is any first pixel value in the first set.

[0014] In conjunction with the first aspect, in another possible implementation, comparing the magnitude of each third virtual black level with the true black level and taking the smaller value as the first virtual black level includes: comparing the magnitude of each third virtual black level with the true black level using an arithmetic expression, which is expressed as:

[0015] BL1 = min(BL3, BL 真值 )

[0016] Wherein, BL1 is the first virtual black level, BL 真值 The true value is black level, and min() is the minimum value operation.

[0017] In conjunction with the first aspect, in another possible implementation, setting the black level of each pixel in the second set to a second virtual black level includes: setting the value of the black level of each pixel in the second set to 0, as the second virtual black level.

[0018] In conjunction with the first aspect, in another possible implementation, the n first pixel values ​​are cropped based on the n virtual black levels to obtain the n second pixel values, including: subtracting the corresponding first virtual black level or second virtual black level from the n first pixel values ​​respectively to obtain the n second pixel values.

[0019] In conjunction with the first aspect, in another possible implementation, image post-processing is performed using n second pixel values ​​to obtain the original image, including: performing RAW domain processing and noise reduction on the n second pixel values, and restoring the processed pixel information to obtain the original image.

[0020] Secondly, this application also provides a pixel processing apparatus for an image, the apparatus comprising:

[0021] The receiving module is used to receive image data of the original image captured by the sensor. The original image includes n pixels. The image data includes: n first pixel values ​​of the n pixels after true black level correction and the bit width of the original image, where n≥1 and is a positive integer.

[0022] The partitioning module is used to divide n pixels into a first set and a second set by detecting whether the n first pixel values ​​are 0, wherein the first pixel values ​​of the pixels in the first set are all greater than or equal to 1, and the first pixel values ​​of the pixels in the second set are all 0.

[0023] The calculation module is used to determine the first virtual black level corresponding to each pixel in the first set based on the first pixel value, the true black level and the bit width, and to set the black level of each pixel in the second set to the second virtual black level, and to count the n virtual black levels corresponding to n pixels; wherein the value of the first virtual black level is less than or equal to the true black level, and the value of the second virtual black level is a constant less than the true black level;

[0024] The processing module is used to crop n first pixel values ​​based on n virtual black levels to obtain n second pixel values, and to perform post-processing on the image using the n second pixel values ​​to obtain the original image.

[0025] Thirdly, this application provides a computer device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the pixel processing method of the image described in the first aspect or any corresponding embodiment.

[0026] Fourthly, this application also provides a computer-readable storage medium storing computer instructions for causing a computer to perform the pixel processing method of an image described in the first aspect or any corresponding embodiment.

[0027] Furthermore, this application provides a computer program product, including computer instructions for causing a computer to execute the pixel processing method for an image described in the first aspect or any corresponding embodiment.

[0028] The image pixel processing method, apparatus, device, and storage medium provided in this embodiment divides n first pixel values ​​in the received image data according to whether they are 0, generating a first set and a second set. Then, the virtual black level BL value corresponding to each pixel in the first set and the second set is set respectively, resulting in at least one first virtual black level and at least one second virtual black level. Since the value of each first virtual black level is less than or equal to the true black level, and the value of the second virtual black level is a constant less than the true black level, using these virtual black levels to perform cropping processing on the n first pixel values ​​can avoid the cropped pixel values ​​being 0. After cropping with virtual black levels, the pixel values ​​of some pixels obtained by the method of this application are not 0, and small values ​​are still retained. Therefore, in subsequent image processing, the pixel color or details in extremely dark areas can be preserved, and the restored original image still retains the grayscale or color differences in extremely dark areas, optimizing the contrast and detail of the image, thereby improving the overall image quality.

[0029] Furthermore, this method, by dynamically adjusting the virtual black level, can better adapt to different lighting conditions and sensor characteristics, resulting in more natural and realistic processed images. It also simplifies the post-processing workflow; through pre-processing steps (such as cropping), it reduces the complexity and computational load of post-processing, thereby improving processing efficiency. Attached Figure Description

[0030] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0031] Figure 1 This is a schematic flowchart of an image pixel processing method according to an embodiment of this application;

[0032] Figure 2 This is a schematic diagram comparing a pixel processing method according to an embodiment of this application;

[0033] Figure 3 This is a schematic flowchart of another image pixel processing method according to an embodiment of this application;

[0034] Figure 4 This is a structural block diagram of an image pixel processing apparatus according to an embodiment of this application;

[0035] Figure 5 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of this application. Detailed Implementation

[0036] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0037] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0038] To enable those skilled in the art to better understand the solution of this application, the application scenarios and technical issues involved in the technical solution of this application will first be introduced.

[0039] The technical solution of this application relates to the field of image processing, especially the pixel processing of extremely dark areas in an image.

[0040] In real-world shooting environments, due to inherent dark current and other non-ideal factors in image sensors, even in the absence of light, the sensor will still output a certain signal value; this value is called the black level. Simply put, the black level is the output value of the image sensor under no-light conditions. To obtain accurate image information, the image signal processor (ISP) needs to perform black level correction (BLC) on this raw data, subtracting the corresponding black level value from each pixel value to eliminate noise and offset from the sensor itself.

[0041] The conventional BLC operation directly subtracts the BL value added to the pixel value at the sensor end, and simultaneously clips any pixels that become negative after the subtraction to 0. During this correction process, because the corrected pixel value may be negative, especially when the original pixel value is close to or equal to the black level, and pixel values ​​in digital images are typically represented as non-negative integers (e.g., grayscale values ​​from 0 to 255 or RGB values), many ISP implementations choose to clip these negative values ​​to 0. While this approach is simple and direct, it leads to the loss of detail in extremely dark areas of the image because the pixel values ​​in these areas are forced to be set to 0, thus losing the original grayscale or color differences.

[0042] To address the problem of pixel value distortion after cropping in extremely dark areas of an image, this application provides an embodiment of an image pixel processing method. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0043] This embodiment provides a pixel processing method for images, which can be used in a processor, such as an ISP. Figure 1 This is a flowchart of a pixel processing method according to an embodiment of the present invention, the process including:

[0044] Step S101: Receive image data of the raw image captured by the sensor.

[0045] The original image can be an image or photograph captured by a camera, which is a type of sensor. The original image consists of n pixels, where n ≥ 1 and is a positive integer. Each pixel corresponds to a pixel value, so n pixels correspond to n pixel values. After capturing the original image, the camera performs black level correction (BLC) on the n pixel values, adding a true black level (i.e., a true_BL value) to each pixel value, which is then recorded as the first pixel value. The resulting n first pixel values ​​are used as part of the image data.

[0046] Therefore, the image data includes at least: n first pixel values ​​after true black level correction of n pixels. In addition, the image data also includes the bit width of the original image. Image bit width, also known as color depth or bit depth, is a parameter used to describe the number of colors that each color channel in an image can represent. It is usually measured in "bits," and optionally, in this embodiment, the image bit width is represented by the letter "b."

[0047] Step S102: By detecting whether the n first pixel values ​​are 0, divide the n pixels into a first set and a second set.

[0048] In this process, all pixels in the first set have a first pixel value greater than or equal to 1, while all pixels in the second set have a first pixel value of 0. Specifically, by filtering the n first pixel values, pixels with first pixel values ​​greater than or equal to 1 are grouped into the first set, and pixels with first pixel values ​​equal to 0 are grouped into the second set.

[0049] Optionally, the first set contains n1 pixels and the second set contains n2 pixels, where n1 + n2 = n, n1 and n2 are both positive integers, and n1 ≥ 1 and n2 ≥ 1.

[0050] Step S103: Set the virtual black level (fake_BL value) corresponding to each pixel value in the first set and the second set respectively.

[0051] Specifically, such as Figure 1 As shown, step S103 includes:

[0052] Step S1031: Determine the first virtual black level corresponding to each pixel in the first set based on the first pixel value, the true black level, and the bit width.

[0053] The true black level is the black level value obtained by pixel addition when the sensor captures an image, i.e., the true_BL value.

[0054] Specifically, firstly, calculate at least n1 virtual black levels corresponding to at least n1 pixels in the first set based on the first pixel value and the bit width b. Then, compare these virtual black levels with the true black level value (true_BL), and take the smaller of the two as the first virtual black level. Ensure that the value of the first virtual black level is less than or equal to the true black level.

[0055] Optionally, the first virtual black level is represented as BL1. And BL1 ≤ BL 真值 .

[0056] Step S1032: Set the black level of each pixel in the second set to the second virtual black level.

[0057] The value of the second virtual black level is a constant that is less than the true black level. Specifically, one implementation is to set the black level value of each pixel in the second set to 0, which is used as the second virtual black level BL2, i.e., BL2 = 0. The prerequisite is that the first pixel value Value... pixel It is 0.

[0058] Step S1033: Statistically obtain the n virtual black levels corresponding to the n pixels.

[0059] The total number of virtual black levels is n. The n1 first virtual black levels BL1 corresponding to the n1 pixels in the first set and the n2 second virtual black levels BL2 set in the second set are counted.

[0060] Step S104: Crop the n first pixel values ​​according to the n virtual black levels to obtain n second pixel values.

[0061] Specifically, subtract the corresponding first virtual black level BL1 or second virtual black level BL2 from each of the n first pixel values ​​to obtain n second pixel values.

[0062] Step S105: Perform post-processing on the image using n second pixel values ​​to obtain the original image.

[0063] like Figure 2 As shown, one implementation involves performing RAW domain processing and noise reduction on the n second pixel values, and then restoring the processed pixel information to obtain the original image.

[0064] RAW domain processing refers to a series of processing steps performed on RAW data before it is converted to common image formats (such as JPEG, PNG, etc.). These processing steps may include white balance adjustment, exposure compensation, color correction, etc., aimed at optimizing image quality.

[0065] Image denoising is an important step in image processing, aiming to reduce or eliminate noise in an image. Noise can originate from image sensors, interference during transmission, and other sources. Denoising can improve image sharpness and visual quality.

[0066] In addition, other types of image processing may be included in the post-processing of images, such as sharpening, contrast adjustment, and color enhancement. This embodiment does not limit these processes.

[0067] In this embodiment, after cropping the fake_BL values ​​of each of the n first pixel values, the resulting RAW data has additional information for reference when further processing in the RAW pipeline. Pixels with smaller fake_BL values ​​can receive greater denoising intensity during windowing filtering in the denoising module.

[0068] The image pixel processing method provided in this embodiment divides the n first pixel values ​​in the received image data according to whether they are 0, generating a first set and a second set. Then, it sets the virtual black level BL value corresponding to each pixel in the first set and the second set respectively, obtaining at least one first virtual black level and at least one second virtual black level. Since the value of each first virtual black level is less than or equal to the true black level, and the value of the second virtual black level is a constant less than the true black level, using these virtual black levels to perform cropping processing on the n first pixel values ​​can avoid the cropped pixel values ​​being 0. After cropping with virtual black levels, the pixel values ​​of some pixels obtained by the method of this application are not 0, and still retain a small value. Therefore, when performing image processing in the later stage, it can retain the pixel color or details in the extremely dark areas, and the restored original image still retains the grayscale or color differences in the extremely dark areas, optimizing the contrast and detail performance of the image, thereby improving the overall image quality.

[0069] Furthermore, this method, by dynamically adjusting the virtual black level, can better adapt to different lighting conditions and sensor characteristics, resulting in more natural and realistic processed images. It also simplifies the post-processing workflow; through pre-processing steps (such as cropping), it reduces the complexity and computational load of post-processing, thereby improving processing efficiency.

[0070] Furthermore, in one possible implementation, such as Figure 3 As shown, step S1031 above, which determines the first virtual black level corresponding to each pixel in the first set based on the first pixel value, the true black level, and the bit width, specifically includes:

[0071] Step S1031-1: Calculate the average and standard deviation of the n first pixel values.

[0072] Here, the n first pixel values ​​include the first pixel values ​​corresponding to all pixels contained in the first set and the second set. In this step, the n first pixel values ​​in the image frame are counted, and their mean and standard deviation are calculated. They are fitted with a Gaussian distribution N(μ,σ2) and calculated using the following relationships (1) and (2):

[0073]

[0074] Where μ represents the average value, n is the number of values ​​in the first pixel, k is the k-th pixel out of n pixels, and Value pixel_k Let σ be the value of the first pixel corresponding to the k-th pixel, and σ be the standard deviation.

[0075] Step S1031-2: Normalize the values ​​based on the standard deviation and bit width to obtain intermediate parameter values.

[0076] Considering the bit width b of this image, normalize the standard deviation σ to obtain intermediate parameter values. Optionally, the intermediate parameter values ​​are represented by α, and the calculation relationship is as follows:

[0077]

[0078] Step S1031-3: Calculate the third virtual black level corresponding to each first pixel value based on the intermediate parameter value, average value, true black level and each first pixel value in the first set.

[0079] Specifically, Value pixel Under the condition of ≥1, based on the intermediate parameter value, average value, true black level and each first pixel value in the first set, the third virtual black level corresponding to each first pixel value is calculated according to the preset relation (4):

[0080]

[0081] Where BL3 is the third virtual black level, α is the intermediate parameter value, μ is the average value, and BL... 真值 The true value is black level. pixel It is any first pixel value in the first set.

[0082] Step S1031-4: Compare the magnitude of each third virtual black level with the true black level, and take the smaller value as the first virtual black level.

[0083] One implementation involves comparing the magnitude of each third virtual black level with the true black level using an arithmetic expression (5), which is expressed as:

[0084] BL1 = min(BL3, BL 真值 (5)

[0085] Wherein, BL1 is the first virtual black level, BL 真值 The true value is black level, and min() is the minimum value operation.

[0086] Substituting relation (4) into relation (5) yields the following result:

[0087] For example, in this embodiment, we assume that the provided true black level, i.e., true_BL value, is 64, and the image pixel value received by the ISP is RAW 16, which can be understood as: 16-bit data, with n pixel values ​​in the range of 0 to 65535, such as {62, 58, 55, 64, 60000, 65000}, where n = 6.

[0088] Based on the general processing flow, the above 6 pixel values ​​are cropped by subtracting true_BL=64 from each pixel value. For pixel values ​​whose difference is less than 0, the value is clipped to 0. The final result is {0, 0, 0, 0, 59936, 64936}. It can be seen that the pixel values ​​of the first 4 pixels are all 0, and the differences in pixel values ​​between the first 4 pixels have disappeared, resulting in the loss of details in the dark area.

[0089] The method provided in this embodiment, according to the above steps S1031 to S1034, first calculates the average value μ and standard deviation σ of the first pixel values ​​n = 6 in the first set. After calculation by the above relation (1) and (2), the average value μ = 20873.17 and the standard deviation σ = 32282.75 are obtained. In this embodiment, the bit width b = 16, and the intermediate parameter value α = 0.4926 is calculated according to the above relation (3).

[0090] Additionally, log2(μ) = 14.35, according to BL... 真值 =64, α=0.4926, substituting into the above relation (4) yields the third virtual black level BL3 corresponding to each pixel. After comparing the third virtual black level BL3 with BL 真值 =64, take the smaller value to get the first virtual black level BL1 corresponding to the 6 pixels in the first set, BL1 = {53.91, 53.04, 52.35, 54.33, 64, 64}.

[0091] Finally, according to step S104 above, subtract BL1 from the above {62, 58, 55, 64, 60000, 65000} respectively, that is, calculate 62-53.91, 58-53.04, 55-52.35, 64-54.33, 60000-64, 65000-64 respectively, and round to get 6 second pixel values, which are {8, 5, 3, 10, 59936, 64936}. It can be seen that the pixel value difference between the first four pixels is still there, and the details in the dark area are preserved.

[0092] This method resets the virtual black level (fake_BL value) for each pixel according to different pixel intensities, and the fake_BL value is less than or equal to the true_BL value, thereby avoiding the pixel value being 0 after cropping. Therefore, the cropped pixel value preserves details in the darkest areas.

[0093] This embodiment also provides an image pixel processing apparatus for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0094] This embodiment provides an image pixel processing device, such as... Figure 4 As shown, the device includes a receiving module 410, a dividing module 420, a calculation module 430, and a processing module 440. Furthermore, the device may include more or fewer other modules; this embodiment does not impose any limitations on this.

[0095] The receiving module 410 is used to receive image data of the original image captured by the sensor. The original image includes n pixels, and the image data includes: n first pixel values ​​after true black level correction of the n pixels and the bit width of the original image, where n≥1 and is a positive integer.

[0096] The partitioning module 420 is used to divide n pixels into a first set and a second set by detecting whether the n first pixel values ​​are 0, wherein the first pixel values ​​corresponding to the pixels in the first set are all greater than or equal to 1, and the first pixel values ​​corresponding to the pixels in the second set are all 0.

[0097] The calculation module 430 is used to determine the first virtual black level corresponding to each pixel in the first set based on the first pixel value, the true black level and the bit width, and to set the black level of each pixel in the second set to the second virtual black level, and to obtain n virtual black levels corresponding to n pixels; wherein the value of the first virtual black level is less than or equal to the true black level, and the value of the second virtual black level is a constant less than the true black level.

[0098] The processing module 440 is used to perform cropping processing on n first pixel values ​​based on n virtual black levels to obtain n second pixel values, and to perform post-processing of the image using the n second pixel values ​​to obtain the original image.

[0099] Optionally, in some optional implementations, the calculation module 430 is specifically used to calculate the average and standard deviation of n first pixel values; perform normalization processing based on the standard deviation and bit width to obtain intermediate parameter values; calculate the third virtual black level corresponding to each first pixel value based on the intermediate parameter values, average value, true black level and each first pixel value in the first set; compare the magnitude of each third virtual black level with the true black level, and take the smaller value as the first virtual black level.

[0100] Optionally, in other alternative embodiments, the calculation module 430 is further configured to calculate the third virtual black level corresponding to each first pixel value according to a preset formula based on the intermediate parameter value, the average value, the true black level, and each first pixel value in the first set. The preset formula is:

[0101]

[0102] Where BL3 is the third virtual black level, α is the intermediate parameter value, μ is the average value, and BL... 真值 The true value is black level. pixel It is any first pixel value in the first set.

[0103] Optionally, in other alternative implementations, the calculation module 430 is further configured to compare the magnitude of each third virtual black level with the true black level using an arithmetic expression, which is expressed as:

[0104] BL1 = min(BL3, BL 真值 )

[0105] Wherein, BL1 is the first virtual black level, BL 真值 The true value is black level, and min() is the minimum value operation.

[0106] Optionally, in some other alternative implementations, the calculation module 430 is further configured to set the black level value of each pixel in the second set to 0, as the second virtual black level.

[0107] The processing module 440 is specifically used to subtract the corresponding first virtual black level or second virtual black level from each of the n first pixel values ​​to obtain n second pixel values, and to perform RAW domain processing and noise reduction processing on the n second pixel values, and then restore the processed pixel information to obtain the original image.

[0108] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0109] In this embodiment, the pixel processing device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0110] This invention also provides a computer device having the above-described features. Figure 4 The pixel processing device shown.

[0111] Please see Figure 5This is a schematic diagram of a computer device provided in an optional embodiment of the present invention. The computer device includes one or more processors 10, a memory 20, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processor can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface).

[0112] In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory units, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 5 Take a processor 10 as an example.

[0113] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.

[0114] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the pixel processing method shown in the above embodiments.

[0115] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may include memory remotely located relative to the processor 10, which can be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0116] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0117] The computer device also includes an input device 30 and an output device 40. The processor 10, memory 20, input device 30, and output device 40 can be connected via a bus or other means. Figure 5 Taking the example of a connection between China and Israel via a bus.

[0118] Input device 30 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the computer device, such as a touchscreen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 40 may include display devices, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors). The aforementioned display devices include, but are not limited to, liquid crystal displays, light-emitting diodes, displays, and plasma displays. In some alternative embodiments, the display device may be a touchscreen.

[0119] In addition, the computer device also includes a communication interface for communicating with other devices or communication networks.

[0120] Optionally, in this embodiment, the computer device may be an image signal processor (ISP) or an electronic device that includes an ISP.

[0121] This invention also provides a computer-readable storage medium in which the methods described in this invention can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code originally stored on a remote storage medium or a non-transitory machine-readable storage medium and to be stored on a local storage medium after being downloaded via a network, so that the methods described herein can be stored on such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware.

[0122] The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; furthermore, the storage medium can also include combinations of the above types of memory. It is understood that a computer, processor, microprocessor controller, or programmable hardware includes a storage component capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the pixel processing method of the image shown in the above embodiments is implemented.

[0123] Embodiments of this application may also provide a computer program product, including computer program instructions, which, when executed by a processor, cause the processor to perform the steps in the methods described above. The computer program product may be written in any combination of one or more programming languages ​​to perform the operations of the embodiments of this disclosure. The programming languages ​​include object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code may execute entirely on a user's computing device, partially on a user's device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0124] The above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, and are not intended to limit them. Although the embodiments of the present invention have been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method of processing pixels of an image, characterized in that, The method includes: The image data of the original image captured by the sensor includes n pixels. The image data includes n first pixel values ​​after true black level correction of the n pixels and the bit width of the original image, where n ≥ 1 and is a positive integer. By detecting whether the n first pixel values ​​are 0, the n pixels are divided into a first set and a second set, wherein the first pixel values ​​corresponding to the pixels in the first set are all greater than or equal to 1, and the first pixel values ​​corresponding to the pixels in the second set are all 0; Based on the first pixel value, the true black level, and the bit width, a first virtual black level is determined for each pixel in the first set, and the black level of each pixel in the second set is set to a second virtual black level. The n virtual black levels corresponding to the n pixels are then statistically obtained. The values ​​of the first virtual black levels are all less than or equal to the true black level, and the values ​​of the second virtual black levels are constants less than the true black level. Based on the n virtual black levels, the n first pixel values ​​are cropped to obtain n second pixel values; The original image is obtained by performing post-processing using the n second pixel values. The step of determining the first virtual black level corresponding to each pixel in the first set based on the first pixel value, the true black level, and the bit width includes: Calculate the average and standard deviation of the n first pixel values; The intermediate parameter values ​​are obtained by normalizing the standard deviation and the bit width. Based on the intermediate parameter value, the average value, the true black level, and each first pixel value in the first set, calculate the third virtual black level corresponding to each first pixel value; Compare the magnitude of each of the third virtual black level with the true black level, and take the smaller value as the first virtual black level.

2. The method of claim 1, wherein, The step of calculating the third virtual black level corresponding to each first pixel value based on the intermediate parameter value, the average value, the true black level, and each first pixel value in the first set includes: Based on the intermediate parameter value, the average value, the true black level, and each first pixel value in the first set, the third virtual black level corresponding to each first pixel value is calculated according to a preset formula, which is: wherein is a third virtual black level, is an intermediate parameter value, is an average value, is a true value black level, is any first pixel value in the first set.

3. The method according to claim 2, characterized in that, The step of comparing each of the third virtual black level with the true black level and taking the smaller value as the first virtual black level includes: The magnitude of each of the third virtual black levels is compared with the true black level using an arithmetic expression, which is expressed as: in, This is the first virtual black level. The true value is black level, and min() is the minimum value operation.

4. The method according to claim 1, characterized in that, Setting the black level of each pixel in the second set to the second virtual black level includes: The black level value of each pixel in the second set is set to 0, which is used as the second virtual black level.

5. The method according to any one of claims 1-4, characterized in that, The step of cropping the n first pixel values ​​based on the n virtual black levels to obtain n second pixel values ​​includes: Subtract the corresponding first virtual black level or second virtual black level from each of the n first pixel values ​​to obtain the n second pixel values.

6. The method according to any one of claims 1-4, characterized in that, The step of using the n second pixel values ​​for image post-processing to obtain the original image includes: The n second pixel values ​​are processed in the RAW domain and denoised, and the processed pixel information is restored to obtain the original image.

7. An image pixel processing apparatus, characterized in that, The device includes: The receiving module is used to receive image data of the original image captured by the sensor. The original image includes n pixels. The image data includes: n first pixel values ​​of the n pixels after true black level correction and the bit width of the original image, where n≥1 and is a positive integer. The partitioning module is used to divide the n pixels into a first set and a second set by detecting whether the n first pixel values ​​are 0, wherein the first pixel values ​​corresponding to the pixels in the first set are all greater than or equal to 1, and the first pixel values ​​corresponding to the pixels in the second set are all 0. The calculation module is used to determine the first virtual black level corresponding to each pixel in the first set based on the first pixel value, the true black level, and the bit width, and to set the black level of each pixel in the second set to the second virtual black level, and to statistically obtain n virtual black levels corresponding to the n pixels; wherein the value of the first virtual black level is less than or equal to the true black level, and the value of the second virtual black level is a constant less than the true black level; wherein determining the first virtual black level corresponding to each pixel in the first set based on the first pixel value, the true black level, and the bit width includes: calculating the average and standard deviation of the n first pixel values; performing normalization processing based on the standard deviation and the bit width to obtain intermediate parameter values; calculating the third virtual black level corresponding to each first pixel value based on the intermediate parameter values, the average value, the true black level, and each first pixel value in the first set; comparing the magnitude of each third virtual black level with the true black level, and taking the smaller value as the first virtual black level; The processing module is used to crop the n first pixel values ​​according to the n virtual black levels to obtain n second pixel values, and to perform post-processing of the image using the n second pixel values ​​to obtain the original image.

8. A computer device, characterized in that, It includes a memory and a processor, wherein the memory and the processor are connected. The memory stores computer instructions, and the processor executes the computer instructions to perform the pixel processing method of the image according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the pixel processing method of the image according to any one of claims 1 to 6.