A safety monitoring process line marking adaptive drawing method and system

By adaptively adjusting the position of the annotation box through image binarization processing and simulated annealing algorithm, the problem of low efficiency in marking process lines in safety monitoring was solved, and automated annotation was achieved, improving the timeliness and readability of monitoring data.

CN122115608APending Publication Date: 2026-05-29CHINA THREE GORGES PROJECTS DEV CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA THREE GORGES PROJECTS DEV CO LTD
Filing Date
2026-04-02
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing technologies, safety monitoring process line marking relies on manual operation, which is inefficient. Especially in emergency situations where a large number of monitoring points need to be marked, it seriously affects the timely output of monitoring data.

Method used

By employing image binarization processing and simulated annealing algorithm, monitoring data is automatically acquired, annotation points are located, and the position of annotation boxes is optimized. By establishing linear mapping relationship and overlap evaluation, the annotation boxes are adaptively adjusted.

Benefits of technology

It enables automated labeling of safety monitoring process lines, reduces manual intervention, improves the timeliness and visual readability of monitoring data, and is suitable for batch processing of multiple monitoring points.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122115608A_ABST
    Figure CN122115608A_ABST
Patent Text Reader

Abstract

The application is suitable for the technical field of safety monitoring, and provides a safety monitoring process line marking adaptive drawing method and system, including the following steps: obtaining historical monitoring data of a safety monitoring measuring point, drawing an original process line graph, performing image binarization processing thereon to generate an original binary graph; drawing a simplified line graph to generate a simplified line binary graph; obtaining the coordinates of the left and right endpoints of the process line in the simplified line binary graph; combining the endpoint, the time and measured value information of the marked point in the process line graph, and the coordinates of the endpoint in the simplified line binary graph to establish a linear mapping relationship from the simplified line graph to the original binary graph, and determine the initial center coordinates of the marking box; and iteratively optimizing the center coordinates of the marking box by using a simulated annealing algorithm. The application realizes full-process automation by automatically obtaining monitoring data, drawing a process line, positioning a marking point, and adaptively adjusting the position of a marking box by using an optimization algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of safety monitoring technology, specifically to an adaptive drawing method and system for safety monitoring process line annotation. Background Technology

[0002] Safety monitoring, acting as the "eyes and ears" of dam safety, comprehensively captures the performance of hydraulic structures through instruments, analyzes and evaluates their safety status and development trends, promptly detects anomalies, and takes corresponding measures to ensure the safe operation of the project. To this end, various types of monitoring sensors (such as crack gauges, piezometers, rebar gauges, and thermometers) are deployed in reservoirs and dams to continuously collect time-series data on displacement deformation, seepage pressure, stress, and strain. When analyzing monitoring data, a process line graph is typically created by connecting the monitoring data points on a time-numerical coordinate system, visually displaying the changing trends of the monitored physical quantities.

[0003] According to the specifications, when inflection points, abrupt changes, or other abnormal phenomena appear in the process line diagram, they must be annotated to explain the reasons for the abrupt changes in the measurement process. Currently, this mainly relies on manual annotation of each process line and manual adjustment of its position, which is inefficient. Especially when encountering sudden situations or changes in operating conditions, and when a large number of measurement points need to be annotated, the workload increases significantly, seriously affecting the timely output of monitoring data. Therefore, there is a need to provide an adaptive drawing method and system for safety monitoring process line annotation to solve the above problems. Summary of the Invention

[0004] In view of the shortcomings of the existing technology, the purpose of this invention is to provide an adaptive drawing method and system for safety monitoring process line annotation, so as to solve the problems existing in the above-mentioned background technology.

[0005] This invention is implemented as follows: an adaptive drawing method for line annotation in a safety monitoring process, the method comprising the following steps: Obtain historical monitoring data from safety monitoring points and draw the original process line graph including coordinate axes, legend, and title; The original process line graph is subjected to image binarization to generate an original binary image, wherein the obstacle pixels correspond to the process line, coordinate axis, legend and title in the original process line graph. Based on the historical monitoring data, a simplified line graph without coordinate axes, legends, and titles is drawn, and image binarization processing is performed to generate a simplified line binary graph. Scan the simplified line binary image to obtain the coordinates of the left and right endpoints of the process line in the simplified line binary image. and ; Obtain the time point t and monitoring result value v corresponding to the labeled information, and obtain the time corresponding to the two endpoints of the process line. , Compared with monitoring results value , ; Based on endpoint coordinates and A linear mapping relationship is established from the simplified line binary image to the original binary image, and the position of the annotation information is determined through the linear mapping relationship. Converted to coordinates in the original binary graph Use this as the initial center coordinate of the annotation box; Overlap is defined to evaluate the layout quality of bounding boxes. The overlap is equal to the ratio of the total number of obstacle pixels in the bounding box area to the total number of pixels in the bounding box area. Starting from the initial center coordinates, the center coordinates of the annotation box are iteratively optimized using the simulated annealing algorithm. The optimization objective of the simulated annealing algorithm is to make the overlap less than or equal to a preset overlap threshold and output the optimal center coordinates of the annotation box.

[0006] As a further aspect of the present invention, the image binarization process includes: converting the image into a grayscale image; setting a grayscale threshold, classifying pixels with grayscale values ​​higher than the threshold as idle pixels, and classifying pixels with grayscale values ​​lower than or equal to the threshold as obstacle pixels.

[0007] As a further aspect of the present invention, the step of obtaining the coordinates of the left and right endpoints of the process line in the simplified binary line graph specifically includes: Scan each column of pixels in the simplified line binary image from left to right along the horizontal direction, and mark the column coordinates of the first detected obstacle pixel as the x-coordinate of the left endpoint. ; Scan each column of pixels in the simplified line binary image from right to left along the horizontal direction, and mark the column coordinate of the first detected obstacle pixel as the x-coordinate of the right endpoint. ; On the horizontal axis and In the column of pixels, the ordinate of the first obstacle pixel found from bottom to top is recorded as the ordinate of the left endpoint. and the y-coordinate of the right endpoint .

[0008] As a further aspect of the present invention, the abscissa of the initial center coordinates y-axis .

[0009] As a further aspect of the present invention, the overlap... The calculation formula is: ,in, This represents the total number of obstacle pixels within the bounding box area. This represents the total number of pixels within the labeled area.

[0010] As a further aspect of the present invention, the initial temperature of the simulated annealing algorithm... Determined through the following steps: Multiple candidate center coordinates are randomly generated near the initial center coordinates, and their corresponding overlap is calculated; Calculate the difference between the overlap of each candidate center coordinate and the overlap of the initial center coordinate. Statistics of all The difference is calculated and its average value is used to obtain the average degree of deterioration. ; Based on the preset initial acceptance probability and the average degree of deterioration Through formula Calculate the initial temperature .

[0011] As a further aspect of the present invention, the iterative process of the simulated annealing algorithm includes: According to the formula Calculate the search step size within the current iteration period, where The initial step size is T, and the current temperature is T. Based on the current center coordinates of the annotation box, the search step size is expanded in the four directions of up, down, left, and right to generate a set of candidate center coordinates; Calculate the overlap degree corresponding to each candidate center coordinate. If there is a candidate center coordinate with an overlap degree less than or equal to the overlap degree threshold, output it as the optimal solution and end the iteration. If the termination condition is not met, check if the overlap difference is less than zero. If it is less than zero, accept the new solution; if it is greater than zero, accept or reject the new solution based on the Metropolis criterion, update the historical best solution and the best center coordinates, and reduce the temperature according to the cooling coefficient α to enter the next iteration.

[0012] Another object of the present invention is to provide an adaptive drawing system for safety monitoring process line annotation, the system comprising: The original process line graph module is used to acquire historical monitoring data of safety monitoring points and draw original process line graphs including coordinate axes, legends, and titles; The original binary image module is used to perform image binarization processing on the original process line graph to generate an original binary image, wherein the obstacle pixels correspond to the process line, coordinate axis, legend and title in the original process line graph; The simplified line binary graph module is used to draw a simplified line graph without coordinate axes, legends and titles based on the historical monitoring data, and to perform image binarization processing to generate a simplified line binary graph. The process line endpoint coordinate module is used to scan the simplified line binary image and obtain the coordinates of the left and right endpoints of the process line in the simplified line binary image. and ; The annotation-related information module is used to obtain the time point t and monitoring result value v corresponding to the annotation information, and to obtain the time corresponding to the two endpoints of the process line. , Compared with monitoring results value , ; The initial center coordinate module is used to determine the coordinates based on the endpoints. and A linear mapping relationship is established from the process line diagram to the original binary diagram, and the position of the annotation information is determined through the linear mapping relationship. Converted to coordinates in the original binary graph Use this as the initial center coordinate of the annotation box; The overlap calculation module is used to define the overlap and evaluate the layout quality of the annotation box. The overlap is equal to the ratio of the total number of obstacle pixels in the annotation box area to the total number of pixels in the annotation box area. The iterative optimization module is used to iteratively optimize the center coordinates of the annotation box using the simulated annealing algorithm, starting from the initial center coordinates. The optimization objective of the simulated annealing algorithm is to make the overlap less than or equal to a preset overlap threshold and output the optimal center coordinates of the annotation box.

[0013] Compared with the prior art, the beneficial effects of the present invention are: By automatically acquiring monitoring data, drawing process lines, locating annotation points, and adaptively adjusting the annotation box positions using optimization algorithms, the entire process is automated, significantly reducing manual intervention. This is particularly suitable for batch processing of multiple measurement points, greatly improving the timeliness of safety monitoring data compilation. Image binarization is used to abstract the graphic elements (process lines, coordinate axes, etc.) in the process line diagram into obstacle pixels, and a linear mapping relationship from data coordinates to image coordinates is established. This ensures that the annotation boxes accurately correspond to the actual monitoring data points, guaranteeing semantic and visual consistency and accuracy. Overlap is defined as a quantitative indicator of layout quality, and simulated annealing algorithm is used to iteratively optimize the annotation box positions until the overlap is below a set threshold. This automatically avoids overlap with graphic elements such as process lines and coordinate axes, resulting in a clear and reasonable annotation box layout, greatly enhancing the visual readability and information delivery effect of the process line diagram. Attached Figure Description

[0014] Figure 1 This is a flowchart of an adaptive drawing method for line annotation in a safety monitoring process.

[0015] Figure 2 This is a schematic diagram illustrating the binarized graphic elements in an adaptive drawing method for line annotation in a safety monitoring process.

[0016] Figure 3 This is the original process line diagram for an adaptive drawing method of process line annotation in safety monitoring.

[0017] Figure 4 This is the original binary image for an adaptive drawing method of line annotation in a safety monitoring process.

[0018] Figure 5 This is a simplified line drawing for an adaptive drawing method of line annotation in a safety monitoring process.

[0019] Figure 6 This is a process line diagram with the annotation box in its initial position in an adaptive drawing method for process line annotation in safety monitoring.

[0020] Figure 7 This is a process line diagram with the annotation box adjusted to an appropriate position in an adaptive drawing method for process line annotation in safety monitoring.

[0021] Figure 8 This is a schematic diagram of a safety monitoring process line annotation adaptive drawing system. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0023] The specific implementation of the present invention will be described in detail below with reference to specific embodiments.

[0024] like Figures 1 to 7 As shown in the figure, this embodiment of the invention provides an adaptive drawing method for safety monitoring process line annotation, the method comprising the following steps: Step 1: Obtain historical monitoring data from safety monitoring points and draw the original process line graph including coordinate axes, legend, and title; Step 2: Perform image binarization on the original process line graph to generate an original binary graph, wherein the obstacle pixels correspond to the process lines, coordinate axes, legend and title in the original process line graph. Step 3: Based on the historical monitoring data, draw a simplified line graph without coordinate axes, legends, and titles, and perform image binarization to generate a simplified line binary graph; Step 4: Scan the simplified line binary image to obtain the coordinates of the left and right endpoints of the process line in the simplified line binary image. and ; Step 5: Obtain the time point t and monitoring result value v corresponding to the labeled information, and obtain the time corresponding to the two endpoints of the process line. , Compared with monitoring results value , ; Step 6: Based on endpoint coordinates and A linear mapping relationship is established from the simplified line drawing to the original binary image, and the position of the annotation information is determined through the linear mapping relationship. Converted to coordinates in the original binary graph Use this as the initial center coordinate of the annotation box; Step 7: Define the overlap to evaluate the layout quality of the bounding box. The overlap is equal to the ratio of the total number of obstacle pixels in the bounding box area to the total number of pixels in the bounding box area. Step 8: Starting from the initial center coordinates, use the simulated annealing algorithm to iteratively optimize the center coordinates of the annotation box. The optimization goal of the simulated annealing algorithm is to make the overlap less than or equal to a preset overlap threshold and output the optimal center coordinates of the annotation box.

[0025] In this embodiment of the invention, firstly, an image binarization method is defined, which includes the following two steps: First, grayscale processing: the original image is read by calling an image processing library such as OpenCV and directly converted into a grayscale image. Second, threshold segmentation: a grayscale threshold is set (the grayscale value ranges from 0 to 255, with a default grayscale threshold of 128), and each pixel is divided accordingly: if its grayscale value is higher than the threshold, it is classified as a free pixel (assigned a value of 0), corresponding to an unoccupied blank area; otherwise, it is classified as an obstacle pixel (assigned a value of 1), corresponding to all existing elements except for blank areas.

[0026] In this embodiment of the invention, historical monitoring data of safety monitoring points are obtained from a database. By calling drawing components such as ECharts and Highcharts, the time-series monitoring data is plotted as a process line graph. The annotation information is also read from the database, including the annotation time point t and the annotation content. The monitoring result value v is obtained based on the time point.

[0027] In this embodiment of the invention, the step of obtaining the coordinates of the left and right endpoints of the process line in the simplified line binary image specifically includes: scanning each column of pixels in the simplified line binary image from left to right along the horizontal direction, and marking the column coordinates of the first detected obstacle pixel as the horizontal coordinate of the left endpoint. Scan each column of pixels in the simplified line binary image from right to left along the horizontal direction, and mark the column coordinates of the first detected obstacle pixel as the x-coordinate of the right endpoint. ; on the x-axis is and In the column of pixels, the ordinate of the first obstacle pixel found from bottom to top is recorded as the ordinate of the left endpoint. and the y-coordinate of the right endpoint Therefore, the coordinates of the left and right endpoints of the process line in the simplified binary graph of the line are obtained. , .

[0028] In this embodiment of the invention, the position of the annotation information on the process line is determined through a linear mapping relationship. Converted to coordinates in the original binary graph. This coordinate is used as the initial center coordinate of the annotation box, that is, the initial position of the annotation box. The x-coordinate of the initial center coordinate is... y-axis .

[0029] In this embodiment of the invention, by overlap The overall evaluation of the layout quality of the annotation information on the process line is as follows: the smaller the value, the less overlap between the annotation box and the original process line diagram, indicating a better layout. Furthermore, a method for calculating the overlap is defined: the annotation box is binarized to obtain a binary image of the annotation box, and then overlapped with the original binary image. The overlap... The calculation formula is: ,in, This represents the total number of obstacle pixels within the bounding box area. This represents the total number of pixels within the labeled area.

[0030] In this embodiment of the invention, the coordinates of the center of the annotation box are adaptively adjusted using a simulated annealing algorithm. The steps are as follows: First, set the allowed overlap threshold between the process line graph and the annotation box. The overlap threshold sets a clear optimization objective for the simulated annealing algorithm. When the overlap of a candidate label coordinate is found to be less than or equal to a certain value during the iteration process, the threshold is set. When the threshold is reached, the algorithm can immediately determine that the labeled coordinates have reached an acceptable standard and terminate the search early. This threshold-based early termination mechanism can effectively avoid unnecessary computational overhead.

[0031] Furthermore, at the center coordinates of the initial annotation box mentioned above Random sampling was performed nearby to determine the initial temperature for the simulated annealing algorithm. The steps include: (1) Calculation of average deterioration: Multiple candidate annotation box center coordinates are randomly generated within a set radius near the initial annotation box center coordinates, and the overlap degree corresponding to the center coordinates of each candidate annotation box is calculated. For each candidate annotation box center coordinate, the difference between its overlap degree and the overlap degree of the initial annotation box center coordinates is calculated. The aforementioned The degree of deterioration is defined, i.e. This indicates that the layout quality has deteriorated compared to the initial coordinates of the candidate annotation box center. The larger the value, the more severe the degradation. Statistics on all... The extent of deterioration was assessed, and its average value was calculated, denoted as the average degree of deterioration. .

[0032] (2) Inferring the initial temperature based on the Metropolis criterion: The Metropolis criterion is a key rule in simulated annealing algorithms used to accept deteriorated solutions with a certain probability, thereby escaping local optima. The probability of accepting a deteriorated solution... From the formula Calculation, where This is the current temperature for the algorithm.

[0033] To ensure the algorithm has strong global exploration capabilities in the initial stage, a relatively high initial acceptance probability is set. (For example =0.8). The average degree of deterioration. and preset Substituting the Metropolis criterion formula, the initial temperature can be calculated by reverse calculation. The calculation formula is: .

[0034] Set in this way This ensures that when the algorithm encounters a solution with an average degree of deterioration in the initial stage, it can achieve exactly [the desired result]. It has a high probability of accepting it, thus enabling effective exploration in the solution space.

[0035] Furthermore, set the cooling coefficient. (Value is 0~1). Set the initial step size. The step size represents the movement distance in each search. Its initial value is usually set to a certain proportion of the width of the problem search space, such as 10 pixels.

[0036] Further, the simulated annealing algorithm iterative process begins.

[0037] First, based on the current step size (Initially) ) and algorithm temperature state (Initially) ), through formula Calculate the search step size within the current iteration period. This step size is related to the temperature. Positive correlation ensures that the algorithm can explore a wide range of areas during high-temperature phases and perform local fine-tuning during low-temperature phases.

[0038] Furthermore, using the aforementioned step size, a multi-directional candidate search space is constructed: based on the current coordinates of the bounding box, the step size is extended in four directions (up, down, left, and right) to generate a set of candidate bounding box center coordinates for bounding box search.

[0039] Furthermore, for the center coordinates of each candidate bounding box, the overlap is calculated using the aforementioned overlap calculation method. If the calculation result is less than or equal to the overlap threshold... Then directly output the current solution and the center coordinates of the current annotation box, and exit the iteration.

[0040] Furthermore, the overlap at the current coordinates of the annotation box center is compared with the overlap at the old coordinates to obtain the difference. If the difference Then accept the new solution; otherwise, base the solution on the current temperature. Calculate the current acceptance probability P, and choose to retain or reject the new solution.

[0041] Furthermore, the coordinates of the historical best solution and the center of the best bounding box are updated, and the temperature after iteration is calculated according to the predetermined cooling coefficient α. This completes one iteration.

[0042] Furthermore, determine the temperature after iteration. If the condition of "greater than the minimum temperature and solution not converged" is not met, output the historical best solution and the center coordinates of the best bounding box, and stop iterating; otherwise, continue iterating.

[0043] Furthermore, after the above iterative process is completed, the optimal center coordinates of the annotation box, which is the final position of the annotation box, are saved to the database. At the same time, manual intervention and adjustment are also supported, and the final center coordinates of the annotation box can also be saved to the database.

[0044] In this embodiment of the invention, safety monitoring points are selected, a time range is set, historical data is retrieved from the database, and a process line is drawn. Simultaneously, the style corresponding to the process line can be loaded, and information such as the coordinate axes and legends of the process line can be added. It also supports loading annotation information and positions for drawing annotation boxes. Manual adjustment of the annotation box positions is supported. The annotation time, annotation information, and position coordinates of the annotation boxes are recorded. The position information of the annotation boxes can be obtained using the aforementioned adaptive drawing method. Furthermore, the annotation information can be associated with multiple safety monitoring points. Multiple safety monitoring points can be selected to generate process lines in batches, and the process line diagrams can be exported to a safety monitoring data analysis report, improving data analysis efficiency. The overlap threshold, acceptance probability, search step size, and cooling coefficient can be set. This part mainly serves as the default parameters for the process line standard adaptive adjustment algorithm and can be adjusted as needed. Thus, this embodiment of the invention supports automatic drawing and adaptive position adjustment of process line annotations, reducing the workload of manual adjustment; at the same time, it supports batch association of annotation information with safety monitoring measurement points, thereby realizing batch drawing of annotation boxes in process lines of multiple measurement points, and supports exporting to safety monitoring data analysis reports, which greatly improves the efficiency of data compilation.

[0045] like Figure 8 As shown, this embodiment of the invention also provides an adaptive drawing system for safety monitoring process line annotation, the system comprising: The original process line graph module 100 is used to acquire historical monitoring data of safety monitoring points and draw an original process line graph including coordinate axes, legends and titles; The original binary image module 200 is used to perform image binarization processing on the original process line graph to generate an original binary image, wherein the obstacle pixels correspond to the process lines, coordinate axes, legends and titles in the original process line graph. The simplified line binary graph module 300 is used to draw a simplified line graph without coordinate axes, legends and titles based on the historical monitoring data, and to perform image binarization processing to generate a simplified line binary graph. The process line endpoint coordinate module 400 is used to scan the simplified line binary image and obtain the coordinates of the left and right endpoints of the process line in the simplified line binary image. and ; The annotation-related information module 500 is used to obtain the time points corresponding to the annotation information. And monitor the result value v, and obtain the time corresponding to the two endpoints of the process line. , Compared with monitoring results value , ; Initial center coordinate module 600, used for endpoint coordinates and A linear mapping relationship is established from the simplified line drawing to the original binary image, and the position of the annotation information is determined through the linear mapping relationship. Converted to coordinates in the original binary graph Use this as the initial center coordinate of the annotation box; The overlap calculation module 700 is used to define the overlap degree to evaluate the layout quality of the annotation box. The overlap degree is equal to the ratio of the total number of obstacle pixels in the annotation box area to the total number of pixels in the annotation box area. The iterative optimization module 800 is used to iteratively optimize the center coordinates of the annotation box using the simulated annealing algorithm, starting from the initial center coordinates. The optimization objective of the simulated annealing algorithm is to make the overlap less than or equal to a preset overlap threshold and output the optimal center coordinates of the annotation box.

[0046] In this embodiment of the invention, the process line endpoint coordinate module 400 includes: The left endpoint x-coordinate unit is used to scan each column of pixels in the simplified line binary image from left to right along the horizontal direction, and the column coordinate of the first detected obstacle pixel is marked as the x-coordinate of the left endpoint. ; The right endpoint x-coordinate unit is used to scan each column of pixels in the simplified line binary image from right to left along the horizontal direction, and the column coordinate of the first detected obstacle pixel is marked as the x-coordinate of the right endpoint. ; The vertical coordinate determination unit is used to determine the horizontal coordinate. and In the column of pixels, the ordinate of the first obstacle pixel found from bottom to top is recorded as the ordinate of the left endpoint. and the y-coordinate of the right endpoint .

[0047] In this embodiment of the invention, the iterative optimization module 800 includes: Candidate center coordinate units are used to randomly generate multiple candidate center coordinates near the initial center coordinates and calculate their corresponding overlap. The average degradation unit is used to calculate the difference between the overlap of each candidate center coordinate and the overlap of the initial center coordinate. Statistics of all The difference is calculated and its average value is used to obtain the average degree of deterioration. .

[0048] The initial temperature determination unit is used to determine the initial acceptance probability based on a preset initial acceptance probability. and the average degree of deterioration Through formula Calculate the initial temperature .

[0049] The above description only details the preferred embodiments of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

[0050] It should be understood that although the steps in the flowcharts of the various embodiments of the present invention are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the various embodiments may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.

[0051] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0052] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the disclosure in the specification and embodiments. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

Claims

1. An adaptive drawing method for line annotation in a safety monitoring process, characterized in that, The method includes the following steps: Obtain historical monitoring data from safety monitoring points and draw the original process line graph including coordinate axes, legend, and title; The original process line graph is subjected to image binarization to generate an original binary image, wherein the obstacle pixels correspond to the process line, coordinate axis, legend and title in the original process line graph. Based on the historical monitoring data, a simplified line graph without coordinate axes, legends, and titles is drawn, and image binarization processing is performed to generate a simplified line binary graph. Scan the simplified line binary image to obtain the coordinates of the left and right endpoints of the process line in the simplified line binary image. and ; Obtain the time point t and monitoring result value v corresponding to the labeled information, and obtain the time corresponding to the two endpoints of the process line. , Compared with monitoring results value , ; Based on endpoint coordinates and A linear mapping relationship is established from the simplified line drawing to the original binary image, and the position of the annotation information is determined through the linear mapping relationship. Converted to coordinates in the original binary graph Use this as the initial center coordinate of the annotation box; Overlap is defined to evaluate the layout quality of bounding boxes. The overlap is equal to the ratio of the total number of obstacle pixels in the bounding box area to the total number of pixels in the bounding box area. Starting from the initial center coordinates, the center coordinates of the annotation box are iteratively optimized using the simulated annealing algorithm. The optimization objective of the simulated annealing algorithm is to make the overlap less than or equal to a preset overlap threshold and output the optimal center coordinates of the annotation box.

2. The adaptive drawing method for safety monitoring process line annotation according to claim 1, characterized in that, The image binarization process includes: converting the image into a grayscale image; setting a grayscale threshold, classifying pixels with grayscale values ​​higher than the threshold as idle pixels, and classifying pixels with grayscale values ​​lower than or equal to the threshold as obstacle pixels.

3. The adaptive drawing method for safety monitoring process line annotation according to claim 1, characterized in that, The step of obtaining the coordinates of the left and right endpoints of the process line in the simplified binary line graph specifically includes: Scan each column of pixels in the simplified line binary image from left to right along the horizontal direction, and mark the column coordinates of the first detected obstacle pixel as the x-coordinate of the left endpoint. ; Scan each column of pixels in the simplified line binary image from right to left along the horizontal direction, and mark the column coordinate of the first detected obstacle pixel as the x-coordinate of the right endpoint. ; On the horizontal axis and In the column of pixels, the ordinate of the first obstacle pixel found from bottom to top is recorded as the ordinate of the left endpoint. and the y-coordinate of the right endpoint .

4. The adaptive drawing method for safety monitoring process line annotation according to claim 1, characterized in that, The x-coordinate of the initial center coordinates y-axis .

5. The adaptive drawing method for safety monitoring process line annotation according to claim 1, characterized in that, The formula for calculating the overlap is: ,in, This represents the total number of obstacle pixels within the bounding box area. This represents the total number of pixels within the labeled area.

6. The adaptive drawing method for safety monitoring process line annotation according to claim 1, characterized in that, The initial temperature of the simulated annealing algorithm Determined through the following steps: Multiple candidate center coordinates are randomly generated within a radius set near the initial center coordinates, and their corresponding overlap is calculated; Calculate the difference between the overlap of each candidate center coordinate and the overlap of the initial center coordinate. Statistics of all The difference is calculated and its average value is used to obtain the average degree of deterioration. ; Based on the preset initial acceptance probability and the average degree of deterioration Through formula Calculate the initial temperature .

7. The adaptive drawing method for safety monitoring process line annotation according to claim 6, characterized in that, The iterative process of the simulated annealing algorithm includes: According to the formula Calculate the search step size within the current iteration period, where The initial step size is T, and the current temperature is T. Based on the current center coordinates of the annotation box, the search step size is expanded in the four directions of up, down, left, and right to generate a set of candidate center coordinates; Calculate the overlap degree corresponding to each candidate center coordinate. If there is a candidate center coordinate with an overlap degree less than or equal to the overlap degree threshold, output it as the optimal solution and end the iteration. If the termination condition is not met, check if the overlap difference is less than zero. If it is less than zero, accept the new solution; if it is greater than zero, accept or reject the new solution based on the Metropolis criterion. Finally, update the historical best solution and the best center coordinates, and reduce the temperature according to the cooling coefficient α to enter the next iteration.

8. An adaptive drawing system for line annotation in a safety monitoring process, characterized in that, The system includes: The original process line graph module is used to acquire historical monitoring data of safety monitoring points and draw original process line graphs including coordinate axes, legends, and titles; The original binary image module is used to perform image binarization processing on the original process line graph to generate an original binary image, wherein the obstacle pixels correspond to the process line, coordinate axis, legend and title in the original process line graph; The simplified line binary graph module is used to draw a simplified line graph without coordinate axes, legends and titles based on the historical monitoring data, and to perform image binarization processing to generate a simplified line binary graph. The process line endpoint coordinate module is used to scan the simplified line binary image and obtain the coordinates of the left and right endpoints of the process line in the simplified line binary image. and ; The annotation-related information module is used to obtain the time point t and monitoring result value v corresponding to the annotation information, and to obtain the process. , Compared with monitoring results value , ; The initial center coordinate module is used to determine the coordinates based on the endpoints. and A linear mapping relationship is established from the simplified line drawing to the original binary image, and the position of the annotation information is determined through the linear mapping relationship. Converted to coordinates in the original binary graph Use this as the initial center coordinate of the annotation box; The overlap calculation module is used to define the overlap degree to evaluate the layout quality of the annotation box. The overlap degree is equal to the ratio of the total number of obstacle pixels in the annotation box area to the total number of pixels in the annotation box area. The iterative optimization module is used to iteratively optimize the center coordinates of the annotation box using the simulated annealing algorithm, starting from the initial center coordinates. The optimization objective of the simulated annealing algorithm is to make the overlap less than or equal to a preset overlap threshold and output the optimal center coordinates of the annotation box.

9. The adaptive drawing system for safety monitoring process line annotation according to claim 8, characterized in that, The process line endpoint coordinate module includes: The left endpoint x-coordinate detection unit is used to scan each column of pixels in the simplified line binary image from left to right along the horizontal direction, and to mark the column coordinate of the first detected obstacle pixel as the x-coordinate of the left endpoint. ; The right endpoint x-coordinate detection unit is used to scan each column of pixels in the simplified line binary image from right to left along the horizontal direction, and marks the column coordinate of the first detected obstacle pixel as the x-coordinate of the right endpoint. ; The vertical coordinate detection unit is used to detect the horizontal coordinate as... and In the column of pixels, the ordinate of the first obstacle pixel found from bottom to top is recorded as the ordinate of the left endpoint. and the y-coordinate of the right endpoint .

10. The adaptive drawing system for safety monitoring process line annotation according to claim 8, characterized in that, The iterative optimization module includes: Candidate center coordinate units are used to randomly generate multiple candidate center coordinates near the initial center coordinates and calculate their corresponding overlap. The average degradation unit is used to calculate the difference between the overlap of each candidate center coordinate and the overlap of the initial center coordinate. Statistics of all The difference is calculated and its average value is used to obtain the average degree of deterioration. ; The initial temperature determination unit is used to determine the initial acceptance probability based on a preset initial acceptance probability. and the average degree of deterioration Through formula Calculate the initial temperature .