Image processing method and device, chip, electronic device and medium
By acquiring and displaying the brightness partition grid and intermediate points of the input image, the color changes of target pixel points and their mapping points are synchronized in the 3D lookup table debugging tool, solving the insufficient color change labeling and flexible adjustment in the existing technology. The problem of poor degree improves user experience and adjustment efficiency.
Patent Information
- Application Number
- CN202210557919.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-19
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2042-05-19
AI Technical Summary
The existing 3D lookup table debugging tools lack the label of color changes before and after adjustment of the same pixel point in the input image and output image, which reduces the user experience and cannot partition and adjust the grid according to brightness, resulting in poor adjustment flexibility.
Provide an image processing method, obtain and display the color range and brightness partition grid of the input image in the specified brightness gear, obtain the intermediate point of the brightness partition grid, and obtain the output image according to the intermediate point, in response to the detection of the target pixel point , synchronously display the color changes of the target pixel point and its mapping points to compare the color changes.
Improves adjustment efficiency and user experience, and synchronously displays the target pixel points and their mapping points, which facilitates color changes and enhances the flexibility and accuracy of adjustment.
Smart Images

Figure CN116385565B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to an image processing method and device, a chip, an electronic device and a medium. Background Art
[0002] Existing 3D lookup table debugging tools can be used to generate 3D lookup tables, which can achieve mapping between different color spaces and meet different color matching requirements, so they are widely used. Currently, with existing 3D lookup table debugging tools, users can generate output images with expected effects through a series of visual operations. Summary of the invention
[0003] The present disclosure provides an image processing method and device, a chip, an electronic device and a medium to solve the deficiencies of the related art.
[0004] According to a first aspect of an embodiment of the present disclosure, there is provided an image processing method, including:
[0005] Get and display the color range and brightness partition grid corresponding to the input image at the specified brightness level;
[0006] Obtaining a middle point in the brightness partition grid, and obtaining an output image corresponding to the input image according to the middle point;
[0007] In response to detecting that a target pixel point of the input image or the output image is selected, a mapping point of the target pixel point is synchronously displayed in another image to compare color changes of the target pixel point and the mapping point.
[0008] Optionally, obtaining the color range corresponding to the input image at a specified brightness level includes:
[0009] Obtaining the size and pixel data of the input image;
[0010] When the size of the input image is less than or equal to a preset size threshold, obtaining polar color space data corresponding to the pixel data;
[0011] Obtaining rectangular color space data corresponding to the polar color space data;
[0012] Determine the brightness level corresponding to each pixel in the input image according to the brightness value of the rectangular color space data; the brightness level is an identifier corresponding to each brightness interval after the brightness value range is divided into multiple brightness intervals;
[0013] Obtain rectangular color space data whose brightness level is equal to the specified brightness level, and obtain a color range corresponding to the specified brightness level.
[0014] Optionally, determining the brightness level corresponding to each pixel in the input image according to the brightness value of the rectangular color space data includes:
[0015] Obtaining the product of the brightness value of the rectangular color space data of each pixel and the preset gear adjustment data; the gear adjustment data is the difference between the maximum value of the brightness gear and the minimum value of the brightness gear;
[0016] The product is rounded and then the sum of the product and the preset constant is calculated. The sum is the brightness level corresponding to each pixel.
[0017] Optionally, obtaining a brightness partition grid corresponding to the input image at a specified brightness level includes:
[0018] Obtaining a specified brightness level selected by a user; the brightness level is an identifier corresponding to each brightness interval after the brightness value range is divided into multiple brightness intervals;
[0019] Get the brightness partition grid corresponding to the brightness level.
[0020] Optionally, obtaining the middle point in the brightness partition grid includes:
[0021] In response to detecting an operation representing dragging any basic point in the brightness partition grid, determining a target position of the basic point;
[0022] Adjusting the position of the associated basic point of the basic point according to the target position to obtain a midpoint rectangular color space lookup table; the associated basic point refers to a basic point between a first brightness partition and a second brightness partition; the first brightness partition refers to a brightness partition locked by a user or a brightness partition with a minimum brightness level, and the second brightness partition refers to a brightness partition locked by a user or a brightness partition with a maximum brightness level;
[0023] The midpoint between the first brightness partition and the second brightness partition in the midpoint rectangular color space lookup table is updated, and the midpoints of all brightness levels are obtained from the midpoint rectangular color space lookup table.
[0024] Optionally, acquiring an output image corresponding to the input image according to the intermediate point includes:
[0025] Obtaining polar color space data corresponding to an input image, and obtaining a relative position relationship of each pixel in the input image;
[0026] The output image is acquired according to the relative positional relationship, the intermediate point and the extreme color space data.
[0027] Optionally, obtaining the relative position relationship of each pixel in the input image includes:
[0028] Obtain a basic point rectangular color space lookup table of the brightness partition grid and polar color space data and rectangular color space data corresponding to each pixel point;
[0029] Determine the position of each pixel point in the vertex of the three-dimensional grid block corresponding to the brightness partition grid according to the position of each pixel point in the extreme color space data;
[0030] Determine the rectangular color space data of each vertex in the three-dimensional grid block according to the basic point rectangular color space lookup table;
[0031] The proportional coefficients of each pixel in the hue, saturation and brightness directions are determined according to the rectangular color space data of each pixel and the rectangular color space data of each vertex in the three-dimensional grid block, and the proportional coefficients are used as the relative position relationship.
[0032] Optionally, determining the proportional coefficient of each pixel in the hue, saturation and brightness direction according to the rectangular color space data of each pixel and the rectangular color space data of each vertex in the three-dimensional grid block includes:
[0033] Projecting the rectangular color space data of each pixel point onto a first plane and a second plane of the three-dimensional grid block to obtain a projection point; the first plane and the second plane are parallel;
[0034] Acquire shapes of the first plane and the second plane, and select an interpolation model according to the shapes;
[0035] Performing interpolation processing on the projection points according to the interpolation model to obtain proportional coefficients in the hue direction and the saturation direction;
[0036] Get the scale factor in the brightness direction.
[0037] Optionally, selecting an interpolation model according to the shape includes:
[0038] When the shape is a quadrilateral, determining that the interpolation model is an inverse bilinear interpolation model; and / or,
[0039] When the shape is a triangle, the interpolation model is determined to be a triangle interpolation model.
[0040] Optionally, obtaining a basic point rectangular color space lookup table of the brightness partition grid includes:
[0041] Obtaining the hue density, saturation density and brightness density of the brightness partition grid, as well as the hue value range, saturation value range and brightness value range;
[0042] generating an original color space lookup table according to the hue density, the saturation density and the brightness density;
[0043] Fill in the hue value, saturation value and brightness value of each position in the original color space lookup table according to the hue value range, the saturation value range and the brightness value range;
[0044] The hue value and saturation value in the original color space lookup table are replaced with the rectangular coordinates of the basic point of the same rank and the brightness value is retained to obtain the basic point rectangular color space lookup table.
[0045] Optionally, acquiring the output image according to the relative position relationship, the intermediate point and the extreme color space data comprises:
[0046] Obtaining the position corresponding to the extreme color space data of each pixel point;
[0047] Determine the three-dimensional grid block corresponding to the position in the brightness partition grid, and the position of each vertex of the three-dimensional grid block;
[0048] Obtaining rectangular color space data corresponding to the position of each vertex in the rectangular color space lookup table of the middle point;
[0049] Determine the rectangular color space data of each pixel point according to the rectangular color space data of each vertex and the relative position relationship;
[0050] The rectangular color space data of each pixel point is converted into pixel data to obtain the output image.
[0051] Optionally, the method further comprises:
[0052] Obtaining the position coordinates of the target pixel point;
[0053] Converting the position coordinates into pixel data corresponding to the pixel point;
[0054] Obtaining rectangular color space data and position corresponding to the pixel data;
[0055] Mapping points within the brightness partition grid are displayed within the brightness partition grid according to the rectangular color space data and positions.
[0056] Optionally, displaying mapping points in the brightness partition grid according to the rectangular color space data and the position in the brightness partition grid comprises:
[0057] Comparing the brightness level of the brightness partition where the mapping point corresponding to the target pixel point is located with the specified brightness level;
[0058] If they are equal, the mapping points in the brightness partition grid are displayed in a first display mode;
[0059] If they are not equal, the mapping points in the brightness partition grid are displayed in a second display mode.
[0060] Optionally, the method further comprises:
[0061] Get the initial pixel lookup table according to the specified lookup table size;
[0062] Obtaining an extreme color space lookup table and a rectangular color space lookup table corresponding to the initial pixel lookup table;
[0063] Obtain a basic point rectangular color space lookup table of the brightness partition grid;
[0064] Acquire a target pixel lookup table according to the intermediate point, the basic point rectangular color space lookup table, the extreme color space lookup table, and the rectangular color space lookup table;
[0065] The target pixel lookup table is stored in a preset format.
[0066] According to a second aspect of an embodiment of the present disclosure, there is provided an image processing apparatus, including:
[0067] A color range acquisition module is used to acquire and display the color range and brightness partition grid corresponding to the input image at a specified brightness level;
[0068] A brightness partition acquisition module is used to acquire and display the brightness partition grid corresponding to the input image at a specified brightness level;
[0069] A middle point acquisition module, used to acquire the middle point in the brightness partition grid;
[0070] An output image acquisition module, used for acquiring an output image corresponding to the input image according to the intermediate point;
[0071] A mapping point acquisition module is used for synchronously displaying the mapping point of the target pixel point in another image in response to detecting the target pixel point of the input image or the output image, so as to compare the color changes of the target pixel point and the mapping point.
[0072] Optionally, the color range acquisition module includes:
[0073] A size acquisition submodule, used to acquire the size and pixel data of the input image;
[0074] The polar color space data acquisition submodule is used to acquire the polar color space data corresponding to the pixel data when the size of the input image is less than or equal to a preset size threshold;
[0075] A rectangular color space data acquisition submodule, used to acquire the rectangular color space data corresponding to the polar color space data;
[0076] A brightness level acquisition submodule is used to determine the brightness level corresponding to each pixel in the input image according to the brightness value of the rectangular color space data; the brightness level is an identifier corresponding to each brightness interval after the brightness value range is divided into multiple brightness intervals;
[0077] The color range acquisition submodule is used to acquire the rectangular color space data whose brightness level is equal to the specified brightness level, and obtain the color range corresponding to the specified brightness level.
[0078] Optionally, the brightness level acquisition submodule includes:
[0079] A product acquisition unit, used to acquire the product of the brightness value of the rectangular color space data of each pixel and preset gear adjustment data; the gear adjustment data is the difference between the maximum value of the brightness gear and the minimum value of the brightness gear;
[0080] The brightness level acquisition unit is used to round the product and then calculate the sum of the product and a preset constant, where the sum is the brightness level corresponding to each pixel point.
[0081] Optionally, the brightness partition acquisition module includes:
[0082] The designated gear acquisition submodule is used to acquire the designated brightness gear selected by the user; the brightness gear is an identifier corresponding to each brightness interval after the brightness value range is divided into multiple brightness intervals;
[0083] The brightness partition acquisition submodule is used to acquire the brightness partition grid corresponding to the brightness level.
[0084] Optionally, the intermediate point acquisition module includes:
[0085] a target position acquisition submodule, configured to determine a target position of any basic point in the brightness partition grid in response to detecting an operation of dragging the basic point;
[0086] A lookup table acquisition submodule, used for adjusting the position of the associated basic point of the basic point according to the target position, and obtaining a midpoint rectangular color space lookup table; the associated basic point refers to the basic point between the first brightness partition and the second brightness partition; the first brightness partition refers to the brightness partition locked by the user or the brightness partition with the smallest brightness level, and the second brightness partition refers to the brightness partition locked by the user or the brightness partition with the largest brightness level;
[0087] The midpoint acquisition submodule is used to update the midpoint between the first brightness partition and the second brightness partition in the midpoint rectangular color space lookup table, and to acquire the midpoints of all brightness levels from the midpoint rectangular color space lookup table.
[0088] Optionally, the output image acquisition module includes:
[0089] A data acquisition submodule, used to acquire the polar color space data corresponding to the input image;
[0090] A position relationship acquisition submodule, used to acquire the relative position relationship of each pixel in the input image;
[0091] The output image acquisition submodule is used to acquire the output image according to the relative position relationship, the middle point and the extreme color space data.
[0092] Optionally, the position relationship acquisition submodule includes:
[0093] A color space data acquisition unit, used to acquire a basic point rectangular color space lookup table of the brightness partition grid and polar color space data and rectangular color space data corresponding to each pixel point;
[0094] A grid block acquisition unit, used to determine the position of each pixel point in the vertex of the three-dimensional grid block corresponding to the brightness partition grid according to the position of each pixel point in the extreme color space data;
[0095] A vertex data acquisition unit, used to determine the rectangular color space data of each vertex in the three-dimensional grid block according to the basic point rectangular color space lookup table and the order of the vertex;
[0096] The position relationship acquisition unit is used to determine the proportional coefficient of each pixel point in the hue, saturation and brightness direction according to the rectangular color space data of each pixel point and the rectangular color space data of each vertex in the three-dimensional grid block, and use the proportional coefficient as the relative position relationship.
[0097] Optionally, the position relationship acquisition unit includes:
[0098] A projection point acquisition subunit, used for projecting the rectangular color space data of each pixel point onto the first plane and the second plane of the three-dimensional grid block to obtain a projection point; the first plane and the second plane are parallel;
[0099] an interpolation model acquisition subunit, configured to acquire shapes of the first plane and the second plane, and select an interpolation model according to the shapes;
[0100] The proportional coefficient acquisition subunit is used to perform interpolation processing on the projection points according to the interpolation model to obtain the proportional coefficients in the hue direction and the saturation direction; and to obtain the proportional coefficient in the brightness direction.
[0101] Optionally, the interpolation model acquisition subunit includes:
[0102] a first subunit, configured to determine, when the shape is a quadrilateral, that the interpolation model is an inverse bilinear interpolation model; and / or,
[0103] The second subunit is used to determine that the interpolation model is a triangle interpolation model when the shape is a triangle.
[0104] Optionally, the color space data acquisition unit includes:
[0105] A value range acquisition subunit, used to acquire the hue density, saturation density and brightness density of the brightness partition grid, as well as the hue value range, saturation value range and brightness value range;
[0106] An original table acquisition subunit, used for generating an original color space lookup table according to the hue density, the saturation density and the brightness density;
[0107] An original table filling subunit, used to fill the hue value, saturation value and brightness value of each position in the original color space lookup table according to the hue value range, the saturation value range and the brightness value range;
[0108] The lookup table acquisition subunit is used to replace the hue value and saturation value in the original color space lookup table with the rectangular coordinates of the basic point of the same rank and retain the brightness value to obtain the basic point rectangular color space lookup table.
[0109] Optionally, the output image acquisition submodule includes:
[0110] A pixel order acquisition unit, used for acquiring the order corresponding to the extreme color space data of each pixel point;
[0111] A vertex ranking acquisition unit, used to determine the ranking of the three-dimensional grid block corresponding to the brightness partition grid, and the ranking of each vertex of the three-dimensional grid block;
[0112] An intermediate data acquisition unit, used for acquiring rectangular color space data corresponding to the position of each vertex in the rectangular color space lookup table of the intermediate point;
[0113] A pixel data acquisition unit, used to determine the rectangular color space data of each pixel point according to the rectangular color space data of each vertex and the relative position relationship;
[0114] The output image acquisition unit is used to convert the rectangular color space data of each pixel point into pixel data to obtain the output image.
[0115] Optionally, the device further comprises:
[0116] A position coordinate acquisition module, used to acquire the position coordinates of the target pixel point;
[0117] A pixel data acquisition module, used for converting the position coordinates into pixel data corresponding to the pixel point;
[0118] A rectangular color space data acquisition module, used to acquire the rectangular color space data and position corresponding to the pixel data;
[0119] A mapping point display module is used to display the mapping points in the brightness partition grid according to the rectangular color space data and the position in the brightness partition grid.
[0120] Optionally, the mapping point display module includes:
[0121] A level comparison submodule, used to compare the brightness level of the brightness partition where the mapping point corresponding to the target pixel point is located with the specified brightness level;
[0122] The first display submodule is used to display the mapping point in the brightness partition grid in a first display mode when the brightness level of the brightness partition where the mapping point is located is equal to the specified brightness level; and is also used to display the mapping point in the brightness partition grid in a second display mode when the brightness level of the brightness partition where the mapping point is located is not equal to the specified brightness level.
[0123] Optionally, the device further comprises:
[0124] An initial table acquisition module, used to acquire an initial pixel lookup table according to a specified lookup table size;
[0125] A lookup table acquisition module, used to acquire an extreme color space lookup table and a rectangular color space lookup table corresponding to the initial pixel lookup table;
[0126] A basic point table acquisition module, used to acquire a basic point rectangular color space lookup table of the brightness partition grid;
[0127] A target table acquisition module, configured to acquire a target pixel lookup table according to the intermediate point, the basic point rectangular color space lookup table, the extreme color space lookup table and the rectangular color space lookup table;
[0128] The target table storage module is used to store the target pixel lookup table in a preset format.
[0129] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0130] Memory and processor;
[0131] The memory is used to store a computer program executable by the processor;
[0132] The processor is used to execute the computer program in the memory to implement the above method.
[0133] According to a fourth aspect of an embodiment of the present disclosure, a non-transitory computer-readable storage medium is provided, and when an executable computer program in the storage medium is executed by a processor, the above-mentioned method can be implemented.
[0134] According to a fifth aspect of an embodiment of the present disclosure, a chip is provided, comprising one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from a memory of an electronic device and send the signal to the processor, the signal comprising a computer instruction stored in the memory; when the processor executes the computer instruction, the electronic device executes the image processing method described in the first aspect.
[0135] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0136] As can be seen from the above embodiments, the solution provided by the embodiments of the present disclosure can obtain and display the color range and brightness partition grid corresponding to the input image at the specified brightness level; then, obtain the middle point in the brightness partition grid, and obtain the output image corresponding to the input image according to the middle point; thereafter, in response to detecting the selection of the target pixel point of the input image or the output image, synchronously display the mapping point of the target pixel point in the other image to compare the color changes of the target pixel point and the mapping point. In this way, the present embodiment can synchronously display the target pixel point and its corresponding mapping point in the input image and the output image to facilitate the comparison of the color changes of the target pixel point and the mapping point, thereby improving the adjustment efficiency and the user experience.
[0137] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0138] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0139] Figure 1 The figure is a flowchart of an image processing method according to an exemplary embodiment.
[0140] Figure 2 The figure is a flow chart showing a method of obtaining a color range according to an exemplary embodiment.
[0141] Figure 3 The figure is a schematic diagram showing a direct color space position of a pixel according to an exemplary embodiment.
[0142] Figure 4 The figure is a flow chart showing a method of obtaining an output image according to an exemplary embodiment.
[0143] Figure 5 The figure is a flow chart showing a method of obtaining a relative position relationship according to an exemplary embodiment.
[0144] Figure 6 The present invention is a flowchart showing a method of obtaining a basic point rectangular color space lookup table according to an exemplary embodiment.
[0145] Figure 7 The figure is a schematic diagram showing polar color space data of an original color space lookup table according to an exemplary embodiment.
[0146] Figure 8 The diagram is a schematic diagram showing a correspondence between a rank in an original color space lookup table and a brightness partition grid according to an exemplary embodiment.
[0147] Fig. 9 The figure is a schematic diagram showing a method of correcting polar color space data of an original color space lookup table according to an exemplary embodiment.
[0148] Fig.10 The diagram is a schematic diagram showing a method of correcting rectangular color space data of an original color space lookup table according to an exemplary embodiment.
[0149] Fig.11 is a schematic diagram of a three-dimensional grid block before adjustment according to an exemplary embodiment.
[0150] Fig.12 The figure is a flow chart showing a method of obtaining a proportionality coefficient according to an exemplary embodiment.
[0151] Fig.13 is a schematic diagram showing a quadrilateral interpolation according to an exemplary embodiment.
[0152] Fig.14 The figure is a schematic diagram showing a triangle interpolation according to an exemplary embodiment.
[0153] Fig.15 is a schematic diagram showing an adjusted three-dimensional grid block according to an exemplary embodiment.
[0154] Fig.16The figure is a flow chart showing a method of obtaining an output image according to an exemplary embodiment.
[0155] Fig.17 The diagram is a schematic diagram showing synchronously displaying the same pixel in an input image and an output image according to an exemplary embodiment.
[0156] Fig.18 The present invention is a flow chart showing a method of displaying mapping points corresponding to target pixels in a brightness partition grid according to an exemplary embodiment.
[0157] Fig.19 The diagram is a schematic diagram showing a mapping point corresponding to a target pixel point in a brightness partition grid according to an exemplary embodiment.
[0158] Fig. 20 The diagram is another schematic diagram showing mapping points corresponding to target pixels in a brightness partition grid according to an exemplary embodiment.
[0159] Fig.21 The figure is a flowchart showing a method of storing a target pixel lookup table according to an exemplary embodiment.
[0160] Fig. 22 is a schematic diagram of an initial pixel lookup table according to an exemplary embodiment.
[0161] Fig.23 The figure is a block diagram of a real-time display part according to an exemplary embodiment.
[0162] Fig.24 The figure is a flow chart showing a data change according to an exemplary embodiment.
[0163] Fig.25 The figure is a block diagram showing a method for storing a pixel lookup table according to an exemplary embodiment.
[0164] Fig.26 is a block diagram of an image processing apparatus according to an exemplary embodiment.
[0165] Fig. 27 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0166] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described exemplarily below do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices consistent with some aspects of the present disclosure as detailed in the attached claims. It should be noted that the features in the following embodiments and implementations may be combined with each other without conflict.
[0167] Existing 3D lookup table debugging tools can be used to generate 3D lookup tables, which can achieve mapping between different color spaces and meet different color adjustment requirements, so they are widely used. With the existing 3D lookup table debugging tools, users can generate output images with expected effects through a series of visual operations. However, the existing lookup table debugging tools can only display input images and output images. The colors of the same pixel before and after adjustment in the two images are not marked, which reduces the user experience. In addition, the existing lookup table debugging tools cannot adjust the grid according to brightness. When adjusting the hue and saturation, it usually affects the hue and saturation corresponding to a larger range of brightness, resulting in poor adjustment flexibility.
[0168] In order to solve the above technical problems, an embodiment of the present disclosure provides an image processing method, which can be applicable to an electronic device equipped with a 3D lookup table debugging tool. Figure 1 is a flowchart of an image processing method according to an exemplary embodiment. Figure 1 , an image processing method, comprising steps 11 to 13.
[0169] In step 11, the color range and brightness partition grid corresponding to the input image at the specified brightness level are obtained and displayed.
[0170] In this embodiment, the electronic device can obtain an input image and display the input image in the display area.
[0171] In this embodiment, the electronic device can obtain the color range corresponding to the specified brightness level of the input image, see Figure 2 , including steps 21 to 25:
[0172] In step 21, the electronic device can obtain the size and pixel data of the input image. The pixel data refers to the data composed of the three colors RGB in the input image. For example, the pixel data of a certain pixel in the input image is (0.0, 0.5, 0.5).
[0173] In step 22, the electronic device can compare the size of the input image with a preset size threshold; when the size of the input image is less than or equal to the preset size threshold, the electronic device can obtain the polar color space data corresponding to the above pixel data. The above polar color space data refers to color space data represented by polar coordinates, and the color space may include HSV color space and HSL color space. For the convenience of description, the HSV color space is taken as an example, where H (Hue) represents hue, S (Saturation) represents saturation, and V (Value) represents brightness, then the polar color space data can be represented by Polar HSV. For example, the polar color space data is (180, 1.0, 0.5), and the normalized polar color space data is (0.5, 1.0, 0.5).
[0174] In step 23, the electronic device may obtain rectangular color space data corresponding to the polar color space data. The rectangular color space data refers to color space data represented by rectangular coordinates, that is, color space data in a rectangular coordinate system, represented by Cart HSV. For example, the rectangular color space data is (-6.0, 0.0, 0.5).
[0175] In step 24, the electronic device can determine the brightness level corresponding to each pixel in the input image according to the brightness value of the rectangular color space data. The brightness level is an identifier corresponding to each brightness interval after the brightness value range is divided into multiple brightness intervals.
[0176] For example, the electronic device can obtain the product of the brightness value of the rectangular color space data of each pixel and the preset gear adjustment data. The gear adjustment data is the difference between the maximum value of the brightness gear and the minimum value of the brightness gear. Then, the electronic device can round the product and calculate the sum with the preset constant, and the sum is the brightness gear corresponding to each pixel, and the preset constant is 0 or 1. In one example, the above brightness value range is divided into 9 brightness intervals, and the corresponding brightness gears are 1 to 9.
[0177] Assume that the brightness level of the pixel at the i-th row and j-th column of the input image is:
[0178] K=round[CartHSV(i,j,3)*(9-1)+1]; (1)
[0179] In formula (1), K represents the brightness level, round represents rounding, CartHSV(i,j,3) represents the brightness value of the pixel in the i-th row and j-th column, (9-1) represents the difference between the maximum value of the brightness level and the minimum value of the brightness level, and +1 represents that the value of the brightness level starts from 1.
[0180] Assume that the rectangular color space data of the pixel point in the i-th row and j-th column of the input image is (-6.0, 0.0, 0.5), and its brightness level is: K = round[0.5*(9-1)+1] = 5. Therefore, the pixel point in the i-th row and j-th column falls in the 5th brightness interval, and the coordinates in the brightness partition grid are the H and S values of the rectangular color space data, that is, (-6.0, 0.0). The effect is as follows Figure 3 See Figure 3 , Figure 3 The -5 in the left box indicates the brightness level of the currently displayed brightness partition grid. Figure 3 The point in the circle on the left indicates the position of the pixel and coincides with a basic point in the brightness partition grid.
[0181] In step 25, the electronic device may obtain rectangular color space data in which the brightness level is equal to the designated brightness level, and obtain a color range corresponding to the designated brightness level.
[0182] In this embodiment, Figure 2 The content of the example shown can divide the brightness value range into multiple brightness intervals, so that the color (hue and / or saturation) within each brightness interval can be adjusted to achieve the effect of accurately adjusting the local color.
[0183] In this embodiment, the electronic device can obtain and display the brightness partition grid (also referred to as A / B grid) corresponding to the input image at the specified brightness level, and the effect is as follows: Figure 3 shown.
[0184] For example, the electronic device can obtain the specified brightness level selected by the user; wherein the brightness level is an identifier corresponding to each brightness interval after the brightness value range is divided into multiple brightness intervals. Then, the electronic device can obtain the brightness partition grid corresponding to the brightness level. It is understandable that the brightness partition grids of each brightness level are the same before adjustment; after adjusting the basic point of a brightness partition grid, the position of the basic point in the brightness partition grid of at least one level is changed. The change of the brightness partition grid of at least one level means that when all brightness levels are not locked, if the position of a basic point changes, the brightness partition grids of all levels will change synchronously, and the basic points of the brightness partition grids of each level will change linearly with the basic point being dragged; if the brightness partition grids of the two levels adjacent to the basic point being dragged are locked, only the basic points of the brightness partition grid where the basic point being dragged is located will change; if the brightness partition grid of the level farther from the basic point being dragged is locked, the basic points in the brightness partition grid adjacent to the brightness partition grid where the basic point being dragged is located will change. The technician can lock different brightness partition grids according to the specific scene to achieve the effect of accurately adjusting the basic points in the specified brightness level.
[0185] It is understandable that, for the convenience of description, in the embodiments of the present disclosure, the basic points in the brightness partition grid refer to the points before adjustment, and all the basic points after adjustment are referred to as intermediate points.
[0186] In step 12, the middle point in the brightness partition grid is obtained, and the output image corresponding to the input image is obtained according to the middle point.
[0187] In this embodiment, the electronic device may obtain the middle point in the brightness partition grid.
[0188] In one example, when displaying a brightness partition grid, if the user drags the position of a basic point in the brightness partition grid, the positions of other basic points in the brightness partition grid also change accordingly, and all basic points in the brightness partition grid constitute the middle point of the brightness partition grid.
[0189] In another example, the brightness partition grid is the currently displayed grid, and the position of the middle point can be displayed in the brightness partition grid before and after the change, so as to facilitate direct viewing by the user. However, for brightness partition grids other than the currently displayed brightness partition grid, the positions of the basic points in these brightness partition grids will also change synchronously and become the middle points to be saved.
[0190] Since the electronic device does not display these brightness partition grids or middle points, the user cannot perceive the position change of the middle point outside the current brightness partition grid. In this case, the user can adjust the brightness partition grid as shown in the figure. Figure 3 The rightmost brightness level (-1 to -9) is shown. For example, the brightness partition grid of the 6th brightness level (-6) is currently displayed, and the user can select the 5th brightness level (-5) to view the position change of the middle point of the brightness partition grid of the 5th brightness level. In other words, the electronic device can read the middle point of the brightness partition according to the brightness level. In this way, the electronic device can read the middle point of each brightness partition grid.
[0191] In this embodiment, the electronic device can obtain the output image corresponding to the input image according to the intermediate point. Figure 4 , including step 41 and step 42.
[0192] In step 41, the electronic device may obtain polar color space data corresponding to the input image, and obtain the relative position relationship of each pixel in the input image.
[0193] In this step, the electronic device can obtain the polar color space data corresponding to the input image. For details, please refer to the contents of step 21 and step 22, which will not be repeated here.
[0194] In this step, the electronic device can obtain the relative position relationship of each pixel in the input image. It is understandable that the relative position relationship can be obtained in advance when the input image is obtained and stored in a specified position. When there is a need to use the relative position relationship, it can be read from the specified position, which can reduce the amount of data processing and improve the efficiency of obtaining the output image. Of course, when the computing resources of the electronic device are sufficient, the above relative position relationship can also be obtained in real time. The technician can choose an appropriate method according to the specific scenario, which is not limited here.
[0195] See also Figure 5 , the electronic device obtains the relative position relationship of each pixel point, including steps 51 to 54.
[0196] In step 51, the electronic device may obtain a basic point rectangular color space lookup table of the brightness partition grid and polar color space data and rectangular color space data corresponding to each pixel point.
[0197] In this step, the electronic device obtains the polar color space data and the rectangular color space data corresponding to each pixel point. Figure 2 The contents of the illustrated embodiment will not be repeated here.
[0198] In this step, the electronic device obtains the basic point rectangular color space lookup table of the brightness partition grid, see Figure 6 , including steps 61 to 64.
[0199] In step 61, the electronic device may obtain the hue density, saturation density and brightness density of the brightness partition grid, as well as the hue value range, saturation value range and brightness value range.
[0200] In this step, hue density refers to the number of gears into which the hue value range is divided, saturation density refers to the number of gears into which the saturation value range is divided, and brightness density refers to the number of gears into which the brightness value range is divided. In one example, the hue value range is (in the rectangular coordinate system) [-7,7] or (in the polar coordinate system) [0,360], and the hue density is 8, which is divided into 8 gears. Considering that 0 and 360 degrees coincide in the polar coordinate system, there are actually 9 gears, namely 0, 45, 90, 135, 180, 225, 270, 315 and 360 degrees. In one example, the saturation value range is (in the rectangular coordinate system) [-7,7], and the saturation density is 7, which is actually 8 gears, namely 0, 1, 2, 3, 4, 5, 6 and 7. In one example, the brightness value range is (in the rectangular coordinate system) [0, 1], and the brightness density is 8, which is divided into 9 gears. It should be noted that the above hue density, saturation density and brightness density can be adjusted according to specific scenarios. Taking hue as an example, it can be divided into 17 gears, 25 gears, etc. If each value range can be evenly divided, the corresponding solution falls within the protection scope of this disclosure.
[0201] In one example, before acquiring the input image, the electronic device may display a configuration page and guide the user to configure the above value range and its density, and save it to a designated location to facilitate subsequent reading.
[0202] In step 62, the electronic device may generate an original color space lookup table according to the hue density, the saturation density, and the brightness density.
[0203] In this step, the electronic device can generate an original color space lookup table based on the hue density, saturation density and brightness density. Taking the hue density of 8, the saturation density of 8 and the brightness density of 9 as an example, the electronic device can generate a 9*8*9-position table, with the positions ranging from 1 to 648 (=9*8*9).
[0204] In step 63, the electronic device may fill in the hue value, saturation value and brightness value of each position in the original color space lookup table according to the hue value range, the saturation value range and the brightness value range.
[0205] In this step, the electronic device may fill in the hue value, saturation value and brightness value of each position in the initial color space lookup table according to the hue value range, saturation value range and brightness value range.
[0206] See also Figure 7, the hue H changes by one unit 1 / (9-1) each time, that is, 1 / (9-1) or 0.125000. Then, for the first time, the value of H is 0.000000; for the second time, the value of H is 0.125000; for the third time, the value of H is 0.250000; for the fourth time, the value of H is 0.375000; ...; for the ninth time, the value of H is 1.000000; for the tenth time, the value of H is 1.125000. Since the maximum value of H is 1, it is necessary to carry to S, that is, S changes by one unit 1 / (8-1); at this time, H becomes 0.000000, and the value of S changes from 0.000000 to 1 / (8-1) or 0.142857. At the 11th time, the value of H is 0.125000, and the value of S is 0.142857; at the 12th time, the value of H is 0.250000, and the value of S is 0.142857; at the 13th time, the value of H is 0.375000, and the value of S is 0.142857; ...; at the 72nd (i.e. 9*8) time, the value of H is 1.000000, and the value of S is 1.000000; at the 73rd time When H and S are both 1.000000, H changes by one unit and moves toward V. At this time, V changes by one unit, 1 / (9-1), and the cycle repeats until the 648th (=9*8*9)th time, when H, S and V are all 1.000000.
[0207] From the perspective of polar coordinates, see Figure 7 and Figure 8 , when S is 0, the H value is meaningless. When V is 0, the H and S values are also meaningless. For example Figure 7 The data in rows 1 to 9 of the original color space lookup table shown should all be 0, that is, Figure 8 However, in order to evenly divide the color space values into the original color space lookup table, the present disclosure temporarily adopts Figure 7 The assignment method for the first 9 lines in . Figure 8 , the 10th row in the original color space lookup table indicates that the S value moves one unit to the right, and the 11th row indicates that the H value moves one unit counterclockwise, while the S value remains unchanged. That is, after the H value moves one circle counterclockwise, the S value moves one unit outward, that is, moves to the next circle, until the basic point (the 72nd) of the current brightness partition grid is traversed and then enters the brightness partition grid of the next brightness partition, until the 648th (=72*9) basic point is reached.
[0208] Continue to see Figure 8, the brightness partition is a cylinder, and its cross section is a circle. In the present disclosure, a regular octagon is used to fit the circle. If the saturation value at the vertex of the regular octagon is 1, then the saturation value on the edge of the regular octagon must be less than 1, so that some pixels are located outside the regular octagon and overflow occurs. For this reason, the original color space lookup table obtained in step 63 is also corrected in this embodiment, see Fig. 9 In order to include the points falling outside the regular octagon back to the inside of the regular octagon, the S value 0 to 1 is corrected and divided into 7 points with an interval of 1 / (8-2). At this time, the saturation of the basic points of the 7th circle of the regular octagon is 1, and the saturation of the basic points of the 8th circle is 1+1 / (8-2)=1.666667. In this way, the saturation of each pixel point falls within the range of the regular octagon, avoiding the problem of pixel overflow and ensuring the accuracy of the original color space lookup table.
[0209] In step 64, the electronic device may replace the hue value and the saturation value in the original color space lookup table with the rectangular coordinates of the basic point of the same rank and retain the brightness value to obtain the basic point rectangular color space lookup table.
[0210] Considering that the hue value (i.e., H value) and saturation value (i.e., S value) in the original color space lookup table in step 63 are polar coordinate data, in this step, the electronic device can replace the H value and the S value with the rectangular coordinates of the basic point of the same rank and retain the brightness value, and obtain the following: Fig.10 The basic point rectangular color space lookup table is shown in FIG. Among them, the brightness value remains unchanged because it only involves the brightness partition.
[0211] See also Figure 8 and Fig.10 , the positions 1 to 9 of the basic point rectangular color space lookup table are the origins in the brightness partition grid, Fig.10 The H, S, and V values of the 1st to 9th basic points are all 0. The 10th basic point is moved 1 unit to the right, with an H value of 1, an S value of 0, and a V value of 0. The 11th basic point has an H value that rotates counterclockwise by one unit, and an S value that moves to the right by one unit, that is, at this time Therefore, the H value is 0.707107, the S value is 0.707107, and the V value is 0. The 12th basic point rotates 2 units and S moves 1 unit. At this time, the H value is 0, the S value is 1, and the V value is 0. Based on the above analysis process, Figure 8 The H value and S value in the polar coordinate system of the original color space lookup table shown are replaced with the H value and S value in the rectangular coordinate system, and finally the rectangular coordinates (7, 0, 1) of the 648th basic point are determined.
[0212] In this embodiment, after the user drags a basic point in the brightness partition grid, the basic point becomes an intermediate point. From the user's perspective, the position of the intermediate point in the brightness partition grid changes, which brings about a change in color; from the perspective of the electronic device, it is essentially a process of converting the acquired basic point rectangular color space lookup table into an intermediate point rectangular color space lookup table. The electronic device can determine the target position of the basic point in response to detecting an operation indicating dragging any basic point in the brightness partition grid. Then, the electronic device can adjust the position of the associated basic point of the basic point according to the target position, and obtain the rectangular color space data according to the target position and the position of the associated basic point. Finally, the electronic device can write the rectangular color space data into the corresponding position of the basic point rectangular color space lookup table according to the position of each intermediate point, and obtain the intermediate point rectangular color space lookup table.
[0213] Among them, the associated basic point refers to the basic point between the first brightness zone and the second brightness zone; the first brightness zone refers to the brightness zone locked by the user or the brightness zone with the smallest brightness level, and the second brightness zone refers to the brightness zone locked by the user or the brightness zone with the largest brightness level.
[0214] In step 52, the electronic device may determine the position of each pixel point at the vertex of the three-dimensional grid block corresponding to the brightness partition grid according to the position of each pixel point in the extreme color space data.
[0215] In this step, after obtaining the polar color space data of each pixel point, the electronic device can obtain the position of each pixel point in the lookup table. Then, the electronic device can determine the 8 positions or 6 positions in the brightness partition grid according to the position of each pixel point, and the basic points of these 8 positions or 6 positions constitute a three-dimensional grid block, as well as the rectangular color space data corresponding to these 8 positions or 6 positions. Fig.11 A three-dimensional grid block composed of eight basic points is shown.
[0216] It should be noted that the brightness value of the brightness partition is a value range. Taking the brightness partition of the 6th brightness level as an example, its brightness value range is [0.5625, 0.6875].
[0217] In step 53, the electronic device may determine the rectangular color space data of each vertex in the three-dimensional grid block according to the basic point rectangular color space lookup table.
[0218] In this step, after determining the positions of the vertices in the three-dimensional grid block, the electronic device can retrieve the positions of the basic point rectangular color space lookup table to obtain the rectangular color space data of each vertex.
[0219] In step 54, the electronic device can determine the proportional coefficient of each pixel point in the hue, saturation and brightness directions based on the rectangular color space data of each pixel point and the rectangular color space data of each vertex in the three-dimensional grid block, and use the proportional coefficient as the relative position relationship.
[0220] See also Fig.12 , the electronic device obtains the proportional coefficient, including steps 121 to 124.
[0221] In step 121, the electronic device may project the rectangular color space data of each pixel point onto the first plane and the second plane of the three-dimensional grid block to obtain a projection point; the first plane and the second plane are parallel. Fig.11 , the first plane is ABCD, the second plane is A_1B_1C_1D_1, the pixel point is X1, then the projection point of the pixel point X1 on the first plane is X, and the projection point on the second plane is X_1.
[0222] In step 122, the electronic device may obtain shapes of the first plane and the second plane, and select an interpolation model according to the shapes.
[0223] In this step, the electronic device may select an interpolation model according to the shape. When the shape is a quadrilateral, the interpolation model is determined to be an inverse bilinear interpolation model; and / or, when the shape is a triangle, the interpolation model is determined to be a triangle interpolation model. Fig.11 , the shapes of the first plane and the second plane are quadrilaterals, the electronic device determines that the interpolation model is an inverse bilinear interpolation model.
[0224] In step 123, the electronic device may perform interpolation processing on the projection points according to the interpolation model to obtain proportional coefficients in the hue direction and the saturation direction.
[0225] In this step, taking the first plane ABCD as an example, the rectangular color space data of the vertex ABCD and the rectangular color space data of the projection point X are known, and the proportional coefficient u in the hue direction is calculated.
[0226] See also Fig.13 , P is the linear interpolation of A and B at the ratio u: P = A + (BA) * u;
[0227] Q is the linear interpolation of D and C at the ratio u: Q = D + (CD) * u;
[0228] X is the linear interpolation of P and Q at the ratio v: X = P + (QP) * v;
[0229] From this we can see that
[0230] X(u,v)=A+(BA)*u+(DA)*v+(A-B+CD)*u*v; (2)
[0231] When X is inside the first plane ABCD, the value range of u and v is [0,1].
[0232] For the convenience of description, define intermediate variables:
[0233] E=BA; F=DA; G=A-B+CD; L=XA;
[0234] The above formula (2) becomes:
[0235] L=E*u+F*v+G*u*v; (3)
[0236] In this step, any two coordinates {i, j} can be selected and introduced into equation (3) to calculate:
[0237] u=(Li-Fi*v) / (Ei+Gi*v); (4)
[0238] Lj=Ej*u+Fj*v+G*u*v; (5)
[0239] Substitute equation (4) into equation (5) to eliminate u, and then rearrange to obtain:
[0240] Lj*Ej+Lj*Gi*v=Ej*Li-Ej*Fi*v+Fj*Ei*v+Fj*Gi*v 2 +Gj*Li*v-Gj*Fi*v 2 (6)
[0241] Wherein equation (6) is a quadratic equation about v, namely:
[0242] a*v 2 +b*v+c=0; (7)
[0243] In formula (7), a=Fj*Gi-Gj*Fi; b=Fj*Ei-Ej*Fi-Lj*Gi+Gj*Li; c=Ej*Li-Lj*Ej.
[0244] When X is in the first plane ABCD, b 2 -4ac is always a positive number, and the value of v is between [0, 1]. At this time, the value of v can be obtained. Then substitute the value of v into formula (4) to obtain u.
[0245] In step 124, the electronic device may obtain a proportional coefficient in the brightness direction. For example, the electronic device may obtain the difference between the brightness value of the pixel point X1 and the brightness value corresponding to the first plane ABCD, and then calculate the ratio of the difference to the value range of the brightness partition, which is the proportional coefficient in the brightness direction.
[0246] It should be noted that before and after the basic point or the middle point of the brightness partition grid is adjusted, the above relative position relationship of each pixel point remains unchanged.
[0247] See also Fig.14 , when the interpolation model adopts triangular interpolation, P is the linear interpolation of A and C at the ratio u: P = A + (CA) * u;
[0248] X is the linear interpolation of B and P at a ratio of 1 / n: X = B + (PB) / n, after transformation: P = B + (XB) * n;
[0249] From this we can see that A+(CA)*u=B+(XB)*n.
[0250] When BX and AC are parallel, it is a special case with no solution. You only need to swap the positions of B and C.
[0251] Similarly, introducing two coordinates {i, j}, we get:
[0252] u=[(Bi-Ai)+(Xi-Bi)*n] / (Ci-Ai); (8)
[0253] Aj+(Cj-Aj)*u=Bj+(Xj-Bj)*n; (9)
[0254] By combining equation (8) and equation (9) to eliminate u, we can obtain:
[0255] n=[(Ai-Bi)*(Cj-Aj)+(Bj-Aj)*(Ci-Ai)] / [(Cj-Aj)*(Xi-Bi)+(Bj-Xj)*(Ci-Ai)]; (10)
[0256] Assuming that A and C do not overlap, u can be calculated by substituting equation (10) into equation (8).
[0257] In this example, u is the proportional coefficient in the hue direction, and n is the proportional coefficient in the saturation direction.
[0258] In step 42, the electronic device may acquire the output image according to the relative position relationship, the intermediate point and the extreme color space data.
[0259] In this step, see Fig.15 , the relative position relationship u and v of pixel point X1 is known, and the middle point is Fig.15 The rectangular color space data of the vertices of the three-dimensional grid block shown is known, and the polar color space data of the pixel point is also known, so the output image can be obtained, see Fig.16 , including steps 161 to 165.
[0260] In step 161, the electronic device may obtain the order corresponding to the extreme color space data of each pixel.
[0261] In this step, the calculation of the position of the lower left corner of a quadrilateral or triangle corresponding to each pixel point is taken as an example. The product of the H value and the hue density in the extreme color space data is rounded down, the product of the S value and the saturation density is rounded down, and the product of the V value and the brightness density is rounded down. Assuming that the extreme color space data of the pixel point is (0.1, 0.2, 0.3), the calculation process of its position can be as follows:
[0262] 0.1*(9-1)=0.8, 0.8 is rounded down to 0;
[0263] 0.2*(8-2)=1.2, 1.2 is rounded down to 1;
[0264] 0.3*(9-1)=2.4, 2.4 is rounded down to 2;
[0265] When S is 1, it means H has rotated one circle; when V is 2, it means it has passed through two brightness partitions; therefore, the position is: 0+1*9+2*9*8+1=154. The last addition of 1 in the above formula means that the position starts from 1.
[0266] In step 162, the electronic device may determine the three-dimensional grid block corresponding to the position in the brightness partition grid, and the position of each vertex of the three-dimensional grid block.
[0267] In this step, after determining the position of the lower left corner, a middle point of the three-dimensional grid block is determined. Figure 8 and Fig.11 , assuming Fig.11 The middle point A in the lower left corner is Figure 8 The middle point 10 in the graph shows that:
[0268] The middle point B in the upper left corner: add 1 to the middle point 10, which is the middle point 11;
[0269] The middle point D in the lower right corner: add 9 to the middle point 10, which is the middle point 19;
[0270] The middle point C in the upper right corner: Add 9 to the middle point 10 to get the middle point 19 in the lower right corner, and then add 1 to the middle point 19, which is the middle point 20.
[0271] The positions of the other four intermediate points A_1, B_1, C_1 and D_1 can be obtained by adding 9*8=72 to the intermediate points 10, 11, 20 and 19, namely the intermediate points 82, 83, 92 and 91.
[0272] In step 163, the electronic device may obtain rectangular color space data corresponding to the positions of the vertices in the rectangular color space lookup table of the middle point.
[0273] In this step, consider Figure 6 The scheme for obtaining the basic point rectangular color space lookup table is illustrated in , so that the electronic device can refer to Figure 6 The solution shown obtains the midpoint rectangular color space lookup table, or directly reads the midpoint rectangular color space lookup table. Then, the electronic device can obtain the rectangular color space data of each vertex in the midpoint rectangular color space lookup table according to the order of each vertex.
[0274] In step 164, the electronic device may determine the rectangular color space data of each pixel point according to the rectangular color space data of each vertex and the relative position relationship.
[0275] In this step, continue to see Fig.15 , when the rectangular color space data and relative position relationship of the 8 vertices of the three-dimensional grid block are known, the electronic device can calculate the rectangular color space data of P according to vertex A, vertex B and u, calculate the position of Q according to vertex C, vertex D and u, and then calculate the rectangular color space data of the hue and saturation of the projection point X according to P, Q and v; then, obtain the product of the brightness ratio and the value range of the brightness partition, and calculate the sum of the product and the brightness value of plane ABCD to obtain the rectangular color space data of the brightness, thereby obtaining the rectangular color space data of the pixel point X1.
[0276] In step 165, the electronic device may convert the rectangular color space data of each pixel point into pixel data to obtain the output image.
[0277] In this step, the electronic device can convert the rectangular color space data into polar color space data, and then convert the polar color space data into pixel data, thereby obtaining an output image. At this time, the electronic device can display the output image in the display area. It is understandable that the electronic device is convenient for the user to view the color changes of the two images during the process of simultaneously displaying the input image and the output image.
[0278] In step 13, in response to detecting the target pixel point of the input image or the output image, the mapping point of the target pixel point is synchronously displayed in the other image to compare the color change of the target pixel point and the mapping point.
[0279] In this embodiment, when displaying the input image and the output image, the user passes by and views a certain pixel in the image, and the electronic device can display the selected target pixel in the input image / output image and display the mapping point corresponding to the target pixel in the brightness partition grid. It is understandable that Fig.16 The example shown describes a scheme for obtaining an output image, or describes obtaining the position and pixel data of each pixel in the input image and the output image. Therefore, when the target pixel is detected, a first mark (such as a circle) is used to highlight it in the input image, and the effect is as follows: Fig.17 As shown in Figure (a); the second mark (such as X) is used to highlight the output image, and the effect is as follows Fig.17 As shown in Figure (b).
[0280] In one embodiment, the electronic device may also display the mapping point corresponding to the target pixel point in the brightness partition grid, see Fig.18 , including steps 181 to 184.
[0281] In step 181, the electronic device may obtain the position coordinates of the target pixel point. When the user selects the target pixel point in the input image or the output image, the electronic device may obtain the position coordinates of the target pixel point.
[0282] In step 182, the electronic device may convert the position coordinates into pixel data corresponding to the pixel point. Since each position in the display area corresponds to the pixel data of the pixel point in a one-to-one relationship, the pixel data corresponding to the pixel point may be directly obtained according to the position coordinates.
[0283] In step 183, the electronic device can obtain the rectangular color space data and position corresponding to the pixel data. In this step, the electronic device can obtain the rectangular color space data corresponding to the pixel data, and the rectangular color space data interpolated according to the intermediate point rectangular color space lookup table. The content of the intermediate color space lookup table can be found in Figure 6 The contents of the illustrated embodiment will not be repeated here.
[0284] In step 184, the electronic device can display the mapping points in the brightness partition grid according to the rectangular color space data and the position in the brightness partition grid. The electronic device can synchronously display the mapping points corresponding to the pixels in the input image and the output image in the brightness partition grid, and the effect is as follows: Fig.19 shown.
[0285] See also Fig.19When the user selects a target pixel (marked with a circle) in the input image in the upper left corner, the mapping point corresponding to the target pixel is marked with an X in the output image in the lower left corner; at the same time, the positions of the target pixel and the mapping point are displayed in the brightness partition grid on the right.
[0286] In one embodiment, considering that the brightness partition where the target pixel point is located and the brightness partition currently displayed can be the same or different. Therefore, in this embodiment, the electronic device can compare the brightness level of the brightness partition where the mapping point corresponding to the target pixel point is located with the specified brightness level. If the brightness level of the brightness partition where the mapping point is located is equal to the specified brightness level, the mapping point in the brightness partition grid is displayed in the first display mode, such as Fig.19 In the example, a solid line is used to connect two mapping points. If the brightness level of the brightness partition where the mapping point is located is not equal to the specified brightness level, the mapping point in the brightness partition grid is displayed in a second display mode, such as Fig. 20 In this way, the present embodiment can facilitate the user to accurately determine the position of the pixel before and after adjustment, thereby achieving an accurate adjustment effect.
[0287] In one embodiment, the electronic device may also store a pixel lookup table, see Fig.21 , including steps 211 to 215.
[0288] In step 211, the electronic device may obtain an initial pixel lookup table according to a specified lookup table size.
[0289] In this step, the initial pixel lookup table can be Fig. 22 The specified lookup table size shown is a table of 17*17*17 bits. The initial pixel lookup table stores the RGB data of each pixel. Of course, the initial pixel lookup table can also be implemented using a table of 9*9*9 or 33*33*33 bits, which can be set according to the specific scenario.
[0290] In step 212, the electronic device may obtain a polar color space lookup table and a rectangular color space lookup table corresponding to the initial pixel lookup table; the brightness values in the polar color space lookup table and the rectangular color space lookup table correspond to multiple brightness levels. In this step, the scheme for obtaining the polar color space lookup table can refer to the content shown in step 63, and the scheme for obtaining the rectangular color space lookup table can refer to the content shown in step 64, which will not be repeated here.
[0291] In step 213, the electronic device may obtain a basic point rectangular color space lookup table of the brightness partition grid. The solution of step 213 may be referred to Figure 6 The content of the example shown will not be repeated here.
[0292] In step 214, the electronic device may obtain a target pixel lookup table according to the intermediate point, the basic point rectangular color space lookup table, the extreme color space lookup table, and the rectangular color space lookup table.
[0293] In this step, the electronic device can sequentially obtain the polar color space data of each pixel from the polar color space lookup table, and then obtain the rank of the pixel according to the polar color space data. The scheme for obtaining the rank can refer to the content of step 161, which will not be repeated here.
[0294] After obtaining the position of the pixel point, the electronic device can obtain the three-dimensional grid block where the pixel point is located and the position of each vertex of the three-dimensional grid block. For details, please refer to the content of step 162, which will not be repeated here.
[0295] After obtaining the position of each vertex of the three-dimensional grid block, the basic point rectangular color space lookup table can be searched to obtain the rectangular color space data of each vertex. For details, refer to the content of step 163, which will not be repeated here.
[0296] When the rectangular color space data of each vertex of the three-dimensional grid block and the rectangular color space data of the pixel point are known, the relative position relationship of the pixel point can be calculated. For details, please refer to the content of step 54, which will not be repeated here.
[0297] In this step, the electronic device can obtain the position of the middle point of the three-dimensional grid block and the rectangular color space data of each middle point according to the position of the pixel point. Fig.15 The contents of step 163 are not repeated here.
[0298] In the process of adjusting the middle point, the relative position relationship of the pixels remains unchanged, that is, Fig.10 and Fig.15 The values of u and v are the same. Then, when the rectangular color space data of the middle point of the middle three-dimensional grid block and the relative position relationship of the pixel point are known, the rectangular color space data of the pixel point can be determined by referring to the content of step 164. After obtaining the rectangular color space data of each pixel point, the rectangular color space lookup table after the pixel point adjustment can be obtained.
[0299] The electronic device may convert the rectangular color space lookup table of pixel points into an extreme color space lookup table, and then convert the extreme color space lookup table into a pixel lookup table.
[0300] In step 215, the electronic device may store the target pixel lookup table in a preset format.
[0301] In this step, the preset format may include but is not limited to file formats such as *.3dl, *.cube, and *.icc, and may be set according to specific scenarios. Then, the electronic device may store the target pixel lookup table according to the preset format.
[0302] So far, the scheme provided by the embodiment of the present disclosure can obtain and display the color range and brightness partition grid corresponding to the input image at the specified brightness level; then, obtain the middle point in the brightness partition grid, and obtain the output image corresponding to the input image according to the middle point; thereafter, in response to detecting the selection of the target pixel point of the input image or the output image, synchronously display the mapping point of the target pixel point in the other image to compare the color changes of the target pixel point and the mapping point. In this way, the present embodiment can synchronously display the target pixel point and its corresponding mapping point in the input image and the output image to facilitate the comparison of the color changes of the target pixel point and the mapping point, thereby improving the adjustment efficiency and the user experience.
[0303] The following describes the above image processing method by taking HSV color space as an example. The processing flow includes:
[0304] 1. Real-time preview
[0305] See also Fig.23 ,The real-time preview part includes : color range display of the input image, real-time display of grid points, output image display and real-time display of mapping points.
[0306] (I) Input image color range display
[0307] To ensure real-time display, the size of the input image is limited, that is, adjusted to a preset size (such as 750-1000). The input image is input to the RGB2HSV module, which converts the RGB data into PolarHSV data. Then, the PolarHSV data is input to the Polar2Cart module, which converts the PolarHSV data into CartHSV data. The data change process is as follows: Fig.24 As shown. Assuming that the brightness density is 8, the brightness value range can be divided into 9 partitions (or layers), corresponding to 9 brightness levels. The electronic device displays one brightness partition at a time, that is, specifies the brightness level; and displays the brightness partition grid corresponding to the brightness level. The calculation of the brightness level can be referred to the content of formula (1), which will not be repeated here.
[0308] (II) Real-time display of grid points
[0309] When the brightness partition grid (also called A / B grid) is initialized, only the basic points (Basic Points) of the brightness partition grid of a certain layer need to be displayed. Assuming that each layer of the brightness partition grid includes 57 grid points, i.e., 57 basic points, the brightness partition grid is a position matrix of 57 basic points. Since the brightness value range is divided into 9 levels, all the layered grids have a total of 9*57 basic points (rectangular coordinates).
[0310] When the user adjusts the brightness partition grid, the new position of each basic point can be obtained, which is called the middle point. According to the middle point and the currently selected brightness partition, the adjusted grid point can be displayed in real time.
[0311] (III) Real-time display of output images
[0312] First, a CartHSV lookup table (LUT) is generated based on the basic points. Then, the relative position relationship is calculated based on the CartHSV lookup table, the PolarHSV value of the pixel point, and the CartHSV value. Finally, the relative position relationship, the PolarHSV value of the pixel point, and the intermediate point are sent to the FastTransfer module to obtain the output image.
[0313] 1. Generate basic point HSV lookup table
[0314] See also Figure 6 The contents shown will not be repeated here.
[0315] 2. Transfer module
[0316] The input parameters of the Transfer module include the midpoint, the basic point HSV lookup table (i.e. the basic point rectangular color space lookup table), the PolarHSV data and the CartHSV data of the pixel point. The processing includes:
[0317] Step 1: Similar to the process of generating the basic point HSV lookup table, the Transfer module generates the midpoint HSV lookup table (i.e., the midpoint rectangular color space lookup table) based on the midpoint.
[0318] Step 2: Based on the PolarHSV data of the pixel point, the Transfer module will lock which three-dimensional grid block to use for interpolation, such as Fig.11 or Fig.15 shown.
[0319] Step 3: In the locked three-dimensional grid block, the Transfer module will interpolate the new CartHSV data corresponding to the CartHSV data of the pixel point based on the basic point HSV lookup table and the intermediate point HSV lookup table.
[0320] Since the upper and lower planes of the three-dimensional grid block are parallel, it is only necessary to project the CartHSV data of the pixel points onto the upper and lower planes for plane interpolation. Considering the possible shapes of the plane, namely quadrilaterals and triangles. In this embodiment, the inverse bilinear interpolation method is used for quadrilaterals, and the triangle interpolation method is used for triangles. See the interpolation process for details. Fig.11 and / or Fig.15 The contents of the illustrated embodiment will not be repeated here.
[0321] Step 4: Convert the CartHSV data value of each pixel into RGB data. The RGB value is the output of the Transfer module. It can be understood that the conversion of CartHSV data value into RGB data is the reverse process of converting RGB data into CartHSV data. For details, see Figure 6 The example solution will not be described in detail here.
[0322] 3. Fast Transfer Module
[0323] Considering that it is unnecessary to calculate the relative position relationship every time the middle point of the brightness partition grid is adjusted. Therefore, the present disclosure adds an image preprocessing stage, which only needs to calculate and save the relative position relationship of each pixel once when reading the input image. After that, the above relative position relationship can be directly called every time the middle point is adjusted or the output image is obtained. For triangle and quadrilateral interpolation, the following two relative position relationships are designed, namely:
[0324] When the triangle is interpolated, the relative position relationship is [0, 0, u, n, w, is_exchange].
[0325] The first "0" in the above relative position relationship indicates that the pixel point is triangle interpolation, the second "0" indicates that the pixel point is inside the triangle and does not need extrapolation, u indicates the proportional coefficient in the hue direction, n indicates the proportional coefficient in the saturation direction, w indicates the proportional coefficient in the brightness direction, and is_exchange indicates whether BX and AC are parallel and whether B and C need to be swapped.
[0326] When the quadrilateral is interpolated, the relative position relationship is [0 / 1, 0 / 1, u, v, w].
[0327] The first "0 / 1" in the above relative position relationship means that the pixel point takes 0 when triangle interpolation is performed, and takes 1 when quadrilateral interpolation is performed; the second "0 / 1" means that the pixel point takes the value 0 when no extrapolation is required, and takes 1 when a layer of quadrilateral needs to be extrapolated; u represents the proportional coefficient in the hue direction, v represents the proportional coefficient in the saturation direction, and w represents the proportional coefficient in the brightness direction.
[0328] The input data of the FastTransfer module includes the PolarHSV data of the pixel points, the relative position relationship and the CartHSV lookup table of the intermediate points, and the output is the output image. Its characteristic is that it can avoid repeated calculation work in the Transfer module and ensure the real-time performance of the output image.
[0329] 4. Real-time display of mapping points
[0330] When the mouse is located within the input image / output image, the electronic device will identify the RGB data of the (target) pixel of the input image corresponding to the mouse position, and further calculate the CartHSV data of the pixel of the input image, as well as the new CartHSV data after the three-dimensional grid block interpolation. Finally, the original CartHSV data and the new CartHSV data of the pixel are displayed in real time within the brightness partition grid and connected with arrows. When the brightness partition where the original CartHSV of the pixel is located (such as the brightness level is 5) is the currently displayed brightness partition (such as the brightness level is 5), the two mapping points and the connecting line are marked in red; if the brightness partition where the original CartHSV of the pixel is located (such as the brightness level is 5) is not the currently displayed brightness partition (such as the brightness level is 6), the two mapping points and the connecting line are marked in gray.
[0331] Second, save the RGB lookup table part
[0332] See also Fig.25 , the process of RGB lookup table includes:
[0333] Step 1: Pass the initial RGB lookup table through the RGB2HSV module and the Polar2Cart module in turn to obtain the PolarHSV lookup table and CartHSV lookup table corresponding to all original RGB values respectively;
[0334] Step 2: Send the PolarHSV lookup table and CartHSV lookup table corresponding to all original RGB values, the intermediate point and basic point HSV lookup tables to the Transfer module to calculate the updated CartHSV lookup table, and then inversely transform the updated CartHSV lookup table into an RGB lookup table.
[0335] Step 3: According to the selected preset format, the adjusted RGB lookup table is saved to a specified location, such as a local memory, a cache, etc.
[0336] Based on an image processing method provided in an embodiment of the present disclosure, an image processing device is also provided in an embodiment of the present disclosure. Fig.26 , the device comprises:
[0337] A color range acquisition module 261 is used to acquire and display the color range and brightness partition grid corresponding to the input image at a specified brightness level;
[0338] A brightness partition acquisition module 262, used to acquire and display the brightness partition grid corresponding to the input image at a specified brightness level;
[0339] A middle point acquisition module 263, used to acquire middle points in the brightness partition grid;
[0340] An output image acquisition module 264, configured to acquire an output image corresponding to the input image according to the intermediate point;
[0341] The mapping point acquisition module 265 is used for synchronously displaying the mapping point of the target pixel point in another image in response to detecting the selection of the target pixel point of the input image or the output image, so as to compare the color changes of the target pixel point and the mapping point.
[0342] In one embodiment, the color range acquisition module includes:
[0343] A size acquisition submodule, used to acquire the size and pixel data of the input image;
[0344] The polar color space data acquisition submodule is used to acquire the polar color space data corresponding to the pixel data when the size of the input image is less than or equal to a preset size threshold;
[0345] A rectangular color space data acquisition submodule, used to acquire the rectangular color space data corresponding to the polar color space data;
[0346] A brightness level acquisition submodule is used to determine the brightness level corresponding to each pixel in the input image according to the brightness value of the rectangular color space data; the brightness level is an identifier corresponding to each brightness interval after the brightness value range is divided into multiple brightness intervals;
[0347] The color range acquisition submodule is used to acquire the rectangular color space data whose brightness level is equal to the specified brightness level, and obtain the color range corresponding to the specified brightness level.
[0348] In one embodiment, the brightness level acquisition submodule includes:
[0349] A product acquisition unit, used to acquire the product of the brightness value of the rectangular color space data of each pixel and preset gear adjustment data; the gear adjustment data is the difference between the maximum value of the brightness gear and the minimum value of the brightness gear;
[0350] The brightness level acquisition unit is used to round the product and then calculate the sum of the product and a preset constant, where the sum is the brightness level corresponding to each pixel point.
[0351] In one embodiment, the brightness partition acquisition module includes:
[0352] The designated gear acquisition submodule is used to acquire the designated brightness gear selected by the user; the brightness gear is an identifier corresponding to each brightness interval after the brightness value range is divided into multiple brightness intervals;
[0353] The brightness partition acquisition submodule is used to acquire the brightness partition grid corresponding to the brightness level.
[0354] In one embodiment, the intermediate point acquisition module includes:
[0355] a target position acquisition submodule, configured to determine a target position of any basic point in the brightness partition grid in response to detecting an operation of dragging the basic point;
[0356] A lookup table acquisition submodule, used for adjusting the position of the associated basic point of the basic point according to the target position, and obtaining a midpoint rectangular color space lookup table; the associated basic point refers to the basic point between the first brightness partition and the second brightness partition; the first brightness partition refers to the brightness partition locked by the user or the brightness partition with the smallest brightness level, and the second brightness partition refers to the brightness partition locked by the user or the brightness partition with the largest brightness level;
[0357] The midpoint acquisition submodule is used to update the midpoint between the first brightness partition and the second brightness partition in the midpoint rectangular color space lookup table, and to acquire the midpoints of all brightness levels from the midpoint rectangular color space lookup table.
[0358] In one embodiment, the output image acquisition module includes:
[0359] A data acquisition submodule, used to acquire the polar color space data corresponding to the input image;
[0360] A position relationship acquisition submodule is used to acquire the relative position relationship of each pixel in the input image;
[0361] The output image acquisition submodule is used to acquire the output image according to the relative position relationship, the middle point and the extreme color space data.
[0362] In one embodiment, the position relationship acquisition submodule includes:
[0363] A color space data acquisition unit, used to acquire a basic point rectangular color space lookup table of the brightness partition grid and polar color space data and rectangular color space data corresponding to each pixel point;
[0364] A grid block acquisition unit, used to determine the position of each pixel point in the vertex of the three-dimensional grid block corresponding to the brightness partition grid according to the position of each pixel point in the extreme color space data;
[0365] A vertex data acquisition unit, used to determine the rectangular color space data of each vertex in the three-dimensional grid block according to the basic point rectangular color space lookup table and the order of the vertex;
[0366] The position relationship acquisition unit is used to determine the proportional coefficient of each pixel point in the hue, saturation and brightness direction according to the rectangular color space data of each pixel point and the rectangular color space data of each vertex in the three-dimensional grid block, and use the proportional coefficient as the relative position relationship.
[0367] In one embodiment, the position relationship acquisition unit includes:
[0368] A projection point acquisition subunit, used for projecting the rectangular color space data of each pixel point onto the first plane and the second plane of the three-dimensional grid block to obtain a projection point; the first plane and the second plane are parallel;
[0369] an interpolation model acquisition subunit, configured to acquire shapes of the first plane and the second plane, and select an interpolation model according to the shapes;
[0370] The proportional coefficient acquisition subunit is used to perform interpolation processing on the projection points according to the interpolation model to obtain the proportional coefficients in the hue direction and the saturation direction; and to obtain the proportional coefficient in the brightness direction.
[0371] In one embodiment, the interpolation model acquisition subunit includes:
[0372] a first subunit, configured to determine, when the shape is a quadrilateral, that the interpolation model is an inverse bilinear interpolation model; and / or,
[0373] The second subunit is used to determine that the interpolation model is a triangle interpolation model when the shape is a triangle.
[0374] In one embodiment, the color space data acquisition unit includes:
[0375] A value range acquisition subunit, used to acquire the hue density, saturation density and brightness density of the brightness partition grid, as well as the hue value range, saturation value range and brightness value range;
[0376] An original table acquisition subunit, used for generating an original color space lookup table according to the hue density, the saturation density and the brightness density;
[0377] An original table filling subunit, used to fill the hue value, saturation value and brightness value of each position in the original color space lookup table according to the hue value range, the saturation value range and the brightness value range;
[0378] The lookup table acquisition subunit is used to replace the hue value and saturation value in the original color space lookup table with the rectangular coordinates of the basic point of the same rank and retain the brightness value to obtain the basic point rectangular color space lookup table.
[0379] In one embodiment, the output image acquisition submodule includes:
[0380] A pixel order acquisition unit, used for acquiring the order corresponding to the extreme color space data of each pixel point;
[0381] A vertex ranking acquisition unit, used to determine the ranking of the three-dimensional grid block corresponding to the brightness partition grid, and the ranking of each vertex of the three-dimensional grid block;
[0382] An intermediate data acquisition unit, used for acquiring rectangular color space data corresponding to the position of each vertex in the rectangular color space lookup table of the intermediate point;
[0383] A pixel data acquisition unit, used to determine the rectangular color space data of each pixel point according to the rectangular color space data of each vertex and the relative position relationship;
[0384] The output image acquisition unit is used to convert the rectangular color space data of each pixel point into pixel data to obtain the output image.
[0385] In one embodiment, the device further comprises:
[0386] A position coordinate acquisition module, used to acquire the position coordinates of the target pixel point;
[0387] A pixel data acquisition module, used for converting the position coordinates into pixel data corresponding to the pixel point;
[0388] A rectangular color space data acquisition module, used to acquire the rectangular color space data and position corresponding to the pixel data;
[0389] A mapping point display module is used to display the mapping points in the brightness partition grid according to the rectangular color space data and the position in the brightness partition grid.
[0390] In one embodiment, the mapping point display module includes:
[0391] A level comparison submodule, used to compare the brightness level of the brightness partition where the mapping point corresponding to the target pixel point is located with the specified brightness level;
[0392] The first display submodule is used to display the mapping point in the brightness partition grid in a first display mode when the brightness level of the brightness partition where the mapping point is located is equal to the specified brightness level; and is also used to display the mapping point in the brightness partition grid in a second display mode when the brightness level of the brightness partition where the mapping point is located is not equal to the specified brightness level.
[0393] In one embodiment, the device further comprises:
[0394] An initial table acquisition module, used to acquire an initial pixel lookup table according to a specified lookup table size;
[0395] A lookup table acquisition module, used to acquire an extreme color space lookup table and a rectangular color space lookup table corresponding to the initial pixel lookup table;
[0396] A basic point table acquisition module, used to acquire a basic point rectangular color space lookup table of the brightness partition grid;
[0397] A target table acquisition module, configured to acquire a target pixel lookup table according to the intermediate point, the basic point rectangular color space lookup table, the extreme color space lookup table and the rectangular color space lookup table;
[0398] The target table storage module is used to store the target pixel lookup table in a preset format.
[0399] It should be noted that the device shown in this embodiment matches the contents of the method embodiment, and reference may be made to the contents of the above method embodiment, which will not be repeated here.
[0400] Fig. 27 27 is a block diagram of an electronic device according to an exemplary embodiment. For example, the electronic device 2700 may be a smart phone, a computer, a digital broadcast terminal, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0401] Reference Fig. 27 The electronic device 2700 may include one or more of the following components: a processing component 2702, a memory 2704, a power component 2706, a multimedia component 2708, an audio component 2710, an input / output (I / O) interface 2712, a sensor component 2714, a communication component 2716, and an image acquisition component 2718.
[0402] The processing component 2702 generally controls the overall operation of the electronic device 2700, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 2702 may include one or more processors 2720 to execute computer programs. In addition, the processing component 2702 may include one or more modules to facilitate interaction between the processing component 2702 and other components. For example, the processing component 2702 may include a multimedia module to facilitate interaction between the multimedia component 2708 and the processing component 2702.
[0403] The memory 2704 is configured to store various types of data to support operations on the electronic device 2700. Examples of such data include computer programs for any application or method operating on the electronic device 2700, contact data, phone book data, messages, pictures, videos, etc. The memory 2704 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0404] The power supply component 2706 provides power to various components of the electronic device 2700. The power supply component 2706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 2700. The power supply component 2706 may include a power chip, and the controller may communicate with the power chip to control the power chip to turn on or off a switch device, so that the battery supplies power to the mainboard circuit or not.
[0405] The multimedia component 2708 includes a screen that provides an output interface between the electronic device 2700 and the target object. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input information from the target object. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
[0406] The audio component 2710 is configured to output and / or input audio file information. For example, the audio component 2710 includes a microphone (MIC), and when the electronic device 2700 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive external audio file information. The received audio file information can be further stored in the memory 2704 or sent via the communication component 2716. In some embodiments, the audio component 2710 also includes a speaker for outputting audio file information.
[0407] The I / O interface 2712 provides an interface between the processing component 2702 and a peripheral interface module, which may be a keyboard, a click wheel, a button, etc.
[0408] The sensor component 2714 includes one or more sensors for providing various aspects of status assessment for the electronic device 2700. For example, the sensor component 2714 can detect the open / closed state of the electronic device 2700, the relative positioning of components, such as the display screen and keypad of the electronic device 2700, and the sensor component 2714 can also detect the position change of the electronic device 2700 or a component, the presence or absence of contact between the target object and the electronic device 2700, the orientation or acceleration / deceleration of the electronic device 2700, and the temperature change of the electronic device 2700. In this example, the sensor component 2714 can include a magnetic sensor, a gyroscope, and a magnetic field sensor, wherein the magnetic field sensor includes at least one of the following: a Hall sensor, a thin film magnetoresistive sensor, and a magnetic liquid acceleration sensor.
[0409] The communication component 2716 is configured to facilitate wired or wireless communication between the electronic device 2700 and other devices. The electronic device 2700 can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, or a combination thereof. In an exemplary embodiment, the communication component 2716 receives broadcast information or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 2716 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0410] In an exemplary embodiment, the electronic device 2700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components.
[0411] In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as a memory including instructions, and the above executable computer program can be executed by a processor. The readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0412] In an exemplary embodiment, a chip is also provided, comprising one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from a memory of an electronic device and send the signal to the processor, wherein the signal includes a computer instruction stored in the memory; when the processor executes the computer instruction, the electronic device executes Figure 1 The image processing method exemplified. The chip may be a conventional CPU (central processing unit) chip, GPU (graphics processing unit) chip, ISP (Image Signal Processing), etc., or an acceleration chip dedicated to artificial intelligence technology, such as an AI (Artificial Intelligence) accelerator, a single-chip microcomputer, a SOC (System on Chip), etc.
[0413] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0414] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. An image processing method, characterized in that: include: Get and display the color range and brightness partition grid corresponding to the input image at the specified brightness level; Obtaining polar color space data corresponding to an input image, and obtaining a relative position relationship of each pixel in the input image; Acquire an output image according to the relative position relationship, the middle points in the brightness partition grid and the extreme color space data, wherein the basic points in the brightness partition grid refer to points before adjustment, and all the basic points after adjustment are called middle points; In response to detecting that a target pixel point of the input image or the output image is selected, a mapping point of the target pixel point is synchronously displayed in another image to compare color changes of the target pixel point and the mapping point.
2. The method according to claim 1, characterized in that: Get the color range corresponding to the input image at the specified brightness level, including: Obtaining the size and pixel data of the input image; When the size of the input image is less than or equal to a preset size threshold, obtaining polar color space data corresponding to the pixel data; Obtaining rectangular color space data corresponding to the polar color space data; Determine the brightness level corresponding to each pixel in the input image according to the brightness value of the rectangular color space data; the brightness level is an identifier corresponding to each brightness interval after the brightness value range is divided into multiple brightness intervals; Obtain rectangular color space data whose brightness level is equal to the specified brightness level, and obtain a color range corresponding to the specified brightness level.
3. The method according to claim 2, characterized in that Determining the brightness level corresponding to each pixel in the input image according to the brightness value of the rectangular color space data includes: Obtaining the product of the brightness value of the rectangular color space data of each pixel and the preset gear adjustment data; the gear adjustment data is the difference between the maximum value of the brightness gear and the minimum value of the brightness gear; The product is rounded and then the sum of the product and the preset constant is calculated. The sum is the brightness level corresponding to each pixel.
4. The method according to claim 1, characterized in that: Get the brightness partition grid corresponding to the input image at the specified brightness level, including: Obtaining a specified brightness level selected by a user; the brightness level is an identifier corresponding to each brightness interval after the brightness value range is divided into multiple brightness intervals; Get the brightness partition grid corresponding to the brightness level.
5. The method according to claim 1, characterized in that Obtaining the middle point in the brightness partition grid includes: In response to detecting an operation representing dragging any basic point in the brightness partition grid, determining a target position of the basic point; Adjusting the position of the associated basic point of the basic point according to the target position to obtain a midpoint rectangular color space lookup table; the associated basic point refers to a basic point between a first brightness partition and a second brightness partition; the first brightness partition refers to a brightness partition locked by a user or a brightness partition with a minimum brightness level, and the second brightness partition refers to a brightness partition locked by a user or a brightness partition with a maximum brightness level; The midpoint between the first brightness partition and the second brightness partition in the midpoint rectangular color space lookup table is updated, and the midpoints of all brightness levels are obtained from the midpoint rectangular color space lookup table.
6. The method according to claim 1, characterized in that Obtaining the relative position relationship of each pixel in the input image includes: Obtain a basic point rectangular color space lookup table of the brightness partition grid and polar color space data and rectangular color space data corresponding to each pixel point; Determine the position of each pixel point in the vertex of the three-dimensional grid block corresponding to the brightness partition grid according to the position of each pixel point in the extreme color space data; Determine the rectangular color space data of each vertex in the three-dimensional grid block according to the basic point rectangular color space lookup table; The proportional coefficients of each pixel in the hue, saturation and brightness directions are determined according to the rectangular color space data of each pixel and the rectangular color space data of each vertex in the three-dimensional grid block, and the proportional coefficients are used as the relative position relationship.
7. The method according to claim 6, characterized in that Determining the proportional coefficient of each pixel in the hue, saturation and brightness direction according to the rectangular color space data of each pixel and the rectangular color space data of each vertex in the three-dimensional grid block includes: Projecting the rectangular color space data of each pixel point onto a first plane and a second plane of the three-dimensional grid block to obtain a projection point; the first plane and the second plane are parallel; Acquire shapes of the first plane and the second plane, and select an interpolation model according to the shapes; Performing interpolation processing on the projection points according to the interpolation model to obtain proportional coefficients in the hue direction and the saturation direction; Get the scale factor in the brightness direction.
8. The method according to claim 7, characterized in that An interpolation model is selected according to the shape, comprising: When the shape is a quadrilateral, determining that the interpolation model is an inverse bilinear interpolation model; and / or, When the shape is a triangle, the interpolation model is determined to be a triangle interpolation model.
9. The method according to claim 6, characterized in that Obtaining a basic point rectangular color space lookup table of the brightness partition grid, comprising: Obtaining the hue density, saturation density and brightness density of the brightness partition grid, as well as the hue value range, saturation value range and brightness value range; generating an original color space lookup table according to the hue density, the saturation density and the brightness density; Fill in the hue value, saturation value and brightness value of each position in the original color space lookup table according to the hue value range, the saturation value range and the brightness value range; The hue value and saturation value in the original color space lookup table are replaced with the rectangular coordinates of the basic point of the same rank and the brightness value is retained to obtain the basic point rectangular color space lookup table.
10. The method according to claim 1, characterized in that Acquiring the output image according to the relative position relationship, the intermediate point and the extreme color space data comprises: Obtaining the position corresponding to the extreme color space data of each pixel point; Determine the three-dimensional grid block corresponding to the position in the brightness partition grid, and the position of each vertex of the three-dimensional grid block; Obtaining rectangular color space data corresponding to the position of each vertex in the rectangular color space lookup table of the middle point; Determine the rectangular color space data of each pixel point according to the rectangular color space data of each vertex and the relative position relationship; The rectangular color space data of each pixel point is converted into pixel data to obtain the output image.
11. The method according to claim 1, characterized in that: The method further comprises: Obtaining the position coordinates of the target pixel point; Converting the position coordinates into pixel data corresponding to the pixel point; Obtaining rectangular color space data and position corresponding to the pixel data; Mapping points within the brightness partition grid are displayed within the brightness partition grid according to the rectangular color space data and positions.
12. The method according to claim 11, characterized in that Displaying the mapping points in the brightness partition grid according to the rectangular color space data and the position in the brightness partition grid includes: Comparing the brightness level of the brightness partition where the mapping point corresponding to the target pixel point is located with the specified brightness level; If they are equal, the mapping points in the brightness partition grid are displayed in a first display mode; If they are not equal, the mapping points in the brightness partition grid are displayed in a second display mode.
13. The method according to claim 1, characterized in that The method further comprises: Get the initial pixel lookup table according to the specified lookup table size; Obtaining an extreme color space lookup table and a rectangular color space lookup table corresponding to the initial pixel lookup table; Obtain a basic point rectangular color space lookup table of the brightness partition grid; Acquire a target pixel lookup table according to the intermediate point, the basic point rectangular color space lookup table, the extreme color space lookup table, and the rectangular color space lookup table; The target pixel lookup table is stored in a preset format.
14. An image processing device, characterized in that: include: A color range acquisition module is used to acquire and display the color range and brightness partition grid corresponding to the input image at a specified brightness level; A brightness partition acquisition module is used to acquire and display the brightness partition grid corresponding to the input image at a specified brightness level; A middle point acquisition module, used to acquire middle points in the brightness partition grid, wherein the basic points in the brightness partition grid refer to points before adjustment, and all basic points after adjustment are called middle points; An output image acquisition module is used to acquire polar color space data corresponding to an input image, and to acquire the relative position relationship of each pixel in the input image; Acquire the output image according to the relative position relationship, the intermediate point and the extreme color space data; A mapping point acquisition module is used for synchronously displaying the mapping point of the target pixel point in another image in response to detecting the target pixel point of the input image or the output image, so as to compare the color changes of the target pixel point and the mapping point.
15. An electronic device, characterized in that: include: Memory and processor; The memory is used to store a computer program executable by the processor; The processor is used to execute the computer program in the memory to implement the method according to any one of claims 1 to 13.
16. A non-transitory computer-readable storage medium, characterized in that: When the executable computer program in the storage medium is executed by a processor, the method according to any one of claims 1 to 13 can be implemented.
17. A chip, characterized in that: It comprises one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from a memory of an electronic device and send the signal to the processor, the signal comprising a computer instruction stored in the memory; when the processor executes the computer instruction, the electronic device executes the image processing method according to any one of claims 1 to 13.
