Image correction method, electronic equipment and computer readable storage medium
Through the target color adjustment strategy formed by different preset color adjustment strategies, the original image is adjusted, which solves the problem of single image color adjustment and excessive color replacement in the prior art, and achieves the effect that color blind users can distinguish image colors and the image is natural.
Patent Information
- Application Number
- CN202311304825.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-09
- Publication Date
- 2025-04-11
AI Technical Summary
When adjusting image colors for color blind users, the adjustment method is single, resulting in excessive color replacement and loss of the naturalness of the image.
The target color adjustment strategy formed by different preset color adjustment strategies is adjusted to the original image, allowing color blind users to distinguish the colors in the image and keep the color changes small to improve the naturalness of the image.
It enables color blind users to distinguish image colors while maintaining the naturalness of the image, avoiding image distortion caused by excessive color replacement.
Smart Images

Figure CN119809993A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electronic technology, and in particular to an image correction method, an electronic device and a computer-readable storage medium. Background Art
[0002] In the related art, after a color blind user selects a color blindness type on an electronic device, the existing electronic device determines an indistinguishable initial color and a discernible target color used to replace the initial color according to the color blindness type, establishes a correspondence between the initial color and the target color, and then adjusts the original image according to the correspondence between the initial color and the target color. However, the above method is relatively simple in color adjustment of the original image, and the use of color replacement to adjust the original image results in a large change, which loses the naturalness of the original image. Summary of the invention
[0003] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, one object of the present invention is to provide an image correction method, which can adjust the original image through a target color adjustment strategy formed by different preset color adjustment strategies, so that a color-blind user can distinguish the colors in the original image, and the color changes in the original image are small, so as to improve the naturalness of the original image.
[0004] A second objective of the present invention is to provide an electronic device.
[0005] A third objective of the present invention is to provide a computer-readable storage medium.
[0006] In order to solve the above problems, an embodiment of the first aspect of the present invention provides an image correction method, including: obtaining an original image and a preset color adjustment strategy; obtaining pixel statistical information of the original image; determining a target color adjustment strategy based on the pixel statistical information and the preset color adjustment strategy; adjusting the original image according to the target color adjustment strategy to obtain a target image whose colors can be distinguished by a user.
[0007] According to the image correction method of the embodiment of the present invention, multiple preset color adjustment strategies pre-stored in the electronic device are adjusted through the pixel statistical information of the original image to calculate the target color adjustment strategy, wherein the target color adjustment strategy is the calculated sum of the multiple color adjustment strategies, and then the color of each pixel in the original image is adjusted according to the target color adjustment strategy to obtain the original image that can be distinguished by the color-blind user, instead of directly replacing the colors in the original image that the color-blind user cannot distinguish. Therefore, compared with the existing electronic devices that replace the initial colors, the target color adjustment strategy formed by different preset color adjustment strategies is used in the present application to adjust the original image, so that the color-blind user can distinguish the colors in the original image, and the changes to the colors in the original image are small, so as to improve the naturalness of the original image.
[0008] In some embodiments, the preset color adjustment strategy includes a first color adjustment strategy, which is obtained by the following method: obtaining the coordinate information of the white point in u'v' space, the coordinate information of the pixel to be adjusted in the original image, and the first rotation angle value of the pixel to be adjusted; obtaining the first angle value between the pixel to be adjusted and the white point and the first distance value between the pixel to be adjusted and the white point according to the coordinate information of the white point and the coordinate information of the pixel to be adjusted; obtaining the adjusted coordinate information corresponding to the pixel to be adjusted in the original image according to the coordinate information of the white point, the first rotation angle value, the first angle value and the first distance value.
[0009] In some embodiments, the preset color adjustment strategy includes a second color adjustment strategy, and the second color adjustment strategy is obtained by the following method: performing color clustering on the original image to obtain color classes of pixels in the original image; obtaining coordinate information of the confusion point in u'v' space and coordinate information of the pixel to be adjusted in each color class and a second rotation angle value of the pixel to be adjusted; obtaining a second angle value of the pixel to be adjusted relative to the confusion point and a second distance value from the pixel to be adjusted to the confusion point based on the coordinate information of the confusion point and the coordinate information of the pixel to be adjusted; obtaining the adjusted coordinate information corresponding to the point to be adjusted based on the coordinate information of the confusion point, the second rotation angle value, the second angle value and the second distance value.
[0010] In some embodiments, the preset color adjustment strategy includes a third color adjustment strategy, which is obtained by the following method: obtaining the landing point of the pixel to be adjusted in the original image in the u'v' space; classifying the landing point by color according to the hue to obtain a color class; obtaining the coordinate information of the confusion point in the u'v' space and the coordinate information of the pixel to be adjusted in each of the color classes and the third angle value of the preset confusion line corresponding to the color class in the u'v' space; obtaining the fourth angle value of the pixel to be adjusted in the color class with respect to the confusion point based on the coordinate information of the confusion point and the coordinate information of the pixel to be adjusted in the color class; obtaining the third rotation angle value of the pixel to be adjusted in the color class based on the third angle value and the fourth angle value; obtaining the adjusted coordinate information corresponding to the point to be adjusted in the color class based on the coordinate information of the confusion point, the third rotation angle value, the third angle value and the third distance value.
[0011] In some embodiments, the preset color adjustment strategy includes a fourth color adjustment strategy, and the fourth color adjustment strategy is obtained by the following method: obtaining the color blindness type of a color blind user; obtaining, according to the color blindness type, first color information corresponding to the original image received by the color blind user and second color information lost by the color blind user for the original image; obtaining color compensation information according to the first color information and the second color information; adjusting each pixel to be adjusted in the original image according to the color compensation information to obtain adjusted color information corresponding to the pixel to be adjusted.
[0012] In some embodiments, obtaining pixel statistical information of the original image includes: obtaining at least one of the following: a histogram of the original image in RGB space and Luv space, the coordinates and range of the falling points of the pixels of the original image in the Luv space, and a clustering result of the falling points of the pixels of the original image in the Luv space.
[0013] In some embodiments, a target color adjustment strategy is determined based on the pixel statistical information and a preset color adjustment strategy, including: determining a color distribution scene of the original image based on the pixel statistical information; determining a weight of the preset color adjustment strategy based on the color distribution scene; and obtaining the target color adjustment strategy based on the weight and the preset color adjustment strategy.
[0014] In some embodiments, determining the weight of the preset color adjustment strategy according to the color distribution scenario includes: obtaining the coordinate information of the landing point of the pixel point in the original image in the Luv space; determining the color gamut area of the Luv space and the number of landing points of different color types; calculating the landing point area according to the coordinate information of the landing point; determining the image color distribution according to the landing point area and the color gamut area; determining the weight of the preset color adjustment strategy according to the image color distribution or the number of landing points.
[0015] In some embodiments, the target color adjustment strategy is obtained according to the weight and the preset color adjustment strategy, including: multiplying the result of adjusting the pixels in the original image according to the preset color adjustment strategy by the corresponding weight; and taking the sum of the multiplication results as the target color adjustment strategy.
[0016] In some embodiments, the image correction method further includes: obtaining a clustering result of the points where the pixels of the original image fall in the Luv space; counting the brightness values of different colors in each cluster based on the clustering result; and adjusting the brightness of the pixels in each cluster based on the brightness value.
[0017] In some embodiments, the brightness of pixels within each cluster is adjusted according to the brightness value, including: determining a brightness adjustment amount according to the degree of difference in brightness values of different colors within the cluster; and adjusting the brightness value of the corresponding pixel according to the brightness adjustment amount.
[0018] In some embodiments, the image correction method further includes: obtaining multi-frame pixel statistical information of the current video frame and the previous video frame; judging whether the color distribution scene has changed based on the multi-frame pixel statistical information; if the color distribution scene has changed, adjusting the image correction strategy of the current video frame based on the color distribution scene and the image correction strategy of the previous video frame, wherein the image correction strategy includes a color adjustment strategy and a brightness adjustment strategy.
[0019] In some embodiments, the image correction strategy of the current video frame is adjusted with reference to the image correction strategy of the previous video frame, including: obtaining a reference weight of the image correction strategy of the previous video frame according to the change difference value of the color distribution scene; and obtaining an adjusted image correction strategy of the current video frame according to the reference weight, the image correction strategy of the previous video frame and the image correction strategy of the current video frame.
[0020] A second aspect of the present invention provides an electronic device, comprising: at least one processor; a memory communicatively connected to the at least one processor; the memory storing a computer program executable by the at least one processor, wherein the at least one processor implements the image correction method described in the above embodiment when executing the computer program.
[0021] According to the electronic device of the embodiment of the present invention, by executing the image correction method of the above embodiment, the original image can be adjusted through the target color adjustment strategy formed by different preset color adjustment strategies, so that the color blind user can distinguish the colors in the original image, and the color changes in the original image are small, so as to improve the naturalness of the original image.
[0022] A third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the image correction method described in the above embodiment when executed.
[0023] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0025] Figure 1 is a flow chart of an image correction method according to an embodiment of the present invention;
[0026] Figure 2 is a schematic diagram of an RGB color gamut according to an embodiment of the present invention;
[0027] Figure 3 is a schematic diagram of a first color adjustment strategy according to an embodiment of the present invention;
[0028] Figure 4 is a schematic diagram of a second color adjustment strategy according to an embodiment of the present invention;
[0029] Figure 5 is a schematic diagram of a third color adjustment strategy according to an embodiment of the present invention;
[0030] Figure 6 is a flow chart of an image correction method according to another embodiment of the present invention;
[0031] Figure 7 is a flow chart of an image correction method according to another embodiment of the present invention;
[0032] Figure 8is a flow chart of an image correction method according to another embodiment of the present invention;
[0033] Fig. 9 is a structural block diagram of an electronic device according to an embodiment of the present invention.
[0034] Reference numerals:
[0035] Electronic device 10;
[0036] Processor 1; Memory 2. DETAILED DESCRIPTION
[0037] Embodiments of the present invention are described in detail below. The embodiments described with reference to the accompanying drawings are exemplary. Embodiments of the present invention are described in detail below.
[0038] According to a survey, the proportion of color-blind patients in my country is 5% to 8% among men and 0.5% to 1% among women. Colors that are easy to distinguish for normal people are difficult to distinguish for color-blind patients, which causes them to encounter many troubles in life. Therefore, it is crucial for electronic devices to have the function of adjusting the color of images to be distinguishable by color-blind patients.
[0039] Humans rely on cones on the retina that receive signals of different wavelengths to distinguish colors. The reason why color-blind patients cannot distinguish colors is because their cones are damaged or they lack at least one type of cone. This may be congenital or acquired. Color-blind patients are divided into red-green blindness, green-green blindness and blue-blue blindness. Their abnormal cones are the cones that receive long-wave, medium-wave and short-wave signals respectively.
[0040] In order to solve the above problems, an embodiment of the first aspect of the present invention provides an image correction method, which can be used to adjust the original image through a target color adjustment strategy formed by different preset color adjustment strategies, so that color-blind users can distinguish the colors in the original image, and the color changes in the original image are small, so as to improve the naturalness of the original image.
[0041] Reference below Figure 1 The image correction method according to an embodiment of the present invention is described as follows: Figure 1 As shown, the method at least includes steps S1 to S3.
[0042] Step S1, obtaining an original image and a preset color adjustment strategy.
[0043] Specifically, the electronic device obtains an original image stored therein or captured in real time, and obtains one or more preset color adjustment strategies pre-stored in the electronic device for adjusting the color of the original image.
[0044] Step S2, obtaining pixel statistical information of the original image.
[0045] Specifically, the electronic device obtains pixel statistical information of the original image, wherein the pixel statistical information may be the overall color, brightness, and contrast of the original image, and is not limited thereto.
[0046] Step S3, determining a target color adjustment strategy according to pixel statistical information of the original image and a preset color adjustment strategy.
[0047] Specifically, each preset adjustment strategy is adjusted according to pixel statistics of the original image, such as overall color, and multiple preset color adjustment strategies are strategies obtained according to the type of color blindness, so as to calculate and obtain the target color adjustment strategy.
[0048] Step S4, adjusting the original image according to the target color adjustment strategy to obtain a target image with distinguishable colors for a user.
[0049] Specifically, in the related art, after a color-blind user selects a color-blindness type on an electronic device, the existing electronic device determines an initial color that the color-blind user cannot distinguish and a target color that can be distinguished to replace the initial color according to the color-blindness type, establishes a correspondence between the initial color and the target color, and then adjusts the original image according to the correspondence between the initial color and the target color. However, the above method is relatively simple for adjusting the color of the original image, and the use of color replacement to adjust the original image causes a large change, which loses the naturalness of the original image. In order to solve the above problem, after the color-blind user inputs the color-blindness type through the electronic device, where the color-blindness type includes red blindness, green blindness and blue blindness, etc., the original image is adjusted according to the target color adjustment strategy in the present application, where the target color adjustment strategy is the calculated sum of multiple color adjustment strategies, for example, the target color adjustment strategy is to rotate the pixels around the white point in the original image, adjust the pixels around the white point, adjust the pixels around the blue point, etc. The calculation sum of multiple preset color compensation strategies such as rotation around the confusion point and RGB space color compensation, that is, adjusting the color of each pixel in the original image that the color-blind user cannot distinguish through the target color adjustment strategy to obtain a target image in which the user can distinguish the color, rather than directly replacing the color in the original image that the color-blind user cannot distinguish, and the overall color of different original images, that is, the pixel statistical information is different. The present application adjusts each preset adjustment strategy through the statistical information of the pixel points and calculates different target color adjustment strategies, thereby effectively realizing the color distinction of the original image. Therefore, compared with the existing electronic devices that replace the initial color, the present application adjusts the original image through the target color adjustment strategy formed by different preset color adjustment strategies, so that the color of the original image can be distinguished by the color-blind user, and the color change in the original image is small, so as to improve the naturalness of the original image.
[0050] According to the image correction method of the embodiment of the present invention, multiple preset color adjustment strategies pre-stored in the electronic device are adjusted through the pixel statistical information of the original image to calculate the target color adjustment strategy, wherein the target color adjustment strategy is the calculated sum of the multiple color adjustment strategies, and then the color of each pixel in the original image is adjusted according to the target color adjustment strategy to obtain the original image that can be distinguished by the color-blind user, instead of directly replacing the colors in the original image that the color-blind user cannot distinguish. Therefore, compared with the existing electronic devices that replace the initial colors, the target color adjustment strategy formed by different preset color adjustment strategies is used in the present application to adjust the original image, so that the color-blind user can distinguish the colors in the original image, and the changes to the colors in the original image are small, so as to improve the naturalness of the original image.
[0051] In the embodiment, for different types of color blind patients, there are different confusion points on the u'v' plane, and the points emitted from the confusion points are called confusion lines. Color blind patients cannot distinguish colors with the same brightness on the confusion lines. For example, red color blindness Figure 2 As shown, the confusion point on the coordinate system of the u'v' plane is P (0.678, 0.501). If the line connecting the two colors passes through this point and has the same brightness, red-blind patients cannot distinguish between the two colors.
[0052] In some embodiments, the preset color adjustment strategy includes a first color adjustment strategy, and the first color adjustment strategy is obtained by the following method: obtaining the coordinate information of the white point in the u'v' space, the coordinate information of the pixel to be adjusted in the original image, and the first rotation angle value of the pixel to be adjusted; obtaining the first angle value between the pixel to be adjusted and the white point and the first distance value between the pixel to be adjusted and the white point according to the coordinate information of the white point and the coordinate information of the pixel to be adjusted; obtaining the adjusted coordinate information corresponding to the pixel to be adjusted in the original image according to the coordinate information of the white point, the first rotation angle value, the first angle value and the first distance value.
[0053] Specifically, the first color adjustment strategy, that is, the strategy of rotating the pixel to be adjusted around the white point W, is used when the blue content in the original image is very small. The electronic device obtains the coordinate information of the white point in the u'v' space, the coordinate information of the pixel to be adjusted in the original image, and the first rotation angle value of the pixel to be adjusted, wherein the pixel to be adjusted in the original image is all the pixels in the original image, and the first rotation angle value is the angle value adjusted according to the requirements to rotate the pixel to be adjusted on the same confusion line of different colors to different confusion lines, and the rotation angle direction can be clockwise or counterclockwise, such as Figure 3As shown, the pixel point B to be adjusted and the pixel point A to be adjusted of different colors are on the same confusion line, the pixel point B to be adjusted rotates around the white point W to the position of B', and the pixel point A to be adjusted rotates around the white point W to the position of A'. The adjusted pixel point B' and the pixel point A' to be adjusted are not on the same confusion line, so that the color blind user can distinguish red and green. The first angle value between the pixel point to be adjusted and the white point and the first distance value between the pixel point to be adjusted and the white point are calculated according to the coordinate information of the white point and the coordinate information of the pixel point to be adjusted. Then, the adjusted coordinate information corresponding to the pixel point to be adjusted in the original image is obtained according to the coordinate information of the white point, the first rotation angle value, the first angle value and the first distance value. That is, the coordinate information of the white point (u w , v w ), the first rotation angle value Δθ1, the first angle value θ or1 and the first distance value d1 are substituted into the adjustment formula of the pixel to be adjusted, and the formula is u new =u w +d·cos(θ or1 +Δθ1), and v new =v w +d1·sin(θ or1 +Δθ1) to calculate the adjusted coordinate information (u new , v new ), wherein the adjusted coordinate information is the color of the pixel to be adjusted after adjustment, thereby adjusting the color in the original image to a color that a color-blind user can distinguish. Thus, the color of the pixel to be adjusted in the original image is adjusted by the first color adjustment strategy, and for the original image without blue color, the effect of distinguishing red and green is best.
[0054] It should be noted that, in the first color adjustment strategies corresponding to different color blindness types, the first rotation angle values Δθ1 and the rotation directions corresponding to the pixels to be adjusted are different, and the first rotation angle value Δθ1 and the rotation direction can be preset according to the color blindness type, that is, the first rotation angle values Δθ1 and the rotation directions for the same hue are different for different color blindness types, that is, the first rotation angle values Δθ1 and the rotation directions corresponding to different color blindness types are preset according to the hue, and the pixels of two different colors on the same confusion line are rotated with the first rotation angle value and the rotation direction, so that users of different color blindness types can distinguish the original image, thereby obtaining the corresponding first color adjustment strategy according to the color blindness type.
[0055] In some embodiments, the preset color adjustment strategy includes a second color adjustment strategy, wherein the second color adjustment strategy is a strategy for rotating the pixel to be adjusted around the confusion point, and the second color adjustment strategy is obtained by the following method: first, color clustering is performed on the original image to obtain the color class of the pixel in the original image, for example, the electronic device performs color clustering on the original image through an automatic clustering algorithm such as a k-means clustering algorithm to obtain the color class of the pixel in the original image, wherein the color class can be a blue class, a red class, a green class, etc., for example, divided into Figure 4 The color classes 1, 2 and 3 in the image are selected, and the number of color classes is not limited. The coordinate information of the confusion point in the u'v' space and the coordinate information of the pixel to be adjusted in each color class and the second rotation angle value of the pixel to be adjusted are automatically obtained, wherein the second rotation angle values of the pixel to be adjusted in the same color class are the same and the rotation direction is also the same. For example, if some of the pixel to be adjusted in color class 1 and color class 2 are on the same confusion line, color class 1 is rotated clockwise around the confusion point so that the color blind user can distinguish the colors in the original image. The second angle value of the pixel to be adjusted with respect to the confusion point and the second distance value from the pixel to be adjusted to the confusion point are calculated according to the coordinate information of the confusion point and the coordinate information of the pixel to be adjusted. It should be noted that the coordinates of the confusion point corresponding to different types of color blindness are different. Therefore, the corresponding adjustment parameters, i.e., the second angle value and the second distance value, are obtained according to the type of color blindness. Then, the coordinate information of the confusion point (u p , v p ), the second rotation angle value Δθ2, the second angle value θ or2 Substitute the second distance value d2 into the adjustment formula of the pixel to be adjusted, and the formula is u new =u p +d2·cos(θ or2 +Δθ2), and v new =v p +d2·sin(θ or2 +Δθ2) to calculate the adjusted coordinate information (u new , v new ), wherein the adjusted coordinate information is the color of the pixel to be adjusted after adjustment, thereby adjusting the color in the original image to a color that a color-blind user can distinguish. Thus, the color of the pixel to be adjusted in the original image is adjusted through the second color adjustment strategy, and the change to the original image is small.
[0056] It should be noted that the coordinates of the confusion points corresponding to different types of color blindness are different, and thus the corresponding adjustment parameters obtained according to the color blindness type, i.e., the second angle value and the second distance value, are different, and the second rotation angle value and the rotation direction are determined differently according to the color blindness type. Therefore, the coordinate information of the pixel to be adjusted after adjustment in the second color adjustment strategy is different, that is, the adjustment result of the color of the pixel to be adjusted in the original image is different. In other words, the second color adjustment strategy is determined by the color blindness type so that different color blind users can distinguish the original image.
[0057] In addition, the position and range of each class are obtained according to the color clustering of the original image. The distance and arrangement between each class are different, and the second color adjustment strategy obtained is also different. If all classes are arranged along the direction of the perplexity line, the second color adjustment strategy has a large adjustment range for each class.
[0058] In some embodiments, the preset color adjustment strategy includes a third color adjustment strategy, which is a strategy for rotating the pixel to be adjusted around the confusion point. The third color adjustment strategy is obtained by the following method: the electronic device obtains the falling point of the pixel to be adjusted in the original image in the u'v' space, and classifies the falling point by color according to the hue to obtain the color class, for example, the falling point in the u'v' space is divided into red class 1, green class 2 and blue class 3 according to the hue, that is, Figure 5 The three color classes divided by the three straight lines emitted from point W in the figure can also be further divided into yellow class, cyan class and magenta class. The electronic device obtains the coordinate information of the confusion point in u'v' space and the coordinate information of the pixel to be adjusted in each color class and the third angle value of the preset confusion line corresponding to the color class in u'v' space. The third angle value is the angle between the preset confusion line and the positive direction of the u axis, or the angle of the preset confusion line relative to the confusion point. According to the coordinate information of the confusion point and the coordinate information of the pixel to be adjusted in the color class, the fourth angle value of the pixel to be adjusted in the color class with respect to the confusion point is obtained, wherein the preset confusion line is a confusion line with the best color adjustment effect set according to experience, such as Figure 5 As shown, the preset confusion line corresponding to the red class 1 is line1, the preset confusion line corresponding to the green class 2 is line2, and the preset confusion line corresponding to the blue class 3 is line3. That is to say, for the pixel to be adjusted in the red class 1, it is rotated to the vicinity of line1, for the pixel to be adjusted in the green class 2, it is rotated to the vicinity of line2, and for the pixel to be adjusted in the blue class 3, it is rotated to the vicinity of line3. In addition, the rotation method of the color class can be obtained according to actual calculation, and then the difference between the third angle value and the fourth angle value is calculated, that is, the rotation angle range that the pixel can be adjusted, and then the difference is multiplied by the adjustment ratio to rotate the third rotation angle value of the pixel to be adjusted in the color class within the rotation angle range, wherein the adjustment ratio is less than 1, and then according to the coordinate information of the confusion point (u p , vp ), the third rotation angle value, the fourth angle value and the third distance value d3, to calculate the adjusted coordinate information corresponding to the pixel to be adjusted in the color class, and substitute it into the adjustment formula of the pixel to be adjusted, the formula is u new =u p +d3·cos(θ or4 +Δθ3), v new =v p +d3·sin(θ or4 +Δθ3), wherein the adjusted coordinate information is the color of the pixel to be adjusted after adjustment, thereby adjusting the color in the original image to a color that a color-blind user can distinguish. Thus, the color of the pixel to be adjusted in the original image is adjusted through the third color adjustment strategy, which is suitable for original images with complex colors.
[0059] It should be noted that the coordinate information of the confusion points corresponding to different types of color blindness is different. Therefore, the preset confusion lines corresponding to different color classes are preset according to the color blindness type. Therefore, the coordinate information of the pixel points to be adjusted after adjustment in the third color adjustment strategy is different, that is, the adjustment results of the colors of the pixel points to be adjusted in the original image are different. In other words, the third color adjustment strategy is determined by the color blindness type so that different color blind users can distinguish the original image.
[0060] In some embodiments, the preset color adjustment strategy includes a fourth color adjustment strategy, wherein the fourth color adjustment strategy is a strategy for RGB space color compensation, and the fourth color adjustment strategy is obtained by the following method: the electronic device obtains the color blindness type of the color blind user, obtains the first color information corresponding to the original image received by the color blind user and the second color information lost by the color blind user for the original image according to the color blindness type, the second color information can be calculated according to the first color information of the original image, that is, the second color information can be obtained after performing LMS coordinate processing on the first color information, and then the color compensation information is obtained according to the first color information and the second color information, wherein the color compensation information is the difference between the first color information and the second color information, and each pixel to be adjusted in the original image is adjusted according to the color compensation information. For example, for patients with red color blindness, the red component in the color compensation information is converted to the blue component and the green component, that is, the red component is zero, and then the sum of the first color information of the original image and the color compensation information of each pixel to be adjusted in the adjusted original image is calculated to obtain the adjusted color information corresponding to the pixel to be adjusted. Therefore, the color of the pixel to be adjusted in the original image is adjusted by the fourth color adjustment strategy determined according to the color blindness type, so that users with different color blindness can distinguish the original image, and the strategy is applicable to original images with complex colors.
[0061] It should be noted that color blind patients can choose different modes and different adjustment intensities according to their own needs to achieve the adjustment method that best suits their requirements.
[0062] In some embodiments, obtaining pixel statistical information of the original image includes: obtaining at least one of the following: a histogram of the original image in RGB space and Luv space, the coordinates and range of the falling points of the pixels of the original image in Luv space, and a clustering result of the falling points of the pixels of the original image in Luv space, so as to adjust the original image according to the pixel statistical information.
[0063] In some embodiments, the target color adjustment strategy is determined by the following steps. Specifically, the color distribution scene of the original image is determined according to the pixel statistical information, that is, the color distribution in the original image is judged by the coordinates and range of the pixels of the original image in the Luv space, such as the distribution of red, blue and green in the original image. The weights of different preset color adjustment strategies are determined according to the color distribution scene, that is, for different color distributions of the original image, the proportion of different preset color adjustment strategies in all preset color adjustment strategies is changed, and then the target color adjustment strategy is calculated according to the weight and the preset color adjustment strategy, and then the original image is adjusted according to the target color adjustment strategy. Therefore, in this application, the target color adjustment strategy formed by different preset color adjustment strategies is used to adjust the original image, so that color-blind users can distinguish the colors in the original image, and the color changes in the original image are small, so as to improve the naturalness of the original image. In addition, the weights corresponding to different preset color adjustment strategies can also be set according to actual display effects and actual needs.
[0064] In an embodiment, the point clustering may be performed by automatic clustering, and the color distribution scene may be determined by the position of each class and the distance between classes.
[0065] In some embodiments, the weight of a preset color adjustment strategy is determined according to a color distribution scenario, including: obtaining coordinate information of a landing point of a pixel point in the original image in the Luv space; determining the color gamut area of the Luv space and the number of landing points of different color types; calculating the landing point area according to the coordinate information of the landing point; determining the image color distribution according to the landing point area and the color gamut area; and determining the weight of a preset color adjustment strategy according to the image color distribution or the number of landing points.
[0066] Specifically, the first preset color adjustment strategy is mainly used for the situation where the blue content in the image is relatively large, the second color adjustment strategy is mainly applicable to the situation where the landing point area in the Luv space accounts for a small proportion of the entire color gamut and the boundaries between color classes are clear, the third color adjustment strategy is mainly applicable to the situation where the landing point area accounts for a large proportion of the entire color gamut, and the fourth color adjustment strategy is mainly applicable to the situation where the landing point area accounts for a large proportion of the entire color gamut. Based on this, the electronic device obtains the coordinate information of the landing point of the pixel point in the original image in the Luv space, and determines the color gamut area corresponding to the electronic device display screen in the Luv space and the number of landing points of different color types, that is, the number of all landing points falling into different color types is counted to obtain the number of landing points of different color types, and then the landing point area is calculated according to the coordinate information of the landing point, that is, the standard deviation of all landing points in the original image is calculated, for example, the range of the landing point area in the u direction is expressed as 6u_σ or the range in the v direction is expressed as 6v_σ or expressed as v σ *u_σ, in addition, the area of the landing point can also be calculated by the extreme difference, and then the image color distribution is determined according to the landing point area and the color gamut area, that is, the weight of the preset color adjustment strategy is determined according to the image color distribution or the number of landing points. Thus, for different color distributions in the original image, the weight of the preset color adjustment strategy is set to perform different degrees of color adjustment, so that the original image has good distinction in different color distribution scenes. The weight is any value in the range of 0-1. For example, the weight corresponding to each preset color adjustment strategy is determined by the ratio of the landing point area to the color gamut area. v_σ and u_σ are calculated by the following formulas.
[0067]
[0068]
[0069]
[0070] Exemplarily, the second color adjustment strategy, the third color adjustment strategy and the fourth color adjustment strategy are divided into different ratio ranges of the landing point area to the color gamut area, that is, if the ratio range corresponding to the second color adjustment strategy is the first ratio range, and the ratio range corresponding to the third color adjustment strategy is the second ratio range, and the ratio range corresponding to the fourth color adjustment strategy is the third ratio range, if the calculated landing point area and the color gamut area are in the first ratio range, the second color adjustment strategy sets a larger weight, otherwise a smaller weight is set; or if the calculated landing point area and the color gamut area are in the second ratio range, the third color adjustment strategy sets a larger weight, otherwise a smaller weight is set; or if the calculated landing point area and the color gamut area are in the first ratio range, the fourth color adjustment strategy sets a larger weight, otherwise a smaller weight is set.
[0071] Exemplarily, the three confusion lines preset in the u'v' space divide all the landing points into three color categories: red, green and blue, and then count the number of landing points in the three color categories to determine the proportion of landing points in the blue category to all the landing points in all color categories. The larger the proportion, the smaller the weight of the first color adjustment strategy.
[0072] In some embodiments, a target color adjustment strategy is obtained according to a weight and a preset color adjustment strategy. Specifically, a result after the pixel in the original image is adjusted according to the preset color adjustment strategy is multiplied by the corresponding weight. For example, if the calculated landing area and the color gamut area are in a first ratio range, the weight corresponding to the second color adjustment strategy is 0.4, and the second color adjustment strategy is used to adjust the color of the pixel to be adjusted in the original image to obtain a result adj2 after the second color adjustment strategy is adjusted. The weight corresponding to the third color adjustment strategy is 0.2, and the third color adjustment strategy is used to adjust the color of the pixel to be adjusted in the original image to obtain a third color adjustment strategy. The result adj3 after adjustment by the adjustment strategy, and the weight corresponding to the fourth color adjustment strategy is 0.2, the fourth color adjustment strategy is used to adjust the color of the pixel to be adjusted in the original image to obtain the result adj4 after adjustment by the fourth color adjustment strategy, and the weight corresponding to the first color adjustment strategy is 0.2, the first color adjustment strategy is used to adjust the color of the pixel to be adjusted in the original image to obtain the result adj1 after adjustment by the first color adjustment strategy, and then the result after adjustment by the preset color adjustment strategy is multiplied by the corresponding weight w, and the sum of the multiplication results is used as the target color adjustment strategy color_adj, which can be expressed as color adj =w1*adj1+w2*adj2+w3*adj3+w4*adj4.
[0073] where adj = f adj2 (input img ), input img is the original image.
[0074] In addition, the image correction strategy in this application is suitable for patients with all degrees of red-green blindness, green-green blindness, and blue-blue blindness. Color-blind users can set the color correction type according to their own needs, that is, by setting different preset color adjustment strategies corresponding to the correction weights and overall correction strength, so that the final image presentation effect is more in line with their own preferences.
[0075] In some embodiments, since the colors of pixels in the same class in the original image are very close, the electronic device obtains the clustering results of the points where the pixels of the original image fall in the Luv space by adjusting the brightness values of the pixels in the original image to distinguish different colors of the same brightness within the class. For example, the electronic device performs color clustering on the original image through an automatic clustering algorithm such as a k-means clustering algorithm to obtain the clustering results of the points where the pixels of the original image fall in the Luv space, wherein the clustering results may be three clusters of blue, red, and green, and the brightness values of different colors in each cluster are counted according to the clustering results, wherein the brightness value corresponding to the pixel is L representing the brightness value in the coordinate information in the Luv space, or the three channels of RGB are weighted according to a certain ratio to obtain the brightness value of the pixel, the brightness values of different colors in each cluster are compared, and then the brightness of the pixels in each cluster are adjusted according to the brightness value to enhance the contrast of the brightness of different colors in the cluster, so that color-blind users can distinguish the colors of the same cluster.
[0076] In addition, the brightness of the pixels in the color classes divided by the hue can also be adjusted to enhance the contrast of the brightness of different colors in the cluster, so that color-blind users can distinguish the colors of the same cluster. In this application, the color adjustment is applied between classes to make different classes at different confusion lines, while the brightness adjustment is applied within the class to distinguish different colors at the same brightness within the class, and the change in color and brightness is obtained through the statistical information of a single frame image, wherein the color adjustment is performed in the u'v' plane of the CIE1976 Luv color space, and the brightness adjustment is performed in the L axis of the Lu'v' space.
[0077] In some embodiments, the brightness of the pixels in each cluster is adjusted according to the brightness value, that is, the degree of difference between the different colors in the cluster is determined according to the brightness values of the different colors in the cluster, and then the brightness adjustment amount is determined according to the degree of difference, that is, if the degree of difference between the different colors in the cluster is small, a larger brightness adjustment amount is used to increase the degree of difference between the different colors in the cluster, and then the brightness value of the pixel corresponding to the brightness adjustment amount is adjusted, for example, the brightness value of the pixel is increased or decreased, that is, the positive or negative brightness adjustment amount, and the larger the pixel value before adjustment, the larger the pixel value after adjustment, and vice versa, the smaller the pixel value before adjustment, the smaller the pixel value after adjustment, so as to enhance the contrast of the brightness of different colors in the cluster, and the distinction of different colors is increased, so that color-blind users can distinguish the colors of the same cluster. In addition, if the degree of difference between different colors in the cluster is large, there is no need to adjust the brightness of the pixels in each cluster.
[0078] In some embodiments, when playing a video through a video signal, the electronic device needs to meet the real-time and continuity of the video playback, and judge whether the color distribution scene has changed through the multi-frame pixel point statistics of the current video frame and the previous video frame, where the previous video frame can be the previous few video frames and the previous video frame, to determine the image correction strategy of the current video frame, thereby improving the continuity of the video playback. The multi-frame pixel point statistics of the current video frame and the previous video frame are obtained through the histogram of the original image in the RGB space and the Luv space, that is, the pixel value change of the current video frame and the previous video frame is obtained, and then according to the multi-frame pixel point statistics Determine whether the color distribution scene has changed, that is, determine whether the brightness and color of the original image have changed based on the statistical information of multiple frames of pixel points. If the color distribution scene has changed, adjust the image correction strategy of the current video frame based on the color distribution scene and the image correction strategy of the previous video frame, wherein the image correction strategy includes a color adjustment strategy and a brightness adjustment strategy, that is, recalculate the image correction strategy of the current video frame based on the color distribution scene and with reference to the previous video frame, thereby improving the real-time and continuity of video playback, and calculate the image correction strategy of the current video frame based on the previous video frame, thereby achieving smooth transition between frames and avoiding flickering problems in video frames. In addition, if the color distribution scene has not changed, the image correction strategy corresponding to the previous video frame is used as the image correction strategy of the current video frame.
[0079] In some embodiments, the image correction strategy of the current video frame is adjusted with reference to the image correction strategy of the previous video frame, including: taking the average of the absolute difference between the pixel values of each pixel in the current video frame and the previous video frame to obtain a change difference value of the color distribution scene, and then obtaining a reference weight of the image correction strategy of the previous video frame according to the change difference value. Since the larger the change difference value is, the greater the change of the current video frame compared with the previous video frame is, the reference of the previous video frame is smaller at this time, and therefore the reference weight of the image correction strategy of the previous video frame is smaller. Conversely, the smaller the change difference value is, the reference weight of the image correction strategy of the previous video frame is determined, and then the reference weight k, the image correction strategy ADJ of the previous video frame are determined according to the reference weight k and the image correction strategy ADJ of the previous video frame. pre And the image correction strategy ADJ of the current video frame cur , where ADJ cur The image correction strategy ADJ is obtained by calculating the pixel statistical information to calculate the adjusted image correction strategy ADJ of the current video frame. final , such as expressed as ADJ final =(1-k)×ADJ cur +k×ADJ pre. Therefore, in the present application, the image correction strategy of the current video frame is calculated according to the image correction strategy of the previous video frame and its reference weight, thereby improving the real-time and continuity of video playback, and the image correction strategy of the current video frame is calculated according to the previous video frame, thereby achieving smooth color transition between frames, avoiding the flickering problem of video frames, meeting the real-time and continuity of the video, reducing the computing time, and the image correction strategy has less effect on the color change in the original image, so as to improve the naturalness of the original image.
[0080] Reference below Figure 6 The image correction method of an embodiment of the present invention is illustrated by way of example, and the specific contents are as follows.
[0081] Step S5, inputting the original image.
[0082] Step S6, calculate the pixel statistical information of the original image, wherein the pixel statistical information at least includes the coordinate information of the landing point of the pixel in the original image in the Luv space, and execute step S7, step S8 and step S9.
[0083] Step S7: the first color adjustment strategy is a strategy of rotating the pixel to be adjusted around the white point W.
[0084] Step S8: The second color adjustment strategy and the third color adjustment strategy are both strategies for rotating the pixel to be adjusted around the confusion point.
[0085] Step S9: The fourth color adjustment strategy is a strategy of RGB space color compensation.
[0086] Step S10, obtaining a target color adjustment strategy through weights and results corresponding to the first color adjustment strategy, the second color adjustment strategy, the third color adjustment strategy, and the fourth color adjustment strategy.
[0087] Therefore, in the present application, a target color adjustment strategy formed by multiple preset color adjustment strategies is used to adjust the original image so that color-blind users can distinguish the colors in the original image, and the color changes in the original image are small, so as to improve the naturalness of the original image.
[0088] Reference below Figure 7 The image correction method of an embodiment of the present invention is illustrated by way of example, and the specific contents are as follows.
[0089] Step S11, input the current video frame and the previous video frame.
[0090] Step S12, calculating statistical information of pixels of multiple frames.
[0091] Step S13, determining whether the color distribution scene has changed, if so, executing step S15, otherwise, executing step S14.
[0092] Step S14: the image correction strategy of the current video frame is adjusted to the image correction strategy of the previous video frame.
[0093] Step S15, based on the reference weight k and the image correction strategy ADJ of the previous video frame pre And the image correction strategy ADJ of the current video frame cur , that is, the reference weight k, the image correction strategy ADJ of the previous video frame pre And the image correction strategy ADJ of the current video frame cur Substitute into the formula ADJ final =(1-k)×ADJ cur +k×ADJ pre , to calculate the image correction strategy ADJ for the current video frame final .
[0094] Therefore, in the present application, the image correction strategy of the current video frame is calculated based on the image correction strategy of the previous video frame and its reference weight, thereby improving the real-time and continuity of video playback, and the image correction strategy of the current video frame is calculated based on the previous video frame, thereby achieving smooth transition between frames and avoiding flickering problems in video frames.
[0095] Reference below Figure 8 The image correction method of an embodiment of the present invention is illustrated by way of example, and the specific contents are as follows.
[0096] Step S16, inputting the original image.
[0097] Step S17, obtaining pixel statistical information of the original image.
[0098] Step S18, calculate the adaptive adjustment parameters corresponding to the preset color adjustment strategies, namely, the first rotation angle value and rotation direction corresponding to the first color adjustment strategy; and the second rotation angle value and rotation direction corresponding to the second color adjustment strategy; and the preset confusion line, third rotation angle value and rotation direction corresponding to the second color adjustment strategy; and the color compensation information corresponding to the fourth color adjustment strategy.
[0099] Step S19, obtaining the target color adjustment strategy, that is, obtaining the weight corresponding to each color adjustment strategy through pixel statistical information, and obtaining the target color adjustment strategy through the weights corresponding to the first color adjustment strategy, the second color adjustment strategy, the third color adjustment strategy and the fourth color adjustment strategy and the results.
[0100] Step S20, adjusting the color of each pixel in the original image that cannot be distinguished by the color-blind user through the target color adjustment strategy, so as to obtain a corrected target image with distinguishable colors for the user.
[0101] Therefore, in the present application, a target color adjustment strategy formed by multiple preset color adjustment strategies is used to adjust the original image so that color-blind users can distinguish the colors in the original image, and the color changes in the original image are small, so as to improve the naturalness of the original image.
[0102] A second aspect of the present invention provides an electronic device 10, such as Fig. 9 As shown, the electronic device 10 includes: at least one processor 1 and a memory 2 communicatively connected to the at least one processor 1 .
[0103] The memory 2 stores a computer program that can be executed by at least one processor 1 , and when the at least one processor 1 executes the computer program, the image correction method of the above embodiment is implemented.
[0104] According to the electronic device of the embodiment of the present invention, by executing the image correction method of the above embodiment, the original image can be adjusted through the target color adjustment strategy formed by different preset color adjustment strategies, so that the color blind user can distinguish the colors in the original image, and the color changes in the original image are small, so as to improve the naturalness of the original image.
[0105] A third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed, implements the image correction method of the above embodiment.
[0106] In the description of this specification, any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code including one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.
[0107] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0108] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0109] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0110] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0111] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
[0112] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example.
[0113] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. An image correction method, characterized in that: include: Get the original image and preset color adjustment strategy; Obtaining pixel statistical information of the original image; Determine a target color adjustment strategy according to the pixel statistical information and a preset color adjustment strategy; The original image is adjusted according to the target color adjustment strategy to obtain a target image whose colors can be distinguished by a user.
2. The image correction method according to claim 1, characterized in that: The preset color adjustment strategy includes a first color adjustment strategy, and the first color adjustment strategy is obtained by the following method: Acquire the coordinate information of the white point in u'v' space, the coordinate information of the pixel to be adjusted in the original image, and the first rotation angle value of the pixel to be adjusted; Obtaining a first angle value between the pixel point to be adjusted and the white point and a first distance value between the pixel point to be adjusted and the white point according to the coordinate information of the white point and the coordinate information of the pixel point to be adjusted; The adjusted coordinate information corresponding to the pixel point to be adjusted in the original image is obtained according to the coordinate information of the white point, the first rotation angle value, the first angle value and the first distance value.
3. The image correction method according to claim 1, characterized in that: The preset color adjustment strategy includes a second color adjustment strategy, and the second color adjustment strategy is obtained by the following method: Performing color clustering on the original image to obtain color classes of pixels in the original image; Obtaining coordinate information of the u'v' space confusion point and coordinate information of the pixel to be adjusted in each color class and a second rotation angle value of the pixel to be adjusted; Obtaining a second angle value of the pixel to be adjusted relative to the confusion point and a second distance value from the pixel to be adjusted to the confusion point according to the coordinate information of the confusion point and the coordinate information of the pixel to be adjusted; The adjusted coordinate information corresponding to the point to be adjusted is obtained according to the coordinate information of the confusing point, the second rotation angle value, the second angle value and the second distance value.
4. The image correction method according to claim 1, characterized in that: The preset color adjustment strategy includes a third color adjustment strategy, and the third color adjustment strategy is obtained by the following method: Obtaining the falling point of the pixel to be adjusted in the original image in the u'v' space; Color classifying the landing points according to hue to obtain color classes; Obtaining coordinate information of the confusion point in u'v' space and coordinate information of the pixel point to be adjusted in each color class and a third angle value of the preset confusion line corresponding to the color class in u'v' space; Obtaining a fourth angle value of the pixel to be adjusted in the color class relative to the confusion point according to the coordinate information of the confusion point and the coordinate information of the pixel to be adjusted in the color class; Obtaining a third rotation angle value of the pixel to be adjusted in the color class according to the third angle value and the fourth angle value; The adjusted coordinate information corresponding to the point to be adjusted in the color class is obtained according to the coordinate information of the confusing point, the third rotation angle value, the third angle value and the third distance value.
5. The image correction method according to claim 1, characterized in that: The preset color adjustment strategy includes a fourth color adjustment strategy, and the fourth color adjustment strategy is obtained by the following method: Get the color blindness type of color blind users; Obtaining, according to the color blindness type, first color information corresponding to the original image received by the color blind user and second color information lost by the color blind user for the original image; Obtaining color compensation information according to the first color information and the second color information; Each pixel to be adjusted in the original image is adjusted according to the color compensation information to obtain adjusted color information corresponding to the pixel to be adjusted.
6. The image correction method according to any one of claims 1 to 5, characterized in that: Obtaining pixel statistical information of the original image, including: Obtain at least one of the histogram of the original image in the RGB space and the Luv space, the coordinates and range of the points where the pixels of the original image fall in the Luv space, and the clustering results of the points where the pixels of the original image fall in the Luv space.
7. The image correction method according to claim 6, characterized in that: Determining a target color adjustment strategy according to the pixel point statistical information and a preset color adjustment strategy includes: Determine the color distribution scene of the original image according to the pixel statistical information; Determining a weight of the preset color adjustment strategy according to the color distribution scenario; The target color adjustment strategy is obtained according to the weight and the preset color adjustment strategy.
8. The image correction method according to claim 7, characterized in that: Determining the weight of the preset color adjustment strategy according to the color distribution scenario includes: Obtaining coordinate information of the falling point of the pixel point in the original image in the Luv space; Determine the color gamut area of the Luv space and the number of points where different color types fall; Calculate the area of the landing point according to the coordinate information of the landing point; Determine the image color distribution according to the landing point area and the color gamut area; The weight of the preset color adjustment strategy is determined according to the image color distribution or the number of the landing points.
9. The image correction method according to claim 8, characterized in that: Obtaining the target color adjustment strategy according to the weight and the preset color adjustment strategy includes: Multiplying the pixel points in the original image after being adjusted according to the preset color adjustment strategy by the corresponding weight; The sum of the multiplication results is used as the target color adjustment strategy.
10. The image correction method according to claim 7, characterized in that: The image correction method further comprises: Obtaining a clustering result of the points where the pixels of the original image fall in the Luv space; Counting the brightness values of different colors in each cluster according to the clustering results; The brightness of the pixels in each cluster is adjusted according to the brightness value.
11. The image correction method according to claim 10, characterized in that: Adjusting the brightness of pixels in each cluster according to the brightness value includes: Determining the degree of difference between different colors in the cluster according to the brightness values of different colors in the cluster; Determining a brightness adjustment amount according to the degree of difference; The brightness value of the corresponding pixel point is adjusted according to the brightness adjustment amount.
12. The image correction method according to claim 11, characterized in that: The image correction method further comprises: Get multi-frame pixel statistics of the current video frame and the previous video frame; Determining whether the color distribution scene has changed according to the multi-frame pixel statistical information; If the color distribution scene changes, the image correction strategy of the current video frame is adjusted according to the color distribution scene and the image correction strategy of the previous video frame, wherein the image correction strategy includes a color adjustment strategy and a brightness adjustment strategy.
13. The image correction method according to claim 12, characterized in that: Adjusting the image correction strategy of the current video frame with reference to the image correction strategy of the previous video frame includes: Obtaining a reference weight of the image correction strategy of the previous video frame according to the change difference value of the color distribution scene; An adjusted image correction strategy for the current video frame is obtained according to the reference weight, the image correction strategy for the previous video frame and the image correction strategy for the current video frame.
14. An electronic device, characterized in that: include: at least one processor; a memory communicatively coupled to the at least one processor; The memory stores a computer program that can be executed by the at least one processor, and when the at least one processor executes the computer program, the image correction method described in any one of claims 1 to 13 is implemented.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed, the image correction method described in any one of claims 1 to 13 is implemented.