Image pixel processing method and device, equipment and storage medium
By setting virtual black levels for pixel points in the extremely dark area in image processing, the problem of distortion after the pixel values in the extremely dark area are cropped to 0 is solved, the details and contrast of the image are preserved, and the overall image quality is improved.
Patent Information
- Application Number
- CN202510201688.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-02-21
AI Technical Summary
In image processing, after the pixel value of the extremely dark area is cropped to 0, the pixel value of the later image pixels are easily distorted, resulting in the loss of details of the extremely dark area.
By detecting whether the pixel value in the image data is 0, divide the pixel points into two sets, and set a virtual black level for each pixel point to avoid the pixel values being cropped to 0.
It effectively avoids the pixel value being cropped to 0, retains the details and grayscale or color differences in extremely dark areas, optimizes the contrast and detail performance of the image, and improves the overall image quality.
Smart Images

Figure CN119991533A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an image pixel processing method, device, equipment and storage medium. Background Art
[0002] In the field of image processing, processing the extremely dark areas in images has always been an important topic. When processing image pixels in extremely dark areas, mainly because the pixel values of each pixel in the extremely dark areas of the image are small, but in order to obtain the image details in the extremely dark areas, the image signal processor (Image Signal Processor, ISP) is generally used to clip the negative values to 0 after subtracting the black level value in the black level correction module. Therefore, basically, the pixel values of many pixels in the extremely dark areas are clipped to 0. Although this method is simple and direct, it will cause the details of the extremely dark areas of the image to be lost, because the pixel values of these areas are forced to be set to 0, thereby losing the original grayscale or color difference. Summary of the invention
[0003] The present application provides a method, apparatus, device and storage medium for processing pixels of an image to solve the problem of distortion during subsequent image pixel restoration when the pixel values in extremely dark areas of the image are clipped to 0.
[0004] In a first aspect, the present application provides a method for processing pixels of an image, the method comprising:
[0005] Receive image data of an original image captured by a sensor, the original image including n pixels, and the image data including: n first pixel values of the n pixels after true black level correction and a 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 pixel points are divided into a first set and a second set, wherein the first pixel values corresponding to the pixel points in the first set are all greater than or equal to 1, and the first pixel values corresponding to the pixel points in the second set are all 0;
[0007] Determine a first virtual black level corresponding to each pixel in the first set according to the first pixel value, the true black level and the bit width, set the black level of each pixel in the second set to the second virtual black level, and obtain n virtual black levels corresponding to n pixels by counting; 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] Performing clipping processing on the n first pixel values according to the n virtual black levels to obtain n second pixel values;
[0009] The n second pixel values are used to perform image post-processing to obtain the original image.
[0010] In combination with the first aspect, in a possible implementation, the first virtual black level corresponding to each pixel in the first set is determined according to the first pixel value, the true black level and the bit width, including: calculating the average value and the standard deviation according to the n first pixel values; performing normalization processing according to the standard deviation and the bit width to obtain an intermediate parameter value; calculating the third virtual black level corresponding to each first pixel value according to the intermediate parameter value, the average value, the true black level and each first pixel value in the first set; comparing each third virtual black level with the true black level, and taking the smaller value as the first virtual black level.
[0011] In combination with the first aspect, in another possible implementation, calculating the third virtual black level corresponding to each first pixel value according to the intermediate parameter value, the average value, the 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 relationship according to the intermediate parameter value, the average value, the true black level, and each first pixel value in the first set, wherein the preset relationship is:
[0012]
[0013] Among them, BL3 is the third virtual black level, α is the intermediate parameter value, μ is the average value, BL 真值 is the true black level, Value pixel is any first pixel value in the first set.
[0014] In combination with the first aspect, in another possible implementation, comparing each third virtual black level with the true black level, and taking the smaller value as the first virtual black level, includes: using an arithmetic formula to compare each third virtual black level with the true black level, the arithmetic formula is expressed as:
[0015] BL1=min(BL3,BL 真值 )
[0016] Among them, BL1 is the first virtual black level, BL 真值 is the true black level, and min() is the minimum operation.
[0017] In combination 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 combination with the first aspect, in another possible implementation, the n first pixel values are cropped according to n virtual black levels to obtain n second pixel values, including: subtracting the corresponding first virtual black level or second virtual black level from the n first pixel values to obtain n second pixel values.
[0019] In combination with the first aspect, in another possible implementation, the image is post-processed using n second pixel values to obtain the original image, including: performing RAW domain processing and denoising on the n second pixel values, and restoring the processed pixel information to obtain the original image.
[0020] In a second aspect, the present application further provides a pixel processing device for an image, the device comprising:
[0021] A receiving module, used to receive image data of an original image captured by a sensor, the original image including n pixels, and the image data including: n first pixel values of the n pixels after true value black level correction and a bit width of the original image, where n ≥ 1 and is a positive integer;
[0022] A division module, configured to divide n pixel points 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 pixel points in the first set are all greater than or equal to 1, and the first pixel values corresponding to the pixel points in the second set are all 0;
[0023] A calculation module, used to determine, according to the first pixel value, the true black level and the bit width, that each pixel in the first set corresponds to a first virtual black level, and to set the black level of each pixel in the second set to a second virtual black level, and to obtain statistically that n pixels correspond to n virtual black levels; 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 perform cropping processing on the n first pixel values according to the n virtual black levels to obtain n second pixel values, and perform image post-processing using the n second pixel values to obtain the original image.
[0025] In a third aspect, the present application provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the pixel processing method of an image according to the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0026] In a fourth aspect, the present application further provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the image pixel processing method of the first aspect or any corresponding embodiment thereof.
[0027] In addition, the present application provides a computer program product, including computer instructions, which are used to enable a computer to execute the image pixel processing method of the above-mentioned first aspect or any corresponding embodiment.
[0028] The pixel processing method, device, equipment and storage medium of the image provided in the present embodiment divide the n first pixel values in the received image data according to whether they are 0, generate a first set and a second set, and then set the virtual black level BL value corresponding to each pixel point in the first set and the second set respectively, to obtain 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, these virtual black levels are used to perform cropping processing on the n first pixel values to avoid the cropped pixel value being 0. After the virtual black level cropping, the pixel values of some pixel points obtained by the method of the present application are not 0, and a smaller value is still retained, so that when performing image processing in the later stage, the pixel color or details of the extremely dark area can be retained, and the restored original image still retains the grayscale or color difference in the extremely dark area, optimizes the contrast and detail performance of the image, and thus improves the overall image quality.
[0029] In addition, by dynamically adjusting the virtual black level, this method can better adapt to different lighting conditions and sensor characteristics, making the processed image more natural and realistic. It also simplifies the post-processing process. Through pre-processing steps (such as cropping), the complexity and calculation amount in post-processing can be reduced, and the processing efficiency can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0031] Figure 1 is a flowchart of a pixel processing method of an image according to an embodiment of the present application;
[0032] Figure 2 is a schematic diagram comparing a pixel processing method according to an embodiment of the present application;
[0033] Figure 3 is a flowchart of another method for processing pixels of an image according to an embodiment of the present application;
[0034] Figure 4 is a structural block diagram of a pixel processing device for an image according to an embodiment of the present application;
[0035] Figure 5 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0037] It should be noted that, in the description of this application, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. 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] In order to enable technicians in this technical field to better understand the present application solution, first, the application scenarios and technical issues involved in the technical solution of this application are introduced.
[0039] The technical solution of the present application relates to the field of image processing, and in particular to pixel processing in extremely dark areas of an image.
[0040] In the actual shooting environment, due to the presence of dark current and other non-ideal factors in the image sensor itself, the sensor will output a certain signal value even in the absence of light, and this value is the black level. Black level, in simple terms, is the output value of the image sensor in the absence of light. In order to obtain accurate image information, the image signal processor (ISP) needs to perform black level correction (BLC) on these raw data, that is, subtract the corresponding black level value from each pixel value to eliminate the noise and offset of the sensor itself.
[0041] The conventional BLC operation is to directly add the BL value to the pixel value at the sensor end and force the pixel points that become negative after the subtraction to be clipped to 0. In this correction process, since the corrected pixel value may be negative, especially when the original pixel value is close to or equal to the black level, and the pixel value is usually represented as a non-negative integer (for example, grayscale value or RGB value from 0 to 255) in the digital image, many ISP implementations will choose to clip these negative values to 0. Although this approach is simple and direct, it will cause the details of the extremely dark areas of the image to be lost, because the pixel values in these areas are forced to be set to 0, thus losing the original grayscale or color difference.
[0042] In order to solve the problem of distortion after cropping of pixel values in extremely dark areas of an image, an embodiment of the present application provides an embodiment of a pixel processing method for an image. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0043] In this embodiment, a method for processing pixels of an image is provided, which can be used in a processor, such as an ISP. Figure 1 is a flowchart of a pixel processing method according to an embodiment of the present invention, the process comprising:
[0044] Step S101: receiving image data of an original image captured by a sensor.
[0045] The original image may be an image or photo taken by a camera, and the camera is a type of sensor. The original image includes n pixels, where n≥1 and is a positive integer. Each pixel corresponds to a pixel value, and n pixels correspond to n pixel values. After the camera takes the original image, it performs black level correction (BLC) on the n pixel values on the original image, adds a true black level (i.e., true_BL value) to each pixel value, and records it as the first pixel value. The obtained n first pixel values are used as part of the image data.
[0046] Therefore, the image data at least includes: n first pixel values after the true value black level correction of n pixel points, and 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 can be represented by each color channel in the image. It is usually measured in "bits". 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, the n pixel points are divided into a first set and a second set.
[0048] The first pixel values corresponding to the pixel points in the first set are all greater than or equal to 1, and the first pixel values corresponding to the pixel points in the second set are all 0. Specifically, by screening the n first pixel values, the pixel points corresponding to all the first pixel values greater than or equal to 1 form the first set, and the pixel points corresponding to the screened first pixel values equal to 0 form the second set.
[0049] Optionally, the number of pixel points included in the first set is n1, the number of pixel points included in the second set is n2, n1+n2=n, n1 and n2 are both positive integers, and n1≥1, n2≥1.
[0050] Step S103: respectively setting a virtual black level (fake_BL value) corresponding to each pixel value in the first set and the second set.
[0051] Specifically, Figure 1 As shown, step S103 includes:
[0052] Step S1031: determining a first virtual black level corresponding to each pixel in the first set according to the first pixel value, the true black level and the bit width.
[0053] The true black level is the black level value of the pixel addition process when the sensor captures the image, that is, the true_BL value.
[0054] Specifically, at least n1 virtual black levels corresponding to at least n1 pixels in the first set are calculated according to the first pixel value and the bit width b, and then compared with the true black level true_BL value, and the smaller one of the two is taken as the first virtual black level. Ensure that the values of the first virtual black levels are all less than or equal to the true black level.
[0055] Optionally, the first virtual black level is represented by BL1. And BL1≤BL 真值 .
[0056] Step S1032: setting the black level of each pixel in the second set to a second virtual black level.
[0057] The value of the second virtual black level is a constant 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 as the second virtual black level BL2, that is, BL2 = 0. The prerequisite is that the first pixel value Value pixel is 0.
[0058] Step S1033: Obtaining n virtual black levels corresponding to n pixels by counting.
[0059] The n1 first virtual black levels BL1 corresponding to the n1 pixel points calculated in the first set and the n2 second virtual black levels BL2 set in the second set are counted to obtain a total of n virtual black levels.
[0060] Step S104: performing clipping processing on the n first pixel values according to the n virtual black levels to obtain n second pixel values.
[0061] Specifically, the corresponding first virtual black level BL1 or the second virtual black level BL2 is subtracted from the n first pixel values to obtain n second pixel values.
[0062] Step S105: perform image post-processing using the n second pixel values to obtain an original image.
[0063] like Figure 2 As shown, one implementation is to perform RAW domain processing, denoising and other processing on the n second pixel values, and then restore the processed pixel information to obtain the original image.
[0064] RAW domain processing refers to a series of processing performed on RAW data before it is converted into common image formats such as JPEG, PNG, etc. These processes may include white balance adjustment, exposure compensation, color correction, etc., aiming to optimize image quality.
[0065] Image denoising is an important step in image processing, which aims to reduce or eliminate noise in the image. Noise may come from the image sensor, interference during transmission, etc. Denoising can improve the clarity and visual quality of the image.
[0066] In addition, the image post-processing process may also include other types of image processing, such as sharpening, contrast adjustment, color enhancement, etc., which are not limited in this embodiment.
[0067] In this embodiment, after the fake_BL value clipping operation is performed on the n first pixel values one by one, the RAW data obtained has additional information for reference when the subsequent RAW pipeline processing is continued. For pixels with smaller fake_BL values, a greater degree of denoising strength can be given when the denoising module performs window filtering.
[0068] The pixel processing method of the image provided in the present embodiment divides the n first pixel values in the received image data according to whether they are 0, generates a first set and a second set, and then sets the virtual black level BL value corresponding to each pixel point in the first set and the second set respectively, to obtain 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, these virtual black levels are used to perform cropping processing on the n first pixel values, which can avoid the pixel value after cropping being 0. After the virtual black level cropping, the pixel values of some pixel points obtained by the method of the present application are not 0, and still retain smaller values, so that when performing image processing in the later stage, the pixel color or details of the extremely dark area can be retained, and the restored original image still retains the grayscale or color difference in the extremely dark area, optimizes the contrast and detail performance of the image, and thus improves the overall image quality.
[0069] In addition, by dynamically adjusting the virtual black level, this method can better adapt to different lighting conditions and sensor characteristics, making the processed image more natural and realistic. It also simplifies the post-processing process. Through pre-processing steps (such as cropping), the complexity and calculation amount in post-processing can be reduced, and the processing efficiency can be improved.
[0070] Further, in a possible implementation manner, as Figure 3 As shown, the above step S1031, determining the first virtual black level corresponding to each pixel point in the first set according to the first pixel value, the true black level and the bit width, specifically includes:
[0071] Step S1031 - 1 : Calculate the average value and standard deviation of n first pixel values.
[0072] Among them, the n first pixel values include the first pixel values corresponding to all the pixel points included in the first set and the second set. In this step, the n first pixel values in the image frame are counted, and their average value and standard deviation are calculated, and the Gaussian distribution N (μ, σ2) is fitted, and the calculation is shown in the following equations (1) and (2):
[0073]
[0074] Among them, μ represents the average value, n is the number of first pixel values, k is the kth pixel among n pixels, Value pixel_k is the first pixel value corresponding to the kth pixel, and σ is the standard deviation.
[0075] Step S1031 - 2 : performing normalization processing according to the standard deviation and the bit width to obtain an intermediate parameter value.
[0076] Considering the bit width b of this image, the standard deviation σ is normalized to obtain an intermediate parameter value. Optionally, the intermediate parameter value is represented by α, and the calculation relationship is:
[0077]
[0078] Step S1031 - 3 : Calculate a third virtual black level corresponding to each first pixel value according to the intermediate parameter value, the average value, the true black level and each first pixel value in the first set.
[0079] Specifically, Value pixel ≥1, according to 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 the preset relationship, and the preset relationship (4) is:
[0080]
[0081] Among them, BL3 is the third virtual black level, α is the intermediate parameter value, μ is the average value, BL 真值 is the true black level, Value pixel is any first pixel value in the first set.
[0082] Step S1031 - 4 : comparing each third virtual black level with the true black level, and taking the smaller value as the first virtual black level.
[0083] One implementation method is to compare each third virtual black level with the true black level using arithmetic formula (5), where arithmetic formula (5) is expressed as:
[0084] BL1=min(BL3,BL 真值 ) (5)
[0085] Among them, BL1 is the first virtual black level, BL 真值 is the true black level, and min() is the minimum operation.
[0086] Substituting the above equation (4) into equation (5) we get
[0087] For example, this embodiment assumes that the true black level, that is, the true_BL value provided is 64, and the image pixel value received by the ISP is RAW 16, which is understood as: 16-bit data, with a value range of n pixel values in the range of 0 to 65535 such as {62, 58, 55, 64, 60000, 65000}, and n=6.
[0088] Based on the general processing flow, the above 6 pixel values are clipped respectively. After subtracting true_BL=64 from each pixel value, the pixel values with calculated difference results less than 0 are clipped to 0, and 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 disappear, 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 n=6 first pixel values in the first set, and calculates the average value μ=20873.17 and the standard deviation σ=32282.75 through the above relationship formulas (1) and (2). In this embodiment, the bit width b=16, and the intermediate parameter value α=0.4926 is calculated according to the above relationship formula (3).
[0090] In addition, log2(μ)=14.35, according to BL 真值 =64, α=0.4926, and the third virtual black level BL3 corresponding to each pixel is obtained by comparing the third virtual black level BL3 with BL 真值 =64, take the smaller value to obtain 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 the above step S104, BL1 is subtracted from the above {62, 58, 55, 64, 60000, 65000}, that is, 62-53.91, 58-53.04, 55-52.35, 64-54.33, 60000-64, 65000-64 are calculated respectively, and 6 second pixel values are rounded off, namely {8, 5, 3, 10, 59936, 64936}. It can be seen that the pixel value difference between the first four pixel points is still there, and the details of the dark area are retained.
[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 pixel cropping. Therefore, the pixel value after cropping guarantees the details of the extremely dark area.
[0093] In this embodiment, a pixel processing device for an image is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0094] This embodiment provides a pixel processing device for an image, such as Figure 4 As shown, the device includes: a receiving module 410, a dividing module 420, a calculating module 430 and a processing module 440. In addition, the device may also include more or fewer other modules, which is not limited in this embodiment.
[0095] Among them, 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 of the n pixels after true value black level correction and the bit width of the original image, n≥1 and is a positive integer.
[0096] The division module 420 is used to divide n pixel points into a first set and a second set by detecting whether n first pixel values are 0, wherein the first pixel values corresponding to the pixel points in the first set are all greater than or equal to 1, and the first pixel values corresponding to the pixel points 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 according to 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 statistically that n pixels correspond to n virtual black levels; 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 the n first pixel values according to the n virtual black levels to obtain n second pixel values, and perform image post-processing using the n second pixel values to obtain the original image.
[0099] Optionally, in some optional embodiments, the calculation module 430 is specifically used to calculate the average value and standard deviation of n first pixel values; perform normalization processing according to the standard deviation and the bit width to obtain an intermediate parameter value; calculate the third virtual black level corresponding to each first pixel value according to the intermediate parameter value, the average value, the true black level and each first pixel value in the first set; compare each third virtual black level with the true black level, and take the smaller value as the first virtual black level.
[0100] Optionally, in some other optional implementations, the calculation module 430 is further configured to calculate a third virtual black level corresponding to each first pixel value according to a preset relationship based on the intermediate parameter value, the average value, the true black level and each first pixel value in the first set, and the preset relationship is:
[0101]
[0102] Among them, BL3 is the third virtual black level, α is the intermediate parameter value, μ is the average value, BL 真值 is the true black level, Value pixel is any first pixel value in the first set.
[0103] Optionally, in some other optional 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 formula, and the arithmetic formula is expressed as:
[0104] BL1=min(BL3,BL 真值 )
[0105] Among them, BL1 is the first virtual black level, BL 真值 is the true black level, and min() is the minimum operation.
[0106] Optionally, in some further optional 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 the n first pixel values to obtain n second pixel values, and perform RAW domain processing and denoising on the n second pixel values, and restore the processed pixel information to obtain the original image.
[0108] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0109] The pixel processing device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0110] The embodiment of the present invention also provides a computer device having the above Figure 4 The pixel processing device shown.
[0111] See also Figure 5, is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common motherboard or in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface).
[0112] In some optional embodiments, if desired, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.
[0113] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0114] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the pixel processing method shown in the above embodiment.
[0115] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0116] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a 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, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0118] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0119] In addition, the computer device also includes a communication interface, which is used for the computer device to communicate with other devices or a communication network.
[0120] Optionally, in this embodiment, the computer device may be an image signal processor ISP, or an electronic device including an ISP.
[0121] An embodiment of the present invention also provides a computer-readable storage medium, and the above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented by downloading through a network and originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware.
[0122] The storage medium may be a disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid state drive, etc.; further, the storage medium may also include a combination of the above-mentioned types of memories. It is understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the pixel processing method of the image shown in the above embodiment is implemented.
[0123] Embodiments of the present 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 above method. Wherein, the computer program product may be written in any combination of one or more programming languages to perform program codes for performing the operations of the disclosed embodiments, wherein the programming languages include object-oriented programming languages, such as Java, C++, etc., and also include conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on a user computing device, partially on a user device, as an independent software package, partially on a user computing device, 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, rather than to limit them. Although the embodiments of the present invention are described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for processing pixels of an image, characterized in that: The method comprises: Receive image data of an original image captured by a sensor, the original image comprising n pixels, the image data comprising: n first pixel values of the n pixels after true black level correction and a 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 pixel points are divided into a first set and a second set, wherein the first pixel values corresponding to the pixel points in the first set are all greater than or equal to 1, and the first pixel values corresponding to the pixel points in the second set are all 0; Determine a first virtual black level corresponding to each pixel in the first set according to the first pixel value, the true black level and the bit width, set the black level of each pixel in the second set to a second virtual black level, and obtain n virtual black levels corresponding to the n pixels by statistics; 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; Performing clipping processing on the n first pixel values according to the n virtual black levels to obtain n second pixel values; The n second pixel values are used to perform image post-processing to obtain an original image.
2. The method according to claim 1, characterized in that The determining, according to the first pixel value, the true black level and the bit width, a first virtual black level corresponding to each pixel point in the first set comprises: Calculate the average value and standard deviation of the n first pixel values; Performing normalization processing according to the standard deviation and the bit width to obtain an intermediate parameter value; Calculate a third virtual black level corresponding to each first pixel value according to the intermediate parameter value, the average value, the true black level and each first pixel value in the first set; The magnitudes of each of the third virtual black levels and the true black level are compared, and the smaller value is taken as the first virtual black level.
3. The method according to claim 2, characterized in that The step of calculating a third virtual black level corresponding to each first pixel value according to the intermediate parameter value, the average value, the true black level and each first pixel value in the first set includes: According to the intermediate parameter value, the average value, the true black level and each first pixel value in the first set, a third virtual black level corresponding to each first pixel value is calculated according to a preset relationship, and the preset relationship is: Among them, BL3 is the third virtual black level, α is the intermediate parameter value, μ is the average value, BL 真值 is the true black level, Value pixel is any first pixel value in the first set.
4. The method according to claim 3, characterized in that The comparing each of the third virtual black levels with the true black level and taking the smaller value as the first virtual black level comprises: The magnitude of each of the third virtual black levels is compared with the true black level using an arithmetic formula, and the arithmetic formula is expressed as: BL1=min(BL3,BL 真值 ) Among them, BL1 is the first virtual black level, BL 真值 is the true black level, and min() is the minimum operation.
5. The method according to claim 1, characterized in that The step of setting the black level of each pixel in the second set to a second virtual black level comprises: The black level value of each pixel in the second set is set to 0, which is used as the second virtual black level.
6. The method according to any one of claims 1 to 5, characterized in that: The step of clipping the n first pixel values according to the n virtual black levels to obtain n second pixel values includes: The n second pixel values are obtained by respectively subtracting the corresponding first virtual black level or the second virtual black level from the n first pixel values.
7. The method according to any one of claims 1 to 5, characterized in that: The step of performing image post-processing using the n second pixel values to obtain an original image includes: The n second pixel values are subjected to RAW domain processing and denoising processing, and the processed pixel information is restored to obtain the original image.
8. A pixel processing device for an image, characterized in that: The device comprises: A receiving module, configured to receive image data of an original image captured by a sensor, wherein the original image includes n pixels, and the image data includes: n first pixel values of the n pixels after true value black level correction and a bit width of the original image, where n≥1 and is a positive integer; a division module, configured to divide the n pixel points 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 pixel points in the first set are all greater than or equal to 1, and the first pixel values corresponding to the pixel points in the second set are all 0; A calculation module, used to determine a first virtual black level corresponding to each pixel in the first set according to the first pixel value, the true black level and the bit width, and set the black level of each pixel in the second set to a second virtual black level, and obtain n virtual black levels corresponding to the n pixels by statistics; 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; The processing module is used to perform cropping processing on the n first pixel values according to the n virtual black levels to obtain n second pixel values, and perform image post-processing using the n second pixel values to obtain an original image.
9. A computer device, characterized in that: comprising a memory and a processor, wherein the memory and the processor are connected; The memory stores computer instructions, and the processor executes the image pixel processing method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the pixel processing method of an image according to any one of claims 1 to 7.
Citation Information
Patent Citations
Image denoising method based on similar pixel detection
CN103971343A
Soft bit quantization method and device, demodulator and computer storage medium
CN112994842A
Image processing method, image processing device, electronic equipment and readable storage medium
CN114979500A
Black level correction method and device, computer readable storage medium and terminal
CN115720299A
Black level correction method and device, computer equipment and storage medium
CN117221459A