Method for extracting curve data from curve graph at web end
By preprocessing the curved graph and refining algorithms to extract the curve skeleton, the problem of difficulty in extracting complex curve data in the prior art is solved, and accurate data extraction and display of complex curved graphs is achieved.
Patent Information
- Application Number
- CN202411778809.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-05
AI Technical Summary
Existing curve identification and extraction methods are difficult to accurately extract curve data of complex curve patterns, especially when facing situations where there are grids, large curve slopes, diverse background colors or multiple curves cross.
On the web end, the original image of the curve data to be extracted is input, and preprocessed to obtain auxiliary images. The curve skeleton is extracted and the endpoints and intersections are marked, the curve is broken down and the curve is merged, the original data of the curve is calculated and displayed on the web end.
Reconstruction, sampling and data extraction of complex curve graphics are realized, and the data of multiple curves can be accurately extracted, improving the utilization efficiency and accuracy of curve graphics data.
Smart Images

Figure CN119722725A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of curve data extraction, and in particular to a method for extracting curve data from a curve graphic on a web terminal. Background Art
[0002] Automatically identifying and extracting curve data from curve graphics has very important application value in the field of graphics processing. For example, in the process of RF front-end design, a large amount of data analysis and application of curve graphics knowledge will be involved, such as extracting raw data such as vibration load spectra and temperature cycle records from various complex curve graphics.
[0003] Existing curve recognition methods include boundary recognition algorithms, traditional machine recognition methods, etc. Among them, traditional machine recognition methods cover operations such as extracting curve key points. However, these methods all have many disadvantages. For example, the interaction is extremely cumbersome and requires a lot of manpower and time costs to operate. In terms of accuracy, its performance is also unsatisfactory and it is difficult to meet the requirements of accurate recognition. Especially when facing complex curve graphics scenes, such as grids, large curve slopes, rich and diverse background colors, or multiple curves intersecting each other, these methods are almost difficult to cope with. Taking the boundary recognition algorithm as an example, when processing curve graphics with grids, the grid lines are easy to interfere with its accurate judgment of the curve boundary, resulting in recognition errors; and the traditional machine recognition method for extracting curve key points, when multiple curves intersect, often cannot accurately distinguish the key points of each curve, and it is difficult to extract the data of one of the curves separately. The existence of these problems makes the original data extraction of curve graphics difficult, seriously restricts the effective use and further analysis and mining of curve graphics data, and greatly hinders the efficiency improvement of related work.
[0004] It can be seen from the above description that the existing curve recognition and extraction methods are difficult to accurately extract curve data of relatively complex curve graphics. Summary of the invention
[0005] 1. Technical issues to be solved
[0006] In view of the deficiencies in the prior art, the present invention provides a method for extracting curve data from curve graphics on a web side, which solves the technical problem that the existing curve recognition and extraction methods are difficult to accurately extract curve data from more complex curve graphics.
[0007] (II) Technical solution
[0008] To achieve the above objectives, the present invention is implemented through the following technical solutions:
[0009] The present invention provides a method for extracting curve data from a curve graph on a web terminal, comprising:
[0010] Input the original image of the curve data to be extracted on the web terminal, mark and intercept the original image along the length or width direction, build the image xy coordinate system on the original image and set the maximum and minimum values on the x-axis and y-axis;
[0011] Preprocessing the original image to obtain an auxiliary image, wherein the preprocessing includes grayscale and binarization operations;
[0012] The skeleton of the curve in the auxiliary image is extracted by a thinning algorithm and all endpoints and intersections are marked to obtain a set of intersections and endpoints;
[0013] According to the intersection point and endpoint set, the curves in the original image are disassembled to obtain a disassembled curve set; the width of each curve in the curve set is calculated, and the curves are merged according to the width result to obtain several separate curves in the original image;
[0014] The raw data of a separate curve is calculated based on the maximum and minimum values on the x-axis and y-axis and the set of coordinate points entered, and displayed on the web.
[0015] Preferably, the refinement algorithm comprises:
[0016] By analyzing the eight neighboring points of each black pixel in the auxiliary image, it is determined whether each black pixel can be deleted, and if so, it is deleted.
[0017] Preferably, the step of analyzing eight adjacent points of each black pixel in the curve of the auxiliary image to determine whether each black pixel can be deleted includes:
[0018] For each black pixel, calculate its total value, map the total value to the pre-built index table, and determine whether each black pixel can be deleted;
[0019] The calculation methods of its total value include:
[0020] Set the weight of the black pixel to 0, the weight of the white pixel to 1, assign different multipliers to the 8 neighboring points of the black pixel, multiply the multiplier and the weight to get the value of the 8 neighboring points, and add the values of the 8 neighboring points to get the total value;
[0021] The pre-built index table includes a one-dimensional array with 256 elements, in which 0 indicates that it cannot be removed and 1 indicates that it can be removed.
[0022] Preferably, the method for acquiring the conditions of the eight neighboring points of each black pixel includes:
[0023] The eight neighboring points of each pixel are found by scanning. When scanning each horizontal line, the left and right neighbors of each pixel are first determined. If they are all black pixels, no processing is performed. If a black pixel is deleted, its right neighbor is skipped to process the next point. After a horizontal scan of the rectangle, two rows of pixels are reduced. Then a vertical scan is performed. The vertical scanning method is the same as the horizontal scanning method. Repeat the horizontal and vertical scans many times until the pattern no longer changes.
[0024] Preferably, the endpoint means that: if only one of the eight neighboring points of the current black pixel is a black pixel, then the current black pixel is the endpoint;
[0025] The intersection point means that if there are three or more black pixels among the eight neighboring points of the current black pixel point, then the current black pixel point is the intersection point.
[0026] Preferably, the step of disassembling the curves in the original image according to the intersection points and the endpoint sets includes:
[0027] According to the intersection point and endpoint set, the black point existing on 8 adjacent points is repeatedly searched from the intersection point in the original image until the endpoint is found, thereby disassembling the curve in the original image.
[0028] Preferably, the calculating the width of each curve in the curve set and merging the curves according to the width result to obtain a plurality of separate curves in the original image includes:
[0029] After obtaining all the disassembled curve sets, take out the middle point of each curve and iteratively search for 8 adjacent points on the original image until each of the 8 adjacent points is white. Finally, the shortest distance is calculated, which is the width of the merged curve.
[0030] Preferably, the calculating of the original data of a separate curve according to the maximum and minimum values on the input x-axis and y-axis and the coordinate point set, and displaying the data on the web terminal, includes:
[0031] Click the curve to be extracted on the web side, calculate the original data of the selected curve based on the maximum and minimum values on the x-axis and y-axis and the coordinate point set entered, and display it on the web side.
[0032] (III) Beneficial effects
[0033] The present invention provides a method for extracting curve data from a curve graph on a web terminal. Compared with the prior art, the method has the following beneficial effects:
[0034] The present invention can reconstruct and sample complex curves with diverse background colors, grids, large curve slopes, and multiple curve intersections on the web side, obtain the coordinate information of the picture, and thus extract and apply data to multiple curves in the picture. At the same time, the present invention introduces an advanced image preprocessing mechanism, and realizes efficient compression of image information and highlighting of key features by graying and binarizing the input image. The unique grayscale conversion algorithm and adaptive binarization strategy are adopted, and the parameters can be dynamically adjusted according to the specific characteristics of the image to ensure that the core features of the curve are retained while the irrelevant noise and interference elements are removed to the maximum extent. This preprocessing method not only improves the efficiency of subsequent processing steps, but also lays a solid foundation for accurate curve recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 A block diagram of a method for extracting curve data from a curve graph on a web side according to an embodiment of the present invention;
[0037] Figure 2 A flowchart of a method for extracting curve data from a curve graph on a web terminal;
[0038] Figure 3 A schematic diagram for setting the maximum and minimum values in the X and Y directions;
[0039] Figure 4 A schematic diagram of the auxiliary image;
[0040] Figure 5 This is a schematic diagram of the display of auxiliary images on the web side;
[0041] Figure 6 is an index table, i.e. a one-dimensional array with 256 elements
[0042] Figures 7a to 7d There are four situations of pixel distribution around the black pixel to be removed;
[0043] Figures 8a to 8f There are six situations where pixels cannot be removed;
[0044] Fig. 9 A schematic diagram of the multiplier corresponding to each position;
[0045] Fig.10This is a schematic diagram of a specific example of calculating whether the black dot in the middle can be removed;
[0046] Fig.11 is a skeleton diagram;
[0047] Fig.12 A schematic diagram for finding endpoints;
[0048] Fig.13 A schematic diagram for finding intersection points;
[0049] Figures 14a to 14c This is a schematic diagram for finally obtaining separate curves and raw data. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention are clearly and completely described. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] The embodiment of the present application provides a method for extracting curve data from curve graphics on the web, thereby solving the technical problem that existing curve recognition and extraction methods are difficult to accurately extract curve data from more complex curve graphics, thereby achieving accurate extraction of curve data from complex curve graphics.
[0052] The technical solution in the embodiment of the present application is to solve the above technical problems, and the overall idea is as follows:
[0053] The existing curve recognition and extraction methods are interactive and cumbersome, with low accuracy. It is difficult to extract the data of any one of the curves when there are multiple curves. Especially when the curve graphics have grids, large slopes, diverse background colors, and multiple curves intersect, the extraction of the original data of the curve is more difficult, which seriously hinders the data utilization efficiency of the curve graphics.
[0054] In response to the above problems, an embodiment of the present invention proposes to reconstruct and sample complex curves with diverse background colors, grids, large curve slopes, and multiple intersecting curves, obtain the coordinate information of the image, and thus extract and apply data for multiple curves in the image respectively.
[0055] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0056] The embodiment of the present invention provides a method for extracting curve data from a curve graph on a web terminal, such as Figure 1 As shown, including:
[0057] S1. Input the original image of the curve data to be extracted on the web terminal, mark and intercept the original image along the length or width direction, construct the image xy coordinate system on the original image and set the maximum and minimum values on the x-axis and y-axis;
[0058] S2, preprocessing the original image to obtain an auxiliary image, wherein the preprocessing includes grayscale and binarization operations;
[0059] S3, extracting the skeleton of the curve in the auxiliary image through a thinning algorithm and marking all endpoints and intersections to obtain a set of intersections and endpoints;
[0060] S4, according to the intersection point and the endpoint set, the curves in the original image are disassembled to obtain a set of disassembled curves; the width of each curve in the curve set is calculated, and the curves are merged according to the width result to obtain several separate curves in the original image;
[0061] S5. Calculate the raw data of a separate curve according to the maximum and minimum values on the input x-axis and y-axis and the coordinate point set, and display it on the web side.
[0062] The embodiment of the present invention introduces an advanced image preprocessing mechanism, which realizes efficient compression of image information and highlighting of key features by graying and binarizing the input image. The unique gray conversion algorithm and adaptive binarization strategy can dynamically adjust parameters according to the specific characteristics of the image, ensuring that irrelevant noise and interference elements are removed to the maximum extent while retaining the core features of the curve. This preprocessing method not only improves the efficiency of subsequent processing steps, but also lays a solid foundation for accurate curve recognition.
[0063] The following is combined with Figure 2 The specific flow chart shown describes in detail the method for extracting curve data from a curve graphic on a web side according to an embodiment of the present invention.
[0064] In step S1, the original image of the curve data to be extracted is input on the web terminal, the original image is marked and intercepted along the length and direction, the image xy coordinate system is constructed on the original image, and the maximum and minimum values on the x-axis and y-axis are set. The specific implementation process is as follows:
[0065] Input the original image of the curve data to be extracted on the web terminal, and intercept the original image by marking the X direction and Y direction, and set the maximum and minimum values of the X direction and Y direction. In the specific operation process, click the minimum and maximum values of the X axis and the minimum and maximum values of the Y axis in sequence with the mouse; in sequence, x1, x2, y1, y2, such as Figure 3 shown.
[0066] In step S2, the original image is preprocessed to obtain an auxiliary image. The specific implementation process is as follows:
[0067] The original image is processed by grayscale, binarization, filtering, corrosion, inversion, etc. to obtain an auxiliary image. Figure 4 As shown, it is displayed on the web side as follows Figure 5 shown.
[0068] In step S3, the skeleton of the curve in the auxiliary image is extracted by a thinning algorithm and all endpoints and intersections are marked to obtain a set of intersections and endpoints. The specific implementation process is as follows:
[0069] Thinning is to remove some points from the original image while maintaining the original shape. Whether a point can be removed is determined based on the conditions of the 8 neighboring points of the current point; the specific determination can be divided into internal points that cannot be deleted, isolated points that cannot be deleted, and straight line endpoints that cannot be deleted; if it is a boundary point, it can be deleted if the connected components do not increase after removal. For a binary image, for the eight pixel distributions around the middle black pixel, each position has two conditions: either black or white, so there are a total of 2×2×2×2×2×2×2×2×2=28=256 types, that is, a one-dimensional array with 256 elements defined in the program. 0 in the array means it cannot be removed, and 1 means it can be removed. The array is as follows: Figure 6 shown.
[0070] The pixel distribution around the black pixel to be removed is Figures 7a to 7d Several location situations.
[0071] However, among these 256 position distributions, some cannot be removed, and some can be removed. Among them, the points that cannot be removed are as follows Figures 8a to 8f As shown, it can be described as:
[0072] The first point cannot be removed because it is an interior point
[0073] The second point cannot be removed, it is also an internal point
[0074] The third point cannot be removed, and deleting it will disconnect the originally connected parts.
[0075] The fourth point can be removed, this point is not the skeleton
[0076] The fifth point cannot be removed; it is the endpoint of the line.
[0077] The sixth point cannot be removed; it is the endpoint of the line.
[0078] In the specific implementation process, the table lookup method is used to determine whether the point can be deleted:
[0079] For black pixels, different values are assigned according to the conditions of their eight neighboring points (the surrounding black value is 0, and the white value is the corresponding value of the nine-square grid), and the conditions of all points are mapped to an index table of 0-255. The corresponding items in the index table are checked to decide whether to keep the point. This method of judging by building an index table is one of the core features of the algorithm, which is different from some other thinning algorithms based on complex geometric rules or iterative calculations.
[0080] Index table (i.e. Figure 6 The one-dimensional array with 256 elements in is constructed according to the eight-connectivity criterion, which means:
[0081] The situation of 8 adjacent points (eight-connected) is used as the basis for judging whether a point can be removed. Specifically, internal points cannot be deleted, isolated points cannot be deleted, and straight line endpoints cannot be deleted. If it is a boundary point, it can be deleted if the connected component does not increase after removing the point.
[0082] The value calculation method includes: setting the pixel weight of black to 0, setting the pixel weight of white to 1, and the corresponding multipliers of the surrounding 8 positions are 1, 2, 4, 8, 16, 32, 64, and 128 respectively. Fig. 9 Calculate as Fig.10 Whether the black dot in the middle can be removed, the calculation process is as follows:
[0083] The first pixel is black, its pixel value is 0, and the corresponding multiplier is 1, so the calculation result of this item is: 0×1=0.
[0084] The second pixel is white, and the pixel value is 1 (because the weight of white pixels is set to 1), and the corresponding multiplier is 2. The calculation result is: 1×2=2.
[0085] The third pixel is white, with a pixel value of 1, and the corresponding multiplier is 4. Calculation yields: 1×4=4.
[0086] The fourth pixel is white, with a pixel value of 1, and the corresponding multiplier is 8, so: 1×8=8.
[0087] The fifth pixel is white, with a pixel value of 1, and the corresponding multiplier is 16, so: 1×16=16.
[0088] The sixth pixel is black, with a pixel value of 0, and the corresponding multiplier is 32. The calculation result is: 0×32=0.
[0089] The seventh pixel is black, with a pixel value of 0, and the corresponding multiplier is 64, so: 0×64=0.
[0090] The last pixel is white, with a pixel value of 1, and the corresponding multiplier is 128, which is calculated as: 1×128=128.
[0091] Add up the above calculation results to get the total value:
[0092] 0×1+1×2+1×4+1×8+1×16+0×32+0×64+1×128=158
[0093] array
[158] =0, so this point cannot be removed;
[0094] The skeleton of the curve in the auxiliary image is extracted by the above method. Fig.11 As shown. In the embodiment of the present invention, the "skeleton" is consistent with the common understanding of the skeleton, such as the skeleton of a rectangle is the central axis in the long direction, the skeleton of a circle is the center of the circle, and the skeleton of a straight line and an isolated point is itself. After obtaining the skeleton of the curve, find the 8 adjacent points of each black point. If there is only one adjacent point (pixel value 0), it means that the current point is an endpoint. If there are 3 or more black pixels (pixel value 255) around a point, it is considered an intersection. The view of finding the endpoint is as follows Fig.12 As shown, only one of the eight adjacent points of the current point is black (0), which is the endpoint. The view for finding the intersection point is as follows Fig.13 As shown, if more than 3 of the 8 adjacent points of the current point are black (0), it is an intersection point.
[0095] It should be noted that when judging whether a point can be deleted, the eight adjacent points of each point are searched by scanning. However, the original algorithm may delete points by mistake during the scanning process. For example, for a simple vertical line example, when scanning from top to bottom and from left to right, the entire line may be deleted by mistake, resulting in the final result not meeting expectations.
[0096] In the embodiment of the present invention, the scanning method is improved: when scanning each line horizontally, the left and right neighbors of each point are first determined. If they are all black points, the point is not processed. If a black point is deleted, its right neighbor is skipped to process the next point; a horizontal scan of the rectangle will reduce two rows of pixels, and then the vertical scan is performed in the same way. Repeat the horizontal and vertical scans many times until the figure no longer changes. This improvement measure for the problems encountered during the scanning process is a reflection of the continuous optimization of the algorithm in practical applications. Compared with some refinement algorithms that do not take these special cases into account, it has better accuracy and stability.
[0097] In step S4, according to the intersection point and the endpoint set, the curves in the original image are separated to obtain a separated curve set, the width of each curve in the curve set is calculated, and the curves are merged according to the width result to obtain several separate curves in the original image. The specific implementation process is as follows:
[0098] According to the intersection and endpoint sets, the black dots (pixel value 0) existing on the 8 adjacent points in the original image are repeatedly iterated from the intersection until the endpoint is found, and the curves in the original image are disassembled. After obtaining all the disassembled curve sets, the middle point of each curve (that is, the middle point of the line from each intersection to the endpoint) is taken out to iteratively search for 8 adjacent points on the original image until the pixel value of each point is white (255). Finally, the shortest distance is calculated, which is the width of the merged curve.
[0099] The curve set is grouped according to the width obtained in the above steps. If the curves have the same width, they are merged to obtain the individual curves in the original image of the curve data to be extracted. The merged curves are displayed on the web.
[0100] In the above way, the coordinates of the black points of the extracted skeleton are searched in the original image, and then the width is calculated based on the situation that the adjacent points are black and white points (the search is iterated until the white point is reached); the width is calculated in order to freely merge the disassembled skeleton lines according to the original width, so that the desired separate curve can be obtained.
[0101] In step S5, the original data of the separate curve is calculated based on the input maximum and minimum values on the x-axis and y-axis and the coordinate point set, and is displayed on the web end.
[0102] Click the curve to be extracted on the web side, calculate the original data of the selected curve based on the maximum and minimum values on the x-axis and y-axis and the coordinate point set entered, and display it on the web side.
[0103] Finally, we get the individual curves and raw data as follows: Fig.14a , Fig.14b , Fig.14c shown.
[0104] The embodiment of the present invention can use the program on the web side, which plays a good auxiliary role in the design process of the RF front-end component. It can easily obtain curves and extract raw data for various complex curve maps. For example, in the design process of the RF front-end component, the original data of the coordinate points in the curve map can be quickly extracted for the load curve map obtained by component simulation, thereby improving the data utilization efficiency. At the same time, the present invention can be used as a curve raw data acquisition interface, and can be easily integrated with other applications, with the curve map resource as the input end, and the data can be directly output after being processed by the present invention. Provide a data interface for other applications.
[0105] In summary, compared with the prior art, the present invention has the following beneficial effects:
[0106] 1. The embodiment of the present invention can reconstruct and sample complex curves with diverse background colors, grids, large curve slopes, and multiple curve intersections on the web side, obtain the coordinate information of the image, and thus extract and apply data for multiple curves in the image.
[0107] 2. The embodiment of the present invention introduces an advanced image preprocessing mechanism, which realizes efficient compression of image information and highlighting of key features by graying and binarizing the input image. The unique grayscale conversion algorithm and adaptive binarization strategy can dynamically adjust parameters according to the specific characteristics of the image, ensuring that irrelevant noise and interference elements are removed to the maximum extent while retaining the core features of the curve. This preprocessing method not only improves the efficiency of subsequent processing steps, but also lays a solid foundation for accurate curve recognition.
[0108] 3. The innovative erosion algorithm (i.e., deleting redundant points) of the embodiment of the present invention is applied to remove redundant lines and points in the image. Based on a complex mathematical model and intelligent decision-making mechanism, the algorithm can accurately identify redundant elements that may affect the accuracy of curve recognition and perform targeted erosion processing. Through in-depth analysis of pixel neighborhoods and dynamic adjustment of erosion parameters, it is ensured that while removing redundant elements, the integrity and authenticity of the curve will not be damaged.
[0109] 4. A unique refinement algorithm is carefully designed to extract image skeletons. The algorithm combines advanced mathematical morphology theory and deep learning technology to capture the core structure of curves with extremely high accuracy. Through multi-level analysis and iterative processing of images, the results of skeleton extraction are continuously optimized, making the extracted skeleton more refined and accurate, providing high-quality basic data for subsequent endpoint and intersection extraction.
[0110] 5. Accurate endpoint extraction technology is based on advanced pixel gradient analysis and feature detection algorithms. By deeply mining the gradient information of image pixels (image gradient information indicates the speed of image change and reflects the edge information of the image), combined with complex pattern recognition technology, the endpoints of the lines can be located quickly and accurately. This endpoint extraction method is highly robust and adaptable, and can work reliably even in extremely complex image environments, providing key starting point information for accurate analysis of curves.
[0111] 6. The innovative intersection extraction method uses multi-dimensional pixel association judgment and intelligent area division algorithm. By deeply analyzing the multi-dimensional association characteristics of pixels in the local area and combining the intelligently divided analysis area, the intersection of lines can be accurately identified. This intersection extraction method can not only comprehensively capture different types of intersections, but also provide key node information for subsequent coordinate point grouping and curve analysis.
[0112] 7. The embodiment of the present invention groups all the coordinate points from the intersection to the endpoint of the line, uses an improved scanning method to find the pixel values of 8 adjacent points, and efficiently groups them according to the number of points with a pixel value of 255. This method combines advanced graph theory and data structure technology, can quickly and accurately group coordinate points, and provides strong support for subsequent curve analysis and processing.
[0113] 8. In terms of calculating line width, the embodiment of the present invention adopts an innovative iterative approximation algorithm. By calculating the middle point of the line from each intersection to the endpoint, and then searching for pixels of 8 adjacent points on the original image, iterative approximation is continuously performed until the pixel values are inconsistent and a marking calculation is performed. This algorithm is based on a complex mathematical model and optimization theory, and can accurately calculate the width of the line, providing important parameters for the analysis and processing of the curve.
[0114] 9. Efficient line screening and merging algorithms are based on advanced machine learning technology and optimization strategies. According to the calculated width, the intelligent classification algorithm is used to accurately screen out the lines that meet the requirements, and the optimized merging strategy is used to reasonably merge them. This algorithm can effectively remove unnecessary lines while retaining key curve information, improving the accuracy and reliability of curve recognition.
[0115] 10. The embodiment of the present invention calculates the original coordinate values according to the maximum and minimum values of the X and Y axes set by the front end through an intelligent mechanism that interacts with the front end. This mechanism integrates advanced front-end technology and back-end algorithms, can achieve seamless data interaction and accurate coordinate calculation, and provides accurate coordinate information for further processing and analysis of images, meeting the needs of different application scenarios.
[0116] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0117] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for extracting curve data from a curve graph on a web terminal, characterized in that: include: Input the original image of the curve data to be extracted on the web terminal, mark and intercept the original image along the length or width direction, build the image xy coordinate system on the original image and set the maximum and minimum values on the x-axis and y-axis; Preprocessing the original image to obtain an auxiliary image, wherein the preprocessing includes grayscale and binarization operations; The skeleton of the curve in the auxiliary image is extracted by a thinning algorithm and all endpoints and intersections are marked to obtain a set of intersections and endpoints; According to the intersection points and endpoint sets, the curves in the original image are disassembled to obtain a set of disassembled curves; Calculate the width of each curve in the curve set, and merge the curves according to the width results to obtain several separate curves in the original image; The raw data of a separate curve is calculated based on the maximum and minimum values on the x-axis and y-axis and the set of coordinate points entered, and displayed on the web.
2. The method for extracting curve data from a curve graph on a web terminal according to claim 1, characterized in that: The refinement algorithm includes: By analyzing the eight neighboring points of each black pixel in the auxiliary image, it is determined whether each black pixel can be deleted, and if so, it is deleted.
3. The method for extracting curve data from a curve graph on a web terminal according to claim 2, characterized in that: The step of analyzing the eight neighboring points of each black pixel in the curve in the auxiliary image to determine whether each black pixel can be deleted includes: For each black pixel, calculate its total value, map the total value to the pre-built index table, and determine whether each black pixel can be deleted; The calculation methods of its total value include: Set the weight of the black pixel to 0, the weight of the white pixel to 1, assign different multipliers to the 8 neighboring points of the black pixel, multiply the multiplier and the weight to get the value of the 8 neighboring points, and add the values of the 8 neighboring points to get the total value; The pre-built index table includes a one-dimensional array with 256 elements, in which 0 indicates that it cannot be removed and 1 indicates that it can be removed.
4. The method for extracting curve data from a curve graph on a web terminal according to claim 2, characterized in that: The method of obtaining the conditions of the eight neighboring points of each black pixel includes: The eight neighboring points of each pixel are found by scanning. When scanning each horizontal line, the left and right neighbors of each pixel are first determined. If they are all black pixels, no processing is performed. If a black pixel is deleted, its right neighbor is skipped to process the next point. After a horizontal scan of the rectangle, two rows of pixels are reduced. Then a vertical scan is performed. The vertical scanning method is the same as the horizontal scanning method. Repeat the horizontal and vertical scans many times until the pattern no longer changes.
5. The method for extracting curve data from a curve graph on a web terminal as claimed in any one of claims 1 to 4, characterized in that: The endpoint means that if only one of the eight adjacent points of the current black pixel is a black pixel, then the current black pixel is the endpoint; The intersection point means that if there are three or more black pixels among the eight neighboring points of the current black pixel point, then the current black pixel point is the intersection point.
6. The method for extracting curve data from a curve graph on a web terminal according to any one of claims 1 to 4, characterized in that: The step of disassembling the curves in the original image according to the intersection points and the endpoint sets includes: According to the intersection point and endpoint set, the black dots existing on 8 adjacent points are repeatedly searched from the intersection point in the original image until the endpoint is found, thereby breaking up the curve in the original image.
7. The method for extracting curve data from a curve graph on a web terminal according to any one of claims 1 to 4, characterized in that: The width of each curve in the curve set is calculated, and the curves are merged according to the width result to obtain several separate curves in the original image, including: After obtaining all the disassembled curve sets, take out the middle point of each curve and iteratively search for 8 adjacent points on the original image until each of the 8 adjacent points is white. Finally, the shortest distance is calculated, which is the width of the merged curve.
8. The method for extracting curve data from a curve graph on a web terminal according to any one of claims 1 to 4, characterized in that: The method of calculating the raw data of a separate curve based on the maximum and minimum values on the input x-axis and y-axis and the coordinate point set, and displaying it on the web terminal, includes: Click the curve to be extracted on the web side, calculate the original data of the selected curve based on the maximum and minimum values on the x-axis and y-axis and the coordinate point set entered, and display it on the web side.
Citation Information
Patent Citations
Method for predicting traffic flow extracted by improved C-V model-based remote sensing image road network
CN101980317A
Anti-noise Chinese character feature extraction method based on framework
CN104156730A
Image processing method and system
CN110060260A
Image coordinate extraction method, image processing equipment and storage device
CN112927288A
Literature curve separation and coordinate information extraction method based on image processing
CN114332866A
Cited By
Self-adaptive layout method of multi-stroke image in irregular region
CN122049112A