Method for processing curve in image

By identifying the pixel grid lines and function curves in the coordinate image, the pixel coordinates of the tick marks on the coordinate axis are determined, solving the problem of inaccurate variable values ​​in the coordinate image and achieving higher calculation accuracy.

CN121599897APending Publication Date: 2026-03-03SHANGHAI PYLON TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411146296.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

In existing technologies, the coordinates of coordinate images may be non-uniform coordinate systems, and data points may be missing, making it impossible to accurately estimate the values ​​of variables on the relationship curve and affecting the accuracy of the analysis.

Method used

By identifying the coordinate grid lines and function curves in the pixel map of the coordinate image, the target axis pixel coordinates corresponding to the tick marks on the coordinate axis are determined. Combining the pixel coordinates and tick values, the numerical values ​​of the variables are calculated.

Benefits of technology

It improves the accuracy of calculating variable values ​​in coordinate graphs and solves the problem of not being able to accurately estimate the value of another variable on a curve in a known coordinate graph.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121599897A_ABST
    Figure CN121599897A_ABST
Patent Text Reader

Abstract

The invention provides a method for processing a curve in an image, and the method comprises the steps: obtaining the scale lines of a plurality of coordinate axes on a coordinate image and a pixel image of the coordinate image, and enabling the coordinate image to comprise a coordinate grid and a function curve; determining a pixel grid line corresponding to the coordinate grid and a pixel curve of the function curve in combination with the pixel map; determining a target axis pixel coordinate of each scale line on each coordinate axis according to the axis pixel coordinate of the pixel grid line on each coordinate axis; according to a scale value of an adjacent scale line corresponding to a first numerical value of a target variable and a target axis pixel coordinate, determining a pixel point corresponding to the first numerical value on the pixel curve; and determining a second value of the preset variable corresponding to the first value of the target variable on the function curve according to the scale value of the corresponding adjacent scale line of the pixel point on the coordinate axis of the preset variable and the pixel coordinate of the target axis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a method for processing curves in an image. Background Technology

[0002] In existing technologies, technicians obtain coordinate images by consulting patents, papers, and other materials, or by receiving coordinate images directly from the factory. These coordinate images include the coordinate axes and their scales, as well as relationship curves within the coordinate system. These relationship curves describe the relationships between the variables represented by the coordinate axes. However, the coordinates in these images may be from non-uniform coordinate systems, and some data points may be missing. This necessitates manual estimation, affecting the accuracy of the data and consequently impacting the accuracy of the relationship curve analysis. Summary of the Invention

[0003] In view of this, the purpose of this application is to provide at least one method for processing curves in an image. This method identifies the pixel grid lines of the coordinate grid in the pixel image of a coordinate image, determines the target axis pixel coordinates corresponding to each tick mark on the coordinate axis, and identifies the pixel curves corresponding to the function curves in the pixel image. Based on the target axis pixel coordinates and tick values ​​of each tick mark, the method determines the pixel points corresponding to the known target variable values ​​on the pixel grid lines. Furthermore, based on the pixel coordinates of the pixel points, the target axis pixel coordinates and tick values ​​of each tick mark, the method determines the value of the preset variable corresponding to the pixel points. This solves the technical problem that when one variable is known at any point on the curve in a coordinate image, it is impossible to accurately estimate the value of the corresponding other variable. This method achieves the technical effect of improving the accuracy of calculating variable values ​​using relational curves in coordinate images.

[0004] This application mainly includes the following aspects:

[0005] In a first aspect, embodiments of this application provide a curve processing method for an image, the method comprising: acquiring tick marks of multiple coordinate axes on a coordinate image and a pixel map of the coordinate image, the coordinate image including a coordinate grid and a function curve, wherein the coordinate grid is obtained based on each coordinate axis and its tick marks, and the function curve is a curve describing the relationship between variables corresponding to the multiple coordinate axes respectively; determining the pixel grid lines corresponding to the coordinate grid and the pixel curve of the function curve in conjunction with the pixel map; determining the target axis pixel coordinates of each tick mark on each coordinate axis according to the axis pixel coordinates of the pixel grid lines on each coordinate axis; determining the pixel point corresponding to the first value of the target variable on the pixel curve according to the tick marks of the adjacent tick marks corresponding to the first value of the target variable and the target axis pixel coordinates; and determining the second value of the preset variable corresponding to the first value of the target variable on the function curve according to the tick marks of the adjacent tick marks corresponding to the pixel point on the coordinate axis of the preset variable and the target axis pixel coordinates.

[0006] Optionally, the plurality of coordinate axes includes a first coordinate axis and a second coordinate axis, and the function curve is the relationship curve between a first variable corresponding to the first coordinate axis and a second variable corresponding to the second coordinate axis.

[0007] Optionally, the pixel grid lines corresponding to the coordinate grid are determined by: determining multiple straight lines in the pixel image through straight line detection; and distinguishing multiple first pixel grid lines connected to the first coordinate axis and multiple second pixel grid lines connected to the second coordinate axis based on the endpoint pixel coordinates of each straight line.

[0008] Optionally, for each first pixel grid line, the first coordinate axis pixel coordinates in the endpoint pixel coordinates of the first pixel grid line are the same, and for each second pixel grid line, the second coordinate axis pixel coordinates in the endpoint pixel coordinates of the second pixel grid line are the same.

[0009] Optionally, the pixel curve of the function curve is determined by removing the pixel grid lines from the pixel image and then binarizing the pixel image according to the pixel values ​​of the pixel curve, so that only the pixel curve is retained in the pixel image.

[0010] Optionally, the target axis pixel coordinates of each tick mark on each coordinate axis are determined as follows: among the pixel grid lines connected to the coordinate axis, the pixel interval corresponding to adjacent pixel grid lines is determined according to the axis pixel coordinates of adjacent pixel grid lines in the direction of the coordinate axis; based on the number of corresponding tick marks on the coordinate axis and the pixel interval, the corresponding pixel grid lines on the coordinate axis are divided into multiple groups of pixel grid lines, with each group of pixel grid lines corresponding to one tick mark; based on the axis pixel coordinates of each pixel grid line in each group of pixel grid lines in the direction of the coordinate axis, the target axis pixel coordinates of the tick mark corresponding to each group of pixel grid lines are determined.

[0011] Optionally, dividing each pixel grid line on the coordinate axis into multiple groups of pixel grid lines based on the number of corresponding tick marks on the coordinate axis and the pixel interval includes: sorting the pixel intervals of adjacent pixel grid lines in the direction of the coordinate axis, determining a preset tick mark interval according to the sorting result and the number of corresponding tick marks on the coordinate axis; and dividing each pixel grid line on the coordinate axis into multiple groups of pixel grid lines according to the preset tick mark interval.

[0012] Optionally, the target axis pixel coordinates of the tick line corresponding to each group of pixel grid lines are determined by taking the average value of the axis pixel coordinates of each pixel grid line in the group of pixel grid lines in the direction of the coordinate axis as the target axis pixel coordinates of the tick line corresponding to the group of pixel grid lines.

[0013] Optionally, the target variable is one of the first variable and the second variable, and the preset variable is the other of the first variable and the second variable.

[0014] Optionally, the pixel point corresponding to the first value of the target variable on the pixel curve is determined by: determining the pixel difference between the first value of the target variable and the first adjacent tick line based on the target axis pixel coordinates corresponding to the adjacent tick lines corresponding to the first value of the target variable, wherein the first adjacent tick line is one of the adjacent tick lines; determining the first axis pixel coordinate of the first value of the target variable on the coordinate axis corresponding to the target variable based on the target axis pixel coordinates of the first adjacent tick line and the pixel difference, and determining the pixel point corresponding to the first axis pixel coordinate on the pixel curve.

[0015] Optionally, the second value of a preset variable corresponding to the first value of the target variable on the function curve is determined by: determining the second axis pixel coordinate of the pixel point on the coordinate axis of the preset variable; determining the difference between the second axis pixel coordinate and the preset variable on the coordinate axis of the preset variable based on the second axis pixel coordinate, the scale value of the adjacent scale line corresponding to the pixel point on the coordinate axis of the preset variable, and the target axis pixel coordinate, wherein the second scale line is one of the adjacent scale lines; and calculating the second value corresponding to the second axis pixel coordinate using the scale value of the second scale line and the difference of the preset variable.

[0016] Optionally, obtaining the pixel image of the coordinate image includes: converting the coordinate image into a grayscale image and filtering the grayscale image to obtain the pixel image.

[0017] This application provides a method and apparatus for processing curves in an image. The method includes: acquiring tick marks of multiple coordinate axes on a coordinate image and a pixel map of the coordinate image, wherein the coordinate image includes a coordinate grid and a function curve, wherein the coordinate grid is obtained based on each coordinate axis and its tick marks, and the function curve is a curve describing the relationship between variables corresponding to the multiple coordinate axes respectively; determining the pixel grid lines corresponding to the coordinate grid and the pixel curve of the function curve by combining the pixel map; determining the target axis pixel coordinates of each tick mark on each coordinate axis according to the axis pixel coordinates of the pixel grid lines on each coordinate axis; determining the pixel point corresponding to the first value of the target variable on the pixel curve according to the tick marks of the adjacent tick marks corresponding to the first value of the target variable and the target axis pixel coordinates; and determining the second value of the preset variable corresponding to the first value of the target variable on the function curve according to the tick marks of the adjacent tick marks corresponding to the pixel point on the coordinate axis of the preset variable and the target axis pixel coordinates. By identifying the pixel grid lines of the coordinate grid in the pixel image of the coordinate image, determining the target axis pixel coordinates corresponding to each tick mark on the coordinate axis, and identifying the pixel curves corresponding to the function curves in the pixel image, the pixel points corresponding to the known target variable values ​​on the pixel grid lines are determined according to the target axis pixel coordinates and tick values ​​of each tick mark. Based on the pixel coordinates of the pixel points, the target axis pixel coordinates and tick values ​​of each tick mark, the value of the preset variable corresponding to the pixel point is determined. This solves the technical problem that it is impossible to accurately estimate the value of the other variable when there is a known variable at any point on the curve in the coordinate image. It achieves the technical effect of improving the accuracy of calculating the value of variables through the relationship curves in the coordinate image.

[0018] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0019] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 A flowchart of a curve processing method in an image provided by an embodiment of this application is shown.

[0021] Figure 2 This illustration shows a schematic diagram of a coordinate image provided in an embodiment of this application.

[0022] Figure 3 This illustration shows a schematic diagram of a scale line in a pixel image provided in an embodiment of this application.

[0023] Figure 4 This illustration shows a schematic diagram of a scale line in another pixel image provided by an embodiment of this application.

[0024] Figure 5 This illustration shows a functional block diagram of an image curve processing apparatus provided in an embodiment of this application.

[0025] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.

[0027] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0028] In existing technologies, especially in the lithium battery industry, technicians need to search for technical documents such as papers and patents, as well as receive practical application data transmitted from factories. These technical and practical application data include coordinate graphs, which contain coordinate systems and relationship curves within those systems, such as the relationship curves between time and current, time and voltage, and voltage and SOC (state of charge). Furthermore, technicians analyze the relationship curves in the technical documents to clarify the relationships between different variables for learning purposes, and analyze the relationship curves in the practical application data to determine the relationships between different variables under actual conditions to clarify the factory's processing requirements.

[0029] The relationship curves obtained from the different data sources mentioned above may all be located in a non-uniform coordinate system. Due to the uneven intervals between the scale lines, it is difficult to estimate the ordinate value corresponding to the x-coordinate value of any point on the curve. If the data provides x-coordinate and ordinate data for some points on the relationship curve, but there are missing data points—for example, a point only has an x-coordinate value but not its corresponding ordinate value—then technicians can only determine the missing ordinate value through estimation. This, in turn, affects the technicians' learning and analysis, and reduces the accuracy of calculating the x-coordinate values ​​of each point on the relationship curve.

[0030] Based on this, this application provides a curve processing method for images. By identifying the pixel grid lines of the coordinate grid in the pixel image of a coordinate image, determining the target axis pixel coordinates corresponding to each tick mark on the coordinate axis, and identifying the pixel curve corresponding to the function curve in the pixel image, the method determines the pixel point corresponding to the known target variable value on the pixel grid line according to the target axis pixel coordinates and tick values ​​of each tick mark. Furthermore, based on the pixel coordinates of the pixel point, the target axis pixel coordinates of each tick mark, and the tick values, the method determines the value of the preset variable corresponding to the pixel point. This solves the technical problem that when one variable is known at any point on the curve in a coordinate image, the value of the corresponding other variable cannot be accurately estimated. This achieves the technical effect of improving the accuracy of calculating variable values ​​using relationship curves in coordinate images, as detailed below:

[0031] Please see Figure 1 , Figure 1 This is a flowchart illustrating a curve processing method in an image, as provided in an embodiment of this application. Figure 1 As shown, the curve processing method in an image provided in this application includes the following steps:

[0032] S101: Obtain the tick marks of multiple coordinate axes on the coordinate image and the pixel map of the coordinate image.

[0033] The coordinate image includes a coordinate grid and function curves. The coordinate grid is obtained based on each coordinate axis and its tick marks, and the function curves are curves that describe the relationship between variables corresponding to multiple coordinate axes.

[0034] The plurality of coordinate axes includes a first coordinate axis and a second coordinate axis, and the function curve is the relationship curve between a first variable corresponding to the first coordinate axis and a second variable corresponding to the second coordinate axis. The first coordinate axis includes multiple tick marks for the first variable, and the second coordinate axis includes multiple tick marks for the second variable. The number of tick marks on the first and second coordinate axes can be the same or different. Furthermore, the multiple tick marks on the first coordinate axis are equivalent to multiple tick marks connected to the first coordinate axis, and the multiple tick marks on the first coordinate axis include the second coordinate axis; similarly, the multiple tick marks on the second coordinate axis are equivalent to multiple tick marks connected to the second coordinate axis, and the multiple tick marks on the second coordinate axis include the first coordinate axis.

[0035] In other words, the scale values ​​of the tick marks connecting the various coordinate axes have been marked on the coordinate image. Furthermore, the scale values ​​of each tick mark can be identified either by the staff inputting them or by image recognition.

[0036] For example, please refer to Figure 2 , Figure 2 This is a schematic diagram of a coordinate image provided in an embodiment of this application. Figure 2 As shown, the first coordinate axis is the x-axis of the coordinate system, and the second coordinate axis is the y-axis. The first and second coordinate axes intersect at the origin O of the coordinate system. The x-axis indicates time t, and the y-axis indicates the voltage across the battery terminals. u(t) is a function curve located in the coordinate system and is used to indicate the relationship between the voltage across the battery terminals and time. The x-axis has multiple scale lines representing 0s, 10s, 50s, 100s, and 200s, while the y-axis has multiple scale lines representing 0V, 5V, 10V, 20V, and 50V. The scale lines on the x-axis and y-axis form a coordinate grid.

[0037] The step of obtaining the pixel image of the coordinate image includes: converting the coordinate image into a grayscale image and filtering the grayscale image to obtain the pixel image.

[0038] Specifically, the coordinate image is converted into a grayscale image in the following way: For each pixel in the coordinate image, the grayscale value of the pixel is determined according to the channel values ​​corresponding to the red (R) channel, green (G) channel, and blue (B) channel, respectively, so as to convert the coordinate image into a grayscale image.

[0039] The coordinate image is converted to grayscale by calculating the grayscale value of each pixel. There are various methods for grayscale conversion, which are not limited here. For example, for each pixel in the coordinate image, the maximum value of the corresponding channel values ​​of the red (R) channel, green (G) channel, and blue (B) channel of that pixel is taken as the grayscale value of that pixel.

[0040] Specifically, the pixel image is obtained by filtering the grayscale image in the following way: Gaussian filtering is used to filter noise from the grayscale image to obtain the pixel image.

[0041] Here, the standard deviation of the Gaussian distribution and the kernel size are defined, and the Gaussian operator is calculated using the following formula:

[0042]

[0043] In formula (1), (x,y) refers to the coordinates of the distance from the center of the Gaussian kernel. Generally, the center of the Gaussian kernel is set to the center of the convolution kernel. f(x,y) refers to the Gaussian operator corresponding to the position (x,y), and σ refers to the standard deviation of the Gaussian distribution. For example, the size of the convolution kernel is defined as 5×5, and σ is 2. The Gaussian operators at each position of the Gaussian kernel are calculated using formula (1) and normalized to obtain the final Gaussian kernel. For each pixel in the grayscale image, the pixel is aligned with the center of the Gaussian kernel, and the sum of the products of the pixels around the pixel and the Gaussian operators at the corresponding positions of the Gaussian kernel is calculated. The sum is used as the pixel value of the pixel to obtain the pixel image.

[0044] S102: Based on the pixel map, determine the pixel grid lines corresponding to the coordinate grid and the pixel curves of the function curve.

[0045] The pixel grid lines corresponding to the coordinate grid are determined by: identifying multiple straight lines in the pixel image through straight line detection; and distinguishing multiple first pixel grid lines connected to the first coordinate axis and multiple second pixel grid lines connected to the second coordinate axis based on the endpoint pixel coordinates of each straight line.

[0046] Specifically, for each first pixel grid line, the endpoint pixel coordinates of that first pixel grid line share the same first axis pixel coordinate. Similarly, for each second pixel grid line, the endpoint pixel coordinates of that second pixel grid line share the same second axis pixel coordinate. In other words, the axis pixel coordinate refers to the pixel coordinate corresponding to one of the coordinate axes of a pixel's pixel coordinates. For example, if the coordinate axes of the image include a horizontal x-axis and a vertical y-axis, and the pixel coordinates of a pixel are (10, 15), which corresponds to the pixel in the 10th column and 15th row of the pixel image, then the x-axis pixel coordinate of this pixel is 10, and the y-axis pixel coordinate is 15.

[0047] Specifically, for coordinate images with blurred coordinate axes, the Canny edge detection operator can be used first to detect the edges of the pixel image, and the detected edge pixels can be used as the pixel grid lines corresponding to the coordinate axes. Then, the Hough transform can be used to detect the pixel grid lines corresponding to the straight lines in the pixel image other than the coordinate axes, thus determining the pixel grid lines corresponding to the coordinate grid. For coordinate images with clear coordinate axes, the Canny edge detection operator can be used directly to identify the pixel grid lines corresponding to the coordinate grid of the pixel image.

[0048] In other words, when identifying multiple straight lines in a pixel image, the endpoint pixel coordinates of each straight line are determined. When the straight line corresponds to a tick mark connecting the first coordinate axis, the endpoint pixel coordinates of the straight line are the same as the first coordinate axis pixel coordinates. When the straight line corresponds to a tick mark connecting the second coordinate axis, the endpoint pixel coordinates of the straight line are the same as the second coordinate axis pixel coordinates.

[0049] The pixel curve of the function curve is determined by removing the pixel grid lines from the pixel image and then binarizing the pixel image according to the pixel values ​​of the pixel curve, so that only the pixel curve is retained in the pixel image.

[0050] Specifically, after identifying the pixel grid lines, the pixel values ​​of each pixel along the grid lines are directly modified to the pixel values ​​of the background color of the pixel image, thereby removing the pixel grid lines from the pixel image. For example, if the background color of the pixel image is white, and both the pixel grid lines and the pixel curves corresponding to the function graph are black, then it is only necessary to modify the pixel values ​​of the pixel grid lines from black to white.

[0051] Furthermore, after removing the pixel grid lines from the pixel image, a suitable pixel range is selected for image binarization based on the color depth of each pixel on the pixel curve. For example, if the pixel value of each pixel on the pixel curve corresponding to the function image is between 0 and 128, the pixel value of pixels with a value greater than 128 in the pixel image can be modified to 255, and the pixel value of pixels with a value less than or equal to 128 can be modified to 0. Thus, after binarization, the pixel image can distinguish each pixel on the pixel curve with a pixel value of 255.

[0052] S103: Determine the target axis pixel coordinates of each tick mark on each coordinate axis according to the axis pixel coordinates of the pixel grid lines on each coordinate axis.

[0053] In this coordinate image, one tick mark corresponds to at least one horizontal or vertical pixel bar in the pixel image. That is, if the pixel image includes n×m pixels, a horizontal pixel bar in the pixel image includes n pixels, and a vertical pixel bar includes m pixels. Furthermore, one tick mark in the coordinate image may correspond to one horizontal or vertical pixel bar, or it may correspond to multiple horizontal or vertical pixel bars.

[0054] For example, please refer to Figure 3 and Figure 4 , Figure 3 This is a schematic diagram of a scale line in a pixel image provided in an embodiment of this application. Figure 4 This is a schematic diagram of scale lines in another pixel image provided in an embodiment of this application. For example... Figure 3 and Figure 4 As shown, the pixel image corresponding to the coordinate image is 9×9 in size, meaning that a horizontal pixel bar contains 9 pixels and a vertical pixel bar contains 9 pixels. The coordinates of the pixel image have the top-left vertex as the origin o. Figure 3 The pixel bar corresponding to the x-axis in the image is only a single horizontal pixel bar, that is... Figure 3 This indicates that one tick mark in the coordinate graph corresponds to one horizontal pixel bar. Figure 4 The pixel bars corresponding to the x-axis in the graph are two horizontal pixel bars. Figure 4 This indicates that one tick mark in a coordinate graph corresponds to multiple horizontal pixel bars.

[0055] Furthermore, for each tick mark in the coordinate image, when the number of pixels corresponding to that tick mark in the pixel image is not uniform, it is necessary to specify the number of pixels corresponding to that tick mark in order to clarify the transformation relationship between the pixel coordinates of the pixel image and the coordinate axes of the coordinate image.

[0056] The target axis pixel coordinates of each tick mark on each coordinate axis are determined as follows: In each pixel grid line connected to the coordinate axis, the pixel interval corresponding to adjacent pixel grid lines is determined according to the axis pixel coordinates of adjacent pixel grid lines in the direction of the coordinate axis; based on the number of corresponding tick marks on the coordinate axis and the pixel interval, each pixel grid line on the coordinate axis is divided into multiple groups of pixel grid lines, with each group of pixel grid lines corresponding to one tick mark; based on the axis pixel coordinates of each pixel grid line in each group of pixel grid lines in the direction of the coordinate axis, the target axis pixel coordinates of the tick mark corresponding to each group of pixel grid lines are determined.

[0057] In other words, the target axis pixel coordinates of a tick mark are determined by the axis pixel coordinates of the coordinate axes to which the tick mark is connected, based on the endpoint pixel coordinates of the set of pixel grid lines corresponding to the tick mark. For example, if a tick mark is connected to the x-axis, the target axis pixel coordinates of that tick mark are determined by the x-axis pixel coordinates of each pixel grid line corresponding to that tick mark.

[0058] For example, for each pixel grid line connected to the x-axis, the difference in the x-axis pixel coordinates of adjacent pixel grid lines can be calculated based on their corresponding x-axis pixel coordinates. This difference is then used as the pixel interval between adjacent pixel grid lines. If the x-axis pixel coordinates of each pixel grid line are 0, 1, 2, 10, 11, 20, and 21, the calculated pixel intervals are 1, 1, 8, 1, 9, and 1. If the number of scale lines on the x-axis is 3, the pixel grid lines corresponding to x-axis pixel coordinates 0, 1, and 2 are designated as a first scale line; the pixel grid lines corresponding to x-axis pixel coordinates 10 and 11 are designated as a second scale line; and the pixel grid lines corresponding to x-axis pixel coordinates 20 and 21 are designated as a third scale line. Furthermore, for a set of pixel grid lines corresponding to the first tick mark, the pixel coordinate of the first tick mark is taken as one of the pixel coordinates of the first tick mark, which is 0, 1, or 2.

[0059] The step of dividing each pixel grid line on the coordinate axis into multiple groups of pixel grid lines based on the number of corresponding tick marks on the coordinate axis and the pixel interval includes: sorting the pixel intervals of adjacent pixel grid lines in the direction of the coordinate axis, determining a preset tick mark interval according to the sorting result and the number of corresponding tick marks on the coordinate axis; and dividing each pixel grid line on the coordinate axis into multiple groups of pixel grid lines according to the preset tick mark interval.

[0060] Specifically, the pixel intervals of adjacent pixel grid lines along the coordinate axis are sorted in descending order. The pixel interval that corresponds to the number of tick marks minus one in the sorted result is taken as the preset tick mark interval. Therefore, when the pixel interval is greater than or equal to the preset tick mark interval, the pixel grid line corresponding to the smaller axis pixel coordinate among the adjacent pixel grid lines is taken as the last pixel grid line in the current tick mark's set of pixel grid lines, and the pixel grid line corresponding to the larger axis pixel coordinate is taken as the first pixel grid line in the next tick mark's set of pixel grid lines.

[0061] For example, if the pixel grid lines on the x-axis correspond to pixel coordinates of 0, 1, 2, 10, 11, 20, and 21 in the x-axis direction, and the calculated pixel intervals are 1, 1, 8, 1, 9, and 1, and the number of tick marks on the x-axis is 3, sorting the pixel intervals yields 9, 8, 1, 1, 1, 1, with the preset tick mark interval being the second one in the sorted result (8). Therefore, when the pixel interval is greater than or equal to 8, the pixel grid lines are divided to obtain a set of pixel grid lines corresponding to each tick mark.

[0062] The target axis pixel coordinates of the tick marks corresponding to each group of pixel grid lines are determined as follows: the average value of the axis pixel coordinates of each pixel grid line in the group of pixel grid lines in the direction of the coordinate axis is taken as the target axis pixel coordinates of the tick marks corresponding to the group of pixel grid lines.

[0063] For example, the minimum or maximum axis pixel coordinate in a set of pixel grid lines can also be used as the target axis pixel coordinate of the tick line corresponding to the set of pixel grid lines. If the pixel grid lines corresponding to axis pixel coordinates 0, 1, and 2 in the x-axis direction are used as the set of pixel grid lines corresponding to the first tick line, then the pixel grid line corresponding to axis pixel coordinate 1 in the x-axis direction will be used as the target axis pixel coordinate of the first tick line.

[0064] S104: Determine the pixel point on the pixel curve corresponding to the first value according to the scale value of the adjacent scale line corresponding to the first value of the target variable and the pixel coordinate of the target axis.

[0065] The target variable is one of the first variable and the second variable, and the preset variable is the other of the first variable and the second variable.

[0066] The pixel point corresponding to the first value of the target variable on the pixel curve is determined by the following method: based on the target axis pixel coordinates corresponding to the adjacent tick marks corresponding to the first value of the target variable, the pixel difference between the first value of the target variable and the first adjacent tick mark is determined, where the first adjacent tick mark is one of the adjacent tick marks; the first axis pixel coordinate of the first value of the target variable on the coordinate axis corresponding to the target variable is determined by the target axis pixel coordinates of the first adjacent tick mark and the pixel difference, and the pixel point corresponding to the first axis pixel coordinate on the pixel curve is determined.

[0067] The first adjacent tick mark can be any one of the adjacent tick marks corresponding to the first value of the target variable. Thus, by determining the pixel difference corresponding to the difference between the first value of the target variable and the first adjacent tick mark, and the target axis pixel coordinate of the first adjacent tick mark, the first axis pixel coordinate of the first value of the target variable on the coordinate axis corresponding to the target variable can be known. Therefore, when the coordinates of each pixel point on the pixel curve are known, the pixel point corresponding to the first value of the target variable can be found through the first axis pixel coordinate.

[0068] For example, the pixel coordinate of the first value of the target variable on the first axis of the coordinate axis corresponding to the target variable is calculated using the following formula:

[0069]

[0070] In formula (2), w refers to the pixel coordinate of the first value of the target variable on the first axis of the coordinate system corresponding to the target variable. k-1 This refers to the target axis pixel coordinate of the lower limit tick mark corresponding to the first value of the target variable, w k This refers to the target axis pixel coordinate of the upper bound tick mark corresponding to the first value of the target variable, x. i This refers to the first value of the target variable, x. k This refers to the scale value of the upper limit line corresponding to the first value of the target variable, x. k-1 This refers to the scale value of the lower limit scale line corresponding to the first value of the target variable. Specifically, the scale value range of adjacent scale lines into which the first value of the target variable falls is determined. Among the adjacent scale lines, the scale line corresponding to the smaller value of the target axis pixel coordinate is taken as the lower limit scale line, and the scale line corresponding to the larger value of the target axis pixel coordinate is taken as the upper limit scale line. That is, in formula (2), the lower limit scale line is taken as the first adjacent scale line.

[0071] In other words, This refers to the pixel difference between the first value of the target variable and the lower limit scale line. Therefore, this pixel difference and the target axis pixel coordinate w of the lower limit scale line are used to...k-1 The sum of the values ​​is used as the first pixel coordinate of the target variable on the first axis of the coordinate system corresponding to the target variable.

[0072] Furthermore, after determining the first axis pixel coordinates, the pixel point whose axis pixel coordinates on the target variable are equal to the first axis pixel coordinates is found according to the pixel coordinates of each pixel point on the pixel curve. The pixel value of this pixel point is the pixel value obtained by binarizing the pixel curve. This pixel point is then determined as the pixel point corresponding to the first value of the target variable on the pixel curve. In other words, after determining the first axis pixel coordinates, a pixel strip with the first axis pixel coordinates is identified in the pixel image along the direction of the target variable's coordinate axis. Within this pixel strip, the pixel point whose pixel value is the pixel value obtained by binarizing the pixel curve is identified and used as the pixel point corresponding to the first value of the target variable on the pixel curve. If multiple pixels in the pixel strip have pixel values ​​obtained by binarizing the pixel curve, one pixel can be randomly selected from these multiple pixels as the pixel point corresponding to the first value of the target variable on the pixel curve.

[0073] Specifically, the first value of the target variable must fall within the range of values ​​for the target variable on the pixel curve. The range of values ​​for the target variable on the pixel curve is determined as follows: The minimum and maximum pixel coordinates of each pixel on the pixel curve are determined; if the first pixel coordinate corresponding to the first value of the target variable falls between the minimum and maximum pixel coordinates, then the first value of the target variable is considered to fall within the range of values ​​for the target variable on the pixel curve. If the first value of the target variable does not fall within the range of values ​​for the target variable on the pixel curve, it means that the pixel corresponding to the first value of the target variable is not on the pixel curve, and the corresponding pixel cannot be found. Therefore, the second value of the preset variable corresponding to the first value of the target variable on the curve cannot be determined.

[0074] Because some pixels on the pixel curve overlap with pixels on the pixel grid lines, the pixel values ​​of these overlapping pixels are changed to the background color of the pixel image during grid line removal, resulting in discontinuities on the pixel curve. Furthermore, if the first value of the target variable falls within the range of the target variable on the pixel curve but no corresponding pixel can be found using the first axis pixel coordinates, then this pixel is on the pixel grid line, causing its pixel value to differ from the pixel curve. In this case, for each pixel on the pixel curve, the pixel coordinates of the preceding and following axes that are closest to the first axis pixel coordinates are determined. The average of the axis pixel coordinates of the pixels corresponding to the preceding and following axis pixel coordinates on the preset variable's coordinate axes is used as the second axis pixel coordinate of the pixel corresponding to the first axis pixel coordinate.

[0075] S105: Based on the scale value of the adjacent scale line corresponding to the pixel point on the coordinate axis of the preset variable and the target axis pixel coordinate, determine the second value of the preset variable corresponding to the first value of the target variable on the function curve.

[0076] The second value of a preset variable corresponding to the first value of the target variable on the function curve is determined by the following method: determining the second axis pixel coordinate of the pixel point on the coordinate axis of the preset variable; determining the difference between the second axis pixel coordinate and the preset variable on the coordinate axis of the second scale line based on the second axis pixel coordinate, the scale value of the adjacent scale line corresponding to the pixel point on the coordinate axis of the preset variable, and the target axis pixel coordinate, wherein the second scale line is one of the adjacent scale lines; and calculating the second value corresponding to the second axis pixel coordinate using the scale value of the second scale line and the difference of the preset variable.

[0077] In other words, by knowing the second axis pixel coordinate of the pixel point on the coordinate axis of the preset variable, the pixel difference between the second axis pixel coordinate and the target axis pixel coordinate of the second scale line in the adjacent scale line on the coordinate axis of the preset variable can be calculated, and the difference between the pixel difference and the preset variable difference of the second scale line can be calculated, thereby calculating the second value corresponding to the second axis pixel coordinate.

[0078] For example, the second value of the preset variable is calculated using the following formula:

[0079]

[0080] In formula (3), y i This refers to the first value x of the target variable. i The second value of the preset variable corresponding to the function curve, y k-1This refers to the scale value of the lower limit line corresponding to the second value of the preset variable, y. k This refers to the scale value of the upper limit line corresponding to the second value of the preset variable, h. i This refers to the pixel coordinate of the second value of the preset variable on the second axis of the preset variable's coordinate system, h. k-1 This refers to the target axis pixel coordinate of the lower limit tick mark corresponding to the second value of the preset variable, h. k This refers to the target axis pixel coordinate of the upper limit tick line corresponding to the second value of the preset variable. Specifically, the target axis pixel coordinate interval of the adjacent tick lines into which the second axis pixel coordinate falls is determined. Among the adjacent tick lines, the tick line corresponding to the smaller value of the target axis pixel coordinate is taken as the lower limit tick line, and the tick line corresponding to the larger value of the target axis pixel coordinate is taken as the upper limit tick line. That is, in formula (3), the lower limit tick line is taken as the second adjacent tick line.

[0081] In other words, This refers to the difference between the second value of the preset variable and the preset variable's lower limit scale line. Therefore, the preset variable difference and the scale value y of the lower limit scale line are... k-1 The sum of the values ​​is used as the second value of the preset variable.

[0082] Furthermore, this application can calculate the correspondence between one variable and another by means of image processing when the expression of the image curve is unknown, which improves accuracy, especially in the processing of functional relationships in non-uniform coordinate systems.

[0083] Based on the same concept, this application also provides an image curve processing device corresponding to the image curve processing method provided in the above embodiments. Since the principle of the device in this application is similar to the image curve processing method in the above embodiments, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0084] like Figure 5 As shown, Figure 5This is a functional block diagram of an image curve processing device provided in an embodiment of this application. The image curve processing device 10 includes: an acquisition module 101, used to acquire the tick marks of multiple coordinate axes on a coordinate image and the pixel map of the coordinate image, the coordinate image including a coordinate grid and a function curve, wherein the coordinate grid is obtained based on each coordinate axis and its tick marks, and the function curve is a curve describing the relationship between variables corresponding to the multiple coordinate axes respectively; a first determination module 102, used to determine the pixel grid lines corresponding to the coordinate grid and the pixel curve of the function curve by combining the pixel map; a second determination module 103, used to determine the target axis pixel coordinates of each tick mark on each coordinate axis according to the axis pixel coordinates of the pixel grid lines on each coordinate axis; a third determination module 104, used to determine the pixel point corresponding to the first value on the pixel curve according to the tick mark values ​​of the adjacent tick marks corresponding to the first value of the target variable and the target axis pixel coordinates; and a fourth determination module 105, used to determine the second value of the preset variable corresponding to the first value of the target variable on the function curve according to the tick mark values ​​of the adjacent tick marks corresponding to the pixel point on the coordinate axis of the preset variable and the target axis pixel coordinates.

[0085] Based on the same application concept, see [link / reference] Figure 6 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this application. The electronic device 20 includes a processor 201, a memory 202, and a bus 203. The memory 202 stores machine-readable instructions that can be executed by the processor 201. When the electronic device 20 is running, the processor 201 and the memory 202 communicate through the bus 203. When the machine-readable instructions are executed by the processor 201, the steps of the curve processing method in the image as described in any of the above embodiments are executed.

[0086] Specifically, when the machine-readable instructions are executed by the processor 201, they can perform the following processing: acquiring the tick marks of multiple coordinate axes on a coordinate image and the pixel image of the coordinate image, wherein the coordinate image includes a coordinate grid and a function curve, wherein the coordinate grid is obtained based on each coordinate axis and its tick marks, and the function curve is a curve describing the relationship between variables corresponding to the multiple coordinate axes respectively; combining the pixel image, determining the pixel grid lines corresponding to the coordinate grid and the pixel curve of the function curve; determining the target axis pixel coordinates of each tick mark on each coordinate axis according to the axis pixel coordinates of the pixel grid lines on each coordinate axis; determining the pixel point corresponding to the first value of the target variable on the pixel curve according to the tick marks of the adjacent tick marks corresponding to the first value of the target variable and the target axis pixel coordinates; determining the second value of the preset variable corresponding to the first value of the target variable on the function curve according to the tick marks of the adjacent tick marks corresponding to the pixel point on the coordinate axis of the preset variable and the target axis pixel coordinates.

[0087] Based on the same concept, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the curve processing method for images provided in the above embodiments.

[0088] Specifically, the storage medium can be a general-purpose storage medium, such as a portable disk or hard disk. When the computer program on the storage medium is run, it can execute the curve processing method in the image described above. By identifying the pixel grid lines of the coordinate grid in the pixel image of the coordinate image, determining the target axis pixel coordinates corresponding to each tick mark on the coordinate axis, and identifying the pixel curve corresponding to the function curve in the pixel image, the pixel point corresponding to the known target variable value on the pixel grid line is determined according to the target axis pixel coordinates and tick values ​​of each tick mark. Based on the pixel coordinates of the pixel point, the target axis pixel coordinates and tick values ​​of each tick mark, the value of the preset variable corresponding to the pixel point is determined. This solves the technical problem that it is impossible to accurately estimate the value of the other variable when there is a variable at any point on the curve in the coordinate image. It achieves the technical effect of improving the accuracy of calculating the value of the variable through the relationship curve in the coordinate image.

[0089] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.

[0090] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0091] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0092] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0093] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for processing curves in an image, characterized in that, The method includes: Obtain the tick marks of multiple coordinate axes on a coordinate image and the pixel image of the coordinate image. The coordinate image includes a coordinate grid and function curves. The coordinate grid is obtained based on each coordinate axis and its tick marks, and the function curves are curves that describe the relationship between variables corresponding to the multiple coordinate axes. Based on the pixel image, the pixel grid lines corresponding to the coordinate grid and the pixel curves of the function curve are determined; Determine the target axis pixel coordinates of each tick mark on each coordinate axis based on the axis pixel grid lines; Based on the scale value of the adjacent scale line corresponding to the first value of the target variable and the pixel coordinate of the target axis, determine the pixel point corresponding to the first value on the pixel curve; Based on the scale values ​​of the adjacent tick lines corresponding to the pixel points on the coordinate axis of the preset variable and the pixel coordinates of the target axis, the second value of the preset variable corresponding to the first value of the target variable on the function curve is determined.

2. The method according to claim 1, characterized in that, The plurality of coordinate axes includes a first coordinate axis and a second coordinate axis, and the function curve is the relationship curve between a first variable corresponding to the first coordinate axis and a second variable corresponding to the second coordinate axis.

3. The method according to claim 2, characterized in that, The pixel grid lines corresponding to the coordinate grid are determined using the following method: Multiple straight lines in the pixel image are determined by line detection; Based on the endpoint pixel coordinates of each straight line, distinguish between multiple first pixel grid lines connected to the first coordinate axis and multiple second pixel grid lines connected to the second coordinate axis.

4. The method according to claim 3, characterized in that, For each first pixel grid line, the first axis pixel coordinates of the endpoint pixels of that first pixel grid line are the same. For each second pixel grid line, the second coordinate axis pixel coordinates in the endpoint pixel coordinates of that second pixel grid line are the same.

5. The method according to claim 1, characterized in that, The pixel curve of the function curve is determined in the following way: After removing the pixel grid lines from the pixel image, the pixel image is binarized according to the pixel values ​​of the pixel curves so that only the pixel curves are retained in the pixel image.

6. The method according to claim 1, characterized in that, The target axis pixel coordinates for each tick mark on each coordinate axis are determined using the following method: In each pixel grid line connected to the coordinate axis, the pixel interval corresponding to the adjacent pixel grid lines is determined according to the axis pixel coordinates of the adjacent pixel grid lines in the direction of the coordinate axis. Based on the number of corresponding tick marks on the coordinate axis and the pixel interval, each pixel grid line on the coordinate axis is divided into multiple groups of pixel grid lines, with each group of pixel grid lines corresponding to one tick mark. Based on the axis pixel coordinates of each pixel grid line in each group of pixel grid lines in that coordinate axis direction, determine the target axis pixel coordinates of the tick lines corresponding to each group of pixel grid lines.

7. The method according to claim 6, characterized in that, The process of dividing each pixel grid line on the coordinate axis into multiple groups of pixel grid lines based on the number of corresponding tick marks and the pixel interval includes: The pixel spacing of adjacent pixel grid lines along the coordinate axis is sorted, and the preset tick mark spacing is determined according to the sorting result and the number of corresponding tick marks on the coordinate axis. According to the preset scale line interval, the corresponding pixel grid line on the coordinate axis is divided into multiple groups of pixel grid lines.

8. The method according to claim 6, characterized in that, The target axis pixel coordinates of the tick marks corresponding to each group of pixel grid lines are determined using the following method: The average value of the axis pixel coordinates of each pixel grid line in the set of pixel grid lines in the direction of the coordinate axis is used as the target axis pixel coordinate of the tick line corresponding to the set of pixel grid lines.

9. The method according to claim 2, characterized in that, The target variable is one of the first variable and the second variable, and the preset variable is the other of the first variable and the second variable.

10. The method according to claim 8, characterized in that, The pixel point corresponding to the first value of the target variable on the pixel curve is determined by the following method: Based on the target axis pixel coordinates corresponding to the adjacent tick marks corresponding to the first value of the target variable, the pixel difference between the first value of the target variable and the first adjacent tick mark is determined, where the first adjacent tick mark is one of the adjacent tick marks. By using the target axis pixel coordinates of the first adjacent scale line and the pixel difference, the first value of the target variable is determined to be the first axis pixel coordinate on the coordinate axis corresponding to the target variable, and the pixel point corresponding to the first axis pixel coordinate on the pixel curve is determined.

11. The method according to claim 8, characterized in that, The second value of the preset variable corresponding to the first value of the target variable on the function curve is determined by the following method: Determine the second axis pixel coordinate of the pixel point on the coordinate axis of the preset variable; Based on the second axis pixel coordinates, the scale values ​​of the adjacent scale lines corresponding to the pixel on the coordinate axis of the preset variable, and the target axis pixel coordinates, the preset variable difference between the second axis pixel coordinates and the second scale line on the coordinate axis of the preset variable is determined, where the second scale line is one of the adjacent scale lines. The second value corresponding to the pixel coordinate of the second axis is calculated by using the difference between the scale value of the second scale line and the preset variable value.

12. The method according to claim 1, characterized in that, The process of obtaining the pixel map of the coordinate image includes: The coordinate image is converted into a grayscale image, and the grayscale image is filtered to obtain the pixel image.