Disclosure of Invention
In order to achieve the purpose, the invention provides a graphical identification method of characteristic points of a data trend line, which comprises the following steps:
converting a data trend line formed by the acquired data into a trend image;
and secondly, scanning and comparing preset characteristic images in the trend image, wherein when the preset similarity is reached or greater than the preset similarity, the current scanning position on the trend image is the position of the characteristic point of the data trend line, and the number of the characteristic points can be one, multiple or even none.
Further, the preset similarity is 80%.
Further, when a plurality of preset feature images need to be identified, repeating the first step and the second step, and identifying the corresponding feature points of each preset feature image respectively.
Further, in the first step, a coordinate system is established for the trend image, so that the feature point position is represented by coordinate values.
The present invention also provides a groove width measurement method, the groove defining a surface profile having a height difference, the method comprising:
scanning the surface contour by adopting a distance meter with uniform linear motion, and recording the actual measurement distance between the surface contour and the distance meter on a motion track at a certain frequency so as to form a data trend line;
converting the data trend lines into trend images;
setting a first characteristic image and a second characteristic image which respectively correspond to the data graph change trend of the groove when the height is suddenly changed;
respectively scanning and comparing the first characteristic image and the second characteristic image in the trend image, wherein when the first characteristic image and the second characteristic image reach or are greater than a preset similarity, the current scanning position on the trend image is the position of a characteristic point corresponding to the first characteristic image or the second characteristic image;
and calculating the width of the groove through the characteristic points corresponding to the first characteristic image and the second characteristic image.
Further, the rangefinder enables ranging based on transmitting and receiving signal waves, such as using a laser rangefinder, an infrared rangefinder, or the like.
Further, the preset similarity is 80%, and can be adjusted according to actual needs.
Further, a coordinate system is established for the trend image, so that the positions of the feature points are represented by coordinate values. For picture files, a coordinate system can be established by the positions of the pixels.
The present invention applies image recognition techniques to data analysis that obfuscates the noise or fluctuations of the data through the imaging of the data, thereby enhancing the recognition of data trends and providing a useful complement to current data analysis.
The conception, the specific structure and the technical effects of the present invention will be further described with reference to the accompanying drawings to fully understand the objects, the features and the effects of the present invention.
Detailed Description
In the description of the embodiments of the present invention, it should be understood that the terms "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", etc., indicate orientations or positional relationships based on those shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the referred devices or elements must have a specific orientation, be constructed and operated in a specific orientation, and thus, should not be construed as limiting the present invention.
As shown in fig. 1, the method for graphically identifying characteristic points of a data trend line of the present invention comprises the following steps:
step S1: converting a data trend line formed by the collected data into a trend image;
step S2: establishing a coordinate system for the trend image;
step S3: determining a preset characteristic image;
step S4: scanning and comparing the preset characteristic image in the trend image, and when the preset similarity is reached or greater than the preset similarity, obtaining the current scanning position on the trend image, namely the position of the characteristic point of the data trend line;
step S5: when it is necessary to recognize another preset feature image, steps S3 and S4 are repeated.
The method for graphically identifying characteristic points of a data trend line of the present invention is further illustrated by an embodiment of measuring the groove width.
As shown in fig. 2, the laser rangefinder 1 is placed above the groove 2 for measuring its distance from the wall surface defined by the groove 2, the groove 2 defining wall surface profiles 21, 22, 23, 24, 25. The incident direction of the laser distance measuring device 1 is perpendicular to the wall profiles 21, 22, 23 and parallel to the wall profiles 23, 24.
The laser distance measuring device 1 moves linearly at a certain speed v and sequentially sweeps the wall profiles 21, 24, 23, 25 and 22, and the actually measured distance values during the moving process are recorded at a certain frequency, and the recorded numerical curve is shown in fig. 3.
In fig. 3, the horizontal axis (X axis) represents "time", and the vertical axis (Y axis) represents "distance", and since the laser range finder 1 performs a linear motion at a constant speed v, the actually measured distance values are recorded at each time point of the time axis, thereby forming a data trend line shown in fig. 3.
When it is desired to calculate the width of the groove 2 in fig. 2 by using the data trend lines in fig. 3, the mathematical method is to find the break point in the curve by numerical calculation, such as point A, B, C, D in fig. 3, and after determining one of points a and B and one of points C and D, the width of the groove can be easily found. Generally, the method for finding the break point of the continuous curve through calculation is to derive the continuous curve, and when data jump occurs in a derivative curve (which is not derivable based on the break point), the corresponding position in the original continuous curve is the break point position.
For a data trend line formed by continuous data like that in fig. 3, the derivation method for each point is as follows:
let the coordinates of the points recorded be (x) in sequence0,y0)、(x1,y1)、(x2,y2)……(xn,yn) When any point (x) of the curve needs to be calculatedm,ym) At the derivative of (b), the derivative of the point KmThe following formula is satisfied:
Km=(ym-ym-1)/(xm-xm-1)
when the sampled data has ideal precision, each break point of the data trend line can be effectively found through the method, but in actual measurement, the measured data can be influenced by various noises, so that a curve which looks smooth on a trend graph actually has severe fluctuation in a small interval or range. The line segment OA is approximately a straight line as shown in fig. 3, but when the point a is enlarged, it can be seen that the data from O to a forms a curve with sharp fluctuations, which are caused by measurement errors and noise. If the break point is found only by the derivation method, a plurality of break points may appear on the line segment from O to a, which may affect the correct determination of the data. Of course, the data can be further processed by other algorithms, which increases the processing difficulty, and different algorithms are often required according to different actual situations, thereby increasing the workload of developers.
For the above situation, the present embodiment finds the break point of the curve in fig. 3 in the following manner.
First, the numerical value curve in fig. 3 is saved as an image file, i.e., picture 3 as shown in fig. 4.
Pictures 31, 32 are provided corresponding to the curve changes at points a and D, respectively. For the arrangement of the pictures 31 and 32, the data curve trend in fig. 3 is not needed to be known, in the measurement as shown in fig. 2, the laser range finder 1 scans from the wall surface contour 21 to the wall surface contour 23, and a jump of a numerical value is necessarily generated due to the height difference, so that the picture 31 only needs to be arranged in a way that a horizontal line segment is connected with an upward vertical line segment, and the picture 32 is arranged similarly.
Then, the picture 31 is scanned and compared in the picture 3, and a position with a similarity meeting a preset value is found, in this embodiment, when the compared similarity is greater than 80%, the graph is considered to be consistent, so that the point a can be found to be the position consistent with the picture 31 through the comparison. Similarly, a location at point D that coincides with picture 32 may also be found.
For the picture 3, accurate coordinate positioning can be performed through the pixel points, so that a coordinate system can be established. Therefore, the found points A and D can be represented by coordinate values, and when the coordinates of the two points are known, the width of the groove can be calculated according to the coordinates.
Suppose the coordinates of point A are (x)A,yA) The coordinates of point D are (x)D,yD) Therefore, the width W of the groove satisfies the following formula:
W=(xD-xA)×v
where v is the moving speed at the time of measurement by the laser range finder 1.
The data pattern recognition method of the present invention is explained above by a groove width measurement method. Similarly, the method can also be applied to more complicated data trend line analysis, such as a K-line graph of stock tendency, and various feature pictures (images) can be set according to the experience of an operator to compare with the whole K-line graph to find the feature points. Since the comparison is performed only by the graph, the influence of the small-range fluctuation of the data on the result is greatly reduced, namely, the data fluctuation is blurred. And the degree of the fuzzification can be adjusted by presetting the similarity so as to represent tolerable comparison difference.
The present embodiment applies image recognition techniques to data analysis, which obscures the noise or fluctuations of the data through the patterning of the data, thereby enhancing the identification of data trends and providing a useful complement to current data analysis.
The foregoing detailed description of the preferred embodiments of the invention has been presented. It should be understood that numerous modifications and variations could be devised by those skilled in the art in light of the present teachings without departing from the inventive concepts. Therefore, the technical solutions available to those skilled in the art through logic analysis, reasoning and limited experiments based on the prior art according to the concept of the present invention should be within the scope of protection defined by the claims.