Graph data extraction method based on topology robustness calibration and multi-dimensional feature fusion
Patent Information
- Application Number
- CN202610699323.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-20
- Publication Date
- 2026-09-25
AI Technical Summary
[0005]鉴于上述的分析,本发明公开一种基于拓扑鲁棒性标定与多维特征融合的图表数据提取方法;解决现有技术在处理复杂科学图表时存在的坐标系统标定过程中误差控制与校准质量保障不足、颜色与视觉特征分析精度瓶颈、数据提取算法鲁棒性不足、以及误差自校正机制缺失的问题
通过创新的“用户引导+交互式约束+质量评估提示”混合标定策略,提升复杂拓扑条件下的数据提取鲁棒性;在坐标标定阶段对坐标轴几何关系提供校准质量评估与交互式重标定提示,在数据提取阶段通过划线区域约束、重叠/不清晰检测与策略化掩膜生成机制,使传统方法难以稳定提取的遮挡、断裂或重叠图表能够被有效处理。相比现有技术仅支持标准笛卡尔单轴坐标系且在复杂场景下易失效的局限,本发明将图表提取的适用边界扩展至工程实践与科学研究中常见的复杂坐标场景,形成从标定、验证到数据提取的交互式闭环鲁棒性保障体系,为科学文献数据挖掘、技术档案数字化与工程数据分析提供了图表数据提取方案,具有科研与工程应用价值。
Smart Images

Figure CN122821567A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision, pattern recognition and artificial intelligence, and in particular to a method for extracting chart data based on topological robustness calibration and multidimensional feature fusion. Background Technology
[0002] Charts and graphs in scientific literature and engineering drawings contain a wealth of experimental data and engineering parameter relationships. Converting charts and graphs from unstructured images into structured numerical data can enhance the knowledge base of large language models, enabling them to understand the quantitative information in the charts and graphs and improve their scientific question-answering and knowledge reasoning abilities. This is of great significance for scientific data mining and engineering digitization. However, the numerical information in charts and graphs cannot be directly parsed by machines. Traditional methods rely on manual point-by-point reading or rough estimation, which is inefficient and prone to introducing errors.
[0003] Current technical solutions mainly extract chart data through methods such as vector path parsing, image pixel classification, or semantic segmentation, but they still have the following shortcomings when processing complex scientific charts: First, the lack of error control and calibration during the coordinate calibration process leads to insufficient extraction accuracy. Coordinate calibration establishes the mapping relationship between pixel coordinates and physical quantities, which is a fundamental step in the entire data extraction process. Calibration deviations will be passed on to all subsequent data points and are difficult to correct automatically in later stages. Existing solutions typically only perform linear conversions based on the distance between adjacent scales during the calibration stage, lacking a quality assessment and calibration feedback mechanism for the geometric relationships between axes (such as perpendicularity and angular deviation). Users cannot obtain accuracy prompts during the calibration stage, and calibration errors are difficult to detect and correct in a timely manner, easily introducing systematic mapping errors. Second, the accuracy and versatility of color and visual feature analysis extraction methods are limited. Existing methods mostly use the RGB device-dependent color space, which is affected by lighting, device differences, and compression artifacts, leading to unstable color recognition. Moreover, most algorithms rely only on color or edge features and cannot distinguish data series with similar colors but different line types (dashed / solid lines) or marker shapes, resulting in series extraction errors. Simply relying on global color thresholds or manual color sampling methods has poor robustness in complex multi-series charts commonly found in scientific papers, making it difficult to reliably extract target data. Third, the data extraction capabilities for complex topological scenarios such as coordinate axis occlusion, curve breaks, and multiple overlapping sequences are insufficient. Existing solutions only provide local processing for a few specific cases, do not provide unwrapping solutions for pixel aliasing at the intersection of multiple curves, and lack systematic processing mechanisms for coordinate axis occlusion, curve breaks, and multiple overlapping sequences. They generally lack interactive region constraints, clear quantifiable detection of problem areas, and strategic mask generation capabilities for complex topological scenarios, making it impossible to stably extract target data within occluded or aliased regions.
[0004] In summary, existing technologies have limitations in the accuracy and robustness of complex chart data extraction, failing to meet the urgent need for efficient, accurate, and reliable analysis of massive amounts of complex charts in scientific research and engineering practice. Therefore, a novel chart data extraction method is needed that can uniformly process complex scientific charts, integrate multi-dimensional visual features, and intelligently correct errors. Summary of the Invention
[0005] Based on the above analysis, this invention discloses a chart data extraction method based on topological robust calibration and multidimensional feature fusion; it solves the problems of insufficient error control and calibration quality assurance in the coordinate system calibration process, bottlenecks in the accuracy of color and visual feature analysis, insufficient robustness of data extraction algorithms, and lack of error self-correction mechanism in the existing technology when processing complex scientific charts.
[0006] This invention discloses a method for extracting chart data based on topological robustness calibration and multidimensional feature fusion, comprising the following steps: S1. Preprocess the chart image, the preprocessing including region labeling, the region labeling being used to divide the data region, legend region and interference region; S2. Pick calibration points in the visible area of the coordinate axes, establish the mapping relationship between pixel coordinates and data coordinates, construct a multi-coordinate system mapping model, and establish interpolation mapping for each coordinate axis; in multi-axis scenarios, maintain the calibration parameters of each axis and the relationship between axes through coordinate axis containers; S3. Perform background filtering on the preprocessed chart image to generate a binary mask, and perform color clustering in combination with the legend area to determine the data series; determine the coordinate axes used by each data series in the series configuration; perform geometric relationship verification on the coordinate axis mapping based on the calibration points, and correct the mapping parameters when the verification result does not meet the preset constraints; within the data area, perform constraint screening on the mask for topological scenes of occlusion, breakage and overlap, and integrate line center path, shape detection and connected component features to extract the set of pixel coordinates; S4. Based on the mapping model, the set of pixel coordinates is converted into physical values, and after density control, noise removal, and duplicate point detection and merging, chart data is obtained.
[0007] Further, S2 includes: S201. Pick two calibration points in the visible area of each axis in the chart and record the pixel and data coordinates; S202. Abstract the coordinate axes into mathematical objects containing types, reference points, and transformation functions, and manage the multi-axis system uniformly through coordinate axis containers; perform linear interpolation on linear axes, and perform log-domain linear interpolation followed by exponential transformation on logarithmic axes to construct a unified mapping model that supports nonlinear transformations.
[0008] Furthermore, S201 includes: Through step-by-step guided interaction, the user is prompted to pick at least two non-overlapping calibration points in the visible area of each coordinate axis in the preprocessed chart image, and the pixel coordinates and corresponding real data values are recorded simultaneously. Based on the calibration points, an interpolation mapping relationship between linear or logarithmic coordinate axes is established, and the calibration results are saved as a coordinate system object for subsequent data extraction and retrieval.
[0009] Furthermore, when the number of calibration points picked by the user exceeds two, the least squares fitting algorithm is used to optimize the parameters and minimize the sum of squared calibration errors in order to improve the coordinate mapping accuracy within the observable area. The objective function of least squares estimation is: ; in, The parameters are the linear transformation parameters to be optimized. To determine the number of sampling points; For sampling point index, For the first The pixel spatial coordinates of each sampling point; For the first The corresponding real data space value of each sampling point.
[0010] Furthermore, in S202, the unified multi-coordinate system modeling includes: S202-1. Abstract each coordinate axis into an independent mathematical object, including type attributes and pixel space reference points. Data space corresponding values The type attribute includes either a linear axis or a logarithmic axis. S202-2. Use coordinate axis containers to uniformly manage master-slave relationships and geometric relationships in single X-axis, dual Y-axis, dual X-axis, or multi-subgraph systems; S202-3. Establish linear axis transformation functions and logarithmic coordinate axis transformation functions to realize interpolation from pixel space to data space; The linear axis transformation function is: ; The logarithmic coordinate axis transformation function is: ; in, For the current pixel, These are the actual data values of two known calibration points on the coordinate axis. ; For the current pixel The linear interpolation result of the corresponding linear axis; For the current pixel The corresponding logarithmic interpolation results for the logarithmic coordinate axes.
[0011] Further, S3 includes: S301. Convert the chart image from RGB color space to HSV color space, and generate a foreground / target mask based on HSV threshold and joint region constraint to suppress background and interference areas. S302. Determine the target color by combining the auxiliary color sampling of the cropped area in the illustration; generate an HSV threshold and tolerance range for the target color, using the data area as the effective extraction range, suppress pixel extraction in the interference area and exclusion area, and generate a binary mask for single-series or multi-series extraction; wherein... S302-1. Based on the distinguished data series, establish the correspondence between each data series and the coordinate axis in the series configuration, including the horizontal and vertical axis identifiers used by each data series and the axis objects corresponding to the range. S302-2. Perform geometric relationship verification on coordinate axis mapping based on calibration points; when the verification result does not meet the preset constraints, correct the mapping parameters or output a recalibration prompt to the user so that subsequent pixel-to-data conversion adopts the updated mapping relationship. S302-3. Generate calibration reference information based on the calibration point and the current mapping parameters. The calibration reference information includes at least a precision prompt related to the range and the pixel spacing of the calibration point, which is used to help determine whether the calibration meets the extraction precision requirements. S303. For complex topological scenes with occlusion, breaks, and overlaps, robust constraint conditions are provided by interactive constraints and strategic processing: user-defined manually drawn regions are received to limit the effective extraction range; overlapping parts between multiple manually drawn regions are detected, and discrete pixels in the overlapping regions are connected and clustered based on distance thresholds; low-resolution parts in the manually drawn regions are detected based on Laplacian local sharpness, and enhancement mask or exclusion strategy parameters are generated for extraction accordingly. S304. For line-type data series, morphological skeletonization or column scanning is used to extract the center path. For discrete point-type data series, circular detection and contour approximation / centroid positioning are used to extract marker points. The center path and marker points are converted into a set of pixel coordinates, and a high-precision extracted data point set is output.
[0012] Furthermore, in S301, the RGB format chart image is converted to the HSV color space; based on brightness and saturation thresholds, white, black, and gray background areas are removed to generate a foreground pixel set, achieving initial separation of the data series from the complex background; among which, Background mask ; The masks are white, black, and gray, respectively. " is the logical OR operator, representing the union operation between masks; Foreground Mask ; " is the logical NOT operator; White mask ; black mask ; gray mask ; For pixel saturation, HSV color space components; For pixel brightness / luminance, HSV color space components; This is the minimum saturation threshold used to distinguish between color and gray. The maximum brightness threshold; The minimum brightness threshold; This is a conditional operator that returns 1 if the internal condition is met, and 0 otherwise. " is the logical AND operator.
[0013] Furthermore, in S303, the data extraction and processing for complex topological regions includes: S303-1. For areas where data curves are occluded, extract constraints are executed within the user-specified line area, and a mask for extraction is generated in conjunction with a color filtering strategy, so that the target pixel set can still be stably obtained under occlusion conditions. S303-2. For regions with broken or discontinuous data curves, perform continuous sorting and path construction on mask pixels, and perform sampling and retention of continuous line points according to density pattern, so that an ordered sequence of curve pixels can still be obtained under broken conditions. S303-3. To address the aliasing issue caused by overlapping multiple manually drawn areas, the overlapping portions between each drawn area are detected, and discrete pixels within the overlapping areas are clustered based on a distance threshold. Simultaneously, low-resolution portions within the drawn areas are detected. Based on the distribution relationship between the overlapping portions and low-resolution portions, one of the following strategies is selected to generate an extraction mask: priority is given to extracting overlapping and low-resolution areas, only overlapping areas are extracted, only low-resolution areas are extracted, or problematic areas are excluded; this improves the reliability of data extraction in aliasing and low-resolution scenarios.
[0014] Furthermore, S4 includes: S401. Based on the mapping model, convert the pixel coordinates into physical values to generate an initial extraction dataset; S402. Perform density control based on the preset maximum number of points threshold and minimum point distance threshold, and sparsify the dense point set that violates the maximum number of points threshold or minimum point distance threshold constraint; after clustering by x coordinate, take the median of y value so that each x coordinate corresponds to only a single y value. S403. Redundant points with a distance less than a threshold are identified through a duplicate point detection mechanism, and the redundant points are merged to eliminate noise. S404: All cleaning parameters and structured data are saved as JSON snapshots through State objects, supporting subsequent batch processing and configuration replay.
[0015] Furthermore, the sparsity constraints are as follows: ; This is the set of raw data points extracted from the chart. The subset of retained data points after density-controlled filtering satisfies all constraints; It is a subset relation; To preserve subsets Two different data points in the data; For point The Euclidean distance between them; This is the preset minimum point spacing threshold; To preserve subsets The cardinality; The preset maximum number of points threshold; The function relationship where each x-coordinate corresponds to a single y-value is: ; The processed output y-value. It is a median function; For the first data point in the original data set The y-coordinate values of each point. For the first data point in the original data set x-coordinates of each point; Let x be the x-coordinate of the target to be solved. The x-value is the preset clustering window radius; " is the condition separator.
[0016] This invention can achieve one of the following beneficial effects: This invention enhances the robustness of data extraction under complex topological conditions through an innovative hybrid calibration strategy combining user guidance, interactive constraints, and quality assessment prompts. During the coordinate calibration phase, it provides calibration quality assessment and interactive recalibration prompts for the geometric relationships of the coordinate axes. In the data extraction phase, it effectively handles occlusion, breakage, or overlap in graphs that are difficult to extract stably using traditional methods through line-drawing region constraints, overlap / ambiguity detection, and a strategic mask generation mechanism. Compared to the limitations of existing technologies that only support standard Cartesian single-axis coordinate systems and are prone to failure in complex scenarios, this invention extends the applicability of graph extraction to complex coordinate scenarios commonly encountered in engineering practice and scientific research. It forms an interactive closed-loop robustness assurance system from calibration and verification to data extraction, providing a graph data extraction solution for scientific literature data mining, technical archive digitization, and engineering data analysis, and has significant research and engineering application value. Attached Figure Description
[0017] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts. Figure 1 This is a flowchart of the chart data extraction method based on topological robustness calibration and multidimensional feature fusion in an embodiment of the present invention. Detailed Implementation
[0018] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and, together with the embodiments of the present invention, serve to illustrate the principles of the present invention.
[0019] One embodiment of the present invention discloses a method for extracting chart data based on topological robustness calibration and multidimensional feature fusion, such as... Figure 1 As shown, it includes the following steps: S1. Preprocess the chart image, the preprocessing including region labeling, the region labeling being used to divide the data region, legend region and interference region; S2. Pick calibration points in the visible area of the coordinate axes, establish the mapping relationship between pixel coordinates and data coordinates, construct a multi-coordinate system mapping model, and establish interpolation mapping for each coordinate axis; in multi-axis scenarios, maintain the calibration parameters of each axis and the relationship between axes through coordinate axis containers; S3. Perform background filtering on the preprocessed chart image to generate a binary mask, and perform color clustering in combination with the legend area to determine the data series; determine the coordinate axes used by each data series in the series configuration; perform geometric relationship verification on the coordinate axis mapping based on the calibration points, and correct the mapping parameters when the verification result does not meet the preset constraints; within the data area, perform constraint screening on the mask for topological scenes of occlusion, breakage and overlap, and integrate line center path, shape detection and connected component features to extract the set of pixel coordinates; S4. Based on the mapping model, the set of pixel coordinates is converted into physical values, and after density control, noise removal, and duplicate point detection and merging, chart data is obtained.
[0020] In S1, the preprocessing operation specifically includes: S101, Image Format Standardization Conversion; Receives chart images uploaded by users in PNG, JPG, BMP, or TIFF formats, automatically performs format standardization conversion, and uniformly converts them to the internally processed RGB color space; providing a unified data foundation for subsequent image analysis; S102. Interactive Region Annotation: This method combines interactive rectangular selection with polygon drawing to accurately annotate three types of key regions. Data area: The smallest bounding rectangle containing the curve / marker point; Legend area: Color coding and text description area; Interference areas: grid lines, coordinate axis ticks, title text, etc. It supports direct color selection in the merged legend preview, and allows users to accurately select the target color without background noise by cropping the legend area and zooming in. S103. Save preprocessing state snapshot; All labeled coordinates and preprocessing parameters are saved as JSON state snapshots through State objects, supporting subsequent breakpoint resume and configuration replay, avoiding repetitive operations and improving batch processing efficiency. The status snapshot file adopts a hierarchical structured format, which facilitates version management and cross-session recovery.
[0021] Furthermore, an image quality assessment step can be added between S101 and S102; In this step, for the user-specified line area or data area, unclear areas are detected based on Laplacian local sharpness, and overlapping parts between multiple manually lined areas are detected and connected to provide hints or generate parameters required for subsequent extraction strategies. An image enhancement processing step can be added between S102 and S103; During the process, when the image contrast is insufficient or light-colored data points are difficult to identify, enhancement operations such as contrast enhancement, sharpening, and bilateral filtering noise reduction are performed to improve the data point detection rate.
[0022] The process of constructing the multi-coordinate system mapping model, as described in S2, includes: S201. Pick two calibration points in the visible area of each axis in the chart and record the pixel and data coordinates; S202. Abstract the coordinate axes into mathematical objects containing types, reference points, and transformation functions, and manage the multi-axis system uniformly through coordinate axis containers; perform linear interpolation on linear axes, and perform log-domain linear interpolation followed by exponential transformation on logarithmic axes to construct a unified mapping model that supports nonlinear transformations.
[0023] S201 includes: Through step-by-step guided interaction, the user is prompted to pick at least two non-overlapping calibration points in the visible area of each coordinate axis in the preprocessed chart image, and the pixel coordinates and corresponding real data values are recorded simultaneously. Based on the calibration points, an interpolation mapping relationship between linear or logarithmic coordinate axes is established, and the calibration results are saved as a coordinate system object for subsequent data extraction and retrieval.
[0024] For example, guiding the user to click the left and right endpoints of the X-axis simultaneously records the pixel coordinates. Compared with the actual data value input by the user .
[0025] When the number of calibration points picked by the user exceeds two, the least squares fitting algorithm is used to optimize the scaling parameters and minimize the sum of squared calibration errors in order to improve the coordinate mapping accuracy within the observable area. The objective function of least squares estimation is: ; in, The linear transformation parameters to be optimized are: This is the proportionality coefficient (slope). The optimal value is determined by minimizing the sum of squared errors, where the offset (intercept) is used. The number of calibration sampling points, i.e., the total number of calibration points picked by the user on the coordinate axis; For sampling point index, For the first The pixel spatial coordinates of each sampling point, i.e., the pixel position when the user clicks on the calibration point in the image; For the first The actual data space value corresponding to each sampling point, that is, the actual physical quantity value corresponding to that pixel input by the user; By minimizing the true data values of all sampling points Compared with linear predicted values By summing the squared errors between them, the optimal coordinate transformation parameters can be fitted. and This improves calibration accuracy.
[0026] This optimization mechanism significantly improves the accuracy of coordinate mapping within the observable area, and is especially suitable for scenarios with multiple scales on the long axis.
[0027] When performing least-squares fitting on the logarithmic axis, the data values are first transformed to the logarithmic domain, and then the sum of squared errors in the logarithmic domain is minimized.
[0028] In S202, unified multi-coordinate system modeling includes: S202-1. Abstract each coordinate axis into an independent mathematical object, including type attributes (linear or logarithmic axis, linear or log) and pixel space reference point. Data space corresponding values ; S202-2. Use coordinate axis containers to uniformly manage master-slave relationships and geometric relationships in single X-axis, dual Y-axis, dual X-axis, or multi-subgraph systems; S202-3. Establish linear axis transformation functions and logarithmic coordinate axis transformation functions to realize interpolation from pixel space to data space; The linear axis transformation function is: ; The logarithmic coordinate axis transformation function is: ; in, For the current pixel, These are the actual data values of two known calibration points on the coordinate axis. ; For the current pixel The linear interpolation result of the corresponding linear axis; For the current pixel The corresponding logarithmic interpolation results for the logarithmic coordinate axes.
[0029] This step incorporates nonlinear transformations into a unified framework, eliminating the need to write special processing logic for logarithmic / double logarithmic coordinates.
[0030] Optionally, this step may also include: S203. Calculate the actual tilt angle of the coordinate axis using the calibration point. Based on the angular deviation, classify it into four levels: excellent, good, average and poor to verify the verticality and consistency. For dual-axis systems, an additional consistency check between the primary and secondary coordinate axes is required. Deviation Determined to be "Excellent" level; Deviation Graded "Good"; Deviation Grade "General"; Deviation The rating is "poor"; when the rating is "poor", a recalibration warning is triggered.
[0031] For a dual Y-axis system, the perpendicularity of the left and right Y-axis to the X-axis is calculated separately, and a consistency check is performed to ensure that the geometric relationship between the primary and secondary axes conforms to the physical meaning of the chart. This quantitative rating mechanism provides users with intuitive accuracy feedback and reduces error levels.
[0032] In S204, the system summarizes the number of calibration points, verticality deviation, coordinate axis types, and related parameters, generating a readable calibration quality assessment text report; all mapping parameters are saved as a JSON snapshot through a State object. This snapshot supports cold start recovery and configuration playback, ensuring that similar charts in the same batch can directly call the verified mapping model without repeated calibration, thus improving batch processing efficiency.
[0033] The S3 includes: S301. Convert the chart image from RGB color space to HSV color space, and generate a foreground / target mask based on HSV threshold and joint region constraint to suppress background and interference areas. In S301, the RGB format chart image is converted to the device-independent HSV color space; based on brightness and saturation thresholds, white, black, and gray background areas are removed to generate a foreground pixel set, achieving initial separation of the data series from the complex background; among these... Background mask ; The masks are white, black, and gray, respectively. " is the logical OR operator, representing the union operation between masks; Foreground Mask ; " is the logical NOT operator; White mask ; black mask ; gray mask ; For pixel saturation, HSV color space components; For pixel brightness / luminance, HSV color space components; This is the minimum saturation threshold used to distinguish between color and gray. This is the maximum brightness threshold used to identify bright white areas; This is the minimum brightness threshold used to identify black areas; This is a conditional operator that returns 1 if the internal condition is met, and 0 otherwise. " is the logical AND operator.
[0034] S302. Determine the target color by combining the auxiliary color sampling of the cropping area in the legend; generate an HSV threshold and tolerance range for the target color, take the data area as the effective extraction range, suppress pixel extraction in the interference area and exclusion area, and generate a binary mask for single series or multiple series extraction. Optionally, K-Means color clustering can be performed on the foreground pixels of the image to help discover candidate data series colors, and a binary mask can be generated for the candidate colors using the same method.
[0035] The objective function for K-means clustering is: ; This represents the total number of foreground pixels. , The number of cluster centers. ; For the first Feature vectors in each cluster For all A set consisting of cluster centers; It is the square of the Euclidean distance.
[0036] S302 includes: S302-1. Based on the distinguished data series, establish the correspondence between each data series and the coordinate axis in the series configuration, including the horizontal and vertical axis identifiers used by each data series and the axis object corresponding to the range (for example, in a multi-vertical axis scenario, specify the series as the left Y-axis or the right Y-axis, and record the binding information consistent with the axis ID in the coordinate system object). S302-2. Perform geometric relationship verification on coordinate axis mapping based on calibration points; when the verification result does not meet the preset constraints, correct the mapping parameters or output a recalibration prompt to the user so that subsequent pixel-to-data conversion adopts the updated mapping relationship. S302-3. Generate calibration reference information based on the calibration point and the current mapping parameters. The calibration reference information includes at least accuracy prompts related to the range and the pixel spacing of the calibration point, which are used to assist in determining whether the calibration meets the extraction accuracy requirements.
[0037] S303. For complex topological scenes with occlusion, breaks, and overlaps, robust constraint conditions are provided by interactive constraints and strategic processing: user-defined manually drawn regions are received to limit the effective extraction range; overlapping parts between multiple manually drawn regions are detected, and discrete pixels in the overlapping regions are connected and clustered based on distance thresholds; low-resolution parts in the manually drawn regions are detected based on Laplacian local sharpness, and enhancement mask or exclusion strategy parameters are generated for extraction accordingly. In S303, data extraction and processing for complex topological regions includes: S303-1. For areas where data curves are occluded, extract constraints are executed within the user-specified line area, and a mask for extraction is generated in conjunction with a color filtering strategy, so that the target pixel set can still be stably obtained under occlusion conditions. S303-2. For regions with broken or discontinuous data curves, perform continuous sorting and path construction on mask pixels, and perform sampling and retention of continuous line points according to density pattern, so that an ordered sequence of curve pixels can still be obtained under broken conditions. S303-3. To address the aliasing issue caused by overlapping multiple manually drawn areas, the overlapping portions between each drawn area are detected, and discrete pixels within the overlapping areas are clustered based on a distance threshold. Simultaneously, low-resolution portions within the drawn areas are detected. Based on the distribution relationship between the overlapping portions and low-resolution portions, one of the following strategies is selected to generate an extraction mask: priority is given to extracting overlapping and low-resolution areas, only overlapping areas are extracted, only low-resolution areas are extracted, or problematic areas are excluded; this improves the reliability of data extraction in aliasing and low-resolution scenarios.
[0038] S304. For line-type data series, morphological skeletonization or column scanning is used to extract the center path. For discrete point-type data series, circular detection and contour approximation / centroid positioning are used to extract marker points. The center path and marker points are converted into a set of pixel coordinates, and a high-precision extracted data point set is output.
[0039] In S304, for line data series, the morphological skeletonization algorithm is used first to extract the center line and downsample according to the sampling step size. When skeletonization is not available, the median of each column is scanned by column and taken as the center path. The center line or center path is converted into the first pixel coordinate set. For discrete point data series, a circular detection and contour approximation / centroid localization algorithm is used to identify various types of marker points, and the marker points are converted into a second pixel coordinate set; Merge the first set of pixel coordinates with the second set of pixel coordinates to output a high-precision set of extracted data points.
[0040] S4 includes: S401. Based on the mapping model, convert the pixel coordinates into physical values to generate an initial extraction dataset; The unified transformation function constructed in S202 is used to perform batch transformation on the set of pixel coordinates obtained in S304, and the corresponding coordinate axis parameters are selected according to the series correspondence with the coordinate axes determined in S3. If the coordinate axis mapping parameters have been corrected in S3, the corrected parameters are used for transformation, thereby mapping the pixel coordinates to real data values and forming a structured initial dataset.
[0041] S402, perform density control based on the preset maximum number of points threshold and minimum point distance threshold, and sparsify the dense point set that violates the maximum number of points threshold or minimum point distance threshold constraint; after clustering by x coordinate, take the median of y value so that each x coordinate corresponds to only a single y value; The constraints for sparsification are: ; This is the set of raw data points extracted from the chart. The subset of retained data points after density-controlled filtering satisfies all constraints; It is a subset relation; To preserve subsets Two different data points in the data; For point The Euclidean distance between them; This is the preset minimum point spacing threshold; To preserve subsets The cardinality; The preset maximum number of points threshold; The function relationship where each x-coordinate corresponds to a single y-value is: ; The processed output y-value. It is a median function; For the first data point in the original data set The y-coordinate values of each point. For the first data point in the original data set x-coordinates of each point; Let x be the x-coordinate of the target to be solved. The x-value is the preset clustering window radius; " is a condition separator, indicating that the condition is met. Take the median of the set of elements.
[0042] S403. Redundant points with a distance less than a threshold are identified through a duplicate point detection mechanism, and the redundant points are merged to eliminate noise. In duplicate point merging, redundant points with a detection distance less than a set pixel threshold (e.g., 3 pixels) can be merged using five merging strategies: average, median, centroid, and retaining the first / last point. For smooth curves, the average value is preferred; for noisy data, the median is preferred; for markers requiring precise location, the centroid is used; for the start and end points of time series data, the beginning and end points are retained respectively.
[0043] S404: All cleaning parameters and structured data are saved as JSON snapshots through State objects, supporting subsequent batch processing and configuration replay.
[0044] In a more specific implementation, S401 involves converting pixel coordinates into physical values based on the mapping model to generate an initial extraction dataset; this includes: S401-1, Coordinate Axis Parameter Preparation; Using the unified transformation function constructed in S202, a mathematical object containing the following parameters is created for each coordinate axis: Reference point: pixel coordinates With corresponding data values ; Linear axis transformation parameters: ; ; Series-axis binding relationship: The coordinate axes that each data series is bound to, such as the main X-axis, left Y-axis, or right Y-axis; S401-2. Based on the x-coordinate of each pixel determined in S3, use the corresponding X-axis parameter; for the y-coordinate, use the corresponding Y-axis parameter; call vectorization operation to complete the coordinate transformation of the entire series in one go; in multi-axis charts, the system automatically selects the corresponding transformation parameters according to the series-axis binding relationship to ensure that different series are mapped to the correct range; in, Under the linear axis, the coordinate transformation relationship is as follows: ; S401-3. The converted physical quantity values are automatically appended with the unit attribute stored in the corresponding coordinate axis object, generating a JSON structured data object in the example format.
[0045] Unit attributes are stored as strings in the coordinate axis object (such as "mm", "°C", "MPa"), and are appended as a separate field "unit" to each data point in the JSON output to ensure the complete semantic expression of the physical quantity value.
[0046] In summary, the chart data extraction method based on topological robustness calibration and multidimensional feature fusion in this embodiment improves the robustness of data extraction under complex topological conditions through an innovative hybrid calibration strategy of "user guidance + interactive constraints + quality assessment prompts." In the coordinate calibration stage, a multi-coordinate system mapping is established for the geometric relationships of the coordinate axes, and calibration quality assessments for verticality and consistency are provided. In the visual feature analysis stage, multidimensional features such as HSV adaptive clustering and skeletonization are combined to accurately distinguish similar data series. In the data extraction stage, through line-drawing region constraints, overlap / unclear detection, and strategic mask generation mechanisms, occlusion, breakage, or overlap charts that are difficult to extract stably in traditional methods can be effectively handled. This invention extends the applicable boundaries of chart extraction to complex coordinate scenarios commonly encountered in engineering practice and scientific research, forming a closed-loop robustness assurance system from calibration and verification to data extraction. It provides chart data extraction solutions for scientific literature data mining, technical archive digitization, and engineering data analysis, and has significant scientific research and industrial application value.
[0047] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for extracting chart data based on topological robustness calibration and multidimensional feature fusion, characterized in that, Includes the following steps: S1. Preprocess the chart image, the preprocessing including region labeling, the region labeling being used to divide the data region, legend region and interference region; S2. Pick calibration points in the visible area of the coordinate axes, establish the mapping relationship between pixel coordinates and data coordinates, construct a multi-coordinate system mapping model, and establish interpolation mapping for each coordinate axis; in multi-axis scenarios, maintain the calibration parameters of each axis and the relationship between axes through coordinate axis containers; S3. Perform background filtering on the preprocessed chart image to generate a binary mask, and combine the legend area to perform color clustering to determine the data series; In the series configuration, determine the coordinate axes used for each data series; Geometric relationship verification is performed on the coordinate axis mapping based on the calibration points. When the verification result does not meet the preset constraints, the mapping parameters are corrected. Within the data area, the mask is constrained and filtered for topological scenes with occlusion, breakage and overlap. The pixel coordinate set is extracted by fusing line center path, shape detection and connected component features. S4. Based on the mapping model, the set of pixel coordinates is converted into physical values, and after density control, noise removal, and duplicate point detection and merging, chart data is obtained.
2. The chart data extraction method based on topological robustness calibration and multidimensional feature fusion according to claim 1, characterized in that, S2 includes: S201. Pick two calibration points in the visible area of each axis in the chart and record the pixel and data coordinates; S202. Abstract the coordinate axes into mathematical objects containing types, reference points, and transformation functions, and manage the multi-axis system uniformly through coordinate axis containers; perform linear interpolation on linear axes, and perform log-domain linear interpolation followed by exponential transformation on logarithmic axes to construct a unified mapping model that supports nonlinear transformations.
3. The chart data extraction method based on topological robustness calibration and multidimensional feature fusion according to claim 2, characterized in that, S201 includes: Through step-by-step guided interaction, the user is prompted to pick at least two non-overlapping calibration points in the visible area of each coordinate axis in the preprocessed chart image, and the pixel coordinates and corresponding real data values are recorded simultaneously. Based on the calibration points, an interpolation mapping relationship between linear or logarithmic coordinate axes is established, and the calibration results are saved as a coordinate system object for subsequent data extraction and retrieval.
4. The chart data extraction method based on topological robustness calibration and multidimensional feature fusion according to claim 3, characterized in that, When the number of calibration points picked by the user exceeds two, the least squares fitting algorithm is used to optimize the parameters and minimize the sum of squared calibration errors in order to improve the accuracy of coordinate mapping within the observable area. The objective function of least squares estimation is: ; in, The parameters are the linear transformation parameters to be optimized. To determine the number of sampling points; For sampling point index, For the first The pixel spatial coordinates of each sampling point; For the first The corresponding real data space value of each sampling point.
5. The chart data extraction method based on topological robustness calibration and multidimensional feature fusion according to claim 2, characterized in that, In S202, unified multi-coordinate system modeling includes: S202-1. Abstract each coordinate axis into an independent mathematical object, including type attributes and pixel space reference points. Data space corresponding values The type attribute includes either a linear axis or a logarithmic axis. S202-2. Use coordinate axis containers to uniformly manage master-slave relationships and geometric relationships in single X-axis, dual Y-axis, dual X-axis, or multi-subgraph systems; S202-3. Establish linear axis transformation functions and logarithmic coordinate axis transformation functions to realize interpolation from pixel space to data space; The linear axis transformation function is: ; The logarithmic coordinate axis transformation function is: ; in, For the current pixel, These are the actual data values of two known calibration points on the coordinate axis. ; For the current pixel The linear interpolation result of the corresponding linear axis; For the current pixel The corresponding logarithmic interpolation results for the logarithmic coordinate axes.
6. The chart data extraction method based on topological robustness calibration and multidimensional feature fusion according to claim 1, characterized in that, The S3 includes: S301. Convert the chart image from RGB color space to HSV color space, and generate a foreground / target mask based on HSV threshold and joint region constraint to suppress background and interference areas. S302. Determine the target color by combining the auxiliary color sampling of the cropped area in the illustration; generate an HSV threshold and tolerance range for the target color, using the data area as the effective extraction range, suppress pixel extraction in the interference area and exclusion area, and generate a binary mask for single-series or multi-series extraction; including: S302-1. Based on the distinguished data series, establish the correspondence between each data series and the coordinate axis in the series configuration, including the horizontal and vertical axis identifiers used by each data series and the axis objects corresponding to the range. S302-2. Perform geometric relationship verification on coordinate axis mapping based on calibration points; when the verification result does not meet the preset constraints, correct the mapping parameters or output a recalibration prompt to the user so that subsequent pixel-to-data conversion adopts the updated mapping relationship. S302-3. Generate calibration reference information based on the calibration point and the current mapping parameters. The calibration reference information includes at least a precision prompt related to the range and the pixel spacing of the calibration point, which is used to help determine whether the calibration meets the extraction precision requirements. S303. For complex topological scenes with occlusion, breaks, and overlaps, robust constraint conditions are provided by interactive constraints and strategic processing: user-defined manually drawn regions are received to limit the effective extraction range; overlapping parts between multiple manually drawn regions are detected, and discrete pixels in the overlapping regions are connected and clustered based on distance thresholds; low-resolution parts in the manually drawn regions are detected based on Laplacian local sharpness, and enhancement mask or exclusion strategy parameters are generated for extraction accordingly. S304. For line-type data series, morphological skeletonization or column scanning is used to extract the center path. For discrete point-type data series, circular detection and contour approximation / centroid positioning are used to extract marker points. The center path and marker points are converted into a set of pixel coordinates, and a high-precision extracted data point set is output.
7. The chart data extraction method based on topological robustness calibration and multidimensional feature fusion according to claim 6, characterized in that, In S301, RGB format chart images are converted to HSV color space; By jointly removing white, black, and gray background areas based on brightness and saturation thresholds, a foreground pixel set is generated, achieving initial separation of the data series from the complex background; among which... Background mask ; The masks are white, black, and gray, respectively. " is the logical OR operator, representing the union operation between masks; Foreground Mask ;" " is the logical NOT operator; White mask ; black mask ; gray mask ; For pixel saturation, HSV color space components; For pixel brightness / luminance, HSV color space components; This is the minimum saturation threshold used to distinguish between color and gray. The maximum brightness threshold; The minimum brightness threshold; This is a conditional operator that returns 1 if the internal condition is met, and 0 otherwise. " is the logical AND operator.
8. The chart data extraction method based on topological robustness calibration and multidimensional feature fusion according to claim 6, characterized in that, In S303, data extraction and processing for complex topological regions includes: S303-1. For areas where data curves are occluded, extract constraints are executed within the user-specified line area, and a mask for extraction is generated in conjunction with a color filtering strategy, so that the target pixel set can still be stably obtained under occlusion conditions. S303-2. For regions with broken or discontinuous data curves, perform continuous sorting and path construction on mask pixels, and perform sampling and retention of continuous line points according to density pattern, so that an ordered sequence of curve pixels can still be obtained under broken conditions. S303-3. To address the aliasing issue caused by overlapping multiple manually drawn areas, the overlapping portions between each drawn area are detected, and discrete pixels within the overlapping areas are clustered based on a distance threshold. Simultaneously, low-resolution portions within the drawn areas are detected. Based on the distribution relationship between the overlapping portions and low-resolution portions, one of the following strategies is selected to generate an extraction mask: priority is given to extracting overlapping and low-resolution areas, only overlapping areas are extracted, only low-resolution areas are extracted, or problematic areas are excluded; this improves the reliability of data extraction in aliasing and low-resolution scenarios.
9. The chart data extraction method based on topological robustness calibration and multidimensional feature fusion according to any one of claims 6-8, characterized in that, S4 includes: S401. Based on the mapping model, convert the pixel coordinates into physical values to generate an initial extraction dataset; S402. Perform density control based on the preset maximum number of points threshold and minimum point distance threshold, and sparsify the dense point set that violates the maximum number of points threshold or minimum point distance threshold constraint; after clustering by x coordinate, take the median of y value so that each x coordinate corresponds to only a single y value. S403. Redundant points with a distance less than a threshold are identified through a duplicate point detection mechanism, and the redundant points are merged to eliminate noise. S404: All cleaning parameters and structured data are saved as JSON snapshots through State objects, supporting subsequent batch processing and configuration playback.
10. The chart data extraction method based on topological robustness calibration and multidimensional feature fusion according to claim 9, characterized in that, The constraints for sparsification are: ; This is the set of raw data points extracted from the chart. The subset of retained data points after density-controlled filtering satisfies all constraints; It is a subset relation; To preserve subsets Two different data points in the data; For point The Euclidean distance between them; This is the preset minimum point spacing threshold; To preserve subsets The cardinality; The preset maximum number of points threshold; The function relationship where each x-coordinate corresponds to a single y-value is: ; The processed output y value. It is a median function; For the first data point in the original data set The y-coordinate values of each point. For the first data point in the original data set x-coordinate values of each point; Let x be the x-coordinate of the target to be solved. The x-value is the preset clustering window radius; " is the condition separator.