Image processing method, system, device, storage medium and program product
By determining a reference brightness value set based on the image brightness distribution and using target mapping curves and cluster interpolation calculations, the problem of inaccurate image pixel brightness value mapping is solved, and more accurate electrical signal conversion and image display effects are achieved.
Patent Information
- Application Number
- CN202510210013.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2045-02-25
AI Technical Summary
In the prior art, when the brightness values of image pixels are mapped into nonlinear electrical signals, the results are not accurate enough and often differ greatly from expectations.
Based on the brightness distribution of each pixel in the first image, a reference brightness value set is determined, and according to the mapping value of the reference brightness value on the target mapping curve, the brightness value of the pixel is converted into an electrical signal value, and the mapping process is optimized through clustering and interpolation calculations.
The accuracy of converting image pixel brightness values into electrical signal values is improved, the amount of calculation and storage space are reduced, and the accuracy and efficiency of image display are enhanced.
Smart Images

Figure CN119722544B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to, but is not limited to, the field of image processing technology, and in particular to an image processing method, system, device, storage medium, and program product. Background Art
[0002] In the field of image signal processing and display, it's common to map the linear optical signals (i.e., brightness values) of pixels in an image into nonlinear electrical signals. In related art, mapping pixel brightness values into nonlinear electrical signals often results in inaccurate results, often significantly deviating from expectations. Summary of the Invention
[0003] In view of this, embodiments of the present disclosure at least provide an image processing method, system, device, storage medium, and program product.
[0004] The technical solution of the embodiment of the present disclosure is implemented as follows:
[0005] The present disclosure provides an image processing method, the method comprising:
[0006] acquiring a first image;
[0007] Based on the reference electrical signal values corresponding to multiple reference brightness values in the reference brightness value set, the brightness value of the pixel in the first image is converted to obtain the electrical signal value corresponding to the pixel; the reference brightness value set is determined based on the brightness distribution of each pixel in the first image, and the reference electrical signal value corresponding to the reference brightness value is the mapping value of the reference brightness value on the target mapping curve.
[0008] An embodiment of the present disclosure provides an image processing system, the image processing system including a display component and a processing component, wherein:
[0009] The processing component is configured to acquire a first image and determine, based on the brightness distribution of each pixel in the first image, a reference brightness value set and a reference electrical signal value corresponding to each reference brightness value in the reference brightness value set; the reference electrical signal value corresponding to the reference brightness value is a mapping value of the reference brightness value on a target mapping curve;
[0010] The display component is used to convert the brightness values of pixels in the first image based on the reference electrical signal values corresponding to the multiple reference brightness values to obtain the electrical signal values corresponding to the pixels.
[0011] An embodiment of the present disclosure provides an image processing device, the device comprising:
[0012] An acquisition module, configured to acquire a first image;
[0013] A conversion module is used to convert the brightness value of a pixel in the first image based on the reference electrical signal values corresponding to multiple reference brightness values in a reference brightness value set to obtain the electrical signal value corresponding to the pixel; the reference brightness value set is determined based on the brightness distribution of each pixel in the first image, and the reference electrical signal value corresponding to the reference brightness value is the mapping value of the reference brightness value on the target mapping curve.
[0014] An embodiment of the present disclosure provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.
[0015] An embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, some or all of the steps in the above method are implemented.
[0016] An embodiment of the present disclosure provides a computer program product, including a computer program or instructions, which implements some or all of the steps in the above method when executed by a processor.
[0017] In the disclosed embodiment, a reference brightness value set is determined based on the brightness distribution of each pixel in the first image, and the brightness values of the pixels in the first image are converted based on the reference electrical signal values corresponding to the multiple reference brightness values in the reference brightness value set to obtain the electrical signal values corresponding to the pixels, wherein the reference electrical signal values corresponding to the reference brightness values are the mapped values of the reference brightness values on the target mapping curve. Thus, since the reference brightness value set is determined based on the brightness distribution of each pixel in the first image, the multiple reference brightness values in the reference brightness value set can satisfy the distribution of most pixels in the first image, thereby providing more accurate electrical signal values after converting the brightness values of each pixel in the first image.
[0018] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings herein are incorporated into and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and, together with the specification, are used to explain the technical solutions of the present disclosure.
[0020] Figure 1 A schematic diagram of an implementation flow of an image processing method provided in an embodiment of the present disclosure;
[0021] Figure 2 A schematic diagram of the structure of an image processing system provided in an embodiment of the present disclosure;
[0022] Figure 3 The embodiment of the present disclosure provides a relationship between linearly increasing brightness in nature and the uniform grayscale perceived by humans;
[0023] Figure 4 A schematic diagram of a Gamma2.2 curve provided in an embodiment of the present disclosure;
[0024] Figure 5 A schematic diagram of a PQ curve provided in an embodiment of the present disclosure;
[0025] Figure 6 A schematic diagram of image mapping using fixed discrete points provided in an embodiment of the present disclosure;
[0026] Figure 7 A schematic diagram of determining a pre-stored peak list psList provided in an embodiment of the present disclosure;
[0027] Figure 8 A schematic diagram of determining a cluster point sequence provided by an embodiment of the present disclosure;
[0028] Figure 9 A schematic diagram of image mapping by image clustering points provided in an embodiment of the present disclosure;
[0029] Figure 10 A schematic diagram of the structure of an image processing device provided by an embodiment of the present disclosure;
[0030] Figure 11 A schematic diagram of a hardware entity of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the technical solutions of the present disclosure are further elaborated in detail below with reference to the accompanying drawings and embodiments. The described embodiments should not be regarded as limiting the present disclosure. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.
[0032] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0033] The terms "first / second / third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It is understandable that "first / second / third" can be interchanged with a specific order or sequence where permitted so that the embodiments of the present disclosure described herein can be implemented in an order other than that illustrated or described herein.
[0034] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present disclosure pertains. The terms used herein are for the purpose of describing the present disclosure only and are not intended to limit the present disclosure.
[0035] In view of this, an embodiment of the present disclosure provides an image processing method. Figure 1 A schematic diagram of an implementation flow of an image processing method provided in an embodiment of the present disclosure is shown as follows: Figure 1 As shown, the method includes the following steps S101 and S102:
[0036] Step S101: Acquire a first image;
[0037] In some embodiments, in order to adapt to the physical characteristics of the display component, enhance image quality, or achieve a specific visual effect, it is necessary to map the linear optical signal of the first image to be displayed to a nonlinear electrical signal that matches the display component, so that the first image can be accurately and uniformly displayed on the display component.
[0038] In some implementations, the display component may also be expressed as a display or a display device.
[0039] Step S102: Based on the reference electrical signal values corresponding to multiple reference brightness values in the reference brightness value set, the brightness value of the pixel in the first image is converted to obtain the electrical signal value corresponding to the pixel; the reference brightness value set is determined based on the brightness distribution of each pixel in the first image, and the reference electrical signal value corresponding to the reference brightness value is the mapping value of the reference brightness value on the target mapping curve.
[0040] In some embodiments, a method for representing the brightness distribution of each pixel in the first image may include, but is not limited to: representing it using a histogram of the first image; or representing it using a brightness matrix of the first image.
[0041] In some embodiments, a target mapping curve may be determined according to the type of display of the first image, and reference electrical signal values corresponding to a plurality of reference brightness values may be determined according to the target mapping curve.
[0042] In some embodiments, during the conversion of a first image from a linear optical signal to a nonlinear electrical signal, each reference luminance value and the reference electrical signal value corresponding to each reference luminance value are used as inputs to a display device for the first image. When the pixel value of a pixel in the first image is equal to each reference luminance value, the electrical signal value corresponding to the pixel is the reference electrical signal value corresponding to the reference luminance value. When the pixel value of a pixel in the first image is not equal to each reference luminance value, an interpolation calculation is performed based on two adjacent reference luminance values of the pixel to obtain the electrical signal value corresponding to the pixel. This, on the one hand, saves storage space and reduces the time required to look up a mapping table. On the other hand, because the reference luminance value set is determined based on the luminance distribution of each pixel in the first image, multiple reference luminance values in the reference luminance value set can satisfy the luminance distribution of most pixels in the first image, thereby providing a more accurate electrical signal value corresponding to each pixel after the conversion.
[0043] In some embodiments, based on the distribution of each pixel in the first image, the pixel values of each pixel in the first image are clustered to determine multiple reference brightness values, and the reference electrical signal values corresponding to the multiple reference brightness values are determined based on the target mapping curve; based on the reference electrical signal values corresponding to the multiple reference electrical signal values, the brightness value of each pixel is converted to obtain the electrical signal value corresponding to the pixel, thereby completing the mapping of the first image from a linear optical signal to a nonlinear electrical signal.
[0044] In some implementations, multiple reference brightness values are determined by dividing the first image into a number of regular regions, repeatedly splitting out regions with different characteristics, and then merging regions with consistent characteristics. This method has good segmentation effects for complex and poorly connected images, but it increases the computational complexity.
[0045] In the disclosed embodiment, a reference brightness value set is determined based on the brightness distribution of each pixel in the first image, and the brightness values of the pixels in the first image are converted based on the reference electrical signal values corresponding to the multiple reference brightness values in the reference brightness value set to obtain the electrical signal values corresponding to the pixels, wherein the reference electrical signal values corresponding to the reference brightness values are the mapped values of the reference brightness values on the target mapping curve. Thus, since the reference brightness value set is determined based on the brightness distribution of each pixel in the first image, the multiple reference brightness values in the reference brightness value set can satisfy the brightness distribution of most pixels in the first image, thereby making the electrical signal values corresponding to each pixel in the first image more accurate after the conversion.
[0046] In some embodiments, the conversion of the brightness value of a pixel in the first image based on the reference electrical signal values corresponding to the multiple reference brightness values in the reference brightness value set in step S102 to obtain the electrical signal value corresponding to the pixel may include the following steps S111 and S112:
[0047] Step S111: when there is a first reference brightness value equal to the brightness value of the pixel in the reference brightness value set, determining a first reference electrical signal value corresponding to the first reference brightness value as the electrical signal value corresponding to the pixel;
[0048] Step S112: When there is no first reference brightness value equal to the brightness value of the pixel in the reference brightness value set, the brightness value of the pixel is converted based on the second reference electrical signal value corresponding to the second reference brightness value and the third reference electrical signal value corresponding to the third reference brightness value to obtain the electrical signal value corresponding to the pixel; the second reference brightness value and the third reference brightness value are two reference brightness values in the reference brightness value set that are adjacent to the brightness value of the pixel.
[0049] In some embodiments, when a pixel in the first image is equal to a reference brightness value in the reference brightness value set, it can be determined that the first reference brightness value exists in the reference brightness value set.
[0050] In some embodiments, when the brightness value of a pixel in the first image is not equal to any reference brightness value in the reference brightness value set, it can be determined that the first reference brightness value does not exist in the reference brightness value set.
[0051] In some implementations, an interpolation calculation may be performed based on the second reference brightness value and the third reference brightness value to obtain the electrical signal value corresponding to the pixel.
[0052] In some embodiments, each pixel in the first image may be fitted according to each reference brightness value and a reference electrical signal value corresponding to each reference brightness value to obtain an electrical signal value corresponding to the pixel.
[0053] In the disclosed embodiment, if a first reference luminance value equal to the luminance value of a pixel exists in the reference luminance value set, the first reference electrical signal value corresponding to the first reference luminance value is determined as the electrical signal value corresponding to the pixel. If a first reference luminance value equal to the luminance value of a pixel does not exist in the reference luminance value set, the electrical signal value corresponding to the pixel is obtained based on the second and third reference luminance values adjacent in magnitude to the luminance value of the pixel. In this way, the electrical signal value corresponding to the pixel can be obtained by simply converting the luminance value of the pixel in the first image based on each reference luminance value in the reference luminance value set and the reference electrical signal value corresponding to each reference luminance value, thereby reducing the computational complexity of converting the luminance value of the pixel in the first image.
[0054] In some embodiments, the conversion of the brightness value of the pixel based on the second reference electrical signal value corresponding to the second reference brightness value and the third reference electrical signal value corresponding to the third reference brightness value in step S112 to obtain the electrical signal value corresponding to the pixel may include the following step S121:
[0055] Step S121: Based on the second reference electrical signal value corresponding to the second reference brightness value and the third reference electrical signal value corresponding to the third reference brightness value, interpolate the electrical signal value corresponding to the brightness value of the pixel to obtain the electrical signal value corresponding to the pixel.
[0056] In some implementations, the interpolation calculation method may be linear interpolation or nonlinear interpolation that conforms to the changing trend of the target mapping curve.
[0057] In the disclosed embodiment, a difference calculation is performed based on two adjacent reference brightness values to obtain the electrical signal values corresponding to pixels in the first image other than those whose brightness values are equal to the reference brightness values. Thus, using the difference calculation to estimate the electrical signal values corresponding to pixels in the first image between the second reference brightness value and the third reference brightness value reduces the amount of calculation and is easy to implement.
[0058] In some embodiments, the above method may further include the following steps S131 and S132:
[0059] Step S131: performing clustering processing on the brightness value of each pixel in the first image based on the brightness distribution of each pixel in the first image to obtain the multiple reference brightness values;
[0060] In some implementations, the clustering algorithm may include, but is not limited to, a K-means clustering algorithm, a C-means clustering algorithm, a fuzzy C-means clustering algorithm, and the like.
[0061] In some embodiments, clustering is performed on the brightness values of each pixel in the first image to obtain multiple reference brightness values, and the multiple reference brightness values can satisfy the brightness distribution of most pixels in the first image.
[0062] Step S132: Determine reference electrical signal values corresponding to the plurality of reference brightness values.
[0063] In some embodiments, the target mapping curve is determined according to the type of display of the first image.
[0064] In some embodiments, when the display device of the first image is a cathode ray tube display, a gamma 2.2 curve is used as the target mapping curve; when the display device of the first image is a high dynamic range (HDR) display, a perceptual quantizer (PQ) curve is used as the target mapping curve.
[0065] In some embodiments, since physical properties of different display devices may be different, the target mapping curve needs to be calibrated and optimized in actual applications to ensure the accuracy of the mapped first image.
[0066] In the disclosed embodiments, based on the brightness distribution of each pixel, the brightness values of each pixel are clustered to determine multiple reference brightness values, and reference electrical signal values corresponding to each of the multiple reference brightness values are determined. In this way, the multiple reference brightness values obtained through clustering can satisfy the brightness distribution of most pixels.
[0067] In some embodiments, the brightness distribution includes a first brightness value set in the first image and the number of pixels in the first image corresponding to each first brightness value in the first brightness value set. The step S131 described above of clustering the brightness values of each pixel in the first image based on the brightness distribution of each pixel in the first image to obtain the multiple reference brightness values may include the following steps S141 and S142:
[0068] Step S141: determining a second brightness value set from the first brightness value set based on the number of pixels corresponding to each first brightness value in the first image, where the second brightness value set includes a plurality of second brightness values;
[0069] In some embodiments, the number of pixels corresponding to the brightness value of each pixel in the first image is determined according to the brightness distribution of the first image, that is, each first brightness value in the first brightness value set and the number of pixels corresponding to each first brightness value in the first image.
[0070] In some embodiments, each brightness value peak, i.e., each second brightness value in the second brightness value set, is determined from the first brightness value set by comparing the errors between the first brightness value with the largest number of pixels and other first brightness values with numbers of pixels greater than half of the largest number of pixels.
[0071] During implementation, each first brightness value in the first brightness value set is traversed, and the first brightness value with the largest number of pixels is selected as the candidate brightness value, and the first brightness value with a number of pixels greater than half of the number of pixels corresponding to the candidate brightness value is selected as the comparison brightness value; when the difference between the candidate brightness value and each comparison brightness value is greater than the first reference error, the candidate brightness value is determined to be the second brightness value; the candidate brightness value is removed from the first brightness value set, and a candidate brightness value is selected again from the new first brightness value set, and it is determined whether the candidate brightness value is the second brightness value, until the number of pixels corresponding to the candidate brightness value is less than the first number threshold.
[0072] Step S142: performing clustering processing on the brightness value of each pixel in the first image based on each second brightness value to obtain the multiple reference brightness values.
[0073] In some implementations, the brightness values of each pixel in the first image are traversed, and each second brightness value in the second brightness value set is further screened to obtain a plurality of reference brightness values.
[0074] During implementation, the brightness values of each pixel in the first image are traversed, and the difference between the brightness value of each pixel and each second brightness value is calculated. When the difference between the brightness value of the pixel and the second brightness value is the smallest and less than the second reference error, it is determined that the brightness value of the pixel and the second brightness value belong to the same cluster category, and the average of the brightness values belonging to the same cluster category is calculated to obtain a reference brightness value.
[0075] In the disclosed embodiment, a second luminance value set is determined based on the number of pixels having each first luminance value in the first image, and the luminance values of each pixel are clustered based on each second luminance value in the second luminance value set to obtain a plurality of reference luminance values. Thus, based on each second luminance value, the second luminance values are further filtered by clustering the luminance values of each pixel to obtain a plurality of reference luminance values that better satisfy the luminance distribution of each pixel.
[0076] In some embodiments, determining the second brightness value set from the first brightness value set based on the number of pixels corresponding to each first brightness value in the first image in step S141 may include the following steps S151 and S152:
[0077] Step S151: When the difference between the candidate brightness value in the first brightness value set and each contrast brightness value is greater than a first reference error, determining the candidate brightness value to be the second brightness value, wherein, in the first brightness value set, the number of pixels corresponding to the candidate brightness value is the largest and is not less than a first number threshold, and the number of pixels corresponding to the contrast brightness value is greater than half of the number of pixels corresponding to the candidate brightness value;
[0078] In some embodiments, the first brightness value with the largest number of pixels corresponding to the first brightness value in the first brightness value set is used as the candidate brightness value; and all first brightness values with pixel numbers greater than half of the number of pixels corresponding to the candidate brightness value are used as the comparison brightness value.
[0079] In some embodiments, when the error between the candidate luminance value and each contrast luminance value is greater than the first reference error, the candidate luminance value is determined as the second luminance value.
[0080] In some embodiments, if a difference between a candidate luminance value in the first luminance value set and each contrast luminance value is less than or equal to a first reference error, the candidate luminance value is removed from the first luminance value set.
[0081] Step S152: Remove the candidate luminance value from the first luminance value set to obtain an updated first luminance value set, and determine that the candidate luminance value is the second luminance value when the difference between the candidate luminance value in the updated first luminance value set and each contrast luminance value is greater than the first reference error.
[0082] In some implementations, when it is determined that the candidate luminance value is the second luminance value, the candidate luminance value is removed from the first luminance value set, and the first luminance value set is updated.
[0083] In some embodiments, the candidate brightness value and each contrast brightness value are re-determined in the updated first brightness value set, and when the difference between the candidate brightness value and each contrast brightness value is greater than the first reference error, the candidate brightness value is determined to be the second brightness value, until the number of pixels corresponding to the re-determined candidate brightness value is less than the first number threshold.
[0084] In some embodiments, the step S142 of clustering the brightness values of each pixel in the first image based on each second brightness value to obtain the multiple reference brightness values may include the following steps S161 and S162:
[0085] Step S161: determining, based on a difference between a brightness value of each pixel in the first image and each second brightness value, a third brightness value set corresponding to each second brightness value, wherein the third brightness value set corresponding to the second brightness value includes at least one brightness value belonging to the same cluster category as the second brightness value;
[0086] In some embodiments, for each pixel, the second brightness value having the smallest difference between the brightness value of the pixel and multiple second brightness values is selected. When the difference between the brightness value of the pixel and the second brightness value is less than a second reference error, it is determined that the brightness value of the pixel and the second brightness value belong to the same cluster category. Therefore, the brightness value of the pixel can be used as one of the brightness values in the third brightness value set corresponding to the second brightness value.
[0087] In some embodiments, each second brightness value may correspond to a third brightness value set; the third brightness value set includes at least one brightness value that belongs to the same cluster category as the second brightness value.
[0088] In some embodiments, the third brightness value set corresponding to the second brightness value includes the second brightness value.
[0089] In some embodiments, the number of luminance values in a third luminance value set corresponding to the second luminance value is determined.
[0090] Step S162: For each second brightness value, determine a reference brightness value based on an average value of each brightness value in a third brightness value set corresponding to the second brightness value.
[0091] In some embodiments, the average value of each brightness value in the third brightness value set corresponding to the second brightness value is calculated based on the brightness values and the number of brightness values in the third brightness value set corresponding to the second brightness value, and the average value is determined as the new reference brightness value.
[0092] In some embodiments, determining the third brightness value set corresponding to each second brightness value based on the difference between the brightness value of each pixel in the first image and each second brightness value in step S161 may include:
[0093] When the difference between the brightness value of the pixel and the target brightness value in each of the second brightness values is less than a second reference error, it is determined that the brightness value of the pixel and the second brightness value belong to the same cluster category; in each of the second brightness values, the difference between the target brightness value and the brightness value of the pixel is the smallest.
[0094] In some embodiments, a difference between the target brightness value and the brightness value of the pixel is minimum and the difference is smaller than a second reference error.
[0095] In some embodiments, it is determined that the brightness value of the pixel and the second brightness value belong to the same cluster category, that is, the brightness value of the pixel is a brightness value in a third brightness value set corresponding to the second brightness value.
[0096] In some embodiments, the step S142 of clustering the brightness values of each pixel in the first image based on each second brightness value to obtain the multiple reference brightness values may further include the following step S171:
[0097] Step S171 : when the differences between the brightness value of the pixel and each of the second brightness values are not less than a second reference error, adding the brightness value of the pixel as a newly added second brightness value to the second brightness value set.
[0098] In some embodiments, when the difference between the brightness value of a pixel and each second brightness value is not less than the second reference error, it indicates that the brightness value of the pixel and each second brightness value in the second brightness set do not belong to the same cluster category. Therefore, the brightness value of the pixel is determined as a new cluster category, that is, the brightness value of the pixel is added as a newly added second brightness value to the second brightness value set.
[0099] In some embodiments, the difference between the brightness value of each pixel in the first image and the newly added second brightness value may be calculated to determine whether the pixel and the newly added second brightness value belong to the same cluster category.
[0100] In some embodiments, before determining the reference electrical signal values corresponding to the plurality of reference brightness values, the method may further include the following step S181:
[0101] Step S181: merging two reference brightness values whose difference is smaller than a preset step size among the plurality of reference brightness values.
[0102] In some embodiments, two reference brightness values whose difference between the reference brightness values is less than a preset step size are merged, that is, the average of the two reference brightness values is taken as the new reference brightness value.
[0103] In some embodiments, when the number of reference luminance values in the reference luminance value set is greater than a reference luminance value number threshold, the number of reference luminance values in the reference luminance value set is controlled to be no greater than the reference luminance value number threshold.
[0104] In the embodiment of the present disclosure, two reference brightness values whose difference is less than a preset step size among the multiple reference brightness values are merged. In this way, similar reference brightness values among the multiple reference brightness values can be merged, reducing repeated reference brightness values.
[0105] In some embodiments, determining the reference electrical signal values corresponding to the plurality of reference brightness values in step S132 may include the following steps S191 and S192:
[0106] Step S191: determining a target mapping curve based on the type of display to display the first image;
[0107] In some embodiments, when the type of display to display the first image is a cathode ray tube display, the Gamma2.2 curve is used as the target mapping curve; when the type of display to display the first image is an HDR display device, the PQ curve is used as the target mapping curve.
[0108] In some embodiments, the target mapping curve is a non-linear curve that matches the physical characteristics of the type of display on which the first image is to be displayed.
[0109] Step S192: Based on the target mapping curve, determine reference electrical signal values corresponding to the plurality of reference brightness values.
[0110] In some embodiments, each reference brightness value is used as an input of a target mapping curve, and an output value obtained using the target mapping curve is used as a reference electrical signal value corresponding to each reference brightness value.
[0111] In the disclosed embodiment, an appropriate target mapping curve is selected based on the type of display to be used to display the first image, and reference electrical signal values corresponding to the multiple reference brightness values are obtained based on the target mapping curve. Thus, by determining a target mapping curve that matches the display based on the display type, the obtained reference electrical signal values corresponding to the multiple reference brightness values are more accurate.
[0112] An embodiment of the present disclosure provides an image processing system. Figure 2 A schematic diagram of the structure of an image processing system provided in an embodiment of the present disclosure is shown in FIG. Figure 2 As shown, the image processing system 200 includes a processing component 201 and a display component 202, wherein:
[0113] The processing component 201 is configured to acquire a first image and determine, based on the brightness distribution of each pixel in the first image, a reference brightness value set and a reference electrical signal value corresponding to each reference brightness value in the reference brightness value set; the reference electrical signal value corresponding to the reference brightness value is a mapping value of the reference brightness value on a target mapping curve;
[0114] The display component 202 is configured to convert the brightness values of pixels in the first image based on the reference electrical signal values corresponding to the multiple reference brightness values to obtain electrical signal values corresponding to the pixels.
[0115] In some embodiments, the processing component 201 determines a reference brightness value set based on the brightness distribution of each pixel in the first image, and determines a reference electrical signal value corresponding to each reference brightness value in the reference brightness value set through a target mapping curve.
[0116] In some embodiments, the display component 202 determines the electrical signal value corresponding to each pixel in the first image by interpolation calculation based on each reference brightness value in the reference brightness value set and the reference electrical signal value corresponding to each reference brightness value.
[0117] In some embodiments, the brightness distribution includes a first brightness value set in the first image and the number of pixels in the first image corresponding to each first brightness value in the first brightness value set; the processing component 201 is also used to: determine a second brightness value set from the first brightness value set based on the number of pixels in the first image corresponding to each first brightness value, the second brightness value set including multiple second brightness values; based on each second brightness value, cluster the brightness value of each pixel in the first image to obtain the multiple reference brightness values.
[0118] In some embodiments, the processing component 201 is further used to: determine that the candidate brightness value is the second brightness value when the difference between the candidate brightness value and each contrast brightness value in the first brightness value set is greater than a first reference error, wherein, in the first brightness value set, the number of pixels corresponding to the candidate brightness value is the largest and not less than a first number threshold, and the number of pixels corresponding to the contrast brightness value is greater than half of the number of pixels corresponding to the candidate brightness value; remove the candidate brightness value from the first brightness value set to obtain an updated first brightness value set, and determine that the candidate brightness value is the second brightness value when the difference between the candidate brightness value and each contrast brightness value in the updated first brightness value set is greater than the first reference error.
[0119] In some embodiments, the processing component 201 is further used to: determine a third brightness value set corresponding to each second brightness value based on the difference between the brightness value of each pixel in the first image and each second brightness value, the third brightness value set corresponding to the second brightness value including at least one brightness value belonging to the same cluster category as the second brightness value; for each second brightness value, determine a reference brightness value based on the average value of each brightness value in the third brightness value set corresponding to the second brightness value.
[0120] In some embodiments, the processing component 201 is further used to: determine that the brightness value of the pixel and the second brightness value belong to the same cluster category when the difference between the brightness value of the pixel and the target brightness value in each second brightness value is less than a second reference error; and in each second brightness value, the difference between the target brightness value and the brightness value of the pixel is the smallest.
[0121] In some embodiments, the processing component 201 is further configured to: determine the brightness value of the pixel as one of the second brightness values when the differences between the brightness value of the pixel and each of the second brightness values are not less than a second reference error.
[0122] In some embodiments, the processing component 201 is further configured to: merge two reference brightness values whose difference is less than a preset step size among the plurality of reference brightness values.
[0123] In some embodiments, the processing component 201 is further configured to: determine a target mapping curve based on the type of display to display the first image; and determine reference electrical signal values corresponding to a plurality of reference brightness values based on the target mapping curve.
[0124] In some embodiments, the display component 202 is also used for at least one of the following: when there is a first reference brightness value equal to the brightness value of the pixel in the reference brightness value set, determining the first reference electric signal value corresponding to the first reference brightness value as the electric signal value corresponding to the pixel; when there is no first reference brightness value equal to the brightness value of the pixel in the reference brightness value set, converting the brightness value of the pixel based on the second reference electric signal value corresponding to the second reference brightness value and the third reference electric signal value corresponding to the third reference brightness value to obtain the electric signal value corresponding to the pixel; the second reference brightness value and the third reference brightness value are two reference brightness values in the reference brightness value set that are adjacent to the brightness value of the pixel.
[0125] In some embodiments, the display component 202 is also used to: perform interpolation calculation on the electrical signal value corresponding to the brightness value of the pixel based on the second reference electrical signal value corresponding to the second reference brightness value and the third reference electrical signal value corresponding to the third reference brightness value to obtain the electrical signal value corresponding to the pixel.
[0126] In the embodiment of the present disclosure, a reference brightness value set is determined by the processing component 201, and a reference electrical signal value corresponding to each reference brightness value is determined by mapping the reference brightness value on the target mapping curve; the brightness value of the pixel in the first image is converted by the display component 202 according to the reference electrical signal values corresponding to the multiple reference brightness values to obtain the electrical signal value corresponding to the pixel. In this way, on the one hand, the multiple reference brightness values in the reference brightness value set determined by the processing component 201 can meet the distribution of most pixels in the first image, so the electrical signal value corresponding to each pixel after the conversion of each pixel in the first image is more accurate; on the other hand, the electrical signal value corresponding to the pixel can be obtained by only using the multiple reference brightness values and the reference electrical signal values corresponding to the multiple reference brightness values as inputs to the display component 202, thereby saving storage space.
[0127] The following describes the application of the embodiments of the present disclosure in actual scenarios.
[0128] In the field of image signal processing and display, we often encounter the mapping of linear optical signals to nonlinear electrical signals. -3 to 10 6 Candela / square meter (cd / m 2 ), and the perception of the human eye in this area does not increase in equal proportion, but satisfies a mapping curve, Figure 3 It is the relationship between the linear growth of brightness in nature and the uniform grayscale perceived by people psychologically, such as Figure 3 As shown, the brightness in nature increases linearly, but the brightness perceived by people psychologically does not increase at a constant rate, but rather decreases in slope.
[0129] In order to present the image more accurately, the brightness output by the display device matches the brightness perceived by the human eye. For CRT displays, this mapping curve satisfies the inverse of the Gamma2.2 curve. Figure 4 A schematic diagram of a Gamma2.2 curve provided in an embodiment of the present disclosure is shown as follows: Figure 4 As shown in the figure, the horizontal axis is the input brightness value and the vertical axis is the output electrical signal value. By applying this Gamma2.2 curve, we can ensure that the brightness distribution of the image is more in line with the perception characteristics of the human eye, thereby providing a more realistic and natural visual experience. For HDR display devices, this mapping curve satisfies the inverse of the PQ curve. Figure 5 A schematic diagram of a PQ curve provided in an embodiment of the present disclosure is shown as follows: Figure 5 As shown, the horizontal axis is the input brightness value and the vertical axis is the output electrical signal value, ensuring that the brightness information of the source signal can be accurately converted into the brightness that the display device can output.
[0130] When designing image processors or display devices, this characteristic can be exploited to map the linearly increasing brightness of nature to the uniform grayscale perceived by the human eye. This reduces the amount of image data the display device must process. While the linearly increasing brightness range is wide, the data range available to display devices is limited (typically 8, 10, or 12 bits). To ensure no loss during the conversion process, display devices scale the linearly increasing brightness, often to 16 bits or higher. This involves designing a mapping table that maps 16 bits or higher to 8, 10, or 12 bits. This approach requires a significant amount of storage space to store this mapping table, and lookups in such a large table are also time-consuming.
[0131] In order to reduce the length of the mapping table, some manufacturers use a fixed discrete point mapping method to transmit the coordinates of the discrete points to the display device, and the values between the discrete points are calculated using linear interpolation, such as Figure 6 As shown in the figure, the horizontal axis is the brightness value of the image, and the vertical axis is the mapped electrical signal value. The solid line is the electrical signal value after mapping by the ideal mapping curve, and the dashed line is the electrical signal value obtained by linear interpolation through fixed discrete points. This method obtains the data between the discrete points through linear interpolation. The slope of the ideal mapping curve varies greatly with the input, and the interpolated points differ significantly from the ideal values. Because the positions of the discrete points are fixed, but the data distribution of the image data is unknown, it is possible that most of the image data is distributed between the discrete points, causing the interpolation results to differ significantly from the expected results.
[0132] Based on the above analysis, the present disclosure proposes a rapid image mapping method. This method performs finite value clustering on the image data, selects multiple cluster points where the image data is primarily distributed, calculates the coordinates of these cluster points on the ideal mapping curve, and uses linear interpolation for points outside the cluster points to obtain the electrical signal values after image mapping. The method may include steps S1201 to S1203:
[0133] Step S1201: Calculate the finite cluster points of the image to obtain a cluster point sequence;
[0134] There are many image clustering algorithms. Here we use the K-means clustering algorithm as an example. K-means clustering is based on processing the image histogram and further merging the histogram to obtain multiple cluster points. Specifically, it can include the following steps S1211 to S1215:
[0135] Step S1211: setting an upper limit K on the number of cluster points. When counting the number of cluster points, if it exceeds K, K is taken as the maximum.
[0136] Here, the cluster point sequence is equivalent to the above-mentioned reference brightness value set, and the cluster points in the cluster point sequence are equivalent to the above-mentioned reference brightness values.
[0137] Step S1212: Calculate the histogram of the image;
[0138] Here, the brightness distribution of the image can be reflected by a histogram, in which the abscissa corresponds to each first brightness value in the first brightness value set, and the ordinate corresponds to the number of pixels corresponding to each first brightness value.
[0139] Step S1213: traverse the histogram of the image and determine the pre-stored peak list psList;
[0140] Here, the pre-stored peak list psList is equivalent to the above-mentioned second brightness value set, and the pre-stored peak list psList contains multiple peak points, which are equivalent to the second brightness values.
[0141] Determine the pre-stored peak list psList can be as follows Figure 7 As shown, a, b, c, d, e, f, and g are the first brightness values of each pixel in the image, and the ordinate is the number of pixels corresponding to each first brightness value in the first image. The image histogram is traversed, and the candidate brightness value with the largest number of pixels in the histogram is first selected (that is, the corresponding number of pixels is Max_data). If the error between all contrast brightness values greater than half of the maximum number of pixels (that is, Half_max) and the candidate brightness value with the number of pixels being Max_data is greater than the first error error0, then the first brightness value corresponding to this Max_data is considered to be a valid peak data and is stored in the peak list psList. The candidate brightness value corresponding to this Max_data is removed from the histogram; the histogram is updated, and the new histogram is traversed to reselect the candidate brightness value corresponding to Max_data to determine whether the candidate brightness value corresponding to this Max_data is a valid peak data. If it is a valid peak data, it is stored in the peak list psList; until the largest Max_data remaining in the histogram is less than the set minimum number of pixels (Limit).
[0142] Step S1214: traverse each pixel in the image, update the pre-stored peak list psList, and obtain the final cluster point sequence;
[0143] Figure 8 A schematic diagram of determining a cluster point sequence provided by an embodiment of the present disclosure is shown as follows: Figure 8As shown, a, b, c, and d are the peak points in the pre-stored peak list psList. Each pixel in the image is traversed, and the error between each pixel and each peak point in the pre-stored peak list psList is determined. If the error between the pixel and the peak point with the smallest error in the pre-stored peak list psList (i.e., Best_Idx) is less than a second error error1, the pixel is determined to belong to the same cluster category as Best_Idx. The average of each pixel and its corresponding peak point belonging to the same cluster category is calculated to obtain the cluster point in the cluster point sequence (i.e., the average calculated by += pSrc.data in psList').
[0144] When the errors between the pixel and each peak point in the pre-stored peak list psList are greater than or equal to the second error error1, the pixel is determined to be a new cluster point in the cluster point sequence.
[0145] Step S1215: traverse the cluster point sequence, merge two cluster points whose difference between the cluster points is less than the set cluster point step size, and obtain the final cluster point sequence.
[0146] Step S1202: Calculating the coordinates of the cluster points in the cluster point sequence on the ideal mapping curve;
[0147] If the ideal mapping curve uses the Gamma mapping curve, the Gamma calculation formula is used to calculate the mapped electrical signal value of each cluster point:
[0148] (1);
[0149] In formula (1), x is each cluster point in the input cluster point sequence, y is the electrical signal value corresponding to each cluster point.
[0150] If the ideal mapping curve uses the PQ mapping curve, the mapping value of each cluster point is calculated using the PQ calculation formula:
[0151] (2);
[0152] In formula (2), x For each cluster point in the input cluster point sequence, y is the electrical signal value corresponding to each cluster point. m 1. m 2. c 1. c 2 and c 3 is the photoelectric transfer coefficient, m 1 controls the slope of the PQ curve in the low brightness area; m2 controls the slope of the PQ curve in the high brightness area; c 1 is used to ensure that the PQ curve has an appropriate slope when the brightness is low; c 2 and c 3 These two constants work together to smoothly transition to maximum brightness in high brightness areas.
[0153] Step S1203: Map the brightness value of each pixel in the image one by one. When the brightness value of the pixel in the image is equal to the brightness value of the cluster point in the cluster point sequence, an ideal mapping curve is used to obtain the mapped electrical signal value. When the brightness value of the pixel in the image is not equal to the brightness value of the cluster point in the cluster point sequence, linear interpolation is used to obtain the mapped electrical signal value.
[0154] Figure 9 A schematic diagram of image mapping by image clustering points provided in an embodiment of the present disclosure is shown in FIG. Figure 9 As shown in the figure, the horizontal axis is the image brightness value, the vertical axis is the mapped electrical signal value, point0, point1, point2, and pointK are cluster points in the cluster point sequence, the solid line is the electrical signal value obtained by the ideal mapping curve, and the dashed line is the electrical signal value obtained by linear interpolation of the image cluster points, where K is the maximum number of cluster points. The mapped image data at points0, point1, point2, and pointK is obtained according to the ideal mapping curve. At other points, the mapped image data is obtained by linear interpolation between two adjacent cluster points based on the brightness values of the pixels.
[0155] In the disclosed embodiment, an image is clustered to obtain a cluster point sequence. When the brightness value of a pixel in the image is equal to a cluster point in the cluster point sequence, an ideal mapping curve is used to obtain the mapped electrical signal value. When the brightness value of a pixel in the image is not equal to any cluster point in the cluster point sequence, a difference calculation is performed using two cluster points with adjacent brightness values of the pixel to obtain the mapped electrical signal value. In this way, only the cluster point sequence and the mapped electrical signal value corresponding to the cluster point need to be used as the input of the display device, which saves storage space and reduces the time delay of table lookup. In addition, the cluster point sequence obtained by image clustering satisfies the brightness distribution of most pixels in the image, so the mapped electrical signal value is more accurate.
[0156] Based on the aforementioned embodiments, the embodiments of the present disclosure provide an image processing device, which includes the modules included therein and the units included in each module, etc., and can be implemented by a processor in a computer device; of course, it can also be implemented by a specific logic circuit; during implementation, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.
[0157] Figure 10 A schematic diagram of the structure of an image processing device provided in an embodiment of the present disclosure is shown in FIG. Figure 10 As shown, the image processing device 1000 includes: an acquisition module 1001 and a conversion module 1002, wherein:
[0158] An acquisition module 1001 is configured to acquire a first image;
[0159] The conversion module 1002 is used to convert the brightness value of the pixel in the first image based on the reference electrical signal values corresponding to multiple reference brightness values in the reference brightness value set to obtain the electrical signal value corresponding to the pixel; the reference brightness value set is determined based on the brightness distribution of each pixel in the first image, and the reference electrical signal value corresponding to the reference brightness value is the mapping value of the reference brightness value on the target mapping curve.
[0160] In some embodiments, the conversion module includes at least one of the following: a first determination unit, used to determine a first reference electric signal value corresponding to a first reference brightness value as the electric signal value corresponding to the pixel when there is a first reference brightness value equal to the brightness value of the pixel in the reference brightness value set; a second determination unit, used to convert the brightness value of the pixel based on a second reference electric signal value corresponding to the second reference brightness value and a third reference electric signal value corresponding to the third reference brightness value to obtain the electric signal value corresponding to the pixel when there is no first reference brightness value equal to the brightness value of the pixel in the reference brightness value set; the second reference brightness value and the third reference brightness value are two reference brightness values in the reference brightness value set that are adjacent in size to the brightness value of the pixel.
[0161] In some embodiments, the second determination unit includes: an interpolation calculation subunit, which is used to perform interpolation calculation on the electrical signal value corresponding to the brightness value of the pixel based on the second reference electrical signal value corresponding to the second reference brightness value and the third reference electrical signal value corresponding to the third reference brightness value to obtain the electrical signal value corresponding to the pixel.
[0162] In some embodiments, the image processing device also includes: a clustering processing module, which is used to cluster the brightness values of each pixel in the first image based on the brightness distribution of each pixel in the first image to obtain the multiple reference brightness values; and a determination module, which is used to determine the reference electrical signal values corresponding to the multiple reference brightness values.
[0163] In some embodiments, the clustering processing module includes: a third determination unit, used to determine a second brightness value set from the first brightness value set based on the number of pixels corresponding to each first brightness value in the first image, wherein the second brightness value set includes multiple second brightness values; a clustering processing unit, used to cluster the brightness value of each pixel in the first image based on each second brightness value to obtain the multiple reference brightness values.
[0164] In some embodiments, the third determination unit includes: a first determination subunit, configured to determine that the candidate brightness value is the second brightness value when the difference between the candidate brightness value in the first brightness value set and each contrast brightness value is greater than a first reference error, wherein, in the first brightness value set, the number of pixels corresponding to the candidate brightness value is the largest and not less than a first number threshold, and the number of pixels corresponding to the contrast brightness value is greater than half of the number of pixels corresponding to the candidate brightness value; a second determination subunit, configured to remove the candidate brightness value from the first brightness value set to obtain an updated first brightness value set, and determine that the candidate brightness value is the second brightness value when the difference between the candidate brightness value in the updated first brightness value set and each contrast brightness value is greater than the first reference error.
[0165] In some embodiments, the clustering processing unit includes: a third determination subunit, used to determine a third brightness value set corresponding to each second brightness value based on the difference between the brightness value of each pixel in the first image and each second brightness value, the third brightness value set corresponding to the second brightness value including at least one brightness value belonging to the same cluster category as the second brightness value; a fourth determination subunit, used to determine a reference brightness value for each second brightness value based on the average value of each brightness value in the third brightness value set corresponding to the second brightness value.
[0166] In some embodiments, the third determination subunit is also used to: determine that the brightness value of the pixel and the second brightness value belong to the same cluster category when the difference between the brightness value of the pixel and the target brightness value in each second brightness value is less than a second reference error; and in each second brightness value, the difference between the target brightness value and the brightness value of the pixel is the smallest.
[0167] In some embodiments, the clustering processing unit further includes: a fifth determination subunit, configured to determine the brightness value of the pixel as one of the second brightness values when the difference between the brightness value of the pixel and each of the second brightness values is not less than a second reference error.
[0168] In some embodiments, the image processing apparatus further includes: a merging module configured to merge two reference brightness values whose difference is smaller than a preset step size among the plurality of reference brightness values.
[0169] In some embodiments, the determination module includes: a fourth determination unit for determining a target mapping curve based on the type of display to display the first image; and a fifth determination unit for determining reference electrical signal values corresponding to multiple reference brightness values based on the target mapping curve.
[0170] The description of the above device embodiment is similar to the description of the above method embodiment and has similar beneficial effects as the method embodiment. In some embodiments, the functions or modules included in the device provided by the embodiment of the present disclosure can be used to perform the method described in the above method embodiment. For technical details not disclosed in the device embodiment of the present disclosure, please refer to the description of the method embodiment of the present disclosure for understanding.
[0171] It should be noted that in the embodiments of the present disclosure, if the above-mentioned method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present disclosure, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present disclosure. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk. In this way, the embodiments of the present disclosure are not limited to any specific hardware, software, or firmware, or any combination of hardware, software, and firmware.
[0172] An embodiment of the present disclosure provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.
[0173] The present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements some or all of the steps in the above method. The computer-readable storage medium may be transient or non-transient.
[0174] An embodiment of the present disclosure provides a computer program, including computer-readable codes. When the computer-readable codes are executed in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.
[0175] The present disclosure provides a computer program product comprising a non-transitory computer-readable storage medium storing a computer program. When the computer program is read and executed by a computer, the computer program implements some or all of the steps of the above-described method. The computer program product may be implemented in hardware, software, or a combination thereof. In some embodiments, the computer program product is embodied as a computer storage medium. In other embodiments, the computer program product is embodied as a software product, such as a software development kit (SDK).
[0176] It should be noted that the descriptions of the various embodiments above tend to emphasize the differences between the embodiments, and reference can be made to the similarities or similarities between them. The descriptions of the above embodiments of the device, storage medium, computer program, and computer program product are similar to the descriptions of the above-mentioned method embodiments and have similar beneficial effects as the method embodiments. For technical details not disclosed in the embodiments of the device, storage medium, computer program, and computer program product disclosed herein, please refer to the description of the method embodiments disclosed herein for understanding.
[0177] It should be noted that Figure 11 A schematic diagram of a hardware entity of a computer device in an embodiment of the present disclosure is shown in FIG. Figure 11 As shown, the hardware entity of the computer device 1100 includes: a processor 1101, a communication interface 1102 and a memory 1103, wherein:
[0178] Processor 1101 generally controls the overall operation of computer device 1100 .
[0179] The communication interface 1102 enables the computer device to communicate with other terminals or servers through a network.
[0180] Memory 1103 is configured to store instructions and applications executable by processor 1101. It can also cache data to be processed or processed by processor 1101 and various modules in computer device 1100 (e.g., image data, audio data, voice communication data, and video communication data). This can be implemented using flash memory (FLASH) or random access memory (RAM). Data can be transmitted between processor 1101, communication interface 1102, and memory 1103 via bus 1104.
[0181] It should be understood that “one embodiment” or “an embodiment” mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present disclosure. Therefore, “in one embodiment” or “in an embodiment” appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present disclosure, the size of the serial numbers of the above-mentioned steps / processes does not mean the order of execution, and the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure. The serial numbers of the embodiments of the present disclosure are for description only and do not represent the advantages and disadvantages of the embodiments.
[0182] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0183] In the several embodiments provided in the present disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0184] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, the functional units in the various embodiments of the present disclosure may all be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0185] Those skilled in the art will understand that all or part of the steps of the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, and other media that can store program codes.
[0186] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure, or the portion that contributes to the relevant technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of the present disclosure. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0187] The above is only an embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any changes or replacements that can be easily conceived by any technician familiar with this technical field within the technical scope disclosed in this disclosure should be covered by the protection scope of the present disclosure.
Claims
1. An image processing method, characterized in that: The method comprises: Acquire a first image to be displayed; converting the brightness value of a pixel in the first image based on reference electrical signal values corresponding to a plurality of reference brightness values in a reference brightness value set to obtain an electrical signal value corresponding to the pixel; the reference brightness value set is obtained by clustering the brightness values of each pixel in the first image based on the brightness distribution of each pixel in the first image, and the reference electrical signal values corresponding to the reference brightness values are mapping values of the reference brightness values on a target mapping curve; The brightness distribution includes a first brightness value set in the first image and a number of pixels in the first image corresponding to each first brightness value in the first brightness value set; The multiple reference brightness values are obtained by clustering the brightness values of each pixel in the first image based on multiple second brightness values; the multiple second brightness values are obtained through multiple rounds of selection from the first brightness value set, and the second brightness value selected in each round is determined by comparing the differences between the candidate brightness values of the current round in the first brightness value set and the contrast brightness values of the current round, all of which are greater than the first reference error; the candidate brightness value of the current round is the first brightness value in the first brightness value set with the largest number of pixels other than the candidate brightness values of the historical round and not less than the first number threshold, and the number of pixels corresponding to the contrast brightness value of the current round is greater than half of the number of pixels corresponding to the candidate brightness value of the current round.
2. The image processing method according to claim 1, wherein: The converting the brightness value of a pixel in the first image based on the reference electrical signal values respectively corresponding to the plurality of reference brightness values in the reference brightness value set to obtain the electrical signal value corresponding to the pixel includes at least one of the following: When there is a first reference brightness value equal to the brightness value of the pixel in the reference brightness value set, determining a first reference electrical signal value corresponding to the first reference brightness value as the electrical signal value corresponding to the pixel; When there is no first reference brightness value equal to the brightness value of the pixel in the reference brightness value set, converting the brightness value of the pixel based on a second reference electrical signal value corresponding to the second reference brightness value and a third reference electrical signal value corresponding to the third reference brightness value to obtain an electrical signal value corresponding to the pixel; The second reference brightness value and the third reference brightness value are two reference brightness values in the reference brightness value set that are adjacent in magnitude to the brightness value of the pixel.
3. The image processing method according to claim 2, wherein: The converting the brightness value of the pixel based on the second reference electrical signal value corresponding to the second reference brightness value and the third reference electrical signal value corresponding to the third reference brightness value to obtain the electrical signal value corresponding to the pixel includes: Based on the second reference electrical signal value corresponding to the second reference brightness value and the third reference electrical signal value corresponding to the third reference brightness value, the electrical signal value corresponding to the brightness value of the pixel is interpolated to obtain the electrical signal value corresponding to the pixel.
4. The image processing method according to claim 1, wherein: Also includes: performing clustering processing on the brightness value of each pixel in the first image based on the brightness distribution of each pixel in the first image to obtain the multiple reference brightness values; Determine reference electrical signal values corresponding to the plurality of reference brightness values.
5. The image processing method according to claim 4, characterized in that The clustering process of the brightness value of each pixel in the first image based on the brightness distribution of each pixel in the first image to obtain the multiple reference brightness values includes: determining a second brightness value set from the first brightness value set based on numbers of pixels corresponding to each of the first brightness values in the first image, where the second brightness value set includes a plurality of second brightness values; Based on each of the second brightness values, clustering processing is performed on the brightness value of each pixel in the first image to obtain the multiple reference brightness values.
6. The image processing method according to claim 5, characterized in that: The determining a second brightness value set from the first brightness value set based on numbers of pixels corresponding to the first brightness values in the first image includes: When the difference between a first candidate luminance value in the first luminance value set and each first contrast luminance value is greater than a first reference error, determining the first candidate luminance value to be the second luminance value, wherein, in the first luminance value set, the number of pixels corresponding to the first candidate luminance value is the largest and is not less than a first number threshold, and the number of pixels corresponding to the first contrast luminance value is greater than half the number of pixels corresponding to the first candidate luminance value; The first candidate luminance value is removed from the first luminance value set to obtain an updated first luminance value set, and when the difference between the second candidate luminance value and each second contrast luminance value in the updated first luminance value set is greater than the first reference error, the second candidate luminance value is determined to be the second luminance value; wherein, in the updated first luminance value set, the number of pixels corresponding to the second candidate luminance value is the largest and is not less than a first number threshold, and the number of pixels corresponding to the second contrast luminance value is greater than half of the number of pixels corresponding to the second candidate luminance value.
7. The image processing method according to claim 5, characterized in that: The clustering process of the brightness value of each pixel in the first image based on each second brightness value to obtain the multiple reference brightness values includes: Determining, based on a difference between a brightness value of each pixel in the first image and each second brightness value, at least one brightness value belonging to the same cluster category as each second brightness value; and determining, based on the at least one brightness value belonging to the same cluster category as each second brightness value, a third brightness value set corresponding to each second brightness value; For each second brightness value, a reference brightness value is determined based on an average value of brightness values in a third brightness value set corresponding to the second brightness value.
8. The image processing method according to claim 7, wherein: The determining, based on the difference between the brightness value of each pixel in the first image and each second brightness value, and a second reference error, at least one brightness value belonging to the same cluster category as each second brightness value, comprises: When the difference between the brightness value of the pixel and the target brightness value in each of the second brightness values is less than a second reference error, it is determined that the brightness value of the pixel and the second brightness value belong to the same cluster category; in each of the second brightness values, the difference between the target brightness value and the brightness value of the pixel is the smallest.
9. The image processing method according to claim 7, wherein: The clustering process of the brightness value of each pixel in the first image based on each second brightness value to obtain the multiple reference brightness values further includes: When the differences between the brightness value of the pixel and each of the second brightness values are not less than a second reference error, the brightness value of the pixel is added to the second brightness value set as a newly added second brightness value.
10. The image processing method according to any one of claims 4 to 9, characterized in that: Before determining the reference electrical signal values corresponding to the plurality of reference brightness values, the method further includes: Merge two reference brightness values whose difference between the multiple reference brightness values is smaller than a preset step size.
11. The image processing method according to any one of claims 4 to 9, characterized in that: The determining of the reference electrical signal values corresponding to the plurality of reference brightness values includes: determining a target mapping curve based on a type of a display on which the first image is to be displayed; Based on the target mapping curve, reference electrical signal values corresponding to the plurality of reference brightness values are determined.
12. An image processing system, characterized in that: The image processing system includes a display component and a processing component, wherein: The processing component is configured to obtain a first image to be displayed, perform clustering processing on the brightness value of each pixel in the first image based on the brightness distribution of each pixel in the first image, and determine a reference brightness value set and a reference electrical signal value corresponding to each reference brightness value in the reference brightness value set; the reference electrical signal value corresponding to the reference brightness value is a mapping value of the reference brightness value on a target mapping curve; The display component is configured to convert the brightness values of pixels in the first image based on the reference electrical signal values corresponding to the plurality of reference brightness values, to obtain electrical signal values corresponding to the pixels; The brightness distribution includes a first brightness value set in the first image and a number of pixels in the first image corresponding to each first brightness value in the first brightness value set; The multiple reference brightness values are obtained by clustering the brightness values of each pixel in the first image based on multiple second brightness values; the multiple second brightness values are obtained through multiple rounds of selection from the first brightness value set, and the second brightness value selected in each round is determined by comparing the differences between the candidate brightness values of the current round in the first brightness value set and the contrast brightness values of the current round, all of which are greater than the first reference error; the candidate brightness value of the current round is the first brightness value in the first brightness value set with the largest number of pixels other than the candidate brightness values of the historical round and not less than the first number threshold, and the number of pixels corresponding to the contrast brightness value of the current round is greater than half of the number of pixels corresponding to the candidate brightness value of the current round.
13. An image processing device, characterized in that: include: an acquisition module, configured to acquire a first image to be displayed; a conversion module, configured to convert the brightness value of a pixel in the first image based on reference electrical signal values respectively corresponding to a plurality of reference brightness values in a reference brightness value set, to obtain an electrical signal value corresponding to the pixel; The reference brightness value set is obtained by clustering the brightness values of each pixel in the first image based on the brightness distribution of each pixel in the first image, and the reference electrical signal value corresponding to the reference brightness value is the mapping value of the reference brightness value on the target mapping curve; The brightness distribution includes a first brightness value set in the first image and a number of pixels in the first image corresponding to each first brightness value in the first brightness value set; The multiple reference brightness values are obtained by clustering the brightness values of each pixel in the first image based on multiple second brightness values; the multiple second brightness values are obtained through multiple rounds of selection from the first brightness value set, and the second brightness value selected in each round is determined by comparing the differences between the candidate brightness values of the current round in the first brightness value set and the contrast brightness values of the current round, all of which are greater than the first reference error; the candidate brightness value of the current round is the first brightness value in the first brightness value set with the largest number of pixels other than the candidate brightness values of the historical round and not less than the first number threshold, and the number of pixels corresponding to the contrast brightness value of the current round is greater than half of the number of pixels corresponding to the candidate brightness value of the current round.
14. A computer device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, wherein: When the processor executes the program, the steps of the method according to any one of claims 1 to 11 are implemented.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
16. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instructions are executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
Citation Information
Patent Citations
Method for enhancing luminance uniformity of a display panel
CN110580885A
Display terminal, backlight control method and device and storage medium
CN115775542A
Image brightness correction method and device, equipment and storage medium
CN119136062A