CN114581554A - Curve generation method and device for representing image information and storage medium - Google Patents

Curve generation method and device for representing image information and storage medium Download PDF

Info

Publication number
CN114581554A
CN114581554A CN202210152138.8A CN202210152138A CN114581554A CN 114581554 A CN114581554 A CN 114581554A CN 202210152138 A CN202210152138 A CN 202210152138A CN 114581554 A CN114581554 A CN 114581554A
Authority
CN
China
Prior art keywords
curve
coordinate data
anchor point
anchor
image information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210152138.8A
Other languages
Chinese (zh)
Inventor
肖雪
王国利
张骞
黄畅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Horizon Robotics Technology Research and Development Co Ltd
Original Assignee
Beijing Horizon Robotics Technology Research and Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Horizon Robotics Technology Research and Development Co Ltd filed Critical Beijing Horizon Robotics Technology Research and Development Co Ltd
Priority to CN202210152138.8A priority Critical patent/CN114581554A/en
Publication of CN114581554A publication Critical patent/CN114581554A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

The utility model discloses a curve generation method, a device and a storage medium for representing image information, wherein the method comprises the following steps: acquiring coordinate data corresponding to a plurality of anchor points respectively, wherein first coordinate data in the coordinate data of each anchor point are used for representing pixel information of pixel points of an image, and second coordinate data in the coordinate data of each anchor point are used for representing correction parameters of the pixel information; obtaining actual expressions corresponding to the curve segments according to the smooth curve drawing condition, the general expressions corresponding to the curve segments respectively and the coordinate data corresponding to the anchor points respectively, wherein the curve segments are curves between two adjacent anchor points; and generating a curve representing the image information according to the actual expression corresponding to each curve segment. In this way, a plurality of curve segments are generated to generate a curve representing image information, so that when one anchor point is dragged, only two adjacent curve segments corresponding to the anchor point are influenced, and the debugging of pixel information of an image part can be realized.

Description

Curve generation method and device for representing image information and storage medium
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a method and an apparatus for generating a curve representing image information, and a storage medium.
Background
In an image signal processing debugging (ISP tuning) tool, operations are often encountered that require mapping image pixel information using a curve. In order to make the image change as natural as possible, a smooth curve is an indispensable prerequisite. From the perspective of user interaction, in order to enable a user to customize the shape of a curve, the shape of the curve is often controlled by a plurality of anchor points, and the anchor points can be arbitrarily dragged within a specified range. Existing solutions, such as bezier curves, can derive the shape of the curve from the anchor point given by the user. However, the bezier curve has the disadvantage that when an anchor point is dragged, the line segment adjacent to the anchor point propagates deformation, and the propagation range of the deformation is large, which is inconvenient for debugging the pixel information of the image portion.
Disclosure of Invention
In view of this, embodiments of the present disclosure provide a curve generation method, apparatus and storage medium for characterizing image information.
According to a first aspect of the present disclosure, an embodiment of the present disclosure provides a curve generation method for characterizing image information, including: acquiring coordinate data corresponding to a plurality of anchor points respectively, wherein first coordinate data in the coordinate data of each anchor point are used for representing pixel information of pixel points of an image, and second coordinate data in the coordinate data of each anchor point are used for representing correction parameters of the pixel information; obtaining actual expressions corresponding to the curve segments according to the smooth curve drawing condition, the general expressions corresponding to the curve segments respectively and the coordinate data corresponding to the anchor points respectively, wherein the curve segments are curves between two adjacent anchor points; and generating a curve representing the image information according to the actual expression corresponding to each curve segment.
According to a second aspect of the present disclosure, an embodiment of the present disclosure provides a curve generating apparatus for characterizing image information, including: the acquisition module is used for acquiring coordinate data corresponding to the anchor points respectively, wherein first coordinate data in the coordinate data of each anchor point are used for representing pixel information of pixel points of the image, and second coordinate data in the coordinate data of each anchor point are used for representing correction parameters of the pixel information; the calculation module is used for obtaining actual expressions which respectively correspond to the curve segments according to the smooth curve drawing conditions, the general expressions which respectively correspond to the curve segments and the coordinate data which respectively correspond to the anchor points, wherein the curve segments are curves between two adjacent anchor points; and the drawing module is used for generating a curve representing the image information according to the actual expression corresponding to each curve segment.
According to a third aspect of the present disclosure, an embodiment of the present disclosure provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform a curve generation method characterizing image information as in the first aspect or any embodiment of the first aspect.
According to a fourth aspect of the present disclosure, an embodiment of the present disclosure provides a computer-readable storage medium storing computer instructions for causing a computer to execute a curve generation method for characterizing image information as in the first aspect or any implementation manner of the first aspect.
According to the curve generation method, device and storage medium for representing image information, coordinate data corresponding to a plurality of anchor points are obtained, first coordinate data in the coordinate data of each anchor point are used for representing pixel information of pixel points of an image, and second coordinate data in the coordinate data of each anchor point are used for representing correction parameters of the pixel information; obtaining actual expressions corresponding to the curve segments according to the smooth curve drawing condition, the general expressions corresponding to the curve segments respectively and the coordinate data corresponding to the anchor points respectively, wherein the curve segments are curves between two adjacent anchor points; and generating a curve representing the image information according to the actual expression corresponding to each curve segment. In this way, the curve representing the image information is divided into a plurality of curve segments, and the curve segments are generated by respectively calculating the actual expressions of the curve segments in the curve representing the image information, so that the curve used for representing the image information can be generated based on the combination of the curve segments.
The foregoing description is only an overview of the technical solutions of the present disclosure, and the embodiments of the present disclosure are described below in order to make the technical means of the present disclosure more clearly understood and to make the above and other objects, features, and advantages of the present disclosure more clearly understandable.
Drawings
FIG. 1 is a flow chart illustrating a method for generating a curve representing image information according to an embodiment of the disclosure;
fig. 2 shows a schematic flow chart of step S102 of the embodiment of the present disclosure;
FIG. 3 is a schematic diagram illustrating the shape of a curve segment corresponding to two adjacent anchor points in the embodiment of the present disclosure;
FIG. 4 is a schematic diagram illustrating another shape of a curve segment corresponding to two adjacent anchor points in the embodiment of the present disclosure;
FIG. 5 is a flow chart illustrating another method for generating a curve characterizing image information according to an embodiment of the present disclosure;
FIG. 6 illustrates a schematic shape diagram of an unclosed curve in an embodiment of the disclosure;
FIG. 7 is a schematic structural diagram of a curve generation apparatus for characterizing image information according to an embodiment of the present disclosure;
fig. 8 shows a schematic hardware structure diagram of an electronic device in an embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all embodiments of the present disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
The embodiment of the present disclosure provides a curve generating method for characterizing image information, which can be applied to debugging local or partial pixel information of an image, as shown in fig. 1, the specific steps of the curve generating method for characterizing image information include:
step S101, coordinate data corresponding to a plurality of anchor points are obtained, wherein first coordinate data in the coordinate data of each anchor point are used for representing pixel information of pixel points of an image, and second coordinate data in the coordinate data of each anchor point are used for representing correction parameters of the pixel information.
In the present embodiment, the number of anchor points used to generate the curve representing the image signal is not limited. The coordinate data corresponding to the anchor points can be obtained by inputting the coordinate data through the input device. For example, a plurality of coordinate data [ [ x ] are input through an input device0,y0],[x1,y1],[x2,y2]…[xi,yi]]I is 0,1 … n, and the coordinate data are coordinate data corresponding to anchor points sequentially selected according to the shape of a curve representing image information, [ x [ [ x ]0,y0]For the coordinate data corresponding to the selected first anchor point, [ x ]n,yn]And the coordinate data corresponding to the selected last anchor point. x is the number ofiAs first coordinate data, yiIs the second coordinate data. The pixel information may be a pixel value of a pixel point of the image, and the correction parameter of the pixel information may be a correction value of the pixel value.
And S102, obtaining actual expressions corresponding to the curve segments according to the smooth curve drawing conditions, the general expressions corresponding to the curve segments respectively and the coordinate data corresponding to the anchor points respectively, wherein the curve segments are curves between two adjacent anchor points.
In this embodiment, the general expressions corresponding to the curves may be the same or different. For example, the general expressions corresponding to the curves may all use the cubic equation y ═ ax3+bx2+ cx + d, the cubic equation may guarantee the non-linearity of the curve, but not limited thereto, and in other embodiments, the cubic equation or other cubic equations may be used for expression.
According to the smooth curve drawing condition, aiming at each anchor point, two equations can be correspondingly established, wherein one equation is established according to the fact that the anchor point meets the second coordinate data equality on the adjacent curve segment, and the other equation is established according to the fact that the anchor point meets the slope equality on the adjacent curve segment. Then, the equation set is solved, and the coefficients in the actual expressions corresponding to the curve segments can be obtained, so that the actual expressions corresponding to the curve segments are obtained.
And step S103, generating a curve representing the image information according to the actual expression corresponding to each curve segment.
In this embodiment, two adjacent anchor points correspond to a curve segment, each curve segment may be generated based on an actual expression corresponding to each curve segment, and a curve formed after the curve segments are connected is a curve representing image information.
According to the curve generation method for representing the image information, the coordinate data corresponding to the anchor points are obtained, the first coordinate data in the coordinate data of each anchor point are used for representing the pixel information of the pixel point of the image, and the second coordinate data in the coordinate data of each anchor point are used for representing the correction parameters of the pixel information; obtaining actual expressions corresponding to the curve segments according to the smooth curve drawing condition, the general expressions corresponding to the curve segments respectively and the coordinate data corresponding to the anchor points respectively, wherein the curve segments are curves between two adjacent anchor points; and generating a curve representing the image information according to the actual expression corresponding to each curve segment. Therefore, the curve representing the image information is divided into a plurality of curve segments, the actual expressions of the curve segments in the curve representing the image information are respectively calculated to generate the curve segments, and then the curve representing the image information is generated based on the combination of the curve segments.
In an optional embodiment, in step S102, obtaining actual expressions corresponding to the curve segments respectively according to the smooth curve drawing condition, the general expressions corresponding to the curve segments respectively, and the coordinate data corresponding to the anchor points respectively, as shown in fig. 2, specifically includes:
and step S102a, obtaining an equation set of each anchor point based on the smooth curve drawing condition and the general expressions respectively corresponding to each curve segment.
Step S102b, obtaining actual expressions corresponding to the curve segments based on the coordinate data and the equation set corresponding to the anchor points.
In some embodiments, for step S102a, the smooth curve drawing condition includes: and the second coordinate data of the two adjacent curve segments corresponding to each anchor point at the anchor point are the same, and the slopes of the two adjacent curve segments at the anchor point are the same. Thereby ensuring that the curve drawn based on the anchor point is a smooth curve. According to the smooth curve drawing condition, two equations can be established for each anchor point, one equation is established according to the coordinate data of the anchor point, namely an equation is established according to the fact that the anchor point meets the second coordinate data equality on the adjacent curve segment, and the other equation is established according to the coordinate data of the anchor point, namely an equation is established according to the fact that the anchor point meets the slope equality on the adjacent curve segment.
In some embodiments, for step S102b, obtaining the actual expression corresponding to each curve segment based on the coordinate data and the equation system corresponding to each anchor point includes:
determining the closed condition of a curve representing the image information based on the coordinate data respectively corresponding to the anchor points; obtaining slopes corresponding to the anchor points respectively according to the closed condition of the curve representing the image information and the coordinate data corresponding to the anchor points respectively; obtaining coefficients in the general expression corresponding to each curve segment according to the slope corresponding to each anchor point, the coordinate data corresponding to each anchor point, and the equation set; and determining the actual expressions corresponding to the curve segments according to the coefficients in the general expressions corresponding to the curve segments.
In specific implementation, the obtaining of the slopes corresponding to the anchor points according to the closed condition of the curve representing the image information and the coordinate data corresponding to the anchor points respectively comprises: determining that a curve representing image information is an unclosed curve, and obtaining slopes corresponding to anchor points according to coordinate data corresponding to the anchor points and a first calculation mode; or determining a curve representing the image information as a closed curve, and obtaining slopes corresponding to the anchor points according to the coordinate data corresponding to the anchor points and the second calculation mode.
In one embodiment, the list of coordinate data corresponding to all anchor points is [ [ x ]0,y0],[x1,y1],[x2,y2]…[xi,yi]]Where i is 0,1 … n, and the coordinate data list is a sequence of coordinate data corresponding to a plurality of anchor points sequentially selected according to the shape of a curve representing image information. In order to ensure that the curve representing the image information does not jump obviously in the dragging process and ensure that the curve shape is beneficial to image debugging, a first calculation mode and a second calculation mode can be specified.
The curve representing the image information corresponding to the first calculation mode is an unclosed curve, and the first calculation mode can be divided into the following conditions:
1) when (x)i,yi) I.e. (x)0,y0) When it is, note (x)0,y0) The slope of the point is K0,K0Should be (x)0,y0) And (x)1,y1) The slope of the line.
2) When (x)i,yi) I.e. (x)n,yn) When it is, note (x)n,yn) The slope of the point is Kn,KnShould be (x)n,yn) And (x)n-1,yn-1) The slope of the line.
3) When y isi-1<yiAnd y isi+1<yiOr y isi-1>yiAnd y isi+1>yiTime, remember (x)i,yi) The slope of the point is Ki,KiShould be 0 as in fig. 3.
4) When y isi-1<yi<yi+1Or yi-1>yi>yi+1When the temperature of the water is higher than the set temperature,see FIG. 4 for (x)i,yi) The slope of the point is KiPoint (x)i-1,yi-1) And point (x)i,yi) The slope of the connecting line is K01Point (x)i,yi) And point (x)i+1,yi+1) The slope of the connecting line is K12Point (x)i-1,yi-1) And point (x)i+1,yi+1) The slope of the connecting line is K02Then KiThe values of (A) are divided into the following cases:
when the anchor point is located in either area 2 or area 3: ki=K02
When the anchor point is located in area 1: ki=2*K12
When the anchor point is located in area 4: k isi=2*K01
Wherein the slopes of the three boundary lines of the 4 regions are all equal to K02And wherein the two borderlines intersect at the midpoint of the side length of the rectangular box.
Because the curve representing the image information corresponding to the second calculation mode is a closed curve, the second calculation mode can be divided into the following cases:
1) when (x)i,yi) I.e. (x)0,y0) When it is, note (x)0,y0) The slope of the point is K0. If y isn-1<y0And y is1<y0Or y isn-1>y0And y is1>y0Then K00. If y isn-1<y0<y1Or yn-1>y0>y1Then point (x)n-1,yn-1) Conversion to point (x)n-1-xrange,yn-1) Then point (x)n-1-xrange,yn-1)And point (x)0,y0) The slope of the connecting line is K01Point (x)0,y0) And point (x)1,y1) The slope of the connecting line is K12Point (x)n-1-xrange,yn-1) And point (x)1,y1) The slope of the connecting line is K02,xrange=xn-x0. Then K0The values of (a) are shown in fig. 4, and are divided into the following cases: when the anchor point is located in either area 2 or area 3: k0=K02(ii) a When the anchor point is located in area 1: k0=2*K12(ii) a When the anchor point is located in area 4: k0=2*K01(ii) a Wherein the slopes of the three boundary lines of the 4 regions are all equal to K02And wherein the two borderlines intersect at the midpoint of the side length of the rectangular box.
2) When (x)i,yi) I.e. (x)n-1,yn-1) When it is, note (x)n-1,yn-1) Slope of the point is Kn-1. a) If y isn-1<y0And y isn-1<yn-2Or y isn-1>y0And y isn-1>yn-2Then Kn-10. b) If y isn-2<yn-1<y0Or yn-2>yn-1>y0Then point (x)0,y0) Conversion to point (x)0+xrange,y0) Then point (x)0+xrange,y0) And point (x)n-1,yn-1) The slope of the connecting line is K01Point (x)n-1,yn-1) And point (x)n-2,yn-2) The slope of the connecting line is K12Point (x)0+xrange,y0) And point (x)n-2,yn-2) The slope of the connecting line is K02. Then Kn-1The values of (a) are shown in fig. 4, and are divided into the following cases: when the anchor point is located in either area 2 or area 3: ki=K02(ii) a When the anchor point is located in area 1: kn-1=2*K12(ii) a When the anchor point is located in area 4: kn-1=2*K01(ii) a Wherein the slopes of the three boundary lines of the 4 regions are all equal to K02And wherein the two borderlines intersect at the midpoint of the side length of the rectangular box.
3) When (x)i,yi) I.e. (x)n,yn) When it is, note (x)n,yn) The slope of the point is Kn,KnShould be (x)n,yn) And (x)n-1,yn-1) The slope of the line.
4) When y isi-1<yiAnd y isi+1<yiOr y isi-1>yiAnd y isi+1>yiWhen it is, note (x)i,yi) The slope of the point is Ki,KiShould be 0 as in fig. 3.
5) When y isi-1<yi<yi+1Or yi-1>yi>yi+1In time, as shown in FIG. 4, let (x)i,yi) The slope of the point is KiPoint (x)i-1,yi-1) And point (x)i,yi) The slope of the connecting line is K01Point (x)i,yi) And point (x)i+1,yi+1) The slope of the connecting line is K12Point (x)i-1,yi-1) And point (x)i+1,yi+1) The slope of the connecting line is K02Then KiThe values of (A) are divided into the following cases:
when the anchor point is located in either area 2 or area 3: ki=K02
When the anchor point is located in area 1: ki=2*K12
When the anchor point is located in area 4: ki=2*K01
Wherein the slopes of the three boundary lines of the 4 regions are all equal to K02And wherein the two borderlines intersect at the midpoint of the side length of the rectangular box. When (x)i,yi) I.e. (x)n,yn) When it is, note (x)i,yi) The slope of the point is Ki,KiShould be (x)n,yn) And (x)n-1,yn-1) The slope of the line.
Wherein the slopes of the three boundary lines of the 4 regions are all equal to K02And wherein the two borderlines intersect at the midpoint of the side length of the rectangular box.
According to the closed condition of the curve representing the image information, the first calculation mode, the second calculation mode and the coordinate data corresponding to each anchor point, the slope corresponding to each anchor point can be calculated. Therefore, the slope corresponding to each anchor point and the coordinate data corresponding to each anchor point can be substituted into the equation set of each anchor point, the coefficients in the general expressions corresponding to each curve segment, such as the specific values of a, b, c and d in the cubic equation, can be obtained by solving the equation set, and then the actual expressions corresponding to each curve segment can be obtained by substituting the coefficients in the general expressions corresponding to each curve segment into the general expressions corresponding to each curve segment.
In the embodiment of the disclosure, the equation sets corresponding to the anchor points are respectively obtained based on the smooth curve drawing conditions and the general expressions corresponding to the curve segments, and the equation sets are solved based on the coordinate data and the slope corresponding to the anchor points, so that the coefficients in the general expressions corresponding to the curve segments can be quickly obtained, and the actual expressions corresponding to the curve segments can be quickly determined.
In an alternative embodiment, the method for generating a curve representing image information, as shown in fig. 5, further includes:
and step S104, acquiring the coordinate data of the changed first anchor point.
Step S105, obtaining first actual expressions respectively corresponding to the two adjacent curve segments corresponding to the first anchor point according to the smooth curve drawing condition, the general expressions respectively corresponding to the two adjacent curve segments corresponding to the first anchor point, the coordinate data of the first anchor point and the coordinate data of the two anchor points adjacent to the first anchor point;
and step S106, regenerating two adjacent curve segments corresponding to the first anchor point according to the first actual expression.
In this embodiment, for step S104, when the user adjusts the pixel information of the local pixel point of the image through the curve representing the image information, the first anchor point may be arbitrarily dragged, and when the first anchor point is dragged, the coordinate data of the first anchor point will change, and the changed coordinate data of the first anchor point may be recorded.
In some embodiments, for step S105, obtaining, according to the smooth curve drawing condition, the general expressions corresponding to the two adjacent curve segments corresponding to the first anchor point, the coordinate data of the first anchor point, and the coordinate data of the two anchor points adjacent to the first anchor point, the first actual expressions corresponding to the two adjacent curve segments corresponding to the first anchor point respectively includes: obtaining a first anchor point and a first equation group of two anchor points adjacent to the first anchor point based on the smooth curve drawing condition and the universal expressions corresponding to the two adjacent curve segments corresponding to the first anchor point respectively; and obtaining first actual expressions respectively corresponding to two adjacent curve segments corresponding to the first anchor point based on the coordinate data of the first anchor point, and the coordinate data and the first equation group respectively corresponding to the two anchor points adjacent to the first anchor point.
Specifically, the curve representing the image information is formed by combining the curve segments, and when the first anchor point is dragged, only the curves of the two adjacent curve segments corresponding to the first anchor point are affected, so that only the curves of the two adjacent curve segments corresponding to the first anchor point need to be redrawn, and the debugging of the local pixel information of the image is realized.
When the curves of the two adjacent curve segments corresponding to the first anchor point are redrawn, the actual expressions of the two adjacent curve segments corresponding to the first anchor point need to be recalculated, and the specific calculation process may be as described in steps S101 to S103 in the above embodiment, but in this step, only the first anchor point and the two anchor points adjacent to the first anchor point are calculated, and the other anchor points do not need to be calculated again.
In the embodiment of the disclosure, when the coordinate data of the first anchor point changes, the first actual expression corresponding to each of the two adjacent curve segments corresponding to the first anchor point is calculated through the smooth curve drawing condition, the general expressions corresponding to each of the two adjacent curve segments corresponding to the first anchor point, the coordinate data of the first anchor point, and the coordinate data of the two anchor points adjacent to the first anchor point, so that only the actual expressions of the two adjacent curve segments corresponding to the first anchor point with the changed coordinate data can be calculated, the two adjacent curve segments corresponding to the first anchor point are regenerated based on the first actual expressions, the shape changes of other curve segments of the curve representing the image information cannot be changed, the local pixel information of the image can be debugged quickly, and the method is interactive and friendly.
In order to further understand the present disclosure, a method for generating a curve representing image information according to an embodiment of the present disclosure is described below in a specific implementation manner.
The user enters a list of anchor points [ [ x ]0,y0],[x1,y1],[x2,y2]…[xi,yi]]I is 0,1 … n, and the anchor point coordinate data list is a coordinate data sequence corresponding to a plurality of anchor points sequentially selected according to the shape of a curve representing image information, [ x [ [ x ] of0,y0]For the coordinate data corresponding to the selected first anchor point, [ x ]n,yn]And the coordinate data corresponding to the selected last anchor point. Wherein the number of anchor points is not limited, and the value range x of the abscissa of the curve is inputrangeLet x berangeIs [0, 255 ]]. And each curve segment can be represented by a cubic equation y ═ ax3+bx2+ cx + d, we require for each curve segment [ a, b, c, d]These four coefficients. From the known conditions, it can be seen that: the ordinate values of the two curve segments of each anchor point at the anchor point are equal, and the slopes of the two curve segments at the anchor point are also equal, so that the curve is ensured to be smooth. We assume that the curve is not closed and then the first and last anchor points on the curve are fixed, as shown in fig. 6. From the above conditions, the following equations can be set:
Figure BDA0003510895880000101
Figure BDA0003510895880000102
Figure BDA0003510895880000103
Figure BDA0003510895880000104
Figure BDA0003510895880000105
Figure BDA0003510895880000106
Figure BDA0003510895880000107
Figure BDA0003510895880000108
wherein formula (1) represents the point of attachment (x)0,y0) The equation satisfied on the first curve segment, equation (2), represents point (x)0,y0) The slope of (A) should be equal to K0Equations (3) to (6) describe the characteristics of the intermediate anchor points, and equations (3) and (5) represent points (x) respectively1,y1) Equations satisfied at the left and right curve segments, equations (4) and (6), respectively, represent the point (x)1,y1) The slopes of the left and right curve segments should be equal to K1The formulas listed for each intermediate point thereafter and so on until the last anchor point. Formula (7) represents the point (x)n,yn) The equation satisfied on the last curve segment, equation (8), represents the point (x)n,yn) The slope of (A) should be equal to Kn-1
To make the above equations easy to solve, the system of equations can be converted into a form of matrix multiplication:
Figure BDA0003510895880000111
the above matrix multiplication can be written as:
q*M=p;
and M is the coefficient of each segment of the curve that we require, then M should be:
M=p*q-1
then the next step is to set k0,k1...kn-1Therefore, the curve does not jump obviously in the dragging process, and the curve shape is ensured to be beneficial to image debugging. The following is divided into several cases:
1) when (x)i,yi) I.e. (x)0,y0) When it is, note (x)i,yi) The slope of the point is Ki,KiShould be (x)i,yi) And (x)i+1,yi+1) The slope of the line.
2) When (x)i,yi) I.e. (x)n,yn) When it is, note (x)i,yi) The slope of the point is Ki,KiShould be (x)n,yn) And (x)n-1,yn-1) The slope of the line.
3) When y isi-1<yiAnd y isi+1<yiOr y isi-1>yiAnd y isi+1>yiWhen it is, note (x)i,yi) The slope of the point is Ki,KiShould be 0 as in fig. 3.
4) When y isi-1<yi<yi+1Or yi-1>yi>yi+1In time, as shown in FIG. 4, let (x)i,yi) The slope of the point is KiPoint (x)i-1,yi-1) And point (x)i,yi) The slope of the connecting line is K01Point (x)i,yi) And point (x)i+1,yi+1) The slope of the connecting line is K12Point (x)i-1,yi-1) And point (x)i+1,yi+1) The slope of the connecting line is K02Then KiThe values of (A) are divided into the following cases:
when the anchor point is located in region 2 orRegion 3: ki=K02
When the anchor point is located in area 1: ki=2*K12
When the anchor point is located in area 4: ki=2*K01
Wherein the slopes of the three boundary lines of the 4 regions are all equal to K02And wherein the two borderlines intersect at the midpoint of the side length of the rectangular box.
Calculate to k0,k1...kn-1And the coordinate data of each anchor point is known, so that M can be solved to obtain an actual expression corresponding to each curve segment. After the actual expression corresponding to each curve segment is obtained, each curve segment can be drawn, and then the curve representing the image information is obtained. When the pixel value of a certain pixel point in the known image is xnThen the adjusted pixel value for that pixel value should be mapped to yn. That is, the smooth curve forms a lookup table (LUT) for facilitating the user operation and adjusting each pixel value of the image. When a user drags a single anchor point, the shape jump of the curve can not occur in the process of dragging the single anchor point, and the dragging of the single anchor point only affects the curve shapes at two sides of the anchor point, has small influence on the curves of other sections, is easy to adjust the local pixel value of the image and is friendly to interaction.
The embodiment of the present disclosure further provides a curve generating device for characterizing image information, as shown in fig. 7, including:
an obtaining module 41, configured to obtain coordinate data corresponding to each of a plurality of anchor points, where a first coordinate data in the coordinate data of each anchor point is used to represent pixel information of a pixel point of an image, and a second coordinate data in the coordinate data of each anchor point is used to represent a correction parameter of the pixel information; the detailed description of the specific implementation manner is given in step S101 of the above method embodiment, and is not repeated herein.
A calculating module 42, configured to obtain actual expressions corresponding to the curve segments according to the smooth curve drawing condition, the general expressions corresponding to the curve segments, and the coordinate data corresponding to the anchor points, where a curve segment is a curve between two adjacent anchor points; the detailed description of the specific implementation manner is given in step S102 of the above method embodiment, and is not repeated herein.
And a drawing module 43, configured to generate a curve representing the image information according to the actual expression corresponding to each curve segment. The detailed description of the specific implementation manner is given in step S103 of the above method embodiment, and is not repeated herein.
According to the curve generation device for representing image information provided by the embodiment of the disclosure, coordinate data corresponding to a plurality of anchor points respectively are obtained, first coordinate data in the coordinate data of each anchor point are used for representing pixel information of pixel points of an image, and second coordinate data in the coordinate data of each anchor point are used for representing correction parameters of the pixel information; obtaining actual expressions corresponding to the curve segments according to the smooth curve drawing condition, the general expressions corresponding to the curve segments respectively and the coordinate data corresponding to the anchor points respectively, wherein the curve segments are curves between two adjacent anchor points; the curve representing the image information is divided into a plurality of curve segments, and the curve segments are generated by respectively calculating the actual expressions of the curve segments of the curve representing the image information, so that the generated curve representing the image information is the combination of the curve segments, and thus, when any anchor point is dragged, only two adjacent curve segments corresponding to the anchor point are influenced, and other curve segments are not influenced, thereby realizing the debugging of the pixel information of part of the image.
In an alternative embodiment, the calculation module 42 includes:
and the first calculation submodule is used for obtaining an equation set of each anchor point based on the smooth curve drawing condition and the general expression respectively corresponding to each curve section.
And the second calculation submodule is used for obtaining actual expressions corresponding to the curve segments respectively based on the coordinate data and the equation set corresponding to the anchor points respectively.
In an alternative embodiment, the smooth curve drawing condition includes: and the second coordinate data of the two adjacent curve segments corresponding to each anchor point at the anchor point are the same, and the slopes of the two adjacent curve segments at the anchor point are the same.
In an optional embodiment, the second computing submodule is configured to determine a closing condition of a curve representing the image information based on coordinate data corresponding to the plurality of anchor points, respectively; obtaining slopes corresponding to the anchor points respectively according to the closed condition of the curve representing the image information and the coordinate data corresponding to the anchor points respectively; obtaining coefficients in the general expression corresponding to each curve segment according to the slope corresponding to each anchor point, the coordinate data corresponding to each anchor point, and the equation set; and determining the actual expressions corresponding to the curve segments according to the coefficients in the general expressions corresponding to the curve segments.
In an optional embodiment, obtaining slopes corresponding to anchor points respectively according to a closed condition of a curve representing image information and coordinate data corresponding to the anchor points respectively includes: determining that a curve representing image information is an unclosed curve, and obtaining slopes corresponding to anchor points according to coordinate data corresponding to the anchor points and a first calculation mode; or; and determining a curve representing the image information as a closed curve, and obtaining the slope corresponding to each anchor point according to the coordinate data corresponding to each anchor point and the second calculation mode.
In an optional embodiment, the curve generating apparatus for characterizing image information further includes:
and the second acquisition module is used for acquiring the changed coordinate data of the first anchor point.
The second calculation module is used for obtaining first actual expressions which respectively correspond to the two adjacent curve segments corresponding to the first anchor point according to the smooth curve drawing condition, the general expressions which respectively correspond to the two adjacent curve segments corresponding to the first anchor point, the coordinate data of the first anchor point and the coordinate data of the two anchor points adjacent to the first anchor point;
and the generating module is used for regenerating two adjacent curve segments corresponding to the first anchor point according to the first actual expression.
In an alternative embodiment, the second calculation module comprises:
and the third calculation submodule is used for obtaining a first equation group of the first anchor point and two anchor points adjacent to the first anchor point based on the smooth curve drawing condition and the universal expressions respectively corresponding to two adjacent curve segments corresponding to the first anchor point.
And the fourth calculation submodule is used for obtaining first actual expressions respectively corresponding to two adjacent curve segments corresponding to the first anchor point based on the coordinate data of the first anchor point, the coordinate data respectively corresponding to two anchor points adjacent to the first anchor point and the first equation group.
The embodiment of the present disclosure further provides an electronic device, and an exemplary application of the electronic device provided by the embodiment of the present disclosure is described below.
The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud computing services. The terminal device may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, and the like. The terminal device and the server may be directly or indirectly connected through wired or wireless communication, and the embodiments of the present disclosure are not limited herein.
Referring to fig. 8, fig. 8 is a schematic structural diagram of an electronic device 400 provided in an embodiment of the present disclosure, where the electronic device 400 shown in fig. 8 includes: at least one processor 410, memory 450, and bus 440; the various components in electronic device 400 are coupled together by a bus 440. It is understood that bus 440 is used to enable connected communication between these components. Bus 440 includes a power bus, a control bus, and a status signal bus in addition to a data bus. But for clarity of illustration the various busses are labeled as bus 440 in figure 8.
The Processor 410 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like, wherein the general purpose Processor may be a microprocessor or any conventional Processor, or the like.
The memory 450 stores executable instructions for implementing a curve generation method for characterizing image information provided by the embodiment of the present disclosure, which can be implemented by the processor 410 in the electronic device shown in fig. 8; the memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard disk drives, optical disk drives, and the like. Memory 450 optionally includes one or more storage devices physically located remote from processor 410.
In some embodiments, memory 450 is capable of storing data, examples of which include programs, modules, and data structures, or a subset or superset thereof, to support various operations.
In some embodiments, the electronic device 400 may further include:
an operating system 451, including system programs for handling various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and handling hardware-based tasks;
a network communication module 452 for communicating to other computing devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 including: bluetooth, wireless compatibility authentication (WiFi), and Universal Serial Bus (USB), among others.
The disclosed embodiments provide a computer-readable storage medium having stored therein executable instructions that, when executed by a processor, will cause the processor to perform a curve generation method for characterizing image information provided by the disclosed embodiments, for example, the curve generation method for characterizing image information as illustrated in fig. 1-6.
In some embodiments, the computer-readable storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
In some embodiments, executable instructions may be written in any form of programming language (including compiled or interpreted languages), in the form of programs, software modules, scripts or code, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
By way of example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or distributed across multiple sites and interconnected by a communication network.
In addition to the above methods and apparatus, embodiments of the present disclosure provide a computer program product comprising computer program instructions which, when executed by a processor, cause the processor to perform the curve generation method of characterizing image information of the present disclosure.
The computer program product may write program code for performing the operations of embodiments of the present disclosure in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
The above are merely examples of the present disclosure, and are not intended to limit the scope of the present disclosure. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present disclosure are included in the protection scope of the present disclosure.

Claims (10)

1. A curve generation method for characterizing image information, comprising:
acquiring coordinate data corresponding to a plurality of anchor points respectively, wherein first coordinate data in the coordinate data of each anchor point are used for representing pixel information of pixel points of an image, and second coordinate data in the coordinate data of each anchor point are used for representing correction parameters of the pixel information;
obtaining actual expressions corresponding to the curve segments according to the smooth curve drawing condition, the general expressions corresponding to the curve segments respectively and the coordinate data corresponding to the anchor points respectively, wherein the curve segments are curves between two adjacent anchor points;
and generating a curve representing the image information according to the actual expression corresponding to each curve segment.
2. The method of claim 1, wherein obtaining the actual expression corresponding to each curve segment according to the smooth curve drawing condition, the general expression corresponding to each curve segment, and the coordinate data corresponding to each anchor point comprises:
based on the smooth curve drawing condition and the universal expression corresponding to each curve segment, obtaining an equation set of each anchor point;
and obtaining actual expressions corresponding to the curve segments respectively based on the coordinate data corresponding to the anchor points respectively and the equation set.
3. The method according to claim 1 or 2, the smooth curve drawing condition comprising: and the second coordinate data of the two adjacent curve segments corresponding to each anchor point at the anchor point are the same, and the slopes of the two adjacent curve segments at the anchor point are the same.
4. The method of claim 2, wherein obtaining the actual expression corresponding to each curve segment based on the coordinate data corresponding to each anchor point and the equation system comprises:
determining the closing condition of a curve representing image information based on the coordinate data respectively corresponding to the anchor points;
obtaining slopes corresponding to the anchor points respectively according to the closing condition of a curve representing image information and the coordinate data corresponding to the anchor points respectively;
obtaining coefficients in a general expression corresponding to each curve segment according to the slope corresponding to each anchor point, the coordinate data corresponding to each anchor point, and the equation set;
and determining the actual expression corresponding to each curve section according to the coefficient in the general expression corresponding to each curve section.
5. The method according to claim 4, wherein obtaining slopes corresponding to the anchor points according to a closed condition of a curve representing image information and coordinate data corresponding to the anchor points respectively comprises:
determining that the curve representing the image information is an unclosed curve, and obtaining slopes corresponding to the anchor points according to coordinate data corresponding to the anchor points and a first calculation mode; or;
and determining that the curve representing the image information is a closed curve, and obtaining the slope corresponding to each anchor point according to the coordinate data corresponding to each anchor point and a second calculation mode.
6. The method of claim 1, further comprising:
acquiring coordinate data of the changed first anchor point;
obtaining first actual expressions respectively corresponding to the two adjacent curve segments corresponding to the first anchor point according to a smooth curve drawing condition, a general expression respectively corresponding to the two adjacent curve segments corresponding to the first anchor point, coordinate data of the first anchor point and coordinate data of the two anchor points adjacent to the first anchor point;
and regenerating two adjacent curve segments corresponding to the first anchor point according to the first actual expression.
7. The method of claim 6, wherein obtaining the first actual expressions corresponding to the two adjacent curve segments corresponding to the first anchor point according to the smooth curve drawing condition, the common expressions corresponding to the two adjacent curve segments corresponding to the first anchor point, the coordinate data of the first anchor point, and the coordinate data of the two anchor points adjacent to the first anchor point comprises:
obtaining a first equation group of the first anchor point and two anchor points adjacent to the first anchor point based on the smooth curve drawing condition and the universal expressions corresponding to the two adjacent curve segments corresponding to the first anchor point respectively;
and obtaining first actual expressions respectively corresponding to two adjacent curve segments corresponding to the first anchor point based on the coordinate data of the first anchor point, the coordinate data respectively corresponding to two anchor points adjacent to the first anchor point and the first equation group.
8. A curve generating apparatus for characterizing image information, comprising:
the acquisition module is used for acquiring coordinate data corresponding to a plurality of anchor points respectively, wherein first coordinate data in the coordinate data of each anchor point are used for representing pixel information of pixel points of an image, and second coordinate data in the coordinate data of each anchor point are used for representing correction parameters of the pixel information;
the calculation module is used for obtaining actual expressions which respectively correspond to the curve segments according to the smooth curve drawing conditions, the general expressions which respectively correspond to the curve segments and the coordinate data which respectively correspond to the anchor points, wherein the curve segments are curves between two adjacent anchor points;
and the drawing module is used for generating a curve representing the image information according to the actual expression corresponding to each curve segment.
9. An electronic device, comprising:
at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method of curve generation characterizing image information according to any one of claims 1-7.
10. A computer-readable storage medium storing computer instructions for causing a computer to execute the curve generating method for characterizing image information according to any one of claims 1 to 7.
CN202210152138.8A 2022-02-18 2022-02-18 Curve generation method and device for representing image information and storage medium Pending CN114581554A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210152138.8A CN114581554A (en) 2022-02-18 2022-02-18 Curve generation method and device for representing image information and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210152138.8A CN114581554A (en) 2022-02-18 2022-02-18 Curve generation method and device for representing image information and storage medium

Publications (1)

Publication Number Publication Date
CN114581554A true CN114581554A (en) 2022-06-03

Family

ID=81774654

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210152138.8A Pending CN114581554A (en) 2022-02-18 2022-02-18 Curve generation method and device for representing image information and storage medium

Country Status (1)

Country Link
CN (1) CN114581554A (en)

Similar Documents

Publication Publication Date Title
US9129075B2 (en) Mesh generation system
CN104615454A (en) Method and system for UPDATING A CAD MODEL, and readable media
JP2007524156A (en) Block processing of input data in a graphical programming environment
JP7435951B2 (en) Floating point number generation method, apparatus, electronic device, storage medium and computer program for integrated circuit chip verification
CN110633959A (en) Method, device, equipment and medium for creating approval task based on graph structure
JP7068242B2 (en) Learning equipment, learning methods and programs
CN102467593B (en) Nonlinear circuit time domain model reduction method and device
CN114581554A (en) Curve generation method and device for representing image information and storage medium
CN116467896A (en) Orthodontic treatment effect simulation system and method
US10706193B1 (en) Computer processing during simulation of a circuit design
CN107977923B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
JP6065543B2 (en) Neural network design method, fitting method, and program
CN115657467A (en) Wind power plant wake flow control optimization method, device, equipment and storage medium
CN110312990A (en) Configuration method and system
JP2020135748A (en) Optimization device, optimization method, and program
JP4485896B2 (en) PID controller
JP2011221927A (en) Neural network design method and program
CN117172161B (en) Flow field simulation method and device, computer equipment and storage medium
KR20230041183A (en) Method for generating road topology information and system thereof
CN117529737A (en) Information processing system and information processing method
JP5907607B2 (en) Processing arrangement method and program
CN108038012A (en) Data calibration method and device, electronic equipment and computer-readable recording medium
CN109670601B (en) Machine learning feature generation method and device, electronic device and storage medium
CN109324797B (en) Desktop icon generation method, computer readable storage medium and terminal equipment
US20220366329A1 (en) Modeling device of business logic representation model and modeling method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination