A monitoring and early warning method and system for a factory gate

CN122799362APending Publication Date: 2026-09-22NO 63921 UNIT OF PLA +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610994093.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-06
Publication Date
2026-09-22

AI Technical Summary

Technical Problem

(1)定位精度有限,无法提供实时位置反馈

Benefits of technology

(1)本发明通过灰度转换、高斯滤波和索贝尔算子处理,有效提取了图像的梯度信息,为后续的边缘检测提供了可靠的基础。相比现有技术中依赖单一限位开关的方案,本发明采用计算机视觉技术对厂房大门的实时转动图像进行处理,能够获取大门在开启或关闭过程中的连续位置信息,实现了对大门实时开启角度的精确监测,显著提高了定位精度;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122799362A_ABST
    Figure CN122799362A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of factory gate monitoring, in particular to a monitoring and early warning method for factory gate, which effectively extracts gradient information of real-time rotating image through gray scale conversion, Gaussian filtering and Sobel operator processing, providing a reliable basis for subsequent edge detection, and then applying non-maximum suppression to further refine edge features, reduce noise interference and improve the accuracy of edge detection; at the same time, edge features are divided into three types and processed respectively, which not only eliminates unimportant details, but also retains key features, making the final edge information clearer and more continuous. Combined with straight line detection and screening processing of factory gate edge information, it can accurately identify the straight line related to the factory gate, so as to accurately determine the opening angle of the gate, and based on the opening angle of the gate and the preset opening angle threshold, it can timely and accurately discover and respond to abnormal situations, effectively ensuring the safe operation of the factory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of factory gate monitoring technology, specifically a monitoring and early warning method and system for factory gates. Background Technology

[0002] As an important entrance and exit device for large buildings such as industrial plants and warehouses, the stability and security of tall factory gates are of great significance to ensuring production safety and personnel safety. Therefore, ensuring the positioning accuracy and control stability of factory gates is of paramount importance.

[0003] Currently, the closest existing technical solution to the present invention typically relies on a single sensor (such as a limit switch) for position detection and early warning of factory gates. Limit switches use mechanical contact to sense whether the gate has reached a preset limit position and transmit a switching signal to the control system to achieve a simple limit function.

[0004] However, existing monitoring and early warning methods suffer from the problem of failing to provide timely and accurate monitoring and early warnings, seriously affecting production safety. The specific drawbacks and reasons are as follows: (1) The positioning accuracy is limited and cannot provide real-time position feedback. The reason is that the limit switch can only provide a switch quantity (on / off) signal to indicate whether the door has reached a specific position. It cannot obtain continuous position information of the door during the opening or closing process, which makes it impossible for the control system to accurately monitor the real-time opening angle and operating status of the door.

[0005] (2) Poor environmental adaptability, easily affected by interference leading to misjudgment or failure. The reason is that the internal environment of tall factory buildings is usually more complex, with problems such as insufficient light, dust, and large temperature changes. These environmental factors will seriously affect the performance and stability of a single physical sensor, leading to sensor signal distortion or system control failure.

[0006] (3) Fault warnings are not timely and the system reliability is poor. The reason is that the control system of a single sensor lacks redundancy design. When the sensor itself malfunctions or false alarms occur due to environmental interference, the system often cannot identify and issue warnings in time, which can easily lead to the gate going out of control or being damaged, or even causing safety accidents.

[0007] (4) Lack of intelligent management functions, resulting in limited flexibility and scalability. The reason is that traditional control systems can only perform simple logical judgments and lack the ability to deeply analyze and integrate real-time acquired data. They cannot adaptively adjust and optimize according to actual conditions, making it difficult to meet the needs of modern factories for intelligent and visual monitoring and management. Summary of the Invention

[0008] The purpose of this invention is to provide a monitoring and early warning method for factory gates to solve the problems mentioned in the background art.

[0009] To achieve the above objectives, the first aspect of the present invention provides the following technical solution: A monitoring and early warning method for factory gates includes the following steps: Step S1: Obtain a real-time rotating image of the factory gate, and extract the gradient information of the real-time rotating image through grayscale conversion, Gaussian filtering and Sobel operator processing. Step S2: Apply nonmaximum suppression to refine edge features; Step S3: Obtain the edge information of the factory gate; Step S4: Perform line detection processing on the real-time rotating image to obtain line detection results, and filter the line detection results based on the edge information of the factory gate to obtain the target line detection results; Step S5: Determine the opening angle information of the factory gate based on the target line detection results, and visualize the opening angle information and / or the target line detection results. Step S6: In response to the factory gate opening angle information reaching the preset opening angle threshold, control the factory gate to be stationary and issue an early warning for the factory gate opening angle information.

[0010] Preferably, step S1 specifically includes: Step S101: Obtain a real-time rotating image of the factory gate; Step S102: Perform grayscale conversion processing on the real-time rotating image to obtain a grayscale image; Step S103: Perform Gaussian filtering on the grayscale image to obtain a smoothed grayscale image; Step S104: The smoothed grayscale image is processed using the Sobel operator to determine the gradient information of each pixel position in the smoothed grayscale image, wherein the gradient information includes gradient value and gradient direction. Step S105: Based on the gradient information of each pixel position in the smoothed grayscale image, determine the gradient value of the center pixel position corresponding to the gradient direction in the smoothed grayscale image.

[0011] Preferably, step S2 specifically includes: Step 201: Compare the gradient value of each pixel position corresponding to the gradient direction with the gradient value of the center pixel position corresponding to the gradient direction to obtain the comparison result. Step 202: Based on the comparison results, select the gradient values ​​of the first target pixel position that are less than or equal to the gradient value of the center pixel position from the gradient values ​​of each pixel position, and retain the gradient values ​​of the first target pixel position. Step 203: Based on the comparison results, select the gradient values ​​of the second target pixel positions that are greater than the gradient value of the center pixel position from the gradient values ​​of each pixel position, set the gradient value of the second target pixel position to zero, and combine the first target pixel position that retains the gradient value and the second target pixel position that has been set to zero to obtain the image after non-maximum suppression.

[0012] Preferably, step S3 specifically includes: Step 301: The pixel positions in the image after non-maximum suppression where the gradient value is less than a preset first threshold are taken as first type edges; Step 302: The pixel positions in the image after non-maximum suppression where the gradient value is greater than or equal to a preset first threshold and less than or equal to a preset second threshold are designated as second-type edges. Step 303: The pixel positions in the image after non-maximum suppression where the gradient value is greater than a preset second threshold are taken as third-type edges; Step 304: Remove the first type of edge and connect the second type of edge and the third type of edge to obtain the edge information of the factory gate.

[0013] Preferably, step S4 specifically includes: Step S401: Determine the image space where the real-time rotating image is located, and map the real-time rotating image in the image space to the parameter space; Step S402: Calculate the cumulative value of edge points passing through preset positions in the real-time rotating image in the parameter space; Step S403: Combine the edge points whose cumulative value is greater than the preset cumulative value threshold as the line detection result; Step S404: Determine the line detection results that do not match the edge information of the factory gate in the line detection results; Step S405: Remove the line detection results that do not match the edge information of the factory gate from the line detection results to obtain the target line detection results. The target line detection results include the first target line and the second target line.

[0014] Preferably, the step S5 of determining the opening angle information of the factory gate based on the target straight line detection result of the factory gate specifically includes: Step S501: Determine the first slope value corresponding to the first target line, and determine the second slope value corresponding to the second target line; Step S502: Based on the first slope value and the second slope value, perform tangent value calculation to obtain the tangent value; Step S503: Perform arctangent processing on the tangent value to obtain the opening angle information of the factory gate.

[0015] Preferably, the step S5 of determining the opening angle information of the factory gate based on the target straight line detection result of the factory gate specifically includes: Step S501: Obtain the first encoding information corresponding to the first target line and the second encoding information corresponding to the second target line; Step S502: Search for the first rotation angle information corresponding to the first encoding information from the preset rotation angle database, and search for the second rotation angle information corresponding to the second encoding information from the preset rotation angle database, wherein the rotation angle database includes multiple rotation angle information corresponding to different encoding information; Step S503: The opening angle information of the factory gate is obtained by subtracting the first rotation angle information and the second rotation angle.

[0016] A second aspect of the present invention provides a monitoring and early warning system for factory gates, used to implement the monitoring and early warning method for factory gates as described above, comprising: The gradient information acquisition unit includes: The acquisition module is configured to acquire real-time rotating images of the factory gate; The grayscale conversion module is configured to perform grayscale conversion processing on the real-time rotating image to obtain a grayscale image; The smoothing module is configured to perform Gaussian filtering on the grayscale image to obtain a smoothed grayscale image. The gradient information determination module is configured to process the smoothed grayscale image using the Sobel operator to determine the gradient information of each pixel position in the smoothed grayscale image, wherein the gradient information includes gradient value and gradient direction. The gradient value determination module is configured to determine the gradient value of the center pixel position corresponding to the gradient direction in the smoothed grayscale image based on the gradient information of each pixel position in the smoothed grayscale image. Non-maximum suppression unit, including: The comparison module is configured to compare the gradient value of each pixel position corresponding to the gradient direction with the gradient value of the center pixel position corresponding to the gradient direction to obtain a comparison result. The retention module is configured to, based on the comparison result, filter the gradient values ​​of a first target pixel position that are less than or equal to the gradient value of the center pixel position from the gradient values ​​of each pixel position, and retain the gradient values ​​of the first target pixel position. The combination module is configured to, based on the comparison result, filter the gradient values ​​of the second target pixel positions that are greater than the gradient value of the center pixel position from the gradient values ​​of each pixel position, set the gradient value of the second target pixel position to zero, and combine the first target pixel position with the gradient value retained and the second target pixel position with the gradient value set to zero to obtain an image after non-maximum suppression. Edge information acquisition unit, including: The first type determination module is configured to identify pixel locations in the image after non-maximum suppression where the gradient value is less than a preset first threshold as first type edges. The second type determination module is configured to identify pixel positions in the image after non-maximum suppression where the gradient value is greater than or equal to a preset first threshold and less than or equal to a preset second threshold as second type edges. The third type determination module is configured to identify the pixel positions in the image after non-maximum suppression where the gradient value is greater than a preset second threshold as third type edges. The splicing module is configured to remove the first type of edge and connect the second type of edge and the third type of edge to obtain the edge information of the factory gate; The line detection unit is configured to perform line detection processing on the real-time rotating image to obtain line detection results, and to filter the line detection results based on the edge information of the factory gate to obtain target line detection results; The opening angle determination unit is configured to determine the opening angle information of the factory gate based on the target straight line detection result of the factory gate; The visualization unit is configured to visualize the opening angle information of the factory gate and / or the target line detection result of the factory gate after determining the opening angle information of the factory gate. The control unit is configured to control the factory gate to remain stationary after the opening angle information of the factory gate reaches a preset opening angle threshold. The early warning unit is configured to issue an early warning for the opening angle information of the factory gate after the opening angle information of the factory gate reaches a preset opening angle threshold.

[0017] Preferably, it further includes a positioning auxiliary unit, comprising: The image input module is configured to capture images of the gate corner as input via a visual acquisition camera group; The image processing module is configured to convert the input gate corner image into a grayscale image and effectively remove noise; The angle calculation module is configured to perform edge detection on the processed image to obtain the edge information of the gate in the image, detect straight lines in the image and filter them to remove those that do not meet the requirements, and summarize these filtered lines to calculate the angle information. The result image display module is configured to visualize the detected straight lines and the calculated angle information on the original input image and output the processing results. The angle information display module is configured to output detailed information about angle calculations.

[0018] Preferably, it further includes a positioning management unit, comprising: The decision information overview module is configured to display the precise location of the factory gate through a visual interface, and generate corresponding images, tables, and monitoring screens on the visual interface to show users auxiliary decision-making information; The facility management module is configured to monitor the operating status of the equipment, manage the online status and health status of the equipment, and maintain the location information and Internet Protocol address information of each online camera, thereby ensuring the stable operation of the upper-layer application system; The visualization positioning algorithm module is configured to provide algorithm interface encapsulation for specific scenarios to other sub-modules in the positioning management unit. The algorithm exists in the form of backend support service and can obtain real-time status information through the algorithm calculation service interface provided by each sub-module. The calculation results management module is configured to centrally manage and analyze the calculation results generated by other sub-modules in the positioning management unit; The early warning information management module is configured to process early warning information generated in various specific scenarios; The original video management module is configured to store, retrieve, export, and clean up real-time image data captured by cameras at various locations, so as to facilitate the reuse of video data and the retrospection of the decision-making process. The parameter configuration management module is configured to configure and manage various parameters in the location management unit. The system log management module is configured to collect, store, and manage log information of events and activities occurring in the system.

[0019] Compared with the prior art, the beneficial effects of the present invention are: (1) This invention effectively extracts the gradient information of the image through grayscale conversion, Gaussian filtering and Sobel operator processing, providing a reliable foundation for subsequent edge detection. Compared with the existing technology that relies on a single limit switch, this invention uses computer vision technology to process the real-time rotating image of the factory gate, which can obtain the continuous position information of the gate during the opening or closing process, realize the accurate monitoring of the real-time opening angle of the gate, and significantly improve the positioning accuracy; (2) The present invention further refines edge features by applying nonmaximum suppression, reduces noise interference, and improves the accuracy of edge detection; it divides edges into three types and processes them separately, which not only eliminates unimportant details but also retains key features, making the final edge information clearer and more continuous. Compared with the single sensor solution with poor environmental adaptability in the prior art, the image processing method of the present invention has better robustness to complex environments such as insufficient light and dust. (3) This invention combines line detection with the screening and processing of factory gate edge information, which can accurately identify the lines related to the factory gate, thereby accurately determining the opening angle of the gate. Compared with the existing technology's untimely fault warning solution, this invention can monitor the gate opening angle in real time and issue a timely warning when the threshold is reached, effectively ensuring the safe operation of the factory. (4) Based on the opening angle of the gate and the preset opening angle threshold, the present invention can detect and respond to abnormal situations in a timely and accurate manner, effectively ensuring the safe operation of the factory. At the same time, the addition of limit switch sensors and absolute encoders for multi-sensor fusion verification reduces the risk of misjudgment due to the failure of a single sensor and improves the reliability and safety of the system; (5) The present invention also provides a visualization display function, which can intuitively present the opening angle information and target line detection results in the form of graphics, charts, animations, etc., so that relevant personnel can quickly understand the current status of the factory gate. Compared with the existing technology, which lacks intelligent management functions, the present invention meets the needs of modern factories for intelligent and visualized monitoring and management. Attached Figure Description

[0020] Figure 1 This is an overall flowchart of the monitoring and early warning method for the factory gate in an embodiment of the present invention; Figure 2 This is a structural diagram of the positioning auxiliary unit of the monitoring and early warning system for the factory gate in an embodiment of the present invention; Figure 3 This is a flowchart of the factory gate positioning calculation in an embodiment of the present invention; Figure 4 This is a structural block diagram of the positioning management unit of the monitoring and early warning system for the factory gate in this embodiment of the invention; Figure 5This is a schematic diagram illustrating the interaction between the decision information overview module and other sub-modules in an embodiment of the present invention; Figure 6 This is a flowchart illustrating the visual positioning of the factory gate in an embodiment of the present invention. Figure 7 This is a structural block diagram of the monitoring and early warning system for the factory gate in an embodiment of the present invention. Detailed Implementation

[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0022] like Figure 1 As shown, an embodiment of the present invention provides a monitoring and early warning method for factory gates, comprising the following steps: Step S1: Obtain a real-time rotating image of the factory gate, and extract the gradient information of the real-time rotating image through grayscale conversion, Gaussian filtering and Sobel operator processing. Step S2: Apply nonmaximum suppression to refine edge features; Step S3: Obtain the edge information of the factory gate; Step S4: Perform line detection processing on the real-time rotating image to obtain line detection results, and filter the line detection results based on the edge information of the factory gate to obtain the target line detection results; Step S5: Determine the opening angle information of the factory gate based on the target line detection results, and visualize the opening angle information and / or the target line detection results. Step S6: In response to the factory gate opening angle information reaching the preset opening angle threshold, control the factory gate to be stationary and issue an early warning for the factory gate opening angle information.

[0023] This invention effectively extracts gradient information from real-time rotating images through grayscale conversion, Gaussian filtering, and Sobel operator processing, providing a reliable foundation for subsequent edge detection. Non-maximum suppression is then applied to further refine edge features, reducing noise interference and improving edge detection accuracy. Simultaneously, edge features are categorized into three types and processed separately, eliminating unimportant details while retaining key features, resulting in clearer and more continuous edge information. Combined with line detection and the filtering of factory gate edge information, straight lines related to the factory gate can be accurately identified, thereby precisely determining the gate's opening angle. Based on the gate's opening angle and a preset opening angle threshold, abnormal situations can be detected and responded to promptly and accurately, effectively ensuring the safe operation of the factory.

[0024] In one embodiment of the present invention, step S1 specifically includes: Step S101: Obtain a real-time rotating image of the factory gate; In this step, the real-time rotating image refers to the image captured during the opening or closing (i.e., rotation) of the factory gate. For example, the real-time rotating image is the three-dimensional spatial position data of the factory gate; the motion state of the factory gate is captured and recorded in real time during the opening or closing process using a camera or visual acquisition camera. Step S102: Perform grayscale conversion processing on the real-time rotating image to obtain a grayscale image; In this step, to simplify the processing flow and optimize edge extraction, the real-time rotating image is converted into a grayscale image. Grayscale conversion transforms the color real-time rotating image into a grayscale image. In a grayscale image, the brightness level (or grayscale level) of each pixel is unique color information, typically ranging from 0 (black) to 255 (white). This conversion is achieved by removing color information and retaining only brightness information, simplifying the complexity of the image data while preserving sufficient visual information for further analysis or processing. After grayscale conversion, the real-time rotating image, which might have contained rich colors, is transformed into an image containing only grayscale information. Such an image is more efficient in terms of processing speed, storage requirements, and certain types of image analysis (such as edge detection, shape recognition, etc.). Step S103: Perform Gaussian filtering on the grayscale image to obtain a smoothed grayscale image; In this step, a Gaussian filter is applied to smooth the grayscale image to reduce noise interference. For each pixel in the grayscale image, the Gaussian filtering smoothing process uses a weighted average method, replacing the original grayscale value of that pixel with the grayscale values ​​of its surrounding pixels. This weighted average is based on a Gaussian function, meaning that pixels closer to the center pixel have a larger weight, and pixels farther away have a smaller weight. The result of Gaussian filtering smoothing is a smoothed image. Gaussian filtering smoothing can reduce noise and unnecessary details in the grayscale image because it helps highlight the main features of the image while suppressing details that may be caused by noise, making the smoothed image appear smoother and softer. Step S104: The smoothed grayscale image is processed using the Sobel operator to determine the gradient information of each pixel position in the smoothed grayscale image, wherein the gradient information includes gradient value and gradient direction. In this step, the Sobel operator is applied to the smoothed grayscale image to calculate the gradient value and direction of each pixel. The gradient value reflects the degree of intensity change in the image, while the gradient direction indicates the maximum trend of intensity change. The Sobel operator is a discrete differential operator for edge detection, combining Gaussian smoothing and differential differentiation. It calculates the gradient of grayscale changes by applying two 3x3 convolution kernels (one for detecting horizontal edges and the other for detecting vertical edges) to the smoothed grayscale image. These convolution kernels consider neighborhood information of pixels, thus enabling more accurate edge detection. The gradient information describes the rate and direction of change of pixel values ​​in the image. For each pixel location, the gradient information includes two parts: gradient value: representing the magnitude of the rate of change of pixel value at that point, i.e., the edge strength; the larger the gradient value, the more obvious the edge at that pixel location; gradient direction: representing the direction of the fastest change of pixel value, i.e., the direction of the edge. The gradient direction is usually perpendicular to the edge direction. The process of processing a smoothed grayscale image using the Sobel operator is actually applying a Sobel convolution kernel to each pixel in the image to calculate the gradient value and gradient direction at each pixel location. This process helps to highlight the edge features in the image and provides important information for subsequent image analysis (such as edge detection, object recognition, etc.). Step S105: Based on the gradient information of each pixel position in the smoothed grayscale image, determine the gradient value of the center pixel position corresponding to the gradient direction in the smoothed grayscale image.

[0025] In this step, for each pixel in the smoothed grayscale image, the gradient values ​​of neighboring pixels are examined along its gradient direction. The center pixel location refers to the pixel at the center of the gradient direction. Based on the gradient information at each pixel location in the smoothed grayscale image, the gradient value of that pixel in the gradient direction is determined. This means that not only the magnitude of the gradient is considered, but also the direction in which the gradient points. For example, if the gradient points in a specific direction (such as from left to right), the gradient value is calculated in that direction. This typically involves using some form of gradient vector (containing both magnitude and direction) to calculate or extract gradient information in a specific direction.

[0026] In one embodiment of the present invention, step S2 specifically includes: Step 201: Compare the gradient value of each pixel position corresponding to the gradient direction with the gradient value of the center pixel position corresponding to the gradient direction to obtain the comparison result. In this step, the gradient values ​​at each pixel location along the corresponding gradient direction are compared with the gradient value of the center pixel to obtain the comparison result. The gradient direction refers to the direction of the fastest brightness change at a pixel in a smoothed grayscale image. The calculation of the gradient direction is based on the difference in image grayscale values ​​and is crucial for tasks such as edge detection and texture analysis. The gradient direction can be any angle, but it is usually quantized to a limited number of directions (e.g., 0°, 45°, 90°, 135°, etc.) for ease of processing. Each pixel location has a corresponding gradient value, which represents the intensity or speed of the brightness change at that pixel. A larger gradient value indicates a faster brightness change, typically corresponding to edges or textured areas in the image. The center pixel location is the center pixel within a specific region (i.e., the gradient direction). The gradient value of this center pixel is used as the comparison benchmark. The gradient values ​​at all pixel locations corresponding to each gradient direction are compared with the gradient value of the center pixel location. This comparison can involve simple numerical comparisons (e.g., determining whether the gradient values ​​of other pixels are greater than, less than, or equal to the gradient value of the center pixel) or more complex comparisons (e.g., calculating the percentage difference or relative change). The comparison results can be a series of binarized information, such as whether the gradient value at each pixel location is greater than the gradient value of the center pixel, resulting in a series of True / False values, or more complex quantization results (e.g., the magnitude of the difference between the gradient value at each pixel location and the gradient value of the center pixel). Comparison results have various applications in image processing, such as edge detection (by identifying pixels with significant gradient changes), texture analysis (by evaluating the distribution of gradient values ​​in different directions), and feature extraction (by identifying pixels with significant gradient features). By comparing gradient values, the structure and features of the image can be further analyzed, providing useful information for subsequent image processing or computer vision tasks. Step 202: Based on the comparison results, select the gradient values ​​of the first target pixel position that are less than or equal to the gradient value of the center pixel position from the gradient values ​​of each pixel position, and retain the gradient values ​​of the first target pixel position. In this step, the comparison measures the magnitude of the gradient value at each pixel location relative to the gradient at the center pixel location. Among all pixel gradient values, those pixels whose gradient values ​​are less than or equal to the gradient value of the center pixel (i.e., the first target pixel location) are identified and their gradient values ​​(i.e., the gradient values ​​at the first target pixel location) are retained. In other words, if the gradient value at the center pixel location is the maximum value in that direction, then that value is retained. Essentially, this is a local comparison aimed at identifying pixels whose gradient changes are less significant than those at the center pixel. By comparing the gradient value of each pixel with that of the center pixel, pixels with smaller gradient changes are selected and their gradient values ​​are retained. This processing helps subsequent image processing tasks, such as edge thinning, noise removal, or feature extraction, making them clearer. Step 203: Based on the comparison results, select the gradient values ​​of the second target pixel positions that are greater than the gradient value of the center pixel position from the gradient values ​​of each pixel position, set the gradient value of the second target pixel position to zero, and combine the first target pixel position that retains the gradient value and the second target pixel position that has been set to zero to obtain the image after non-maximum suppression.

[0027] In this step, Non-Maximum Suppression (NMS) refines edges, ensuring each edge is only a single pixel wide. The comparison measures the gradient value at each pixel location relative to the gradient at the center pixel location. Among all pixel gradient values, those pixels with gradient values ​​greater than the center pixel location (i.e., the second target pixel location) are identified, and their gradient values ​​(i.e., the gradient values ​​at the second target pixel location) are set to zero. In other words, if the gradient value at the center pixel location is not the maximum value in that direction, it is suppressed to zero. This second target pixel's gradient value is then selected as a potential edge candidate. Setting the gradient value at the second target pixel location to zero aims to suppress non-maximum values, thereby removing pixels that are not the largest gradient values ​​on the edge. Finally, the edges of the image after NMS are further refined, retaining only the pixels most likely to be edges. The width of each edge is reduced to a single pixel, improving the accuracy and sharpness of edge detection. It helps remove pixels that are not the most significant points on the edge, resulting in sharper, refined edges.

[0028] In one embodiment of the present invention, step S3 specifically includes: Step 301: The pixel positions in the image after non-maximum suppression where the gradient value is less than a preset first threshold are taken as first type edges; In this step, a preset first threshold is used to distinguish which gradient values ​​are large enough to be considered part of an edge, and which are not. If the gradient value of a pixel is less than this threshold, then according to this description, the pixel location is classified as a first-type edge. That is, based on the preset low threshold (i.e., the first threshold), the pixel locations in the image after non-maximum suppression are divided, and the pixel locations in the image after non-maximum suppression with gradient values ​​less than the preset low threshold are considered non-edges (i.e., first-type edges). The preset first threshold is used to quickly and accurately determine which edges are significant and which should be ignored; Step 302: The pixel positions in the image after non-maximum suppression where the gradient value is greater than or equal to a preset first threshold and less than or equal to a preset second threshold are designated as second-type edges. In this step, a preset first threshold and a preset second threshold are used to distinguish which gradient values ​​are large enough to be considered part of an edge, and which are not. Only pixels with gradient values ​​between these two thresholds are classified as weak edges (i.e., type II edges). Based on the preset low threshold (i.e., the first threshold) and high threshold (i.e., the second threshold), the non-maximum suppression image is divided, and pixels between the two thresholds are considered weak edges. This can improve the accuracy and robustness of edge detection, thus aiding subsequent image processing tasks. Step 303: The pixel positions in the image after non-maximum suppression where the gradient value is greater than a preset second threshold are taken as third-type edges; In this step, a preset second threshold is used to distinguish which gradient values ​​are large enough to be considered part of an edge, and which are not. Pixels with gradient values ​​higher than the high threshold (i.e., the preset second threshold) are classified as strong edges (i.e., third-type edges). The above method yields more significant and reliable edges (i.e., third-type edges) in the image after non-maximum suppression. Step 304: Remove the first type of edge and connect the second type of edge and the third type of edge to obtain the edge information of the factory gate.

[0029] In this step, the purpose of first-type edge culling is to simplify the image data, reduce the complexity of subsequent processing, and improve the accuracy of the factory gate's edge information. Through iterative processing, weak edges (i.e., second-type edges) are connected to strong edges (i.e., third-type edges) to form complete edge lines, thus obtaining the factory gate's edge information. If a weak edge is connected to a strong edge, it is classified as a strong edge; otherwise, it is suppressed. Second-type and third-type edges refer to those edges that are crucial for identifying the factory gate's edge information. These edges may represent different parts of the factory gate, such as the door frame or door leaf. Connecting these edges involves combining them into a coherent contour to more accurately represent the shape and structure of the factory gate. This connection can be achieved through techniques such as edge tracking, contour extraction, or shape fitting. By connecting these edges, a more complete and accurate set of factory gate edge information can be obtained.

[0030] In one embodiment of the present invention, step S4 specifically includes: Step S401: Determine the image space where the real-time rotating image is located, and map the real-time rotating image in the image space to the parameter space; Step S402: Calculate the cumulative value of edge points passing through preset positions in the real-time rotating image in the parameter space; Step S403: Combine the edge points whose cumulative value is greater than the preset cumulative value threshold as the line detection result; Step S404: Determine the line detection results that do not match the edge information of the factory gate in the line detection results; Step S405: Remove the line detection results that do not match the edge information of the factory gate from the line detection results to obtain the target line detection results. The target line detection results include the first target line and the second target line.

[0031] In the above scheme, image space refers to the representation of the real-time rotating image in its original pixel coordinate system. Each image point has its coordinates (x, y) on a two-dimensional plane. To detect lines, it is often necessary to transform the points in image space to a parameter space that is more suitable for line detection. The most commonly used method is the Hough Transform, which transforms the points in image space to Hough space (or parameter space), where the parameters of the line (such as slope and intercept, or angle and radius in polar coordinates) are used to represent the line. For any given line, all points belonging to this line in image space will intersect at a single point in parameter space.

[0032] The cumulative value of edge points passing through preset positions in a real-time rotating image within parameter space is calculated: In image processing, edges are areas of drastic brightness change, typically corresponding to object boundaries. These edge points can be found using edge detection algorithms (such as the Canny edge detector). In parameter space, for each possible line parameter (e.g., each point in Hough space), the number of all edge points mapped to that parameter (or its vicinity) is counted. This number is called the cumulative value, reflecting how many edge points in the image space might belong to the same line. To determine which parameters (or points in Hough space) correspond to the true line, a threshold is set. Only when the cumulative value exceeds this threshold is the corresponding parameter (or point in Hough space) considered a detected line. Once the parameters (or points in Hough space) corresponding to the line are determined, the image space can be backtracked to find all edge points belonging to that line. The combination of these edge points constitutes the line detection result.

[0033] The Hough line transform is a widely used line detection technique in image processing. This technique maps points in image space to a parameter space and uses an accumulator mechanism in the parameter space to detect lines. The advantage of the Hough line transform lies in its robustness to noise and broken edges in the image. It is suitable for various line detection applications, such as edge detection, line segment extraction, and geometric shape recognition. The Hough line transform process is summarized below: Parameter Space: The Hough Line Transform uses a parameter space to represent lines in an image. For lines in a two-dimensional image, the parameter space can be represented in polar coordinates. A line can be defined by two parameters: the polar radius (ρ, rho) and the polar angle (θ, theta). The polar radius represents the distance from the line to the origin of the image, while the polar angle represents the angle between the line and the positive direction of the image.

[0034] Accumulator Array: The Hough Linear Transform uses an accumulator array to record the lines passing through specific points in the parameter space. The accumulator array is a two-dimensional array structure, where each element represents a point in the parameter space. The size of the accumulator array depends on the range of values ​​for the polar radius and polar angle, as well as the resolution.

[0035] Point-to-line mapping: For each edge point in the image, the Hough line transform maps it to multiple lines in the parameter space. For each point, the polar radius and polar angle are iteratively calculated in the parameter space, and the counter at the corresponding position in the accumulator array is incremented accordingly. Using the accumulator array, the points with the highest counts in the parameter space can be found; these points correspond to lines in the image.

[0036] Threshold setting and line extraction: By setting a threshold, it is possible to determine which points in the accumulator array correspond to the detected lines. Typically, points in the accumulator array with counter values ​​higher than the threshold are selected as candidates for lines. The lines in the image can then be extracted by parsing these candidate points in the parameter space.

[0037] Since the line detection results may include lines corresponding to the edges of other structures, it is necessary to filter the results to remove lines that do not meet the requirements, retaining only those that do (i.e., the target line detection results). The line detection results refer to the set of all lines detected in the image. These lines may represent actual straight structures in the image, such as building edges, road markings, etc. Each line in the line detection results is compared with the known edge information of the factory gate. Mismatches may include the line's position, direction, or length not matching the expected information of the factory gate edge. For example, if a detected line is not at the expected edge position of the factory gate, or its direction differs significantly from the expected edge direction, then these lines are considered mismatched with the factory gate edge information. Once it is determined which line detection results do not match the factory gate edge information, the next step is to remove these mismatched lines from the detection results. The purpose of this is to retain lines that are more likely to represent the factory gate edge, thereby improving the accuracy and reliability of subsequent processing (such as edge recognition, localization, and dimensional measurement). After the above screening process, the remaining line detection results are the lines that match the edge information of the factory gate, i.e., the target line detection results. These lines more accurately reflect the edge features of the factory gate.

[0038] In embodiments of the present invention, there are two implementation methods for determining the opening angle information of the factory gate, as follows: In one embodiment of the present invention, the step S5 of determining the opening angle information of the factory gate based on the target straight line detection result of the factory gate specifically includes: Step S501: Determine the first slope value corresponding to the first target line, and determine the second slope value corresponding to the second target line; Step S502: Based on the first slope value and the second slope value, perform tangent value calculation to obtain the tangent value; Step S503: Perform arctangent processing on the tangent value to obtain the opening angle information of the factory gate.

[0039] In the above scheme, the slope values ​​of the first and second target lines are calculated respectively. The first slope value corresponds to the slope of the first target line, and the second slope value corresponds to the slope of the second target line. Based on the first and second slope values, the tangent value is obtained by using a formula. After obtaining the tangent value, in order to obtain the opening angle of the factory gate (i.e., the angle between the two lines), it is necessary to perform arctangent processing on it. The arctangent function is the inverse function of the tangent function, which can convert the tangent value back into the corresponding angle value. Through this step, the opening angle information of the factory gate can be obtained, that is, the angle between the two target lines, which reflects the degree of opening of the gate.

[0040] In another embodiment of the present invention, the step S5 of determining the opening angle information of the factory gate based on the target straight line detection result of the factory gate specifically includes: Step S501: Obtain the first encoding information corresponding to the first target line and the second encoding information corresponding to the second target line; Step S502: Search for the first rotation angle information corresponding to the first encoding information from the preset rotation angle database, and search for the second rotation angle information corresponding to the second encoding information from the preset rotation angle database, wherein the rotation angle database includes multiple rotation angle information corresponding to different encoding information; Step S503: The opening angle information of the factory gate is obtained by subtracting the first rotation angle information and the second rotation angle.

[0041] In the above scheme, for each detected target line (the first target line and the second target line), a corresponding encoded information is acquired. This encoded information may be some kind of identifier used to retrieve relevant information from the database in subsequent steps. The specific content of the encoded information may depend on the characteristics of the target line (such as position, length, direction, etc.) and the implementation details of the detection method. Next, the rotation angle information corresponding to each encoded information is retrieved from a preset rotation angle database. This database contains multiple different encoded information and their respective corresponding rotation angle information. The rotation angle information may represent the rotation angle of the factory gate relative to a reference position (such as the fully closed state) when the target line is in a specific position or state. Finally, the difference between the two rotation angle information retrieved from the database is calculated. This means that it calculates the difference between the first rotation angle information and the second rotation angle information, and this difference is the opening angle information of the factory gate. This difference reflects the degree of rotation of the gate from one state (such as the state represented by the first target line) to another state (such as the state represented by the second target line), and can thus be used to represent the opening angle of the gate.

[0042] To improve the accuracy of gate positioning, an absolute encoder is integrated into the gate drive motor. This encoder provides precise position feedback to the motor, ensuring that every movement of the gate is recorded in the system. This allows for the fusion and verification of the gate positioning results obtained through visual sensors. The absolute encoder operates based on its built-in encoder disk and photoelectric detection component. The encoder disk is engraved with unique coding patterns, each position corresponding to a unique code value. When the encoder rotates or shifts, the photoelectric detection component reads the coding information on the disk, thus accurately determining the current position. Specifically, the photoelectric detection system consists of light-emitting diodes (as transmitters), phototransistors (as receivers), and signal processing circuitry. Light emitted from the transmitter penetrates the grating on the encoder disk. As the disk rotates, the light is either blocked or transmitted. The receiver detects these changes in light intensity and converts them into electrical signals. The signal processing circuit receives the raw signal from the receiver and amplifies, filters, and shapes it, ultimately converting it into digital codes. These digital codes have a one-to-one correspondence with the rotation angle of the encoder disk and can be read and processed by the control system, thereby achieving precise monitoring of the mechanical position. This system uses a programmable logic controller (PLC) as the receiving device to read and decode the output signal of the absolute encoder, and calculates the current opening angle of the gate through conversion.

[0043] In an embodiment of the present invention, in response to the opening angle information of the factory gate reaching a preset opening angle threshold, the present invention further includes: controlling the factory gate to be in a stationary state.

[0044] In the above solution, a limit switch sensor is added to reduce the impact of errors in calculating the gate opening angle caused by sensor malfunction. Whenever the gate opens to a preset opening angle threshold, the limit switch sends a signal. This opening angle is then compared and corrected with the angle calculated by the vision sensor and the motor's absolute encoder, quickly correcting any deviation. If the deviation exceeds the normal range, a corresponding alarm message will be displayed to prompt staff to intervene and handle the fault promptly. As a physical limit device, the limit switch can control the gate to stop moving when it reaches its limit position (i.e., the preset opening angle threshold), preventing accidental damage. For example, in windy conditions, if the gate opens too wide, it may be damaged by wind pressure. By setting such control logic, the opening degree of the gate can be automatically limited when necessary, protecting equipment and personnel safety.

[0045] In an embodiment of the present invention, after determining the opening angle information of the factory gate based on the target straight line detection result of the factory gate, the present invention further includes: visually displaying the opening angle information of the factory gate and / or the target straight line detection result of the factory gate.

[0046] In the above solution, visualization refers to presenting the opening angle information intuitively in the form of graphics, charts, animations, etc. The purpose of this is likely to allow relevant personnel to quickly and accurately understand the current status of the factory gate, thereby enabling them to make corresponding decisions or actions. For example, a dynamic gate icon can be displayed on the monitoring screen, with its opening degree matching the actual opening angle of the gate.

[0047] This invention also provides a monitoring and early warning system for factory gates, used to implement the monitoring and early warning method for factory gates as described above, including: The gradient information acquisition unit includes: The acquisition module is configured to acquire real-time rotating images of the factory gate; The grayscale conversion module is configured to perform grayscale conversion processing on the real-time rotating image to obtain a grayscale image; The smoothing module is configured to perform Gaussian filtering on the grayscale image to obtain a smoothed grayscale image. The gradient information determination module is configured to process the smoothed grayscale image using the Sobel operator to determine the gradient information of each pixel position in the smoothed grayscale image, wherein the gradient information includes gradient value and gradient direction. The gradient value determination module is configured to determine the gradient value of the center pixel position corresponding to the gradient direction in the smoothed grayscale image based on the gradient information of each pixel position in the smoothed grayscale image. Non-maximum suppression unit, including: The comparison module is configured to compare the gradient value of each pixel position corresponding to the gradient direction with the gradient value of the center pixel position corresponding to the gradient direction to obtain a comparison result. The retention module is configured to, based on the comparison result, filter the gradient values ​​of a first target pixel position that are less than or equal to the gradient value of the center pixel position from the gradient values ​​of each pixel position, and retain the gradient values ​​of the first target pixel position. The combination module is configured to, based on the comparison result, filter the gradient values ​​of the second target pixel positions that are greater than the gradient value of the center pixel position from the gradient values ​​of each pixel position, set the gradient value of the second target pixel position to zero, and combine the first target pixel position with the gradient value retained and the second target pixel position with the gradient value set to zero to obtain an image after non-maximum suppression. Edge information acquisition unit, including: The first type determination module is configured to identify pixel locations in the image after non-maximum suppression where the gradient value is less than a preset first threshold as first type edges. The second type determination module is configured to identify pixel positions in the image after non-maximum suppression where the gradient value is greater than or equal to a preset first threshold and less than or equal to a preset second threshold as second type edges. The third type determination module is configured to identify the pixel positions in the image after non-maximum suppression where the gradient value is greater than a preset second threshold as third type edges. The splicing module is configured to remove the first type of edge and connect the second type of edge and the third type of edge to obtain the edge information of the factory gate; The line detection unit is configured to perform line detection processing on the real-time rotating image to obtain line detection results, and to filter the line detection results based on the edge information of the factory gate to obtain target line detection results; The opening angle determination unit is configured to determine the opening angle information of the factory gate based on the target straight line detection result of the factory gate; The visualization unit is configured to visualize the opening angle information of the factory gate and / or the target line detection result of the factory gate after determining the opening angle information of the factory gate. The control unit is configured to control the factory gate to remain stationary after the opening angle information of the factory gate reaches a preset opening angle threshold. The early warning unit is configured to issue an early warning for the opening angle information of the factory gate after the opening angle information of the factory gate reaches a preset opening angle threshold.

[0048] In one embodiment of the present invention, the monitoring and early warning system for the factory gate further includes a positioning auxiliary unit, comprising: The image input module is configured to capture images of the gate corner as input via a visual acquisition camera group; The image processing module is configured to convert the input gate corner image into a grayscale image and effectively remove noise; The angle calculation module is configured to perform edge detection on the processed image to obtain the edge information of the gate in the image, detect straight lines in the image and filter them to remove those that do not meet the requirements, and summarize these filtered lines to calculate the angle information. The result image display module is configured to visualize the detected straight lines and the calculated angle information on the original input image and output the processing results. The angle information display module is configured to output detailed information about angle calculations.

[0049] In an embodiment of the present invention, the structural relationship diagram of the positioning auxiliary unit of the monitoring and early warning system for the factory gate is attached. Figure 2 As shown, the workflow of the positioning assistance unit is as follows: First, the visual acquisition camera group captures an image of the gate corner as input; to simplify the calculation process and optimize the edge extraction process, the image processing module converts the image into a grayscale image and effectively removes noise; then, the angle measurement module performs edge detection on the processed image to obtain the edge information of the gate in the image; next, the Hough line transform technique is used to detect straight lines in the image; since straight lines corresponding to other structural edges may be detected, the detected straight lines need to be filtered to remove those that do not meet the requirements and retain only those that do meet the conditions; finally, these filtered straight lines are summarized and the angle information is calculated; finally, the detected straight lines and the calculated angle information are visualized on the original input image and the processing results are output; at the same time, detailed information on the angle measurement is also output.

[0050] Furthermore, to improve the accuracy of gate positioning, this invention integrates an absolute encoder into the gate drive motor to achieve fusion verification of the gate positioning results obtained through visual sensors. The absolute encoder operates based on its built-in encoder disk and photoelectric detection component. The encoder disk is engraved with unique coding patterns, with each position corresponding to a unique code value. When the encoder rotates or shifts, the photoelectric detection component reads the coding information on the encoder disk, thereby accurately determining the current position. Specifically, the photoelectric detection system consists of a light-emitting diode (as a transmitter), a phototransistor (as a receiver), and a signal processing circuit. The light emitted by the transmitter penetrates the grating on the encoder disk. As the encoder disk rotates, the light is either blocked or transmitted. The receiver detects these changes in light intensity and converts them into electrical signals. The signal processing circuit receives the raw signal from the receiver and performs amplification, filtering, and shaping processing on it, ultimately converting it into digital codes. These digital codes have a one-to-one correspondence with the rotation angle of the encoder disk and can be read and processed by the control system, thereby achieving precise monitoring of the mechanical position. This system uses a PLC controller as the receiving device to read and decode the output signal of the absolute encoder, and calculates the current opening angle of the gate through conversion.

[0051] To mitigate the impact of errors in gate opening angle calculation caused by sensor malfunctions, this invention incorporates a limit switch sensor. Whenever the gate opens to a preset limit angle, the limit switch sends a signal. The system then compares this opening angle with the angle calculated by the vision sensor and the motor's absolute encoder, quickly correcting any deviations. If the deviation exceeds the normal range, the system displays a corresponding alarm message to alert staff for timely troubleshooting.

[0052] As attached Figure 3 As shown, the factory gate positioning calculation process can be divided into three core steps: image processing, gate edge processing, and real-time angle calculation. Image processing relies on a vision acquisition camera group to capture entity images, convert them into grayscale images, and effectively remove noise. The processed image information is then passed to the gate edge processing module. Gate edge processing performs edge detection, Hough transform line detection, and line filtering, transforming the gate image into a linear structure suitable for angle measurement, and then transmitting the relevant information to the real-time angle calculation module. Real-time angle calculation, based on the processed image data and angle information provided by the absolute encoder and limit switches, uses a precise algorithm to calculate and ultimately output the real-time pivot angle information when the factory gate opens, ensuring the normal opening operation of the factory gate.

[0053] In one embodiment of the present invention, the monitoring and early warning system for the factory gate further includes a positioning management unit, the structure of which is as follows: Figure 4 As shown, it includes: The decision information overview module is configured to display the precise location of the factory gate through a visual interface, and generate corresponding images, tables, and monitoring screens on the visual interface to show users auxiliary decision-making information; The Decision Information Overview module provides users with decision-making information for specific scenarios. It displays the precise location of the gate through a visual interface and, based on the output data from the algorithm submodule, generates corresponding images, tables, and monitoring screens on the page, aiming to intuitively present auxiliary decision-making information to users. The implementation of the Decision Information Overview function relies on the software system's facility management module, algorithm submodule, and system visualization module. The hardware facility submodule is responsible for providing camera information to the auxiliary decision-making algorithm submodules for each scenario. The algorithm submodule, depending on the business scenario, runs corresponding computer vision algorithms to extract pixel information, depth information, etc., and then calculates the angle, distance, and category of specific objects, ultimately outputting warning information based on preset threshold information. Users can browse overview information for various specific scenarios through the main interface. The interface elements displayed for each scenario are different, all covering key information for each scenario. The overview information also shares commonalities, such as alarm indications. If the factory gate positioning system uses a computer vision algorithm to determine that a certain scenario poses a risk, the interface will display warning information of varying degrees. The Decision Information Overview function not only integrates multiple scenarios but also provides the ability to query the status details of a specific scenario. Numerous camera information, processed image information, and detailed angle and distance information are displayed in the decision information details section of the page. Users can switch the content displayed in the details section by clicking different sub-scene details buttons. The interaction between the decision information overview module and other sub-modules is as follows: Figure 5 As shown; The facility management module is configured to monitor the operating status of the equipment, manage the online status and health status of the equipment, and maintain the location information and Internet Protocol address information of each online camera, thereby ensuring the stable operation of the upper-layer application system; The facility management module is responsible for monitoring the operational status of equipment, managing its online status and health status, and maintaining the location information and Internet Protocol (IP) address information of each online camera, thereby ensuring the stable operation of the upper-layer application system. The facility management system has the ability to record and manage basic information for each camera, including name, model, manufacturing origin, installation location, and region, facilitating camera identification, classification, and querying by users, and providing convenience for future maintenance and management. Each camera needs an independent IP address to enable network communication and remote access. The facility management system can monitor the hardware status of cameras in real time, including connection status, network connectivity, and power supply status. Through continuous monitoring, the system can promptly detect camera malfunctions, connection anomalies, or other potential problems, and send alarm notifications to the administrator so that measures can be taken quickly to repair the fault or perform necessary maintenance. Equipment management is a core component of the facility management system, covering the entire lifecycle management of equipment, including warehousing, issuance, allocation, and disposal. With the help of equipment management, comprehensive management of equipment from procurement and issuance to maintenance can be achieved, ensuring the normal operation and effective maintenance of equipment. The system supports remote configuration and management of camera parameters and settings. Administrators can remotely adjust camera parameters such as resolution, frame rate, and image quality to optimize image quality. Furthermore, the system provides remote firmware upgrade functionality for easy camera software updates and upgrades. The camera facility management system records camera operation logs, status change logs, and abnormal event logs. The visualization positioning algorithm module is configured to provide algorithm interface encapsulation for specific scenarios to other sub-modules in the positioning management unit. The algorithm exists in the form of backend support service and can obtain real-time status information through the algorithm calculation service interface provided by each sub-module. The visualization positioning algorithm module provides scenario-specific algorithm interface encapsulation for other sub-modules. Each algorithm exists as a backend support service and can obtain real-time status information through the algorithm calculation service interface provided by each sub-module, achieving decoupling from the decision information overview module in this unit. The core process of the algorithm calculation service begins with image preprocessing, followed by a series of computer vision algorithms to obtain angle and distance information, determine object categories, achieve semantic segmentation, and ultimately generate warning information. Encapsulating the algorithms for each scenario as independent microservices has the advantage of decoupling from the entire positioning management unit, facilitating algorithm replacement as needed, using existing algorithms with different inputs, and applying the output to other software systems, thus achieving algorithm-level reuse. For each scenario-specific algorithm calculation service, each step of the algorithm can be output separately, covering image preprocessing results, angle and distance information, and warning information. The multi-level, fine-grained division of output information allows for good adaptation to various software systems. The visualization positioning service for the gate of a tall factory building covers two main stages: image acquisition and real-time angle measurement. By deploying binocular vision cameras near the main gate, multi-angle images are captured, intelligently identifying vertical transfer gates at various levels and labeling their hierarchy. Using algorithms from the artificial intelligence sub-platform and computer vision technology, the real-time opening and closing angles of each gate are calculated. Angle information is displayed in real-time on the monitoring terminal, with alerts issued when approaching a specified angle, enabling precise control. Historical results of gate angle calculations are displayed in a window to identify abnormal behavior or events and provide guidance for future decisions based on recurring patterns and trends. The visualization positioning algorithm module obtains services from the facility management module and also provides services to the following modules: decision information overview, calculation result management, parameter configuration management, and log management. Alarm level, alarm time, gates involved, recording time, camera screenshots, distance, and final angle information are output to the decision information overview module. The original images from the binocular cameras on both sides of the gate and the images processed after real-time angle detection are directly used for visualization monitoring in the window; the output of the real-time angle calculation module displays specific angle values ​​in a window, with different colors indicating the degree to which requirements are met. The calculated gate opening angle is output to the calculation result management module. Algorithm parameters will be output to the parameter setting module, which will also receive a parameter setting interface. Configurable parameters include edge detection hysteresis threshold, Hough transform distance accuracy, angle accuracy, and threshold parameters for the accumulation plane. Gate angle information and alarm information will be output to the log management module. The factory gate visual positioning process is as follows: Figure 6 As shown; The calculation results management module is configured to centrally manage and analyze the calculation results generated by other sub-modules in the positioning management unit; The calculation results management module aims to centrally manage and analyze the calculation results generated by each subsystem within the system. Each subsystem generates real-time alarm information, distance, angle, and other data through algorithmic analysis. The calculation results management module is responsible for receiving, storing, managing, and analyzing these calculation results, providing solid support for subsequent data analysis and decision-making. With this module, users can easily access and analyze real-time alarm information, distance, angle, and other data, and generate charts and tables to assist in subsequent data analysis and decision-making processes. The calculation results management module works closely with other submodules in the positioning management unit, receiving their real-time calculation results. The calculation results management module encompasses the following core functions: data reception and storage, data management, result verification, chart and table generation, data analysis support, and result export. The early warning information management module is configured to process early warning information generated in various specific scenarios; The early warning information management module is designed to handle early warning information generated in various specific scenarios. By deploying an efficient and reliable early warning information management module, this function can promptly identify, analyze, and respond to abnormal situations and early warning events occurring in the system, thereby ensuring the stable operation and security of the system. This module provides a range of functions, covering early warning information reception, information filtering and classification, abnormal event identification, and response action triggering. The original video management module is configured to store, retrieve, export, and clean up real-time image data captured by cameras at various locations, so as to facilitate the reuse of video data and the retrospection of the decision-making process. The raw video management module is designed to store, retrieve, export, and clean up real-time image data captured by cameras at various locations, facilitating the reuse of video data and the retrospective analysis of decision-making processes. These videos are raw video data that has not been processed by the algorithm submodule. The raw video management module encompasses the following three core functions: video storage configuration, raw video retrieval, and raw video cleaning. The parameter configuration management module is configured to configure and manage various parameters in the location management unit. The parameter configuration management module aims to configure various parameters within the software system. By constructing a flexible and scalable parameter setting mechanism, this function provides users with a convenient and unified interface to manage various parameters in the system. This mechanism can receive parameter values ​​input by the user and verify their validity, including the parameter type, range, and format. Once the user-input parameter values ​​are verified, the module should be able to pass these parameters to the corresponding algorithm subsystem for calculation or processing. The parameter setting function will cover the following core functions: parameter configuration interface, parameter reception and storage, parameter setting for the gate visualization positioning scenario, parameter verification and restrictions, parameter setting interface, parameter application and algorithm invocation; The system log management module is configured to collect, store, and manage log information of events and activities occurring in the system.

[0054] The system log management module, a key component of the system architecture, bears the responsibility of collecting, storing, and managing event and activity logs within the system. This module aims to provide a comprehensive and reliable log recording and analysis solution to support core tasks such as system monitoring and troubleshooting. This system log management function will be integrated into the high-rise factory gate positioning management system, responsible for collecting and processing log events from these subsystems, including recording, storing, querying, and analyzing them. It will provide a standardized log interface for all subsystems to access, ensuring consistency in log recording and management methods. Simultaneously, the module automatically adds a timestamp to each event for accurate tracking of its occurrence time. Furthermore, it supports outputting log information to various targets, such as the console, log files, databases, or remote log servers. To effectively control the size and number of log files, the module also features log rotation, which segments and archives log files based on time intervals or file size limits. The system log management module will cover the following core functions: log recording, log storage, log querying and filtering, and log backup and recovery.

[0055] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the monitoring and early warning method for the factory gate as described above.

[0056] The memory can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage devices, dynamic storage devices, etc. The memory can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory and executed by the processor. The processor can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0057] The present invention also provides a computer-readable storage medium storing computer instructions for causing the computer to execute the monitoring and early warning method for the factory gate as described above.

[0058] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for monitoring and early warning of factory gates, characterized in that, Includes the following steps: Step S1: Obtain a real-time rotating image of the factory gate, and extract the gradient information of the real-time rotating image through grayscale conversion, Gaussian filtering and Sobel operator processing. Step S2: Apply nonmaximum suppression to refine edge features; Step S3: Obtain the edge information of the factory gate; Step S4: Perform line detection processing on the real-time rotating image to obtain line detection results, and filter the line detection results based on the edge information of the factory gate to obtain the target line detection results; Step S5: Determine the opening angle information of the factory gate based on the target line detection results, and visualize the opening angle information and / or the target line detection results. Step S6: In response to the factory gate opening angle information reaching the preset opening angle threshold, control the factory gate to be stationary and issue an early warning for the factory gate opening angle information.

2. The monitoring and early warning method for factory gates according to claim 1, characterized in that, Step S1 specifically includes: Step S101: Obtain a real-time rotating image of the factory gate; Step S102: Perform grayscale conversion processing on the real-time rotating image to obtain a grayscale image; Step S103: Perform Gaussian filtering on the grayscale image to obtain a smoothed grayscale image; Step S104: The smoothed grayscale image is processed using the Sobel operator to determine the gradient information of each pixel position in the smoothed grayscale image, wherein the gradient information includes gradient value and gradient direction. Step S105: Based on the gradient information of each pixel position in the smoothed grayscale image, determine the gradient value of the center pixel position corresponding to the gradient direction in the smoothed grayscale image.

3. The monitoring and early warning method for factory gates according to claim 2, characterized in that, Step S2 specifically includes: Step 201: Compare the gradient value of each pixel position corresponding to the gradient direction with the gradient value of the center pixel position corresponding to the gradient direction to obtain the comparison result. Step 202: Based on the comparison results, select the gradient values ​​of the first target pixel position that are less than or equal to the gradient value of the center pixel position from the gradient values ​​of each pixel position, and retain the gradient values ​​of the first target pixel position. Step 203: Based on the comparison results, select the gradient values ​​of the second target pixel positions that are greater than the gradient value of the center pixel position from the gradient values ​​of each pixel position, set the gradient value of the second target pixel position to zero, and combine the first target pixel position that retains the gradient value and the second target pixel position that has been set to zero to obtain the image after non-maximum suppression.

4. The monitoring and early warning method for factory gates according to claim 3, characterized in that, Step S3 specifically includes: Step 301: The pixel positions in the image after non-maximum suppression where the gradient value is less than a preset first threshold are taken as first type edges; Step 302: The pixel positions in the image after non-maximum suppression where the gradient value is greater than or equal to a preset first threshold and less than or equal to a preset second threshold are designated as second-type edges. Step 303: The pixel positions in the image after non-maximum suppression where the gradient value is greater than a preset second threshold are taken as third-type edges; Step 304: Remove the first type of edge and connect the second type of edge and the third type of edge to obtain the edge information of the factory gate.

5. The monitoring and early warning method for factory gates according to claim 4, characterized in that, Step S4 specifically includes: Step S401: Determine the image space where the real-time rotating image is located, and map the real-time rotating image in the image space to the parameter space; Step S402: Calculate the cumulative value of edge points passing through preset positions in the real-time rotating image in the parameter space; Step S403: Combine the edge points whose cumulative value is greater than the preset cumulative value threshold as the line detection result; Step S404: Determine the line detection results that do not match the edge information of the factory gate in the line detection results; Step S405: Remove the line detection results that do not match the edge information of the factory gate from the line detection results to obtain the target line detection results. The target line detection results include the first target line and the second target line.

6. The monitoring and early warning method for factory gates according to claim 5, characterized in that, Step S5, which involves determining the opening angle information of the factory gate based on the target straight-line detection results, specifically includes: Step S501: Determine the first slope value corresponding to the first target line, and determine the second slope value corresponding to the second target line; Step S502: Based on the first slope value and the second slope value, perform tangent value calculation to obtain the tangent value; Step S503: Perform arctangent processing on the tangent value to obtain the opening angle information of the factory gate.

7. The monitoring and early warning method for factory gates according to claim 6, characterized in that, Step S5, which involves determining the opening angle information of the factory gate based on the target straight-line detection results, specifically includes: Step S501: Obtain the first encoding information corresponding to the first target line and the second encoding information corresponding to the second target line; Step S502: Search for the first rotation angle information corresponding to the first encoding information from the preset rotation angle database, and search for the second rotation angle information corresponding to the second encoding information from the preset rotation angle database, wherein the rotation angle database includes multiple rotation angle information corresponding to different encoding information; Step S503: The opening angle information of the factory gate is obtained by subtracting the first rotation angle information and the second rotation angle.

8. A monitoring and early warning system for factory gates, characterized in that, A monitoring and early warning method for implementing factory gates as described in any one of claims 1-7 includes: The gradient information acquisition unit includes: The acquisition module is configured to acquire real-time rotating images of the factory gate; The grayscale conversion module is configured to perform grayscale conversion processing on the real-time rotating image to obtain a grayscale image; The smoothing module is configured to perform Gaussian filtering on the grayscale image to obtain a smoothed grayscale image. The gradient information determination module is configured to process the smoothed grayscale image using the Sobel operator to determine the gradient information of each pixel position in the smoothed grayscale image, wherein the gradient information includes gradient value and gradient direction. The gradient value determination module is configured to determine the gradient value of the center pixel position corresponding to the gradient direction in the smoothed grayscale image based on the gradient information of each pixel position in the smoothed grayscale image. Non-maximum suppression unit, including: The comparison module is configured to compare the gradient value of each pixel position corresponding to the gradient direction with the gradient value of the center pixel position corresponding to the gradient direction to obtain a comparison result. The retention module is configured to, based on the comparison result, filter the gradient values ​​of a first target pixel position that are less than or equal to the gradient value of the center pixel position from the gradient values ​​of each pixel position, and retain the gradient values ​​of the first target pixel position. The combination module is configured to, based on the comparison result, filter the gradient values ​​of the second target pixel positions that are greater than the gradient value of the center pixel position from the gradient values ​​of each pixel position, set the gradient value of the second target pixel position to zero, and combine the first target pixel position with the gradient value retained and the second target pixel position with the gradient value set to zero to obtain an image after non-maximum suppression. Edge information acquisition unit, including: The first type determination module is configured to identify pixel locations in the image after non-maximum suppression where the gradient value is less than a preset first threshold as first type edges. The second type determination module is configured to identify pixel positions in the image after non-maximum suppression where the gradient value is greater than or equal to a preset first threshold and less than or equal to a preset second threshold as second type edges. The third type determination module is configured to identify the pixel positions in the image after non-maximum suppression where the gradient value is greater than a preset second threshold as third type edges. The splicing module is configured to remove the first type of edge and connect the second type of edge and the third type of edge to obtain the edge information of the factory gate; The line detection unit is configured to perform line detection processing on the real-time rotating image to obtain line detection results, and to filter the line detection results based on the edge information of the factory gate to obtain target line detection results; The opening angle determination unit is configured to determine the opening angle information of the factory gate based on the target straight line detection result of the factory gate; The visualization unit is configured to visualize the opening angle information of the factory gate and / or the target line detection result of the factory gate after determining the opening angle information of the factory gate. The control unit is configured to control the factory gate to remain stationary after the opening angle information of the factory gate reaches a preset opening angle threshold. The early warning unit is configured to issue an early warning for the opening angle information of the factory gate after the opening angle information of the factory gate reaches a preset opening angle threshold.

9. The monitoring and early warning system for factory gates according to claim 8, characterized in that, It also includes a positioning assistance unit, including: The image input module is configured to capture images of the gate corner as input via a visual acquisition camera group; The image processing module is configured to convert the input gate corner image into a grayscale image and effectively remove noise; The angle calculation module is configured to perform edge detection on the processed image to obtain the edge information of the gate in the image, detect straight lines in the image and filter them to remove those that do not meet the requirements, and summarize these filtered lines to calculate the angle information. The result image display module is configured to visualize the detected straight lines and the calculated angle information on the original input image and output the processing results. The angle information display module is configured to output detailed information about angle calculations.

10. The monitoring and early warning system for factory gates according to claim 9, characterized in that, It also includes a location management unit, including: The decision information overview module is configured to display the precise location of the factory gate through a visual interface, and generate corresponding images, tables, and monitoring screens on the visual interface to show users auxiliary decision-making information; The facility management module is configured to monitor the operating status of the equipment, manage the online status and health status of the equipment, and maintain the location information and Internet Protocol address information of each online camera, thereby ensuring the stable operation of the upper-layer application system; The visualization positioning algorithm module is configured to provide algorithm interface encapsulation for specific scenarios to other sub-modules in the positioning management unit. The algorithm exists in the form of backend support service and can obtain real-time status information through the algorithm calculation service interface provided by each sub-module. The calculation results management module is configured to centrally manage and analyze the calculation results generated by other sub-modules in the positioning management unit; The early warning information management module is configured to process early warning information generated in various specific scenarios; The original video management module is configured to store, retrieve, export, and clean up real-time image data captured by cameras at various locations, so as to facilitate the reuse of video data and the retrospection of the decision-making process. The parameter configuration management module is configured to configure and manage various parameters in the location management unit. The system log management module is configured to collect, store, and manage log information of events and activities occurring in the system.