A method for automatically extracting relative numerical coordinates of image curves
Patent Information
- Application Number
- CN202110798778.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-15
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-07-15
AI Technical Summary
The existing technology requires human participation when extracting the numerical information of the curve from the picture, especially the coordinate axis calibration and the determination of the curve position, and the relative numerical value of the curve cannot be directly obtained, which limits the degree of automation.
A two-layer neural network model is adopted. The first layer is used to detect the curve range, and the second layer is used to extract the relative coordinate values of the curve. Through labeling data sets and nonlinear interpolation calculations, automatic curve position detection and coordinate value extraction are realized, avoiding the need for Human calibration and color selection.
It realizes automatic curve relative numerical coordinate extraction without manual calibration of the horizontal and vertical coordinate axes, is suitable for pictures of different sizes, and provides fully automated standardized output.
Smart Images

Figure CN113393518B
Abstract
Description
Technical Field
[0001] The invention relates to a method for digitizing image information, and in particular to a method for automatically extracting relative numerical coordinates of a picture curve. Background Art
[0002] Data charts are an important way to communicate scientific theories and technologies. Free access to data can accelerate the promotion and application of new technologies. People can easily obtain visual image data, but in most cases, the numerical information in the image cannot be directly obtained. To solve this problem, some semi-automatic methods have been proposed. For example, when the color of the curve in the image is different from the background, the color of the curve can be manually selected to extract the curve pixel points, or when the curve in the image is composed of multiple broken lines, the curve is automatically regenerated by manually selecting the nodes on the curve. In addition to the need for human participation in determining the specific position of the curve, another common point of these methods is that they need to manually calibrate the coordinate axis to which the curve belongs, that is, they need to provide information such as the starting point of the horizontal and vertical coordinate axes in the image, the horizontal axis distance corresponding to a single pixel point, and the vertical axis distance corresponding to a single pixel point.
[0003] In recent years, deep learning-based object detection technology has made rapid progress, providing a new method for automatically locating the range of image curves. At the same time, for some special usage scenarios, people often only need to obtain the relative coordinate values of the curve, rather than its absolute value. At this time, using the supervised training method of the neural network, an algorithm model for automatically extracting the relative coordinates of the image curve can be successfully constructed. Summary of the invention
[0004] In view of the defects existing in the prior art, the purpose of the present invention is to provide a method for automatically extracting the relative numerical coordinates of image curves, realizing curve position range detection in the image through neural network model one, and realizing curve relative coordinate value extraction through neural network model two.
[0005] In order to achieve the above purpose, the technical solution adopted by the present invention is:
[0006] A method for automatically extracting relative numerical coordinates of a picture curve comprises the following steps:
[0007] Step S1, randomly generate a series of curve data points, draw the curve data points into a curve graph, annotate the curve graph with the precise position of the curve range in a manner that the annotation box is tangent to the curve contour (the annotation box needs to be close to the curve contour), obtain the curve annotation box position, and combine the curve graph and the curve annotation box position to construct a labeled data set for the neural network model 1;
[0008] Step S2, taking out the image in the area selected by the curve annotation box, and scaling the image to a certain size to obtain a standardized image;
[0009] Step S3, performing nonlinear interpolation calculation on the curve data points corresponding to the standardized image, expanding the number of curve data points corresponding to the standardized image to the same number as the output value of the neural network model 2, and standardizing them in the interval [0,1] to obtain the label value required for training the neural network model 2;
[0010] Step S4, constructing a labeled data set for the neural network model 2 by combining the standardized images and the label values required for training the neural network model 2;
[0011] Step S5: using an open source target detection algorithm to train a curve range detection model based on the labeled data set of the aforementioned neural network model 1, to obtain a trained neural network model 1;
[0012] Step S6: training the curve relative coordinate prediction model based on the labeled data set of the aforementioned neural network model 2 to obtain a trained neural network model 2.
[0013] Based on the above scheme, in the structure of the neural network model 2, C1, C2 and C3 are convolutional layers, R1, R2 and R3 are RELU layers, P1, P2 and P3 are Pooling layers, D1 and D2 are Dropout layers, and FC1 and FC2 are fully connected layers; there are n output values in the output layer, and the n output values are the prediction results of the neural network for the current sample.
[0014] Based on the above solution, n is the number of pixels in the horizontal axis direction of the standardized image in step S2.
[0015] On the basis of the above scheme, the image to be detected is input into the trained neural network model 1, and the output standardized image is input into the trained neural network model 2 to obtain the predicted value of the relative coordinates of the original curve.
[0016] Beneficial effects of the present invention:
[0017] a, Curve range extraction method based on deep learning target detection technology, which does not require manual calibration of the horizontal and vertical axes.
[0018] b. Because the relative coordinate values extracted are standardized, this method can be fully automated, which is different from the general color-based and manual point selection method.
[0019] c. For original images of different sizes, standardized output results can be obtained. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The present invention has the following accompanying drawings:
[0021] Figure 1Schematic diagram of curve graph example 1.
[0022] Figure 2 Schematic diagram of curve chart example 2.
[0023] Figure 3 Schematic diagram of curve chart example 3.
[0024] Figure 4 Schematic diagram of curve graph example 4.
[0025] Figure 5 Schematic diagram of curve diagram annotation box example 1.
[0026] Figure 6 Schematic diagram of curve diagram annotation box example 2.
[0027] Figure 7 Schematic diagram of curve diagram annotation box example 3.
[0028] Figure 8 Schematic diagram of curve diagram annotation box example 4.
[0029] Fig. 9 Schematic diagram of example 1 of standardization of curve graph annotation boxes.
[0030] Fig.10 Schematic diagram of example 2 of curve graph annotation box standardization.
[0031] Fig.11 Schematic diagram of example 3 of curve graph annotation box standardization.
[0032] Fig.12 Schematic diagram of example 4 of the standardization of curve graph annotation boxes.
[0033] Fig.13 Schematic diagram of the curve relative numerical coordinate extraction model structure. DETAILED DESCRIPTION
[0034] The following is combined with Figure 1-13 The present invention is described in further detail.
[0035] 1. Build a dataset
[0036] Since two neural networks are involved, two independent data sets need to be established. In order to improve the efficiency of data set construction, a construction idea based on artificial data is proposed, as follows.
[0037] a, Generate a dataset for neural network model 1
[0038] A series of curve data points are randomly generated, as shown in Table 1.
[0039] Table 1
[0040]
[0041] Draw the data points in Table 1 into a curve graph, such as Figure 1-Figure 4 As shown,
[0042] For example Figure 1-Figure 4 The curve picture shown is as follows Figure 5-Figure 8 The exact position of the curve range is marked in this way, combined with Figure 1-Figure 4 The curve picture shown and Figure 5-Figure 8 The position of the curve annotation box shown is the annotation data set for constructing the neural network model 1.
[0043] b. Generate annotated dataset for neural network model 2
[0044] Take out Figure 5-Figure 8 Select the image in the box area shown in the figure and scale the image to a uniform standard size, such as 100×100 pixels, to obtain the following Figure 9-12 Standardized pictures shown.
[0045] Will Figure 9-12 The corresponding data in Table 1 are subjected to nonlinear interpolation calculation, the number of data points in the table is expanded to the same number as the output value of the neural network model 2, and the values are standardized between [0,1]. Table 2 gives an example of expanding the first two columns of data in Table 1 to 10 columns of data, which are the label values required for training the neural network model 2.
[0046] Table 2
[0047]
[0048] Combined with Figure 9-12 The curve image shown in FIG. 1 and the relative coordinate values of the curve shown in Table 2 are the labeled data sets for constructing the neural network model 2.
[0049] 2. Neural network model-training method
[0050] Use open source target detection algorithms, such as yolo v4, etc., and train the curve range detection model based on the labeled data set of the aforementioned neural network one.
[0051] 3. Neural network model 2 training method:
[0052] Based on the labeled data set of the aforementioned neural network model 2, a curve relative coordinate prediction model is trained to obtain a trained neural network model 2;
[0053] The neural network model is as follows Fig.13As shown in the figure, in the network structure, C1, C2 and C3 are convolutional layers, R1, R2 and R3 are RELU layers, P1, P2 and P3 are Pooling layers, D1 and D2 are Dropout layers, and FC1 and FC2 are fully connected layers. There are n output values in the output layer, which are the prediction results of the neural network for the current sample, that is, the prediction values of the relative coordinates of the standardized curve, where n is the number of pixels in the horizontal axis direction of the standardized image in the above step b.
[0054] 4. Practical usage
[0055] a. Input the image to be detected into the trained neural network model 1 to obtain a standardized output image.
[0056] b. Input the standardized image obtained in the previous step into the trained neural network model 2 to obtain the predicted value of the relative coordinates of the original curve.
[0057] The contents not described in detail in this specification belong to the prior art known to professional and technical personnel in this field.
Claims
1. A method for automatically extracting relative numerical coordinates of image curves, characterized in that: The following steps are involved: Step S1, randomly generate a series of curve data points, draw the above curve data points into a curve graph, mark the curve graph with the precise position of the curve range in a way that the annotation box is tangent to the curve contour, obtain the curve annotation box position, and combine the curve graph and the curve annotation box position to construct a labeled data set for the neural network model 1; Step S2, taking out the image in the area selected by the curve annotation box, and scaling the image to a certain size to obtain a standardized image; Step S3, performing nonlinear interpolation calculation on the curve data points corresponding to the standardized image, expanding the number of curve data points corresponding to the standardized image to the same number as the output value of the neural network model 2, and standardizing them in the interval [0,1] to obtain the label value required for training the neural network model 2; Step S4, constructing a labeled data set for the neural network model 2 by combining the standardized images and the label values required for training the neural network model 2; Step S5: using an open source target detection algorithm to train a curve range detection model based on the labeled data set of the aforementioned neural network model 1, to obtain a trained neural network model 1; Step S6, training the curve relative coordinate prediction model based on the labeled data set of the aforementioned neural network model 2 to obtain a trained neural network model 2; Step S7: input the image to be detected into the trained neural network model 1, and input the output standardized image into the trained neural network model 2 to obtain the predicted value of the relative coordinate of the original curve.
2. The method for automatically extracting relative numerical coordinates of a picture curve according to claim 1, characterized in that: In the structure of the neural network model 2, C1, C2 and C3 are convolutional layers, R1, R2 and R3 are RELU layers, P1, P2 and P3 are Pooling layers, D1 and D2 are Dropout layers, and FC1 and FC2 are fully connected layers; there are n output values in the output layer, and the n output values are the prediction results of the neural network for the current sample.
3. The method for automatically extracting relative numerical coordinates of a picture curve as claimed in claim 2, characterized in that: The n is the number of pixels in the horizontal axis direction of the standardized image in step S2.
