Conveyor belt electronic fence detection method, device and equipment and storage medium

By combining the optical flow segmentation algorithm and edge detection technology, the area of ​​the electronic fence dynamically determines the problem of poor adaptability in the traditional electronic fence system in complex environments, and achieves higher accuracy and robustness.

CN119359689AActive Publication Date: 2025-01-24山东浪潮智能生产技术有限公司

Patent Information

Application Number
CN202411532741.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-01-24
Estimated Expiration
2044-10-30

AI Technical Summary

Technical Problem

When traditional electronic fence systems face the complex and changeable coal mine environment, environmental changes lead to the preset boundary lines not being able to accurately reflect the actual situation, resulting in misjudgment or missed judgments in the fence area.

Method used

The light flow segmentation algorithm and edge detection technology are adopted. By acquiring and preparing image data, the speed vector of the pixel point is calculated, and the position and motion trajectory of the conveyor belt are initially determined, and then the border of the conveyor belt is detected by the edge to dynamically determine the area of ​​the electronic fence.

Benefits of technology

It improves the adaptability and accuracy of the electronic fence system, reduces the situation of error and missed reports, ensures the real -time and robustness of the system, and can work stably in a complex environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119359689A_ABST
    Figure CN119359689A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of coal mine production automation management, and particularly provides a conveyor belt electronic fence detection method, device and equipment and a storage medium, and the method comprises the following steps: obtaining image or video data containing a target area, and carrying out the preprocessing of the obtained data; the target area comprises a conveyor belt; calculating the velocity vector of each pixel point in the image by using an optical flow segmentation algorithm, and preliminarily determining the position and the movement track of the conveyor belt; identifying the boundary of the conveyor belt through an edge detection algorithm based on the preliminarily determined conveyor belt image; and dynamically determining the area of the electronic fence according to the identified boundary of the conveyor belt. By calculating the velocity vector of the pixel point and utilizing the edge detection technology, the method can accurately identify the boundary of the object, the accuracy of the electronic fence area is ensured, and the situations of false alarm and missing alarm are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of coal production automation management, and in particular relates to a conveyor belt electronic fence detection method, device, equipment and storage medium. Background Art

[0002] In the daily operation of coal mines, the main and auxiliary conveyor belts are key transportation facilities, and their safety and order are of vital importance. However, in practice, miners have repeatedly crossed the conveyor belts in violation of regulations, which not only violates the safety production regulations, but also brings potential safety hazards to mining operations.

[0003] In order to effectively curb such illegal behaviors, it is particularly important to introduce an electronic fence system. The system can use advanced image recognition and algorithm analysis capabilities to monitor and warn miners of dangerous behaviors such as approaching or crossing conveyor belts in real time, thereby greatly improving the safety management level of coal mines.

[0004] However, traditional electronic fence technology has also exposed certain limitations during its application, especially when facing the complex and changeable coal mine environment. Specifically, the electronic fence area is determined by preset boundary lines or rules. This method has poor adaptability to environmental changes. Once the environment changes (such as changes in lighting, camera angles, conveyor belt shutdowns and maintenance, etc.), the preset boundary lines may not accurately reflect the actual situation, resulting in misjudgment or omission of the fence area. Summary of the invention

[0005] In view of the poor adaptability of traditional electronic fence systems to environmental changes, once the environment changes, the preset boundary line may not accurately reflect the actual situation, resulting in misjudgment or omission of the fence area. The present invention provides a conveyor belt electronic fence detection method, device, equipment and storage medium.

[0006] In a first aspect, the technical solution of the present invention provides a conveyor belt electronic fence detection method, comprising the following steps: Acquire image or video data containing a target area and pre-process the acquired data; the target area includes a conveyor belt; The optical flow segmentation algorithm is used to calculate the velocity vector of each pixel in the image, and the position and motion trajectory of the conveyor belt are preliminarily determined; Based on the initially determined conveyor belt image, the boundary of the conveyor belt is identified by an edge detection algorithm; The area of ​​the electronic fence is dynamically determined based on the identified boundaries of the conveyor belt.

[0007] As a preferred embodiment of the technical solution of the present invention, the step of acquiring image or video data containing the target area and preprocessing the acquired data includes: Acquire image or video data containing the target area; The acquired data is denoised using mean filtering; The denoised data is converted into a grayscale image using the weighted average method.

[0008] As a preferred embodiment of the technical solution of the present invention, the step of denoising the acquired data by using a mean filter includes: Set the search neighborhood. For the pixel with coordinates (i, j) in the image, calculate the weighted average g(i, j) of the pixels in its neighborhood to get the new pixel value. The new pixel value is used to replace the value of the pixel at coordinate (i, j) in the image.

[0009] in, , The coordinates in the original image are The pixel value of , N is the neighborhood, and m is the number of pixels in the neighborhood.

[0010] As a preferred embodiment of the technical solution of the present invention, the steps of calculating the velocity vector of each pixel in the image by using the optical flow segmentation algorithm and preliminarily determining the position and motion trajectory of the conveyor belt include: The optical flow segmentation algorithm is used to calculate the velocity vector of each pixel in the image to form the image motion field; By comparing the velocity vector difference between the conveyor belt area and the background area, the position and movement trajectory of the conveyor belt are preliminarily determined for each pixel, and the moving conveyor belt is segmented from the background.

[0011] As a preferred embodiment of the technical solution of the present invention, by comparing the velocity vector difference between the conveyor belt area and the background area, the position and motion trajectory of the conveyor belt are preliminarily determined for each pixel point, and the step of segmenting the moving conveyor belt from the background includes: If the velocity vector component in the direction of conveyor belt movement is greater than the set value and the difference with the velocity vector of the background area exceeds the difference threshold, or the angle between the pixel velocity vector and the known conveyor belt movement direction is within the set range and the velocity vector size meets the preset value, the position and movement trajectory of the conveyor belt are preliminarily determined, and the moving conveyor belt is segmented from the background.

[0012] As a preferred embodiment of the technical solution of the present invention, the step of identifying the boundary of the conveyor belt by using an edge detection algorithm based on the initially determined conveyor belt image includes: Set the high and low thresholds for edge detection; In this step, an initial threshold is set, a gradient operator of the image is calculated, a gradient image is obtained, and the gradient image is binary processed using the initial threshold to generate a binary image as a mask template; When the pixel value in the binary image is 1, the pixel at the corresponding position in the image is found as a valid pixel, and the histogram distribution is calculated. The threshold calculated by the Otsu algorithm is set as a high threshold using the histogram distribution, and half of the high threshold is set as a low threshold.

[0013] Calculate the grayscale gradient amplitude and direction of the initially determined conveyor belt image; Determine whether the gradient amplitude of a certain pixel is the maximum value in the same gradient direction around it; If not, set the gray value of the pixel to zero; If yes, keep the pixel as a candidate edge point; Determine whether the grayscale gradient amplitude of the candidate edge point is higher than the high threshold; If so, determine that the candidate edge point is a conveyor belt edge point; If not, determine whether the grayscale gradient amplitude of the candidate edge point is lower than the low threshold; If so, discard the candidate edge point; Otherwise, determine whether there are other pixel points with grayscale gradient higher than the high threshold in the set area of ​​the candidate edge point; If it exists, keep the candidate edge point, otherwise delete it.

[0014] As a preferred embodiment of the technical solution of the present invention, the step of calculating the grayscale gradient amplitude and direction of the initially determined conveyor belt image includes: Set the gradient calculation templates in the horizontal, vertical, 45° and 135° directions respectively; The initially determined conveyor belt image is convolved with the gradient calculation template to obtain the horizontal gradient component , vertical gradient component , 45° directional gradient component and 135° directional gradient component ; The horizontal gradient component , vertical gradient component , 45° directional gradient component and 135° directional gradient component The horizontal gradient amplitude is synthesized and the vertical gradient amplitude ;

[0015] ; Based on the horizontal gradient amplitude and the vertical gradient amplitude Calculate the grayscale gradient amplitude and direction ; , .

[0016] In a second aspect, the technical solution of the present invention provides a conveyor belt electronic fence detection device, including a preprocessing module, an optical flow calculation module, a boundary calculation module and an electronic fence area determination module; A preprocessing module, used for acquiring image or video data including a target area and preprocessing the acquired data; the target area includes a conveyor belt; The optical flow calculation module is used to calculate the velocity vector of each pixel in the image using the optical flow segmentation algorithm to preliminarily determine the position and motion trajectory of the conveyor belt; A boundary calculation module, used to identify the boundary of the conveyor belt through an edge detection algorithm based on the initially determined conveyor belt image; The electronic fence area determination module is used to dynamically determine the area of ​​the electronic fence based on the identified boundary of the conveyor belt.

[0017] As a preferred embodiment of the technical solution of the present invention, the preprocessing module includes a data acquisition unit, a filtering unit and a grayscale conversion unit; An acquisition unit, used for acquiring image or video data containing a target area; A filtering unit, used for performing denoising processing on the acquired data using a mean filtering algorithm; The grayscale conversion unit is used to convert the color image into a grayscale image by using the weighted average method to remove the noise.

[0018] As a preferred embodiment of the technical solution of the present invention, the filtering unit is specifically used to set a search neighborhood. For a pixel with coordinates (i, j) in the image, a new pixel value is obtained by calculating the weighted average g(i, j) of the pixels in its neighborhood; and the value of the pixel with coordinates (i, j) in the image is replaced by the obtained new pixel value.

[0019] in, , The coordinates in the original image are The pixel value of , N is the neighborhood, and m is the number of pixels in the neighborhood.

[0020] As a preferred embodiment of the technical solution of the present invention, the optical flow calculation module is specifically used to calculate the velocity vector of each pixel in the image using the optical flow segmentation algorithm to form an image motion field; by comparing the velocity vector difference between the conveyor belt area and the background area, the position and motion trajectory of the conveyor belt are preliminarily determined for each pixel, and the moving conveyor belt is segmented from the background; if the velocity vector component in the direction of motion of the conveyor belt is greater than the set value and the difference with the velocity vector of the background area exceeds the difference threshold, or the angle between the pixel velocity vector and the known conveyor belt motion direction is within the set range and the velocity vector size meets the preset value, the position and motion trajectory of the conveyor belt are preliminarily determined, and the moving conveyor belt is segmented from the background.

[0021] As a preferred embodiment of the technical solution of the present invention, the boundary calculation module includes a threshold setting unit, a first calculation unit and an edge judgment unit; A threshold setting unit, used to set a high threshold and a low threshold for edge detection; In this step, an initial threshold is set, a gradient operator of the image is calculated, a gradient image is obtained, and the gradient image is binary processed using the initial threshold to generate a binary image as a mask template; When the pixel value in the binary image is 1, the pixel at the corresponding position in the image is found as a valid pixel, and the histogram distribution is calculated. The threshold calculated by the Otsu algorithm is set as a high threshold using the histogram distribution, and half of the high threshold is set as a low threshold.

[0022] A first calculation unit, used for calculating the gray gradient amplitude and direction of the conveyor belt image after preliminary determination; The edge judgment unit is used to judge whether the gradient amplitude of a certain pixel point is the maximum value in the same gradient direction of the surrounding points; if not, the grayscale value of the pixel point is set to zero; if so, the pixel point is retained as a candidate edge point; it is judged whether the grayscale gradient amplitude of the candidate edge point is higher than a high threshold; if so, the candidate edge point is determined to be a conveyor belt edge point; if not, it is judged whether the grayscale gradient amplitude of the candidate edge point is lower than a low threshold; if so, the candidate edge point is discarded; otherwise, it is judged whether there are other pixels with grayscale gradients higher than the high threshold within the set area of ​​the candidate edge point; if so, the candidate edge point is retained, otherwise the candidate edge point is deleted.

[0023] As a preferred embodiment of the technical solution of the present invention, the first calculation unit is specifically used to set the gradient calculation templates in the horizontal, vertical, 45° and 135° directions respectively; the initially determined conveyor belt image is convolved with the gradient calculation template to obtain the horizontal gradient component , vertical gradient component , 45° directional gradient component and 135° directional gradient component ; The horizontal gradient component , vertical gradient component , 45° directional gradient component and 135° directional gradient component The horizontal gradient amplitude is synthesized and the vertical gradient amplitude ; Based on the horizontal gradient amplitude and the vertical gradient amplitude Calculate the grayscale gradient amplitude and direction ; ; ; , .

[0024] In a third aspect, the technical solution of the present invention also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; the memory stores computer program instructions executable by the at least one processor, and the computer program instructions are executed by the at least one processor so that the at least one processor can execute the conveyor belt electronic fence detection method as described in the first aspect.

[0025] In a fourth aspect, the technical solution of the present invention further provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions enable the computer to execute the conveyor belt electronic fence detection method as described in the first aspect.

[0026] It can be seen from the above technical solutions that the present invention has the following advantages: the optical flow method plus edge detection can automatically adapt to changes in the environment without manual intervention or preset rules, thereby improving the flexibility and reliability of the electronic fence system. By calculating the velocity vector of the pixel point and utilizing edge detection technology, the method can accurately identify the boundary of the object, ensure the accuracy of the electronic fence area, and reduce false positives and negative positives. The optical flow method plus edge detection has a high computational efficiency, reduces the computing power required to detect belt movement, can process a large amount of image data in a short time, realize real-time tracking and detection, and ensure the timely response of the electronic fence system. The method has strong robustness to noise and interference, can work stably in a complex environment, and improves the stability and reliability of the electronic fence system.

[0027] By introducing the optical flow segmentation algorithm, the present invention can dynamically capture the motion information of objects in the image, form an accurate motion field, and combine edge detection technology to automatically identify and track the boundaries of objects, thereby dynamically determining the area of ​​the electronic fence. This method not only improves the adaptability and accuracy of the electronic fence system, but also ensures the real-time and robustness of the system. The algorithm itself is implemented based on a moving conveyor belt, eliminating the need for the traditional algorithm to add an algorithm to detect whether the conveyor belt is moving, thereby reducing computing power consumption and providing a more efficient, safe and reliable electronic fence solution for industrial automation, video surveillance and other fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0029] Figure 1 is a schematic flow chart of a method according to an embodiment of the present invention.

[0030] Figure 2 is a schematic block diagram of an apparatus according to an embodiment of the present invention. DETAILED DESCRIPTION

[0031] Traditional electronic fence technology also reveals certain limitations during its application, especially in the complex and changing coal mine environment: In coal mining environments, cameras may shift due to physical vibration, dust coverage or human factors, resulting in misalignment of the electronic fence area. This may cause the AI ​​monitoring of the conveyor belt area to fail, increasing safety risks. In low-light environments, traditional electronic fence systems may not be able to accurately identify targets and backgrounds due to reduced image quality, resulting in frequent false alarms (such as misjudging normal miners as intruders) and missed alarms (such as failing to detect real illegal crossing behaviors in time). This not only disrupts normal production order, but may also weaken the effectiveness of the safety warning system.

[0032] Camera offset and light changes may also cause originally safe areas (such as corridors next to conveyor belts) to be mistakenly included in the electronic fence, causing unnecessary intrusion alarms, further reducing system availability and user trust.

[0033] The present application is the application of optical flow method plus edge detection in the field of electronic fences, which solves the problem that traditional electronic fences have poor adaptability to environmental changes, and has the advantages of strong adaptability, high accuracy, good real-time performance and strong robustness, etc., providing a safer, more reliable and efficient electronic fence solution for the fields of industrial automation and video surveillance. In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of the present invention.

[0034] like Figure 1 As shown, an embodiment of the present invention provides a conveyor belt electronic fence detection method, comprising the following steps: Step 1: Acquire image or video data containing a target area and pre-process the acquired data; the target area includes a conveyor belt; Specifically comprising: Step 11: acquiring image or video data containing the target area; Using Python programming technology, access the video surveillance system or directly connect the camera using the national standard platform to obtain image or video data containing the target area; the target area includes a conveyor belt; Step 12: Use mean filtering to denoise the acquired data; In this step, the average value of the neighboring pixels is used to replace the current pixel value, so as to achieve the purpose of smoothing the image and removing noise. Specifically include: Set the search neighborhood. For the pixel with coordinates (i, j) in the image, calculate the weighted average g(i, j) of the pixels in its neighborhood to get the new pixel value. The new pixel value is used to replace the value of the pixel at coordinate (i, j) in the image.

[0035] in, , The coordinates in the original image are The pixel value of , N is the neighborhood, and m is the number of pixels in the neighborhood.

[0036] Step 13: Use the weighted average method to convert the denoised data into a grayscale image.

[0037] According to the different sensitivities of the human eye to different colors, different weights are assigned to the three RGB channels to convert the color image into a grayscale image.

[0038] Mathematical formula: , where R, G, and B are the red, green, and blue channel values ​​of the pixels in the color image, respectively. is the pixel value after grayscale conversion.

[0039] Step 2: Use the optical flow segmentation algorithm to calculate the velocity vector of each pixel in the image and preliminarily determine the position and motion trajectory of the conveyor belt; This step specifically includes: Step 21: Calculate the velocity vector of each pixel in the image using the optical flow segmentation algorithm to form an image motion field; Step 22: By comparing the speed vector difference between the conveyor belt area and the background area, the position and movement trajectory of the conveyor belt are preliminarily determined for each pixel point, and the moving conveyor belt is segmented from the background. Specifically, if the speed vector component in the direction of movement of the conveyor belt is greater than the set value and the speed vector difference with the background area exceeds the difference threshold, or the angle between the speed vector of the pixel point and the known direction of movement of the conveyor belt is within the set range and the speed vector size meets the preset value, the position and movement trajectory of the conveyor belt are preliminarily determined, and the moving conveyor belt is segmented from the background.

[0040] The optical flow segmentation algorithm is used to calculate the velocity vector of each pixel in the image to form the image motion field. By comparing the velocity vector difference between the belt area and the background area, the position and motion trajectory of the belt can be preliminarily determined. Optical flow segmentation algorithm: Assume that two consecutive image frames are and ,In practical applications, it is generally assumed that the pixel value is constant in a very short time, that is: . Two-dimensional time domain model; Using Taylor series expansion ; After sorting, we get ,in addition , , optical flow equation ,in is the velocity vector of the pixel, represents the gradient of the image in the x direction, represents the gradient of the image in the y direction, Indicates the rate of change of the image over time. 4. The image motion field is formed by calculating the velocity vector of each pixel in the image. Each pixel is judged based on the conditions that the velocity vector component in the belt movement direction is large and the difference with the background area velocity vector exceeds the threshold, or the angle between the pixel velocity vector and the known belt movement direction is within a certain range and the velocity vector size meets expectations, so as to segment the moving conveyor belt from the background.

[0041] Step 3: Based on the initially determined conveyor belt image, the boundary of the conveyor belt is identified by an edge detection algorithm; On the basis of optical flow segmentation, edge detection technology (such as Canny edge detection, Sobel operator and other mature algorithms) is applied to identify the precise boundary of the belt. By combining the results of optical flow segmentation and edge detection, the belt can be accurately segmented.

[0042] Step 4: Based on the identified conveyor belt boundary, dynamically determine the area of ​​the electronic fence.

[0043] In some embodiments, the step of identifying the boundary of the conveyor belt by using an edge detection algorithm based on the initially determined conveyor belt image includes: Step 31: Set the high threshold and low threshold of edge detection; Step 32: Calculate the grayscale gradient amplitude and direction of the initially determined conveyor belt image; Step 33: Determine whether the gradient amplitude of a certain pixel point is the maximum value in the same gradient direction around it; If not, go to step 34; if yes, go to step 35; Step 34: Set the gray value of the pixel to zero; Step 35: retain the pixel point as a candidate edge point; and execute step 36; Step 36: Determine whether the grayscale gradient amplitude of the candidate edge point is higher than the high threshold; If yes, go to step 37; if no, go to step 38; Step 37: Determine that the candidate edge point is a transmission belt edge point; Step 38: Determine whether the grayscale gradient amplitude of the candidate edge point is lower than a low threshold; If yes, go to step 39; otherwise, go to step 40; Step 39: discard the candidate edge point; Step 40: Determine whether there are other pixel points with grayscale gradient higher than the high threshold in the set area of ​​the candidate edge point; If it exists, go to step 41; otherwise, go to step 42; Step 41: retain candidate edge points; Step 42: Delete the candidate edge point.

[0044] In some embodiments, the step of calculating the grayscale gradient amplitude and direction of the initially determined conveyor belt image includes: Step 321: setting gradient calculation templates in the horizontal, vertical, 45° and 135° directions respectively; Step 322: Perform convolution operations on the initially determined conveyor belt image and the gradient calculation template to obtain horizontal gradient components. , vertical gradient component , 45° directional gradient component and 135° directional gradient component ; Step 323: Convert the horizontal gradient component , vertical gradient component , 45° directional gradient component and 135° directional gradient component The horizontal gradient amplitude is synthesized and the vertical gradient amplitude ;

[0045] ; Step 324: Based on the horizontal gradient amplitude and the vertical gradient amplitude Calculate the grayscale gradient amplitude and direction ; , .

[0046] In some embodiments, the step of setting a high threshold and a low threshold for edge detection includes: In this step, an initial threshold is set, a gradient operator of the image is calculated, a gradient image is obtained, and the gradient image is binary processed using the initial threshold to generate a binary image as a mask template; When the pixel value in the binary image is 1, the pixel at the corresponding position in the image is found as a valid pixel, and the histogram distribution is calculated. The threshold calculated by the Otsu algorithm is set as a high threshold using the histogram distribution, and half of the high threshold is set as a low threshold.

[0047] In some embodiments, the electronic fence system designed by the method described in the above embodiments is connected to a video surveillance system or an industrial automation system to realize real-time monitoring and early warning functions. When a person appears in the conveyor belt fence area, the system can automatically send out an early warning signal to remind the operator to take corresponding measures. The prediction results, monitoring data and other information of the electronic fence system are stored in a database for enterprise business call and analysis. Through data analysis, it is possible to further understand the movement law of the belt, optimize the production process, etc.

[0048] By combining optical flow segmentation technology and edge detection technology, these problems of traditional electronic fences have been significantly solved. Optical flow segmentation technology can automatically identify and segment the conveyor belt area without fixing the camera angle or manually drawing the area, and can adjust the electronic fence in real time to adapt to the changes of the camera. Edge detection technology further enhances the recognition ability of the conveyor belt and the surrounding environment, especially in poor lighting conditions. By detecting the edge features of the object, the conveyor belt and the person can be accurately distinguished, improving the recognition accuracy and robustness of the system.

[0049] Combining these two technologies, the present invention not only improves the reliability and accuracy of the system, but also significantly reduces manual intervention and maintenance costs. Optical flow segmentation technology ensures real-time adjustment and accuracy of the electronic fence area, while edge detection technology enhances recognition capabilities under complex lighting conditions. The combination of these two technologies provides a safer, more efficient and more accurate solution for the safety monitoring of mine conveyor belts.

[0050] like Figure 2 As shown, an embodiment of the present invention provides a conveyor belt electronic fence detection device, including a preprocessing module, an optical flow calculation module, a boundary calculation module and an electronic fence area determination module; A preprocessing module, used for acquiring image or video data including a target area and preprocessing the acquired data; the target area includes a conveyor belt; The optical flow calculation module is used to calculate the velocity vector of each pixel in the image using the optical flow segmentation algorithm to preliminarily determine the position and motion trajectory of the conveyor belt; A boundary calculation module, used to identify the boundary of the conveyor belt through an edge detection algorithm based on the initially determined conveyor belt image; The electronic fence area determination module is used to dynamically determine the area of ​​the electronic fence based on the identified boundary of the conveyor belt.

[0051] In some embodiments, the preprocessing module includes a data acquisition unit, a filtering unit, and a grayscale conversion unit; An acquisition unit, used for acquiring image or video data containing a target area; A filtering unit, used for performing denoising processing on the acquired data using a mean filtering algorithm; The grayscale conversion unit is used to convert the color image into a grayscale image by using the weighted average method to remove the noise.

[0052] In some embodiments, the filtering unit is specifically used to set a search neighborhood. For a pixel with coordinates (i, j) in the image, a new pixel value is obtained by calculating the weighted average g(i, j) of the pixels in its neighborhood; and the obtained new pixel value replaces the value of the pixel with coordinates (i, j) in the image.

[0053] in, , The coordinates in the original image are The pixel value of , N is the neighborhood, and m is the number of pixels in the neighborhood.

[0054] In some embodiments, the optical flow calculation module is specifically used to calculate the velocity vector of each pixel in the image using an optical flow segmentation algorithm to form an image motion field; by comparing the velocity vector difference between the conveyor belt area and the background area, the position and motion trajectory of the conveyor belt are preliminarily determined for each pixel, and the moving conveyor belt is segmented from the background; if the velocity vector component in the conveyor belt movement direction is greater than a set value and the difference with the background area velocity vector exceeds a difference threshold, or the angle between the pixel velocity vector and the known conveyor belt movement direction is within a set range and the velocity vector size meets the preset value, the position and motion trajectory of the conveyor belt are preliminarily determined, and the moving conveyor belt is segmented from the background.

[0055] In some embodiments, the boundary calculation module includes a threshold setting unit, a first calculation unit, and an edge determination unit; A threshold setting unit, used to set a high threshold and a low threshold for edge detection; A first calculation unit, used for calculating the gray gradient amplitude and direction of the conveyor belt image after preliminary determination; The edge judgment unit is used to judge whether the gradient amplitude of a certain pixel point is the maximum value in the same gradient direction of the surrounding points; if not, the grayscale value of the pixel point is set to zero; if so, the pixel point is retained as a candidate edge point; it is judged whether the grayscale gradient amplitude of the candidate edge point is higher than a high threshold; if so, the candidate edge point is determined to be a conveyor belt edge point; if not, it is judged whether the grayscale gradient amplitude of the candidate edge point is lower than a low threshold; if so, the candidate edge point is discarded; otherwise, it is judged whether there are other pixels with grayscale gradients higher than the high threshold within the set area of ​​the candidate edge point; if so, the candidate edge point is retained, otherwise the candidate edge point is deleted.

[0056] In some embodiments, the first calculation unit is specifically used to set the gradient calculation templates in the horizontal, vertical, 45° and 135° directions respectively; convolve the initially determined conveyor belt image with the gradient calculation template to obtain the horizontal gradient component , vertical gradient component , 45° directional gradient component and 135° directional gradient component ; The horizontal gradient component , vertical gradient component , 45° directional gradient component and 135° directional gradient component The horizontal gradient amplitude is synthesized and the vertical gradient amplitude ; Based on the horizontal gradient amplitude and the vertical gradient amplitude Calculate the grayscale gradient amplitude and direction ; ; ; , .

[0057] An embodiment of the present invention also provides an electronic device, the electronic device comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus. The communication bus can be used for information transmission between the electronic device and the sensor. The processor can call the logic instructions in the memory to execute the following method: Step 1: Acquire image or video data containing a target area and pre-process the acquired data; the target area includes a conveyor belt; Step 2: Calculate the velocity vector of each pixel in the image using an optical flow segmentation algorithm to preliminarily determine the position and motion trajectory of the conveyor belt; Step 3: Based on the preliminarily determined conveyor belt image, identify the boundary of the conveyor belt through an edge detection algorithm; Step 4: Dynamically determine the area of ​​the electronic fence based on the identified boundary of the conveyor belt.

[0058] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.

[0059] An embodiment of the present invention provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions enable a computer to execute the method provided by the above method embodiment, for example, including: Step 1: Acquire image or video data containing a target area and preprocess the acquired data; the target area includes a conveyor belt; Step 2: Use an optical flow segmentation algorithm to calculate the velocity vector of each pixel in the image, and preliminarily determine the position and motion trajectory of the conveyor belt; Step 3: Based on the preliminarily determined conveyor belt image, identify the boundary of the conveyor belt through an edge detection algorithm; Step 4: Dynamically determine the area of ​​the electronic fence based on the identified boundary of the conveyor belt.

[0060] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0061] An embodiment of a conveyor belt electronic fence detection device provided in an embodiment of the present invention belongs to the same inventive concept as the conveyor belt electronic fence detection method of the above-mentioned embodiments. For details not described in detail in the embodiment of the conveyor belt electronic fence detection device, reference can be made to the embodiment of the above-mentioned conveyor belt electronic fence detection method.

[0062] Although the present invention has been described in detail with reference to the accompanying drawings and in combination with the preferred embodiments, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, a person of ordinary skill in the art may make various equivalent modifications or substitutions to the embodiments of the present invention, and these modifications or substitutions shall be within the scope of the present invention. Any person of ordinary skill in the art may easily think of changes or substitutions within the technical scope disclosed by the present invention, and these shall be within the scope of protection of the present invention.

Claims

1. A conveyor belt electronic fence detection method, characterized in that: The steps include: Acquire image or video data containing a target area and pre-process the acquired data; the target area includes a conveyor belt; The optical flow segmentation algorithm is used to calculate the velocity vector of each pixel in the image, and the position and motion trajectory of the conveyor belt are preliminarily determined; Based on the initially determined conveyor belt image, the boundary of the conveyor belt is identified by an edge detection algorithm; The area of ​​the electronic fence is dynamically determined based on the identified boundaries of the conveyor belt.

2. The conveyor belt electronic fence detection method according to claim 1, characterized in that: The steps of acquiring image or video data containing the target area and preprocessing the acquired data include: Acquire image or video data containing the target area; The acquired data is denoised using mean filtering; The denoised data is converted into a grayscale image using the weighted average method.

3. The conveyor belt electronic fence detection method according to claim 2, characterized in that: The steps of denoising the acquired data using mean filtering include: Set the search neighborhood. For the pixel with coordinates (i, j) in the image, calculate the weighted average g(i, j) of the pixels in its neighborhood to get the new pixel value. The obtained new pixel value replaces the value of the pixel with coordinates (i, j) in the image; in, , The coordinates in the original image are The pixel value of , N is the neighborhood, and m is the number of pixels in the neighborhood.

4. The conveyor belt electronic fence detection method according to claim 3, characterized in that: The steps of using the optical flow segmentation algorithm to calculate the velocity vector of each pixel in the image and preliminarily determine the position and motion trajectory of the conveyor belt include: The optical flow segmentation algorithm is used to calculate the velocity vector of each pixel in the image to form the image motion field; By comparing the velocity vector difference between the conveyor belt area and the background area, the position and movement trajectory of the conveyor belt are preliminarily determined for each pixel, and the moving conveyor belt is segmented from the background.

5. The conveyor belt electronic fence detection method according to claim 4, characterized in that: By comparing the velocity vector difference between the conveyor belt area and the background area, the position and motion trajectory of the conveyor belt are preliminarily determined for each pixel point. The steps of segmenting the moving conveyor belt from the background include: If the velocity vector component in the direction of conveyor belt movement is greater than the set value and the difference with the velocity vector of the background area exceeds the difference threshold, or the angle between the pixel velocity vector and the known conveyor belt movement direction is within the set range and the velocity vector size meets the preset value, the position and movement trajectory of the conveyor belt are preliminarily determined, and the moving conveyor belt is segmented from the background.

6. The conveyor belt electronic fence detection method according to claim 5, characterized in that: The steps of identifying the boundary of the conveyor belt by using an edge detection algorithm based on the initially determined conveyor belt image include: Set the high and low thresholds for edge detection; Calculate the grayscale gradient amplitude and direction of the initially determined conveyor belt image; Determine whether the gradient amplitude of a certain pixel point is the maximum value in the same gradient direction around it; If not, set the gray value of the pixel to zero; If yes, keep the pixel as a candidate edge point; Determine whether the grayscale gradient amplitude of the candidate edge point is higher than the high threshold; If so, determine that the candidate edge point is a conveyor belt edge point; If not, determine whether the grayscale gradient amplitude of the candidate edge point is lower than the low threshold; If so, discard the candidate edge point; Otherwise, determine whether there are other pixel points with grayscale gradient higher than the high threshold in the set area of ​​the candidate edge point; If it exists, keep the candidate edge point, otherwise delete it.

7. The conveyor belt electronic fence detection method according to claim 6, characterized in that: The steps of calculating the grayscale gradient amplitude and direction of the initially determined conveyor belt image include: Set the gradient calculation templates in the horizontal, vertical, 45° and 135° directions respectively; The initially determined conveyor belt image is convolved with the gradient calculation template to obtain the horizontal gradient component , vertical gradient component , 45° directional gradient component and 135° directional gradient component ; The horizontal gradient component , vertical gradient component , 45° directional gradient component and 135° directional gradient component The horizontal gradient amplitude is synthesized and the vertical gradient amplitude ; Based on the horizontal gradient amplitude and the vertical gradient amplitude Calculate the grayscale gradient amplitude and direction ; in, ; ; , 。 8. A conveyor belt electronic fence detection device, characterized in that: It includes a pre-processing module, an optical flow calculation module, a boundary calculation module and an electronic fence area determination module; A preprocessing module, used for acquiring image or video data containing a target area and preprocessing the acquired data; The target area includes a conveyor belt; The optical flow calculation module is used to calculate the velocity vector of each pixel in the image using the optical flow segmentation algorithm to preliminarily determine the position and motion trajectory of the conveyor belt; A boundary calculation module, used to identify the boundary of the conveyor belt through an edge detection algorithm based on the initially determined conveyor belt image; The electronic fence area determination module is used to dynamically determine the area of ​​the electronic fence based on the identified boundary of the conveyor belt.

9. An electronic device, characterized in that: The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; the memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor so that the at least one processor can execute the conveyor belt electronic fence detection method as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions enable the computer to execute the conveyor belt electronic fence detection method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Conveyor belt material state detection method based on computer vision

    CN110782436A

  • Goods edge detection method and device in hazardous chemical substance warehouse and terminal equipment

    CN111815660A

  • Convolutional neural network-based method and device for judging whether people exist on tobacco leaf purchasing conveyor belt

    CN112926443A

  • Virtual electronic fence system, information processing method, equipment and storage medium

    CN115250420A

  • Recognition method and device for conveyor belt area of backward sliding machine head

    CN116503788A

Cited By

  • Stain identification method and device applied to photovoltaic panel and medium

    CN120495949A