Image processing method and device, equipment and medium
By determining and smoothly connecting the auxiliary points and transition curves of the color mapping curve in image processing, the problem of poor image color tone effect is solved, and a more natural color transition effect is achieved.
Patent Information
- Application Number
- CN202410063905.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-16
- Publication Date
- 2025-07-18
AI Technical Summary
The existing image color adjustment effect is poor, especially when there are abrupt bend angles at the transitions of different color areas of the image, resulting in unsmooth and natural color adjustment.
By obtaining the color mapping curves of multiple target color areas of the image to be processed, the first mapping curve and the second mapping curve to be transitioned are determined, and the first auxiliary point and the second auxiliary point are determined on these curves, the transition curve between them is obtained, and the color adjustment is smoothly connected by using the cubic polynomial function to ensure that the slope of the transition curve is consistent with the original mapping curve.
It realizes a smooth and natural transition of image color adjustment, improves the color tone effect, and avoids the abrupt feeling between color areas.
Smart Images

Figure CN120343174A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technologies, and in particular, to an image processing method, apparatus, device, and medium. Background Art
[0002] Currently, post-color adjustment processing of images is required in many scenarios. For example, a user needs to adjust the color of an image obtained by shooting, or a film and television producer needs to perform post-color adjustment on a video so that the overall color style of the picture meets the requirements. However, the existing color adjustment effect is not good. Summary of the Invention
[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides an image processing method, apparatus, device, and medium.
[0004] An embodiment of the present disclosure provides an image processing method, the method including: obtaining color mapping curves corresponding to a plurality of target color regions of an image to be processed; wherein the color mapping curve is used to represent a mapping relationship between a pre-adjustment color value and a post-adjustment color value corresponding to the target color region; determining a first mapping curve and a second mapping curve to be transitioned from the color mapping curves, and determining a first auxiliary point located on the first mapping curve and a second auxiliary point located on the second mapping curve; obtaining a transition curve between the first auxiliary point and the second auxiliary point; and performing color adjustment processing on the image to be processed based on the first mapping curve, the second mapping curve, and the transition curve to obtain a target image.
[0005] Optionally, the obtaining the transition curve between the first auxiliary point and the second auxiliary point includes: obtaining information of the first auxiliary point based on the first mapping curve; wherein the information of the first auxiliary point includes a pre-adjustment color value and a post-adjustment color value corresponding to the first auxiliary point, and a slope of the first auxiliary point on the first mapping curve; obtaining information of the second auxiliary point based on the second mapping curve; wherein the information of the second auxiliary point includes a pre-adjustment color value and a post-adjustment color value corresponding to the second auxiliary point, and a slope of the second auxiliary point on the second mapping curve; and determining the transition curve between the first auxiliary point and the second auxiliary point according to the information of the first auxiliary point and the information of the second auxiliary point.
[0006] Optionally, a slope of the first auxiliary point on the transition curve is the same as a slope of the first auxiliary point on the first mapping curve, and a slope of the second auxiliary point on the transition curve is the same as a slope of the second auxiliary point on the second mapping curve.
[0007] Optionally, determining the first auxiliary point located on the first mapping curve and the second auxiliary point located on the second mapping curve includes: obtaining the boundary information between the first mapping curve and the second mapping curve; determining the first auxiliary point located on the first mapping curve and the second auxiliary point located on the second mapping curve based on the boundary information and a preset threshold.
[0008] Optionally, there is a target intersection point between the first mapping curve and the second mapping curve; the boundary information includes the pre-adjustment color value corresponding to the target intersection point.
[0009] Optionally, determining the first auxiliary point located on the first mapping curve and the second auxiliary point located on the second mapping curve based on the boundary information and a preset threshold includes: determining the first auxiliary point located on the first mapping curve based on the difference between the pre-adjustment color value corresponding to the target intersection point and the preset threshold; determining the second auxiliary point located on the second mapping curve based on the sum of the pre-adjustment color value corresponding to the target intersection point and the preset threshold; wherein, the pre-adjustment color values of the target color region corresponding to the first mapping curve are all not greater than the pre-adjustment color values of the target color region corresponding to the second mapping curve.
[0010] Optionally, determining the first auxiliary point located on the first mapping curve based on the difference between the pre-adjustment color value corresponding to the target intersection point and the preset threshold includes: when the difference between the pre-adjustment color value corresponding to the target intersection point and the preset threshold is greater than a preset minimum color value, using the difference as the pre-adjustment color value corresponding to the first auxiliary point; when the difference between the pre-adjustment color value corresponding to the target intersection point and the preset threshold is not greater than the minimum color value, using the minimum color value as the pre-adjustment color value corresponding to the first auxiliary point; determining the first auxiliary point on the first mapping curve based on the pre-adjustment color value corresponding to the first auxiliary point.
[0011] Optionally, determining the second auxiliary point located on the second mapping curve based on the sum of the pre-adjustment color value corresponding to the target intersection point and the preset threshold includes: when the sum of the pre-adjustment color value corresponding to the target intersection point and the preset threshold is less than a preset maximum color value, using the sum as the pre-adjustment color value corresponding to the second auxiliary point; when the sum of the pre-adjustment color value corresponding to the target intersection point and the preset threshold is not less than the maximum color value, using the maximum color value as the pre-adjustment color value corresponding to the second auxiliary point; determining the second auxiliary point on the second mapping curve based on the pre-adjustment color value corresponding to the second auxiliary point.
[0012] Optionally, the first mapping curve and the third mapping curve have a first intersection point, the second mapping curve and the third mapping curve have a second intersection point, and the difference between the pre-adjustment color values corresponding to the first intersection point and the pre-adjustment color values corresponding to the second intersection point is less than the preset threshold; the demarcation information includes the pre-adjustment color values corresponding to the first intersection point and the pre-adjustment color values corresponding to the second intersection point.
[0013] Optionally, the determining the first auxiliary point on the first mapping curve and the second auxiliary point on the second mapping curve based on the demarcation information and the preset threshold includes: determining the first auxiliary point on the first mapping curve based on the difference between the pre-adjustment color value corresponding to the first intersection point and the preset threshold; determining the second auxiliary point on the second mapping curve based on the sum of the pre-adjustment color value corresponding to the second intersection point and the preset threshold; wherein, the pre-adjustment color values of the target color area corresponding to the first mapping curve are not greater than the pre-adjustment color values of the target color area corresponding to the second mapping curve.
[0014] Optionally, the obtaining the color mapping curves corresponding to multiple target color areas of the image to be processed includes: determining multiple target color areas corresponding to the image to be processed based on the pixel values of the image to be processed; obtaining the color adjustment intensity set by the user, so as to obtain the color mapping curves corresponding to the multiple target color areas based on the color adjustment intensity and the preset color mapping method.
[0015] An embodiment of the present disclosure further provides an image processing apparatus, including: a mapping curve obtaining module, configured to obtain color mapping curves corresponding to multiple target color areas of an image to be processed; wherein, the color mapping curve is used to represent the mapping relationship between the pre-adjustment color value and the post-adjustment color value corresponding to the target color area; an auxiliary point determining module, configured to determine a first mapping curve and a second mapping curve to be transitioned from the color mapping curves, and determine a first auxiliary point on the first mapping curve and a second auxiliary point on the second mapping curve; a transition curve obtaining module, configured to obtain a transition curve between the first auxiliary point and the second auxiliary point; a color adjustment module, configured to perform color adjustment processing on the image to be processed based on the first mapping curve, the second mapping curve, and the transition curve to obtain a target image.
[0016] An embodiment of the present disclosure further provides an electronic device, the electronic device includes: a processor; a memory for storing executable instructions of the processor; the processor is configured to read the executable instructions from the memory and execute the instructions to implement the image processing method provided by the embodiment of the present disclosure.
[0017] An embodiment of the present disclosure also provides a computer-readable storage medium storing a computer program for executing the image processing method provided by the embodiment of the present disclosure.
[0018] The above technical solution provided by the embodiment of the present disclosure can determine a first mapping curve and a second mapping curve to be transitioned from the color mapping curves corresponding to multiple target color regions of the image to be processed, and determine a first auxiliary point on the first mapping curve and a second auxiliary point on the second mapping curve, and then obtain a transition curve between the first auxiliary point and the second auxiliary point. Then, based on the first mapping curve, the second mapping curve, and the transition curve, color adjustment processing is performed on the image to be processed. The above method can use the first auxiliary point on the first mapping curve and the second auxiliary point on the second mapping curve to determine the transition curve between the first mapping curve and the second mapping curve, so as to smoothly connect the first mapping curve and the second mapping curve with the help of the transition curve, thereby helping to present a smoother and more natural color adjustment effect.
[0019] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure and used together with the specification to explain the principles of the present disclosure.
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0022] Figure 1 It is a schematic flowchart of an image processing method provided by an embodiment of the present disclosure;
[0023] Figure 2 It is a schematic diagram of a color mapping curve provided by an embodiment of the present disclosure;
[0024] Figure 3 It is a schematic diagram of a color mapping curve provided by an embodiment of the present disclosure;
[0025] Figure 4 It is a schematic diagram of a color mapping curve provided by an embodiment of the present disclosure;
[0026] Figure 5Schematic structural diagram of an image processing apparatus provided by an embodiment of the present disclosure;
[0027] Figure 6 Schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners
[0028] In order to more clearly understand the above objects, features, and advantages of the present disclosure, the solutions of the present disclosure will be further described below. It should be noted that, without conflict, the embodiments of the present disclosure and the features in the embodiments may be combined with each other.
[0029] Many specific details are set forth in the following description in order to provide a thorough understanding of the present disclosure, but the present disclosure may be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only a part of the embodiments of the present disclosure, rather than all the embodiments.
[0030] Figure 1 Schematic flowchart of an image processing method provided by an embodiment of the present disclosure. This method can be executed by an image processing apparatus, where the apparatus can be implemented by software and / or hardware and is generally integrated in an electronic device. As Figure 1 shown, this method mainly includes the following steps S102 to step S108:
[0031] Step S102, obtaining color mapping curves corresponding to multiple target color regions of an image to be processed; wherein, the color mapping curve is used to represent the mapping relationship between the pre-adjustment color value and the post-adjustment color value corresponding to the target color region.
[0032] Any image that needs to adjust colors can be used as the image to be processed. When performing step S102, multiple target color regions corresponding to the image to be processed can be determined first. The color value range corresponding to different color regions is different, and can be specifically divided according to pixel values, that is, multiple target color regions corresponding to the image to be processed can be determined based on the pixel values of the image to be processed. For example, the pixel value range of the image to be processed is 0-255. In some embodiments, it can be directly considered that the total color value range of all target color regions of the image to be processed is 0-255, and divided according to requirements. For example, the color value range of the first target color region is 0-M, the color value range of the second target color region is M-N, and the color value range of the third target color region is N-255, where M and N can be set according to requirements. In other embodiments, the pixel value range can also be mapped first. For example, 0-255 is mapped to 0-1. At this time, the color value range of the first target color region is 0-M, the color value range of the second target color region is M-N, and the color value range of the third target color region is N-1. The mapping relationship between the above pixel values and color values, as well as M and N, can be flexibly set according to needs and are not limited here.
[0033] The color adjustment methods for different target color regions are different. Each target color region corresponds to a corresponding color mapping curve. The color mapping curve can be a linear mapping or a non-linear mapping, and can be specifically flexibly set according to the color value range of the target color region. For example, the color mapping curves corresponding to the target color regions with relatively low overall color value range and relatively high overall color value range can be directly linear mappings, and the color mapping curves corresponding to the remaining target color regions can be non-linear mappings, etc., so as to provide a better color adjustment visual experience for users. In addition, the user can also set the color adjustment intensity according to needs, that is, the color adjustment intensity is an adjustment parameter open to the user. In practical applications, the RGB channels of different target color regions can each have their own color adjustment intensity. On this basis, the color adjustment intensity set by the user can be obtained first, so as to obtain the color mapping curves corresponding to each of the multiple target color regions based on the color adjustment intensity and the preset color mapping method. The color mapping method in the embodiments of the present disclosure is not limited. The color mapping method can be implemented based on existing color mapping methods, such as color mapping based on the Log color wheel. Among them, the color wheel is an operation method for adjusting the color of an image by interacting in the shape of a "wheel", and the underlying layer still performs color mapping on the RGB channels according to a designed algorithm.
[0034] For the convenience of understanding the color mapping curve corresponding to the target color region, reference can be made to Figure 2A schematic diagram of a color mapping curve is shown. In this figure, three target color regions are used as examples for illustration. Therefore, there are three segments of color mapping curves, namely L1L2, L2L3, and L3L4. Among them, Figure 2 the abscissa x in Figure 2 represents the color value before adjustment, and the ordinate y represents the color value after adjustment. The range of the color value before adjustment of the target color region corresponding to the color mapping curve L1L2 is 0 to 0.3, and the overall range of the color value before adjustment of this target color region is relatively low; the range of the color value before adjustment of the target color region corresponding to the color mapping curve L2L3 is 0.3 to 0.7, and the overall range of the color value before adjustment of this target color region is medium; the range of the color value before adjustment of the target color region corresponding to the color mapping curve L3L4 is 0.7 to 1, and the overall range of the color value before adjustment of this target color region is relatively high. It should be noted that the above is only a division method. In practical applications, the number of target color regions to be divided and the corresponding range of the color value before adjustment can also be flexibly set according to needs, and no limitation is made here.
[0035] In addition, for an image, it usually has three color channels: RGB. For each color channel, based on the pixel value corresponding to the color channel, multiple target color regions corresponding to the color channel can be determined, and the color mapping curve of each target color region corresponding to the color channel can be obtained.
[0036] Step S104, determine the first mapping curve and the second mapping curve to be transitioned from the color mapping curves, and determine the first auxiliary point located on the first mapping curve and the second auxiliary point located on the second mapping curve.
[0037] It can be understood that the color mapping curves of different target color regions are different, that is, the color adjustments of different target color regions are independent of each other and do not affect other regions. Therefore, when adjacent target color regions are connected, it is relatively abrupt and cannot achieve a smooth transition effect. As Figure 2 shown, there are obvious "bending angles" in the color mapping curves corresponding to the three target color regions, and the connectivity is poor, which will also lead to poor color adjustment effects of the image. For this reason, the embodiments of the present disclosure will perform transitions on the color mapping curves corresponding to each target color region. When determining the first mapping curve and the second mapping curve to be transitioned from the color mapping curves, any two adjacent mapping curves with intersections can be used as the first mapping curve and the second mapping curve respectively. For example, Figure 2L1L2 and L2L3 in it are used as mapping curves to be transitioned. Specifically, L1L2 is the first mapping curve and L2L3 is the second mapping curve. Additionally, L2L3 and L3L4 can be used as mapping curves to be transitioned simultaneously. In this case, L2L3 is the first mapping curve and L3L4 is the second mapping curve. Moreover, there may be other shorter mapping curves between the first mapping curve and the second mapping curve to be transitioned. For example, when L2L3 corresponding to some images is short, that is, the range of the pre-adjustment color value area of the target color area corresponding to L2L3 is small, L1L2 and L3L4 can also be directly used as mapping curves to be transitioned. Specifically, L1L2 is the first mapping curve and L3L4 is the second mapping curve. Then, the transition curve between L1L2 and L3L4 can be directly used to replace L2L3.
[0038] After determining the first mapping curve and the second mapping curve, auxiliary points on them can be determined respectively to determine the transition curve based on the auxiliary points. Among them, the first auxiliary point and the second auxiliary point can be used as the two endpoints of the transition curve. For easy understanding, reference can be made to Figure 3 the schematic diagram of the color mapping curve shown. When L1L2 is the first mapping curve and L2L3 is the second mapping curve, P1 is the first auxiliary point and P2 is the second auxiliary point. When L2L3 is the first mapping curve and L3L4 is the second mapping curve, P3 is the first auxiliary point and P4 is the second auxiliary point. The method of determining the first auxiliary point and the second auxiliary point can be set flexibly. For example, the auxiliary points on the first mapping curve and the second mapping curve can be randomly determined within a preset range, and the interval between the first auxiliary point and the second auxiliary point is restricted not to exceed a preset threshold. Or the horizontal distance between the first auxiliary point and a specified point (such as the intersection point of the first mapping curve and the second mapping curve) is set to be equal to the horizontal distance between the second auxiliary point and the specified point (such as the intersection point of the first mapping curve and the second mapping curve), and this horizontal distance can be a preset value.
[0039] Step S106, obtain the transition curve between the first auxiliary point and the second auxiliary point.
[0040] Take the first auxiliary point and the second auxiliary point as the two endpoints of the transition curve. The color values before adjustment (i.e., the x - coordinates) and the color values after adjustment (i.e., the y - coordinates) corresponding to the first auxiliary point and the second auxiliary point are both known. And since the first mapping curve and the second mapping curve are both determined, the slopes corresponding to the first auxiliary point and the second auxiliary point are also known. On this basis, the transition curve between the first auxiliary point and the second auxiliary point can be flexibly determined according to requirements. To ensure a smooth connection effect, it can be constrained that the slope of the first auxiliary point on the transition curve is the same as the slope of the first auxiliary point on the first mapping curve, and the slope of the second auxiliary point on the transition curve is the same as the slope of the second auxiliary point on the second mapping curve. The transition curve obtained in the above - mentioned way can smoothly connect the first mapping curve and the second mapping curve. For easy understanding, reference can be made to Figure 4 the schematic diagram of the color mapping curve shown in Figure 4 Compared with Figure 2 it achieves a relatively obvious smooth effect of the mapping curve, thus effectively ensuring the image color - adjustment effect based on the mapping curve.
[0041] Step S108: Based on the first mapping curve, the second mapping curve, and the transition curve, perform color - adjustment processing on the image to be processed to obtain the target image.
[0042] Taking Figure 3 as an example, the color - adjustment processing can be performed on the image to be processed based on the mapping curve corresponding to L1P1, the transition curve corresponding to P1P2, the mapping curve corresponding to P2P3, the transition curve corresponding to P3P4, and the mapping curve corresponding to P4L4. Modify the color values before adjustment in the image to be processed to the color values after adjustment, so as to achieve the expected color - adjustment effect.
[0043] In summary, through the above - mentioned method, it can effectively ensure that the transition curve can smoothly connect the first mapping curve and the second mapping curve, thus helping to present a smoother and more natural color - adjustment effect.
[0044] As mentioned above, when obtaining the color mapping curves corresponding to the respective target color regions of the image to be processed, the multiple target color regions corresponding to the image to be processed can be determined based on the pixel values of the image to be processed; obtain the color - adjustment intensity set by the user, so as to obtain the color mapping curves corresponding to the respective target color regions based on the color - adjustment intensity and the preset color mapping method. Taking the case where the image to be processed corresponds to three target color regions in total as an example, the range of the color values before adjustment corresponding to the first target color region is generally low, hereinafter simply referred to as the "shadow" region, and the corresponding mapping curve can be, for example, Figure 2 L1L2 in the second target color region has a generally medium range of color values before adjustment, hereinafter simply referred to as the "mid - tone" region, and the corresponding mapping curve can be, for example,Figure 2 In L2L3 among them, the overall range of the pre - adjustment color values corresponding to the third target color area is relatively high, hereinafter simply referred to as the "high - light" area, and the corresponding mapping curve can be, for example, Figure 2 In L3L4. For the convenience of understanding, the following gives an exemplary description of the relevant expressions of the mapping curves of the above three target color areas respectively:
[0045] Taking Figure 2 as an example, the function expression of the mapping curve corresponding to the "shadow" area (hereinafter simply referred to as the mapping formula), the mapping formula corresponding to the "mid - tone" area, and the mapping formula corresponding to the "high - light" area are all used to represent the functional relationship between the y - value and the x - value corresponding to their respective areas. Among them, the y - value is the post - adjustment color value corresponding to the mapping curve, and the x - value is the pre - adjustment color value corresponding to the mapping curve.
[0046] The mapping formula corresponding to the "shadow" area can be a linear expression, such as a linear function of one variable. The specific form of this linear expression is not limited in the embodiments of the present disclosure. The linear expression can include parameter R and can further include parameter S. R is the demarcation value between the "shadow" area and its adjacent target color area (i.e., the "mid - tone" area), that is, the pre - adjustment color value corresponding to the intersection point of the mapping curve corresponding to the "shadow" area and the mapping curve corresponding to the "mid - tone" area; S is the color adjustment intensity corresponding to the "shadow" area. When adjusting in the positive direction, the value range of S is [0, 1], and when adjusting in the negative direction, the value range of S is [-1, 0). In summary, in the mapping formula corresponding to the "shadow" area, the corresponding relationship between the y - value and the x - value is affected by the comprehensive influence of the above - mentioned parameters R and S.
[0047] The mapping formula corresponding to the "mid - tone" area can be a non - linear expression, such as an exponential function or a fitting function composed of multiple functions. The specific form of this non - linear expression is not limited in the embodiments of the present disclosure. The non - linear expression can include parameter R and parameter U. R is the demarcation value between the "shadow" area and the "mid - tone" area, and U is the demarcation value between the "mid - tone" area and the "high - light" area, that is, the pre - adjustment color value corresponding to the intersection point of the mapping curve corresponding to the "mid - tone" area and the mapping curve corresponding to the "high - light" area. In practical applications, the non - linear expression can include the interval range value f of the pre - adjustment color value corresponding to the "mid - tone" area. Specifically, f = U - R; further, the non - linear expression can also include parameter S, and S is the color adjustment intensity corresponding to the "mid - tone" area, and the value range of S is [-1, 1]. In summary, in the mapping formula corresponding to the "mid - tone" area, the corresponding relationship between the y - value and the x - value is affected by the comprehensive influence of the above - mentioned parameters R, U, f, and S.
[0048] The mapping formula corresponding to the "highlights" region can be a linear expression, and the specific form of this linear expression is not limited in the embodiments of the present disclosure. The linear expression may include the parameter U and may further include the parameter S. U is the demarcation value between the "midtones" region and the "highlights" region; S is the color adjustment intensity corresponding to the "highlights" region. When adjusting in the positive direction, the value range of S is [0, 1], and when adjusting in the negative direction, the value range of S is [-1, 0). In summary, in the mapping formula corresponding to the "highlights" region, the correspondence between the y value and the x value is comprehensively affected by the above parameters U and S.
[0049] The above are all exemplary descriptions. In practical applications, different target color regions can be flexibly divided according to needs and the mapping formula corresponding to each target color region can be set. On this basis, the derivative function of the mapping formula corresponding to each target color region can also be obtained, so as to conveniently and quickly know the slope of the points on the mapping curve corresponding to the target color region with the help of the derivative function. In some embodiments, the steps of determining the first auxiliary point on the first mapping curve and the second auxiliary point on the second mapping curve in step S104 above can be performed with reference to the following steps A and B:
[0050] Step A: Obtain the demarcation information between the first mapping curve and the second mapping curve.
[0051] The target color region corresponding to the first mapping curve to be transitioned and the target color region corresponding to the second mapping curve may be adjacent. At this time, there is a target intersection point between the first mapping curve and the second mapping curve. On this basis, the demarcation information includes the pre-adjustment color value corresponding to the target intersection point. For example, Figure 2 when L1L2 is the first mapping curve and L2L3 is the second mapping curve, the x value corresponding to the intersection point L2 of the two can be used as the demarcation information. When L2L3 is the first mapping curve and L3L4 is the second mapping curve, the x value corresponding to the intersection point L3 of the two can be used as the demarcation information.
[0052] In some cases, the target color regions corresponding to the first mapping curve to be transitioned and the second mapping curve may not be adjacent, and the target color region corresponding to the third mapping curve may be interposed therebetween, and the range value of the pre-adjustment color interval of the target color region corresponding to the third mapping curve is less than a preset threshold. At this time, the first mapping curve and the third mapping curve have a first intersection point, the second mapping curve and the third mapping curve have a second intersection point, and the difference between the pre-adjustment color value corresponding to the first intersection point and the pre-adjustment color value corresponding to the second intersection point is less than a preset threshold. For example, the difference between the maximum value of x and the minimum value of x corresponding to the L2L3 curve is less than a preset threshold, that is, L2L3 is relatively short. At this time, L1L2 can be directly used as the first mapping curve, L3L4 can be used as the second mapping curve, and the x values corresponding to the first intersection point L2 and the second intersection point L3 are both used as the boundary information between L1L2 and L3L4.
[0053] Step B: Determine a first auxiliary point on the first mapping curve and a second auxiliary point on the second mapping curve based on the boundary information and the preset threshold. The first auxiliary point and the second auxiliary point are used as the two endpoints of the transition curve between the first mapping curve and the second mapping curve. In order to determine the first auxiliary point and the second auxiliary point reasonably and reliably, the following is a detailed description.
[0054] For the case where there is a target intersection point between the first mapping curve and the second mapping curve, and the boundary information includes the pre-adjustment color value corresponding to the target intersection point, on the basis that the pre-adjustment color values of the target color region corresponding to the first mapping curve are all not greater than the pre-adjustment color values of the target color region corresponding to the second mapping curve, Step B can be executed with reference to the following Steps a to b:
[0055] Step a: Determine a first auxiliary point on the first mapping curve based on the difference between the pre-adjustment color value corresponding to the target intersection point and the preset threshold. In practical applications, the preset threshold can be set flexibly. For example, the preset threshold can be set to 0.05. It should be noted that 0.05 is only an example and should not be regarded as a limitation. Step a can be executed with reference to the following Steps a1 to a2:
[0056] Step a1: When the difference between the pre-adjustment color value corresponding to the target intersection point and the preset threshold is greater than the preset minimum color value, use the difference as the pre-adjustment color value corresponding to the first auxiliary point; when the difference between the pre-adjustment color value corresponding to the target intersection point and the preset threshold is not greater than the minimum color value, use the minimum color value as the pre-adjustment color value corresponding to the first auxiliary point. In other words, use the larger value between the above difference and the minimum color value (such as 0) as the pre-adjustment color value corresponding to the first auxiliary point, so as to ensure that the first auxiliary point is greater than 0 and is on the first mapping curve.
[0057] Step a2: Based on the pre - adjustment color value corresponding to the first auxiliary point, determine the first auxiliary point on the first mapping curve.
[0058] When the pre - adjustment color value (i.e., the x - value) corresponding to the first auxiliary point is known, the first auxiliary point can be directly and uniquely determined on the first mapping curve.
[0059] Step b: Based on the sum value between the pre - adjustment color value corresponding to the target intersection point and the preset threshold, determine the second auxiliary point located on the second mapping curve. Step b can be executed with reference to the following Step b1 to Step b2:
[0060] Step b1: When the sum value between the pre - adjustment color value corresponding to the target intersection point and the preset threshold is less than the preset maximum color value, use the sum value as the pre - adjustment color value corresponding to the second auxiliary point; when the sum value between the pre - adjustment color value corresponding to the target intersection point and the preset threshold is not less than the maximum color value, use the maximum color value as the pre - adjustment color value corresponding to the second auxiliary point. In other words, use the larger value between the above - mentioned sum value and the maximum color value (such as 1) as the pre - adjustment color value corresponding to the second auxiliary point, so as to ensure that the second auxiliary point is less than 1 and is located on the second mapping curve.
[0061] Step b2: Based on the pre - adjustment color value corresponding to the second auxiliary point, determine the second auxiliary point on the second mapping curve.
[0062] When the pre - adjustment color value (i.e., the x - value) corresponding to the second auxiliary point is known, the second auxiliary point can be directly and uniquely determined on the second mapping curve.
[0063] For easy understanding, taking Figure 3 as an example, when determining the transition area between the "shadow" area and the "mid - tone" area, with L2 as the center, expand 0.05 for both the left and right abscissas. Then the abscissa x1 of the first auxiliary point P1 = max(R - 0.05, 0), and the abscissa x2 of the second auxiliary point P2 = min(R + 0.05, 1). Here, R is the demarcation value between the "shadow" area and the "mid - tone" area, that is, the pre - adjustment color value corresponding to the intersection point of the mapping curve corresponding to the "shadow" area and the mapping curve corresponding to the "mid - tone" area. When determining the transition area between the "mid - tone" area and the "highlight" area, with L3 as the center, expand 0.05 for both the left and right abscissas. Then the abscissa x3 of the first auxiliary point P3 = max(U - 0.05, 0), and the abscissa x4 of the second auxiliary point P4 = min(U + 0.05, 1). Here, the above - mentioned U is the demarcation value between the "mid - tone" area and the "highlight" area, that is, the pre - adjustment color value corresponding to the intersection point of the mapping curve corresponding to the "mid - tone" area and the mapping curve corresponding to the "highlight" area.
[0064] For the case where the first mapping curve and the third mapping curve have a first intersection point, the second mapping curve and the third mapping curve have a second intersection point, and the difference between the pre-adjustment color value corresponding to the first intersection point and the pre-adjustment color value corresponding to the second intersection point is less than a preset threshold, and the demarcation information includes the pre-adjustment color value corresponding to the first intersection point and the pre-adjustment color value corresponding to the second intersection point, on the basis that the pre-adjustment color values in the target color region corresponding to the first mapping curve are not greater than the pre-adjustment color values in the target color region corresponding to the second mapping curve, step B can be executed with reference to the following steps 1 to 2:
[0065] Step 1, based on the difference between the pre-adjustment color value corresponding to the first intersection point and the preset threshold, determine a first auxiliary point located on the first mapping curve.
[0066] Step 2, based on the sum value between the pre-adjustment color value corresponding to the second intersection point and the preset threshold, determine a second auxiliary point located on the second mapping curve.
[0067] Still taking Figure 3 as an example, if the range of the "midtone" region is small, and the difference between the x value corresponding to L3 (i.e., the aforementioned U) and the x value corresponding to L2 (i.e., the aforementioned R) is less than the preset threshold of 0.05, then the "midtone" region can be ignored and directly transitioned from the "shadow" region to the "highlight" region. At this time, the abscissa x5 of the first auxiliary point P1 = max(R - 0.05, 0), and the abscissa x6 of the second auxiliary point P4 = min(U + 0.05, 1).
[0068] In some embodiments, the above step S106, that is, obtaining the transition curve between the first auxiliary point and the second auxiliary point, can be executed with reference to the following steps 1 to 3:
[0069] Step 1, obtain the information of the first auxiliary point based on the first mapping curve; wherein, the information of the first auxiliary point includes the pre-adjustment color value and the post-adjustment color value corresponding to the first auxiliary point, and the slope of the first auxiliary point on the first mapping curve.
[0070] Step 2, obtain the information of the second auxiliary point based on the second mapping curve; wherein, the information of the second auxiliary point includes the pre-adjustment color value and the post-adjustment color value corresponding to the second auxiliary point, and the slope of the second auxiliary point on the second mapping curve.
[0071] It can be understood that when the mapping curve is known, the slope of the auxiliary point on it can be directly obtained. In practical applications, the coordinates of the auxiliary point can be substituted into the derivative formula based on the derivative formula corresponding to the mapping curve, and the obtained derivative value is the slope. For ease of understanding, you can also refer to the aforementioned derivative formula example of the mapping curve, which will not be repeated here.
[0072] Step three, determining a transition curve between the first auxiliary point and the second auxiliary point according to the information of the first auxiliary point, the information of the second auxiliary point and the cubic polynomial function.
[0073] In the embodiment of the present disclosure, based on the information of the first auxiliary point and the second auxiliary point that have been acquired, a relatively smooth transition curve can be obtained by cleverly utilizing the cubic polynomial function. In other words, the mapping formula corresponding to the transition curve is a cubic polynomial formula, and the two endpoints of the transition curve are the aforementioned first auxiliary point and the second auxiliary point, and the transition curve will not change the corresponding slopes of the two endpoints on the original mapping curve. Therefore, it can effectively ensure that the original mapping curve and the transition curve achieve a smooth transition without obvious bending angles and the like.
[0074] For ease of understanding, the above step three is further explained in combination with the formula below: Based on the known basic expression of the cubic polynomial (the specific parameters are unknown at this time), the auxiliary point information can be used to constrain the cubic polynomial. Specifically, the x value, y value and slope value of the first auxiliary point and the second auxiliary point can be substituted into the basic expression of the cubic polynomial and the derivative expression of the cubic polynomial, and multiple equations can be solved together to obtain the specific parameters (also called coefficients) of the cubic polynomial, and the expression of the cubic polynomial with known parameters is used as the expression of the transition curve. The expression of the transition curve can also be called the expression of the transition area corresponding to the transition curve, which is used to characterize the corresponding relationship between the color values before adjustment and the color values after adjustment in the transition area.
[0075] The following takes the mapping curve corresponding to the "dark light" area as the first mapping curve and the mapping curve corresponding to the "midtone" area as the second mapping curve as an example. The color value before adjustment corresponding to the first auxiliary point P1 is x1, the color value after adjustment is y1, and the slope on the first mapping curve is k1. The color value before adjustment corresponding to the second auxiliary point P2 is x2, the color value after adjustment is y2, and the slope on the second mapping curve is k2. Assume that the formula expression of the mapping curve corresponding to the aforementioned "dark light" area is y = s(x), the derivative expression is k = s'(x), and the formula expression of the mapping curve corresponding to the "midtone" area is y = m(x), the derivative expression is k = m'(x). We can obtain y1 = s(x1), k1 = s'(x1), y2 = m(x2), k2 = m'(x2), and then substitute them into the above solution formula of the cubic polynomial to obtain the transition curve between P1 and P2. The method for obtaining the transition curves between the remaining areas is similar and will not be elaborated one by one here.
[0076] It should be noted that the inventor has found through research that, compared with the method of determining the transition curve based on the cubic polynomial and the method of determining the transition curve by combining key points with curve interpolation, the obtained transition curve is more continuous and smooth. Using the curve interpolation method will result in an insufficiently smooth transition curve with an obvious sense of bending. Moreover, when the user changes the adjustment parameters such as the intensity of the color condition, it is easy to cause the transition curve to jump. In addition, using the curve interpolation method is prone to phenomena that do not conform to expectations. For example, for positive adjustment, the color value after adjustment should be greater than the color value before adjustment. However, using the curve interpolation method, it may result in the color value after adjustment in some intervals of the transition curve being less than the color value before adjustment, thus presenting a negative adjustment phenomenon, which is contrary to the expected adjustment direction. However, using the above cubic polynomial to determine the obtained transition curve can effectively ensure the consistency between the final adjustment result and the expected adjustment direction, as well as ensure the continuity and smoothness of the transition curve.
[0077] In summary, the embodiments of the present disclosure can effectively ensure that the transition curve can smoothly connect the first mapping curve and the second mapping curve, thereby helping to present a smoother and more natural color adjustment effect.
[0078] Figure 5 It is a schematic structural diagram of an image processing device provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware, and is generally integrated in an electronic device and can execute an image processing method. As Figure 5 shown, the image processing device includes:
[0079] A mapping curve acquisition module 502, configured to acquire color mapping curves corresponding to multiple target color regions of an image to be processed; wherein, the color mapping curve is used to represent the mapping relationship between the pre-adjustment color values and the post-adjustment color values corresponding to the target color region;
[0080] An auxiliary point determination module 504, configured to determine a first mapping curve and a second mapping curve to be transitioned from the color mapping curve, and determine a first auxiliary point located on the first mapping curve and a second auxiliary point located on the second mapping curve;
[0081] A transition curve acquisition module 506, configured to acquire a transition curve between the first auxiliary point and the second auxiliary point;
[0082] A color adjustment module 508, configured to perform color adjustment processing on the image to be processed based on the first mapping curve, the second mapping curve, and the transition curve to obtain a target image.
[0083] The above device can effectively ensure that the transition curve can smoothly connect the first mapping curve and the second mapping curve, thereby helping to present a smoother and more natural color adjustment effect.
[0084] In some embodiments, the slope of the first auxiliary point on the transition curve is the same as the slope of the first auxiliary point on the first mapping curve, and the slope of the second auxiliary point on the transition curve is the same as the slope of the second auxiliary point on the second mapping curve.
[0085] In some embodiments, the transition curve acquisition module 506 is specifically configured to: acquire information of the first auxiliary point based on the first mapping curve; wherein, the information of the first auxiliary point includes the pre-adjustment color value and the post-adjustment color value corresponding to the first auxiliary point, and the slope of the first auxiliary point on the first mapping curve; acquire information of the second auxiliary point based on the second mapping curve; wherein, the information of the second auxiliary point includes the pre-adjustment color value and the post-adjustment color value corresponding to the second auxiliary point, and the slope of the second auxiliary point on the second mapping curve; determine the transition curve between the first auxiliary point and the second auxiliary point according to the information of the first auxiliary point and the information of the second auxiliary point.
[0086] In some embodiments, the auxiliary point determination module 504 is specifically configured to: acquire boundary information between the first mapping curve and the second mapping curve; determine a first auxiliary point located on the first mapping curve and a second auxiliary point located on the second mapping curve based on the boundary information and a preset threshold.
[0087] In some embodiments, there is a target intersection point between the first mapping curve and the second mapping curve; the boundary information includes the pre-adjustment color value corresponding to the target intersection point.
[0088] In some embodiments, the auxiliary point determination module 504 is specifically configured to: determine a first auxiliary point located on the first mapping curve based on the difference between the pre-adjustment color value corresponding to the target intersection point and the preset threshold; determine a second auxiliary point located on the second mapping curve based on the sum of the pre-adjustment color value corresponding to the target intersection point and the preset threshold; wherein, the pre-adjustment color values of the target color region corresponding to the first mapping curve are not greater than the pre-adjustment color values of the target color region corresponding to the second mapping curve.
[0089] In some embodiments, the auxiliary point determination module 504 is specifically configured to: when the difference between the pre-adjustment color value corresponding to the target intersection point and the preset threshold is greater than the preset minimum color value, use the difference as the pre-adjustment color value corresponding to the first auxiliary point; when the difference between the pre-adjustment color value corresponding to the target intersection point and the preset threshold is not greater than the minimum color value, use the minimum color value as the pre-adjustment color value corresponding to the first auxiliary point; and determine the first auxiliary point on the first mapping curve based on the pre-adjustment color value corresponding to the first auxiliary point.
[0090] In some embodiments, the auxiliary point determination module 504 is specifically configured to: when the sum of the pre-adjustment color value corresponding to the target intersection point and the preset threshold is less than the preset maximum color value, use the sum as the pre-adjustment color value corresponding to the second auxiliary point; when the sum of the pre-adjustment color value corresponding to the target intersection point and the preset threshold is not less than the maximum color value, use the maximum color value as the pre-adjustment color value corresponding to the second auxiliary point; and determine the second auxiliary point on the second mapping curve based on the pre-adjustment color value corresponding to the second auxiliary point.
[0091] In some embodiments, the first mapping curve and the third mapping curve have a first intersection point, the second mapping curve and the third mapping curve have a second intersection point, and the difference between the pre-adjustment color value corresponding to the first intersection point and the pre-adjustment color value corresponding to the second intersection point is less than the preset threshold; the boundary information includes the pre-adjustment color value corresponding to the first intersection point and the pre-adjustment color value corresponding to the second intersection point.
[0092] In some embodiments, the auxiliary point determination module 504 is specifically configured to: determine a first auxiliary point located on the first mapping curve based on the difference between the pre-adjustment color value corresponding to the first intersection point and the preset threshold; determine a second auxiliary point located on the second mapping curve based on the sum of the pre-adjustment color value corresponding to the second intersection point and the preset threshold; wherein, the pre-adjustment color values of the target color regions corresponding to the first mapping curve are not greater than the pre-adjustment color values of the target color regions corresponding to the second mapping curve.
[0093] In some embodiments, the mapping curve acquisition module 502 is specifically configured to: determine a plurality of target color regions corresponding to the image to be processed based on the pixel values of the image to be processed; obtain the color adjustment intensity set by the user, so as to obtain the color mapping curves corresponding to the plurality of target color regions based on the color adjustment intensity and a preset color mapping method.
[0094] The image processing apparatus provided by the embodiments of the present disclosure can execute the image processing method provided by any embodiment of the present disclosure, and has functional modules and beneficial effects corresponding to the execution of the method.
[0095] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device embodiments described above can refer to the corresponding process in the method embodiments, and will not be described herein again.
[0096] The embodiments of the present disclosure provide an electronic device, which includes: a storage device on which a computer program is stored; a processing device for executing the computer program in the storage device to implement the steps of any one of the methods in the present disclosure.
[0097] Next, refer to Figure 6 , which shows a schematic structural diagram of an electronic device 600 suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example, and should not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.
[0098] As Figure 6As shown, the electronic device 600 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which may perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage device 608 into the random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. The input / output (I / O) interface 605 is also connected to the bus 604.
[0099] Generally, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or wirelesly to exchange data. Although Figure 6 the electronic device 600 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices may be implemented or had.
[0100] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart may be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program codes for performing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above functions defined in the method of the embodiment of the present disclosure are executed.
[0101] In addition to the above methods and devices, embodiments of the present disclosure may also be computer program products, which include computer program instructions that, when run by a processor, cause the processor to execute the image processing methods provided by the embodiments of the present disclosure. The computer program products may be written in any combination of one or more programming languages for programming code to perform the operations of the embodiments of the present disclosure. The programming languages include object-oriented programming languages such as Java, C++, etc., and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, executed as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0102] In addition, embodiments of the present disclosure may also be computer-readable storage media, on which computer program instructions are stored, and when the computer program instructions are run by a processor, the processor is caused to execute the image processing methods provided by the embodiments of the present disclosure.
[0103] The computer-readable storage media may employ any combination of one or more readable media. The readable media may be a readable signal media or a readable storage media. The readable storage media may, for example, include but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (a non-exhaustive list) of the readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0104] Embodiments of the present disclosure also provide a computer program product, including a computer program / instructions, which when executed by a processor implement the image processing methods in the embodiments of the present disclosure.
[0105] It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the users and the authorization of the users should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0106] For example, when a user's active request is received, a prompt message is sent to the user to clearly prompt the user that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, an application, a server, or a storage medium that performs the operations of the present disclosure technical solution based on the prompt message.
[0107] As an optional but non-limiting implementation manner, the manner of sending a prompt message to the user in response to receiving the user's active request may, for example, be in the form of a pop-up window, and the prompt message may be presented in text in the pop-up window. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0108] It can be understood that the above notification and user authorization process is only illustrative and does not limit the implementation manner of the present disclosure. Other manners that comply with relevant laws and regulations can also be applied to the implementation manner of the present disclosure.
[0109] It should be noted that in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.
[0110] The above are only specific implementation manners of the present disclosure, enabling those skilled in the art to understand or implement the present disclosure. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to these embodiments described herein, but rather to the broadest scope consistent with the principles and novel features disclosed herein.
Claims
1. An image processing method, characterized in that, Including: Obtaining color mapping curves corresponding to multiple target color regions of an image to be processed; wherein, the color mapping curve is used to represent the mapping relationship between the pre-adjustment color value and the post-adjustment color value corresponding to the target color region; Determining a first mapping curve and a second mapping curve to be transitioned from the color mapping curves, and determining a first auxiliary point on the first mapping curve and a second auxiliary point on the second mapping curve; Obtaining a transition curve between the first auxiliary point and the second auxiliary point; Based on the first mapping curve, the second mapping curve, and the transition curve, performing color adjustment processing on the image to be processed to obtain a target image.
2. The method according to claim 1, characterized in that, The obtaining the transition curve between the first auxiliary point and the second auxiliary point includes: Obtaining information of the first auxiliary point based on the first mapping curve; wherein, the information of the first auxiliary point includes the pre-adjustment color value and the post-adjustment color value corresponding to the first auxiliary point, and the slope of the first auxiliary point on the first mapping curve; Obtaining information of the second auxiliary point based on the second mapping curve; wherein, the information of the second auxiliary point includes the pre-adjustment color value and the post-adjustment color value corresponding to the second auxiliary point, and the slope of the second auxiliary point on the second mapping curve; Determining the transition curve between the first auxiliary point and the second auxiliary point according to the information of the first auxiliary point and the information of the second auxiliary point.
3. The method according to claim 1 or 2, wherein The slope of the first auxiliary point on the transition curve is consistent with the slope of the first auxiliary point on the first mapping curve, and the slope of the second auxiliary point on the transition curve is consistent with the slope of the second auxiliary point on the second mapping curve.
4. The method according to claim 1, characterized in that The determining the first auxiliary point on the first mapping curve and the second auxiliary point on the second mapping curve includes: Obtaining boundary information between the first mapping curve and the second mapping curve; Determining the first auxiliary point on the first mapping curve and the second auxiliary point on the second mapping curve based on the boundary information and a preset threshold.
5. The method according to claim 4, characterized in that There is a target intersection point between the first mapping curve and the second mapping curve; the boundary information includes the pre-adjustment color value corresponding to the target intersection point.
6. The method according to claim 5, wherein The determining the first auxiliary point on the first mapping curve and the second auxiliary point on the second mapping curve based on the boundary information and a preset threshold includes: Determining the first auxiliary point on the first mapping curve based on the difference between the pre-adjustment color value corresponding to the target intersection point and the preset threshold; Determining the second auxiliary point on the second mapping curve based on the sum of the pre-adjustment color value corresponding to the target intersection point and the preset threshold; Wherein, the pre-adjustment color values of the target color region corresponding to the first mapping curve are not greater than the pre-adjustment color values of the target color region corresponding to the second mapping curve.
7. The method according to claim 6, wherein Determining a first auxiliary point located on the first mapping curve based on the difference between the pre-adjustment color value corresponding to the target intersection point and the preset threshold includes: When the difference between the pre-adjustment color value corresponding to the target intersection point and the preset threshold is greater than the preset minimum color value, using the difference as the pre-adjustment color value corresponding to the first auxiliary point; when the difference between the pre-adjustment color value corresponding to the target intersection point and the preset threshold is not greater than the minimum color value, using the minimum color value as the pre-adjustment color value corresponding to the first auxiliary point; Based on the pre-adjustment color value corresponding to the first auxiliary point, determining the first auxiliary point on the first mapping curve.
8. The method according to claim 6, wherein Determining a second auxiliary point located on the second mapping curve based on the sum value between the pre-adjustment color value corresponding to the target intersection point and the preset threshold includes: When the sum value between the pre-adjustment color value corresponding to the target intersection point and the preset threshold is less than the preset maximum color value, using the sum value as the pre-adjustment color value corresponding to the second auxiliary point; when the sum value between the pre-adjustment color value corresponding to the target intersection point and the preset threshold is not less than the maximum color value, using the maximum color value as the pre-adjustment color value corresponding to the second auxiliary point; Based on the pre-adjustment color value corresponding to the second auxiliary point, determining the second auxiliary point on the second mapping curve.
9. The method according to claim 4, wherein The first mapping curve and the third mapping curve have a first intersection point, the second mapping curve and the third mapping curve have a second intersection point, and the difference between the pre-adjustment color value corresponding to the first intersection point and the pre-adjustment color value corresponding to the second intersection point is less than the preset threshold; The demarcation information includes the pre-adjustment color value corresponding to the first intersection point and the pre-adjustment color value corresponding to the second intersection point.
10. The method according to claim 9, wherein Determining a first auxiliary point located on the first mapping curve and a second auxiliary point located on the second mapping curve based on the demarcation information and the preset threshold includes: Determining a first auxiliary point located on the first mapping curve based on the difference between the pre-adjustment color value corresponding to the first intersection point and the preset threshold; Determining a second auxiliary point located on the second mapping curve based on the sum value between the pre-adjustment color value corresponding to the second intersection point and the preset threshold; Wherein, the pre-adjustment color values of the target color regions corresponding to the first mapping curve are all not greater than the pre-adjustment color values of the target color regions corresponding to the second mapping curve.
11. The method according to claim 1, wherein Obtaining the color mapping curves corresponding to multiple target color regions of the image to be processed includes: Determining multiple target color regions corresponding to the image to be processed based on the pixel values of the image to be processed; Obtaining the color adjustment intensity set by the user, and based on the color adjustment intensity and the preset color mapping method, obtaining the color mapping curves corresponding to the multiple target color regions.
12. An image processing apparatus, characterized in that, Including: A mapping curve acquisition module, configured to acquire color mapping curves corresponding to multiple target color regions of an image to be processed; wherein, the color mapping curve is used to represent the mapping relationship between the pre-adjustment color value and the post-adjustment color value corresponding to the target color region; An auxiliary point determination module, configured to determine a first mapping curve and a second mapping curve to be transitioned from the color mapping curve, and determine a first auxiliary point located on the first mapping curve and a second auxiliary point located on the second mapping curve; A transition curve acquisition module, configured to acquire a transition curve between the first auxiliary point and the second auxiliary point; A color adjustment module, configured to perform color adjustment processing on the image to be processed based on the first mapping curve, the second mapping curve, and the transition curve to obtain a target image.
13. An electronic device, characterized in that, The electronic device includes: A storage device, on which a computer program is stored; A processing device, configured to execute the computer program in the storage device to implement the steps of the image processing method according to any one of claims 1-11.
14. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, and the computer program is used to execute the image processing method according to any one of claims 1-11 above.