A method and system for detecting pile blockage based on background difference and edge detection
By acquiring image data in real time on the conveyor belt and performing background difference and edge detection, the problem of difficult to improve the robustness and accuracy of stacking blockage detection in the prior art is solved, and more efficient stacking blockage detection is achieved.
Patent Information
- Application Number
- CN202411244974.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-09-06
AI Technical Summary
In the existing conveyor belt stacking material detection based on image detection, detection robustness and accuracy are difficult to improve, and the impact of the on-site environment on detection quality is not considered.
Using a method based on background difference and edge detection, image data is obtained in real time through the camera, grayscale and denoising processing is performed, and the material area is extracted, and the position and area of the external polygon is calculated through the geometric center point. , judge the pile-up condition.
It improves the accuracy and robustness of stacking plugging materials detection, reduces missed inspections, ensures the timeliness of detection results, and maintains high efficiency in different environments.
Smart Images

Figure CN118762012B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pile blockage detection, and in particular to a pile blockage detection method and system based on background difference and edge detection. Background Art
[0002] Conveyor belts are a type of material transport equipment that is widely used in industrial production processes such as metallurgy, chemical industry, mining, and electric power. Blockage refers to the accumulation and blockage of materials that occur during the conveyor belt transmission process. It not only reduces the efficiency of material transmission, but also may damage the conveyor belt and even cause safety accidents. Therefore, timely and effective detection and treatment of blockage problems on conveyor belts is crucial to ensure the normal operation of the production line.
[0003] In the prior art, the methods for detecting the material pile blockage on the conveyor belt are mainly divided into three categories, namely: manual inspection, mechanical inspection, and image detection. Among them, manual inspection refers to the regular inspection of the conveyor belt by staff to find and deal with the material blockage problem. This method is not only inefficient and labor-intensive, but also easily missed due to human factors. Mechanical detection refers to the use of mechanical devices installed on the conveyor belt (such as pile detection rods, pressure sensors, etc.) to monitor the accumulation of materials. Although this method has a high degree of automation, the equipment is easy to wear, the maintenance cost is high, and it cannot be applied in harsh environments. Image detection refers to the use of image processing technology to identify and detect the material pile blockage through a camera installed on the conveyor belt. This non-contact detection method not only does not cause adverse effects on the conveyor belt, but also has the advantages of strong real-time performance and wide adaptability. Based on this, compared with manual inspection and mechanical detection, the image detection method has gradually become the mainstream detection method in the process of conveyor belt pile blockage detection.
[0004] However, the inventors found that in the existing conveyor belt blockage detection process based on image detection, only the universality of the method itself in various scenarios is considered, while the impact of the on-site environment on the detection quality is not considered. For example, the same set of image detection methods are used in a port scenario with a wide field of view and sufficient light and in a mine environment with a narrow environment and dim light. As a result, there are technical defects in the existing conveyor belt blockage detection, which makes it difficult to improve the detection robustness and accuracy. Summary of the invention
[0005] The present invention aims to provide a method and system for detecting material pile blockage based on background difference and edge detection, so as to improve the technical problem that the detection robustness and accuracy of the existing conveyor belt material pile blockage detection cannot be effectively improved.
[0006] To achieve the above object, the present invention proposes the following technical solutions:
[0007] In the first aspect, the technical solution provides a method for detecting pile blockage based on background difference and edge detection. It includes:
[0008] The original image data is acquired in real time based on a camera installed above the conveyor belt discharge port, and the original image data is grayed and denoised to acquire target image data;
[0009] When it is determined that a preset update cycle has been reached, a background model is re-acquired in real time, and background difference processing is performed on the target image data with reference to the background model to extract a material area corresponding to the material;
[0010] The material area is processed based on an edge detection algorithm to sequentially perform non-maximum suppression on each pixel point and edge tracking to obtain a number of original material contours, and the original material contours are screened to obtain a number of material contours whose total pixel value is not less than a preset pixel value threshold;
[0011] Calculate each geometric center point of each material contour, connect the outermost geometric center points in each direction to obtain a circumscribed polygon, and calculate the position coordinates and area of the circumscribed polygon;
[0012] When it is determined that the degree of overlap between the position of the circumscribed polygon and the position of the preset detection frame is not less than a preset position overlap threshold, and the ratio of the area of the circumscribed polygon to the area of the preset detection frame is not less than a preset area ratio threshold, it is confirmed that material blockage has occurred on the conveyor belt.
[0013] Furthermore, when the judgment reaches a preset update cycle, a background model is re-acquired in real time, and background difference processing is performed on the target image data with reference to the background model to extract a material area corresponding to the material; including:
[0014] When the preset update cycle is reached, based on B t =α·B t-1 +(1-α)I' t Get the updated background model; where B t is the updated background model, B t-1 is the background model before updating, I' t is the target image data;
[0015] based on Calculate the difference between the target image data and the updated background model to obtain the original differential image data; wherein, D t is the original differential image data;
[0016] based on The original differential image data is subjected to threshold processing to perform a first denoising process, thereby obtaining intermediate differential image data; wherein T is a threshold value, is the intermediate differential image data;
[0017] based on The intermediate differential image data is subjected to morphological operations to remove continuous fractured regions and perform a second denoising process, thereby obtaining target differential image data; wherein, differential image data of the target;
[0018] A foreground area is extracted from the target differential image data to obtain a material area.
[0019] Furthermore, the material area is processed based on the edge detection algorithm to sequentially suppress non-maximum values of each pixel point and track the edges to obtain a number of original material contours; including:
[0020] based on Obtain the gradient amplitude of each original pixel in the material area, and based on Obtain the gradient direction of each original pixel in the material area; wherein, is the horizontal gradient constant, is the vertical gradient constant; I is the pixel value of the original pixel; and then an original gradient amplitude image is obtained;
[0021] The original gradient magnitude image is subjected to non-maximum suppression processing based on the following formula to obtain a target gradient magnitude image:
[0022] ;
[0023] in, R (x,y) is the pixel value of the pixel at coordinate (x,y) in the target gradient amplitude image. G (x, y) is the pixel value of the pixel at coordinate (x, y) in the original gradient magnitude image. G (x+1,y) is the pixel value of the adjacent pixel to the right of the coordinate (x,y) in the original gradient amplitude image. G (x-1, y) is the pixel value of the adjacent pixel to the left of the coordinate (x, y) in the original gradient amplitude image. G (x, y+1) is the pixel value of the adjacent pixel above the coordinate (x, y) in the original gradient amplitude image. G (x, y-1) is the pixel value of the adjacent pixel below the coordinate (x, y) in the original gradient magnitude image;
[0024] Based on edge tracing, a number of edge pixels in the target gradient amplitude image are acquired, and the corresponding edge pixels are connected into a number of continuous original material contours.
[0025] Furthermore, the grayscale and denoising processing is performed on the original image data to obtain the target image data; including:
[0026] Gray-scaling the original image data to obtain gray-scale image data;
[0027] based on Performing denoising processing on the grayscale image data to obtain target image data;
[0028] in, I smooth (x,y) is the pixel value of the pixel at the coordinate (x,y) in the target image data, I ’’ (xi,yj) is the pixel value of the pixel at the coordinate (xi,yj) in the grayscale image data, G ’ (i,j) is the Gaussian kernel, - M , M 、- N and N are the sizes of the Gaussian kernel.
[0029] Furthermore, after confirming that material blockage occurs on the conveyor belt, the method further comprises:
[0030] When the overlap of the positions is judged to be not less than a preset first position overlap threshold, and the area ratio is not less than a preset first area ratio threshold, an alarm command is sent to the master control terminal to remind personnel to handle the pile blockage;
[0031] The alarm instruction includes the conveyor belt number where the blockage occurs, the time when the blockage occurs, the actual position overlap, and the area ratio;
[0032] When the overlap of the positions is judged to be not less than the preset second position overlap threshold, and the area ratio is not less than the preset second area ratio threshold, an alarm command is sent to the master control end to remind personnel to handle the pile blockage, and a stop command is sent to the control end of the conveyor belt to automatically stop the conveyor belt;
[0033] The first position overlap threshold is smaller than the second position overlap threshold, and the first area ratio threshold is smaller than the second area ratio threshold.
[0034] In the second aspect, the technical solution provides a material pile detection system based on background difference and edge detection. It includes:
[0035] An image acquisition module is used to acquire original image data in real time based on a camera installed above the conveyor belt discharge port, and grayscale and denoise the original image data to acquire target image data;
[0036] The first processing module is used to determine that when a preset update cycle is reached, re-acquire a background model in real time, and perform background difference processing on the target image data with reference to the background model to extract a material area corresponding to the material;
[0037] The second processing module is used to process the material area based on the edge detection algorithm to sequentially perform non-maximum suppression and edge tracking on each pixel point to obtain a number of original material contours, and screen each original material contour to obtain a number of material contours whose total pixel value is not less than a preset pixel value threshold;
[0038] The third processing module is used to calculate the geometric center points of each material contour, connect the outermost geometric center points in each direction to obtain a circumscribed polygon, and calculate the position coordinates and area of the circumscribed polygon;
[0039] The material blockage judgment module is used to determine that when the overlap between the position of the circumscribed polygon and the position of the preset detection frame is not less than a preset position overlap threshold, and the ratio of the area of the circumscribed polygon to the area of the preset detection frame is not less than a preset area ratio threshold, it is confirmed that material blockage has occurred on the conveyor belt.
[0040] Furthermore, the first processing module includes:
[0041] The background update unit is used to determine when the preset update period has arrived. t =α·B t-1 +(1-α)I' t Get the updated background model; where B t is the updated background model, B t-1 is the background model before updating, I' t is the target image data;
[0042] The first acquisition unit is used to Calculate the difference between the target image data and the updated background model to obtain the original differential image data; wherein, D t is the original differential image data;
[0043] The second acquisition unit is used to The original differential image data is subjected to threshold processing to perform a first denoising process, thereby obtaining intermediate differential image data; wherein T is a threshold value, is the intermediate differential image data;
[0044] The third acquisition unit is used to The intermediate differential image data is subjected to morphological operations to remove continuous fractured regions and perform a second denoising process, thereby obtaining target differential image data; wherein, differential image data of the target;
[0045] The fourth acquisition unit is used to extract the foreground area of the target differential image data to obtain the material area.
[0046] Further, including:
[0047] A first sending module is used to send an alarm instruction to the main control end to remind personnel to handle the pile blockage when it is determined that the position overlap is not less than a preset first position overlap threshold and the area ratio is not less than a preset first area ratio threshold;
[0048] The alarm instruction includes the conveyor belt number where the blockage occurs, the time when the blockage occurs, the actual position overlap, and the area ratio;
[0049] The second sending module is used to send an alarm command to the main control end to remind personnel to handle the pile blockage, and send a stop command to the control end of the conveyor belt to automatically stop the conveyor belt when the position overlap is not less than a preset second position overlap threshold and the area ratio is not less than a preset second area ratio threshold;
[0050] The first position overlap threshold is smaller than the second position overlap threshold, and the first area ratio threshold is smaller than the second area ratio threshold.
[0051] In a third aspect, the technical solution provides an electronic device, comprising at least one processor, wherein the processor is coupled to a memory, wherein a computer program is stored in the memory, and wherein the computer program is configured to execute the method described when executed by the processor.
[0052] In a fourth aspect, the present technical solution provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is used to execute the described method.
[0053] Beneficial effects:
[0054] It can be seen from the above that the technical solution of the present invention provides a method for detecting backlogs based on background difference and edge detection to improve the defects of the existing image-based backlogs detection method in that the robustness and accuracy cannot be effectively improved.
[0055] Specifically, firstly, in order to avoid missed detection and ensure the timeliness of the detection results, a camera installed above the discharge port of the conveyor belt is arranged to obtain the original image data in real time, and in order to improve the image quality during subsequent image recognition, the obtained original image data is grayed and denoised to obtain a target image data.
[0056] Secondly, considering that during the detection of pile blockage, the background information such as the conveyor belt is in a relatively static state, while the material is in a relatively moving state; therefore, background difference is introduced for the first image recognition. In this process, the influence of factors such as light and time on the background and the quality of foreground extraction is also considered. The background model is updated regularly, and then the target image data is processed by background difference to extract the material area corresponding to the material.
[0057] Furthermore, considering that the background difference processing is only to extract the material foreground by difference from the background, even when the background model is updated, the accuracy and robustness of image recognition may be low due to the limitations of the difference processing itself. Therefore, it is considered to continue the second image recognition. Specifically, considering that the edge detection algorithm can emphasize the shape and structure of the object, it is suitable for the identification of the piled material, and then introduced for the second image recognition. In order to ensure the accuracy and robustness of the detection results in edge detection, on the one hand, non-maximum suppression is performed on each pixel point to reduce the defects of multiple responses that may exist in edge detection; on the other hand, each original material contour is screened to obtain several material contours whose total pixel value is not less than the preset pixel value threshold to improve the effectiveness of the acquired material contour.
[0058] Then, the geometric center points of each material contour are calculated, and the outermost geometric center points in each direction are connected to obtain a circumscribed polygon, and the position coordinates and area of the circumscribed polygon are calculated. In this process, considering noise and image quality, it is more robust to use the geometric center points of each material contour than the edge points of the object; furthermore, the shape of objects in actual scenes may be very complex, containing many small depressions or protrusions. Connecting the center points of each contour can capture the main features of the shape of the entire material area while simplifying these complexities to obtain a smoother and more regular polygon, which is easier to analyze and process.
[0059] Ultimately, it is only necessary to determine that the degree of overlap between the position of the circumscribed polygon and the position of the preset detection frame is not less than the preset position overlap threshold, and that the ratio of the area of the circumscribed polygon to the area of the preset detection frame is not less than the preset area ratio threshold, in order to more accurately confirm that a conveyor belt blockage has occurred.
[0060] It should be appreciated that all combinations of the foregoing concepts, as well as additional concepts described in greater detail below, may be considered to be part of the inventive subject matter of the present disclosure, provided such concepts are not mutually inconsistent.
[0061] The foregoing and other aspects, embodiments and features of the present invention can be more fully understood from the following description in conjunction with the accompanying drawings. Other additional aspects of the present invention, such as the features and / or beneficial effects of the exemplary embodiments, will be apparent from the following description or learned from the practice of the specific embodiments according to the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] The drawings are not intended to be drawn to scale. In the drawings, each identical or nearly identical component shown in various figures may be represented by the same reference numeral. For clarity, not every component is labeled in every figure. Embodiments of various aspects of the present invention will now be described by way of example and with reference to the accompanying drawings, in which:
[0063] Figure 1 It is a flow chart of the method for detecting pile blockage based on background difference and edge detection described in this embodiment;
[0064] Figure 2 A flowchart for acquiring target image data;
[0065] Figure 3 Flow chart for material area acquisition;
[0066] Figure 4 Flow chart for obtaining the original material profile;
[0067] Figure 5 A flow chart for handling pile blockage;
[0068] Figure 6 It is a structural block diagram of the material pile detection system based on background difference and edge detection described in this embodiment;
[0069] Figure 7 is a structural block diagram of the electronic device described in this embodiment. DETAILED DESCRIPTION
[0070] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Unless otherwise defined, the technical terms or scientific terms used herein should be the common meaning understood by people with general skills in the field to which the present invention belongs.
[0071] The words "first", "second" and similar words used in the specification and claims of this application do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, unless the context clearly indicates otherwise, the singular form of "a", "an" or "the" and other similar words do not indicate a quantitative limitation, but rather indicate the presence of at least one. Words such as "include" or "comprise" and the like mean that the elements or objects appearing before "include" or "comprise" cover the features, wholes, steps, operations, elements and / or components listed after "include" or "comprise", and do not exclude the existence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0072] In the prior art, the methods for detecting the material pile blockage on the conveyor belt are mainly divided into three categories, namely: manual inspection, mechanical detection, and image detection. Among them, the non-contact detection method of image detection not only does not cause adverse effects on the conveyor belt, but also has the advantages of strong real-time performance and wide adaptability. Therefore, compared with the manual inspection method and mechanical detection, it has gradually become the mainstream detection method in the process of conveyor belt material pile blockage detection. However, in the existing conveyor belt material pile blockage detection process based on image detection, only the universality of the method itself in various scenarios is considered, and the influence of the on-site environment on the detection quality is not considered, which leads to the technical defects of the existing conveyor belt material pile blockage detection that the detection robustness and accuracy are difficult to improve. Based on this, the present embodiment aims to provide a material pile blockage detection method based on background difference and edge detection to improve this technical defect.
[0073] The following is a detailed introduction to the method for detecting material pile blockage based on background difference and edge detection described in this embodiment in conjunction with the accompanying drawings.
[0074] like Figure 1 As shown, the method comprises the following steps:
[0075] Step S102: acquiring original image data in real time based on a camera installed above the conveyor belt discharge port, and graying and denoising the original image data to obtain target image data.
[0076] In this step, since the camera is fixedly installed above the conveyor belt discharge port, and the original image data is acquired in real time, preferably, it is located obliquely above the discharge port. Therefore, on the one hand, the missed detection of the material pile-up is avoided, and on the other hand, the timeliness of the subsequent image detection is improved, so that when the material pile-up occurs, it can be discovered in the first time and corresponding measures can be taken.
[0077] Graying and denoising the original image data to obtain target image data is beneficial to improving image quality, as well as the effectiveness and accuracy of subsequent image recognition. Figure 2 As shown, the target image data is obtained through the following steps:
[0078] Step S102.02: grayscale the original image data to obtain grayscale image data.
[0079] Step S102.04: De-noise the grayscale image data using a Gaussian filter based on the following formula to obtain target image data:
[0080] ;
[0081] in, I smooth (x,y) is the pixel value of the pixel at the coordinate (x,y) in the target image data, I ’’ (xi,yj) is the pixel value of the pixel at the coordinate (xi,yj) in the grayscale image data, G ’ (i,j) is the Gaussian kernel, - M , M 、- N and N are the sizes of the Gaussian kernel.
[0082] At this time, based on steps S102.02 to S102.04, the image quality will be improved through corresponding image pre-processing means.
[0083] Step S104: when it is determined that the preset update cycle has been reached, a background model is re-acquired in real time, and background difference processing is performed on the target image data with reference to the background model to extract a material area corresponding to the material.
[0084] The purpose of periodically updating the background model of background difference processing in this step is to reduce the impact of lighting changes, seasonal changes, etc. on the background, which in turn causes defects in image recognition quality.
[0085] Combination Figure 3 As shown, in the specific implementation, the material area is extracted in the following way:
[0086] Step S104.02: When it is determined that the preset update period has been reached, the updated background model is obtained based on the following formula:
[0087] B t =α·B t-1 +(1-α)I' t ;
[0088] Among them, B t is the updated background model, B t-1 is the background model before updating, I' t is the target image data.
[0089] Step S104.04: Calculate the difference between the target image data and the updated background model based on the following formula to obtain original differential image data:
[0090] ;
[0091] Among them, D t is the original differential image data.
[0092] Step S104.06: threshold processing is performed on the original differential image data based on the following formula to perform a first denoising process to obtain intermediate differential image data:
[0093] ;
[0094] Where T is the threshold, is the intermediate differential image data.
[0095] Step S104.08: Perform morphological operations on the intermediate differential image data based on the following formula to remove continuous fractured regions and perform a second denoising process to obtain target differential image data:
[0096] ;
[0097] in, The target differential image data.
[0098] Step S104.10: extract the foreground area of the target differential image data to obtain the material area.
[0099] At this time, the original differential image data is acquired based on the updated background model through steps S104.02 to S104.10, and the original differential image data is subjected to two image processing steps to improve the accuracy of the material area finally acquired.
[0100] Step S106, processing the material area based on the edge detection algorithm to sequentially perform non-maximum suppression on each pixel point, and edge tracking to obtain a number of original material contours, and screening the original material contours to obtain a number of material contours whose total pixel value is not less than a preset pixel value threshold.
[0101] For edge algorithms, the core of edge computing is to calculate the gradient of the image, that is, the spatial rate of change of the image brightness; and non-maximum suppression can reduce the defects of multiple responses that may exist in edge detection. Therefore, as a specific implementation method, combined with Figure 4 As shown, the processing of the material area based on the Canny edge detection algorithm to sequentially suppress non-maximum values of each pixel point and track edges to obtain several original material contours includes the following steps:
[0102] Step S106.02: Obtain the gradient amplitude of each original pixel in the material area based on the following formula:
[0103] ;
[0104] And continue to obtain the gradient direction of each original pixel in the material area based on the following formula:
[0105] ;
[0106] in, is the horizontal gradient constant, is the vertical gradient constant;
[0107] I is the pixel value of the original pixel; and then an original gradient amplitude image is obtained.
[0108] if G x · I =0, the direction can be set to 0 degrees or 90 degrees, depending on G y · I symbol.
[0109] Step S106.04: Perform non-maximum suppression processing on the original gradient magnitude image based on the following formula to obtain a target gradient magnitude image:
[0110] ;
[0111] in, R (x,y) is the pixel value of the pixel at coordinate (x,y) in the target gradient amplitude image. G (x, y) is the pixel value of the pixel at coordinate (x, y) in the original gradient magnitude image. G (x+1,y) is the pixel value of the adjacent pixel to the right of the coordinate (x,y) in the original gradient amplitude image. G (x-1, y) is the pixel value of the adjacent pixel to the left of the coordinate (x, y) in the original gradient amplitude image. G (x, y+1) is the pixel value of the adjacent pixel above the coordinate (x, y) in the original gradient amplitude image. G (x, y-1) is the pixel value of the adjacent pixel below the coordinate (x, y) in the original gradient magnitude image.
[0112] Step S106.06: Acquire a number of edge pixels in the target gradient amplitude image based on edge tracing, and connect the corresponding edge pixels into a number of continuous original material contours.
[0113] In a specific implementation, when screening the original material contours to obtain a number of material contours whose total pixel values are not less than a preset pixel value threshold, edge contours whose total pixel values are less than 10 are specifically eliminated.
[0114] Step S108, calculating each geometric center point of each material contour, connecting a plurality of outermost geometric center points in each direction to obtain a circumscribed polygon, and calculating the position coordinates and area of the circumscribed polygon.
[0115] The calculation method in this step has the following technical advantages in practical application:
[0116] From the perspective of accuracy: (1) Since the geometric center point corresponds to the key part of the object shape, the circumscribed polygon formed by connecting the geometric center points of each material contour can capture the main features of the entire material area and summarize the overall contour of the entire material area. (2) In terms of noise and image quality, edge points may be offset due to image noise or partial occlusion, while the geometric center point can better resist these interferences; therefore, using the geometric center point of each material contour for image recognition is more robust.
[0117] Considering the difficulty of processing: (1) The shapes of objects in actual scenes may be very complex, containing many small depressions or protrusions. By connecting the geometric center points of each material contour, the shape complexity can be simplified, and a relatively smoother and more regular polygon can be obtained, which is easier to analyze and process. (2) Compared with processing all material contours, focusing only on the geometric center points can also greatly reduce the amount of calculation; this is particularly important for the real-time system in this embodiment or other more specific resource-constrained application scenarios.
[0118] From the perspective of universality: Since it is not based on a specific geometric shape, but on the actual contour of the material area, it can be applied to the identification of blockages of materials of various regular or irregular shapes.
[0119] Step S110: When it is determined that the degree of overlap between the position of the circumscribed polygon and the position of the preset detection frame is not less than a preset position overlap threshold, and the ratio of the area of the circumscribed polygon to the area of the preset detection frame is not less than a preset area ratio threshold, it is confirmed that material blockage has occurred in the conveyor belt.
[0120] In the specific implementation, different measures need to be taken for different degrees of pile blockage to ensure smooth material transportation without damaging the equipment. Figure 5 As shown, after step S110, the following steps are further included:
[0121] Step S112.02: When it is determined that the position overlap is not less than a preset first position overlap threshold, and the area ratio is not less than a preset first area ratio threshold, an alarm command is sent to the master control terminal to remind personnel to handle the pile blockage.
[0122] In this step, the alarm instruction includes the conveyor belt number where the blockage occurs, the time when the blockage occurs, the overlap of the corresponding positions, and the ratio of the areas.
[0123] Step S112.04: When it is determined that the position overlap is not less than the preset second position overlap threshold, and the area ratio is not less than the preset second area ratio threshold, an alarm command is sent to the main control end to remind personnel to handle the blockage, and a stop command is sent to the control end of the conveyor belt for automatic shutdown.
[0124] In a specific implementation, the first position overlap threshold is smaller than the second position overlap threshold, and the first area ratio threshold is smaller than the second area ratio threshold.
[0125] At this time, based on steps S112.02 to S112.04, when the degree of material blockage is low, it will not cause damage to the equipment, so it is only necessary to notify the maintenance personnel to evacuate the materials. When the degree of material blockage is serious, it will cause damage to the equipment. Therefore, while notifying the maintenance personnel to evacuate the materials, automatic shutdown processing is also taken to avoid equipment abnormalities; it has a higher response speed than notifying personnel to shut down the equipment.
[0126] In summary, the method for detecting pile blockages described in this embodiment is considered from both the hardware perspective and the software algorithm perspective. Specifically, on the one hand, the installation position of the camera is optimized, and on the other hand, an image processing method combining multiple image recognition operations or algorithms is adopted; ultimately, the purpose of improving the accuracy and robustness of pile blockage detection is achieved.
[0127] The above program can be run in the processor, or it can be stored in the memory (or computer-readable storage medium), which includes permanent and non-permanent, removable and non-removable media. Information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined in this article, computer-readable media does not include temporary computer-readable media, such as modulated data signals and carrier waves.
[0128] These computer programs can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps of the functions specified in one or more blocks can be implemented by different modules corresponding to different steps.
[0129] Based on this, this embodiment also provides a material pile detection system based on background difference and edge detection. Figure 6 As shown, the system comprises:
[0130] The image acquisition module is used to acquire original image data in real time based on a camera installed above the conveyor belt discharge port, and grayscale and denoise the original image data to obtain target image data.
[0131] The first processing module is used to determine that when a preset update cycle is reached, re-acquire a background model in real time, and perform background difference processing on the target image data with reference to the background model to extract a material area corresponding to the material.
[0132] The second processing module is used to process the material area based on the edge detection algorithm to sequentially perform non-maximum suppression on each pixel point, and then track the edge to obtain a number of original material contours, and screen the original material contours to obtain a number of material contours whose total pixel value is not less than a preset pixel value threshold.
[0133] The third processing module is used to calculate the geometric center points of each material contour, connect the outermost geometric center points in each direction to obtain a circumscribed polygon, and calculate the position coordinates and area of the circumscribed polygon.
[0134] The material blockage judgment module is used to determine that when the overlap between the position of the circumscribed polygon and the position of the preset detection frame is not less than a preset position overlap threshold, and the ratio of the area of the circumscribed polygon to the area of the preset detection frame is not less than a preset area ratio threshold, it is confirmed that material blockage has occurred on the conveyor belt.
[0135] The system is used to implement the steps of the above method, so what has been explained will not be repeated here.
[0136] For example, the first processing module includes:
[0137] The background update unit is used to determine when the preset update period has arrived. t =α·B t-1 +(1-α)I' t Get the updated background model; where B t is the updated background model, B t-1 is the background model before updating, I' t is the target image data.
[0138] The first acquisition unit is used to Calculate the difference between the target image data and the updated background model to obtain the original differential image data; wherein, D t is the original differential image data.
[0139] The second acquisition unit is used to The original differential image data is subjected to threshold processing to perform a first denoising process, thereby obtaining intermediate differential image data; wherein T is a threshold value, is the intermediate differential image data.
[0140] The third acquisition unit is used to The intermediate differential image data is subjected to morphological operations to remove continuous fractured regions and perform a second denoising process, thereby obtaining target differential image data; wherein, The target differential image data.
[0141] The fourth acquisition unit is used to extract the foreground area of the target differential image data to obtain the material area.
[0142] For example, the system further comprises:
[0143] The first sending module is used to send an alarm instruction to the main control end to remind personnel to handle the pile blockage when it is determined that the position overlap is not less than a preset first position overlap threshold and the area ratio is not less than a preset first area ratio threshold.
[0144] The alarm instruction includes the conveyor belt number where the blockage occurs, the time when the blockage occurs, the overlap of the corresponding positions, and the ratio of the areas.
[0145] The second sending module is used to send an alarm command to the main control end to remind personnel to handle the pile blockage, and send a stop command to the control end of the conveyor belt for automatic shutdown processing when the position overlap is not less than a preset second position overlap threshold and the area ratio is not less than a preset second area ratio threshold.
[0146] The first position overlap threshold is smaller than the second position overlap threshold, and the first area ratio threshold is smaller than the second area ratio threshold.
[0147] like Figure 7 As shown, this embodiment further provides an electronic device, including at least one processor, wherein the processor is coupled to a memory, wherein a computer program is stored in the memory, and wherein the computer program is configured to execute the method when executed by the processor.
[0148] At the same time, this embodiment also provides a computer-readable storage medium, on which a computer program is stored, and the computer program is used to execute the method described.
[0149] Since the system, electronic equipment and storage medium are all built based on the method and used to execute the method, they also have the technical advantages of high robustness and high accuracy in detecting pile blockages in actual applications.
[0150] Although the present invention has been disclosed as above with preferred embodiments, it is not intended to limit the present invention. A person with ordinary knowledge in the technical field to which the present invention belongs may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the definition of the claims.
Claims
1. A method for detecting pile blockage based on background difference and edge detection, characterized in that: include: The original image data is acquired in real time based on a camera installed above the conveyor belt discharge port, and the original image data is grayed and denoised to acquire target image data; When it is determined that a preset update cycle has been reached, a background model is re-acquired in real time, and background difference processing is performed on the target image data with reference to the background model to extract a material area corresponding to the material; The material area is processed based on an edge detection algorithm to sequentially perform non-maximum suppression on each pixel point and edge tracking to obtain a number of original material contours, and the original material contours are screened to obtain a number of material contours whose total pixel value is not less than a preset pixel value threshold; Calculate each geometric center point of each material contour, connect the outermost geometric center points in each direction to obtain a circumscribed polygon, and calculate the position coordinates and area of the circumscribed polygon; When it is determined that the degree of overlap between the position of the circumscribed polygon and the position of the preset detection frame is not less than a preset position overlap threshold, and the ratio of the area of the circumscribed polygon to the area of the preset detection frame is not less than a preset area ratio threshold, it is confirmed that material blockage has occurred on the conveyor belt.
2. The method for detecting pile blockage based on background difference and edge detection according to claim 1, characterized in that: When the judgment reaches the preset update cycle, a background model is acquired again in real time, and background difference processing is performed on the target image data with reference to the background model to extract a material area corresponding to the material; including: When the preset update cycle is reached, based on B t =α·B t-1 +(1-α)I' t Get the updated background model; where B t is the updated background model, B t-1 is the background model before updating, I' t is the target image data; based on Calculate the difference between the target image data and the updated background model to obtain the original differential image data; wherein, D t is the original differential image data; based on The original differential image data is subjected to threshold processing to perform a first denoising process, thereby obtaining intermediate differential image data; wherein T is a threshold value, is the intermediate differential image data; based on The intermediate differential image data is subjected to morphological operations to remove continuous fractured regions and perform a second denoising process, thereby obtaining target differential image data; wherein, differential image data of the target; A foreground area is extracted from the target differential image data to obtain a material area.
3. The method for detecting pile blockage based on background difference and edge detection according to claim 1, characterized in that: The material area is processed based on the edge detection algorithm to sequentially perform non-maximum suppression and edge tracking on each pixel point to obtain a number of original material contours; include: based on Obtain the gradient amplitude of each original pixel in the material area, and based on Obtain the gradient direction of each original pixel in the material area; wherein, is the horizontal gradient constant, is the vertical gradient constant; I is the pixel value of the original pixel; and then an original gradient amplitude image is obtained; The original gradient magnitude image is subjected to non-maximum suppression processing based on the following formula to obtain a target gradient magnitude image: ; in, R (x,y) is the pixel value of the pixel at coordinate (x,y) in the target gradient amplitude image. G (x, y) is the pixel value of the pixel at coordinate (x, y) in the original gradient magnitude image. G (x+1,y) is the pixel value of the adjacent pixel to the right of the coordinate (x,y) in the original gradient amplitude image. G (x-1, y) is the pixel value of the adjacent pixel to the left of the coordinate (x, y) in the original gradient amplitude image. G (x, y+1) is the pixel value of the adjacent pixel above the coordinate (x, y) in the original gradient amplitude image. G (x, y-1) is the pixel value of the adjacent pixel below the coordinate (x, y) in the original gradient magnitude image; Based on edge tracing, a number of edge pixels in the target gradient amplitude image are acquired, and the corresponding edge pixels are connected into a number of continuous original material contours.
4. The method for detecting backlogging based on background difference and edge detection according to claim 1, characterized in that: The grayscale and denoising processing of the original image data to obtain target image data comprises: Gray-scaling the original image data to obtain gray-scale image data; based on Performing denoising processing on the grayscale image data to obtain target image data; in, I smooth (x,y) is the pixel value of the pixel at the coordinate (x,y) in the target image data, I ’’ (xi,yj) is the pixel value of the pixel at the coordinate (xi,yj) in the grayscale image data, G ’ (i,j) is the Gaussian kernel, - M , M 、- N and N are the sizes of the Gaussian kernel.
5. The method for detecting pile blockage based on background difference and edge detection according to claim 1, characterized in that: After confirming that material blockage occurs on the conveyor belt, the following steps are included: When the overlap of the positions is judged to be not less than a preset first position overlap threshold, and the area ratio is not less than a preset first area ratio threshold, an alarm command is sent to the master control terminal to remind personnel to handle the pile blockage; The alarm instruction includes the conveyor belt number where the blockage occurs, the time when the blockage occurs, the actual position overlap, and the area ratio; When the overlap of the positions is judged to be not less than the preset second position overlap threshold, and the area ratio is not less than the preset second area ratio threshold, an alarm command is sent to the master control end to remind personnel to handle the pile blockage, and a stop command is sent to the control end of the conveyor belt to automatically stop the conveyor belt; The first position overlap threshold is smaller than the second position overlap threshold, and the first area ratio threshold is smaller than the second area ratio threshold.
6. A material pile detection system based on background difference and edge detection, characterized in that: include: An image acquisition module is used to acquire original image data in real time based on a camera installed above the conveyor belt discharge port, and grayscale and denoise the original image data to acquire target image data; The first processing module is used to determine that when a preset update cycle is reached, re-acquire a background model in real time, and perform background difference processing on the target image data with reference to the background model to extract a material area corresponding to the material; The second processing module is used to process the material area based on the edge detection algorithm to sequentially perform non-maximum suppression and edge tracking on each pixel point to obtain a number of original material contours, and screen each original material contour to obtain a number of material contours whose total pixel value is not less than a preset pixel value threshold; The third processing module is used to calculate the geometric center points of each material contour, connect the outermost geometric center points in each direction to obtain a circumscribed polygon, and calculate the position coordinates and area of the circumscribed polygon; The material blockage judgment module is used to determine that when the overlap between the position of the circumscribed polygon and the position of the preset detection frame is not less than a preset position overlap threshold, and the ratio of the area of the circumscribed polygon to the area of the preset detection frame is not less than a preset area ratio threshold, it is confirmed that material blockage has occurred on the conveyor belt.
7. The material pile blockage detection system based on background difference and edge detection according to claim 6, characterized in that: The first processing module comprises: The background update unit is used to determine when the preset update period has arrived. t =α·B t-1 +(1-α)I' t Get the updated background model; where B t is the updated background model, B t-1 is the background model before updating, I' t is the target image data; The first acquisition unit is used to Calculate the difference between the target image data and the updated background model to obtain the original differential image data; wherein, D t is the original differential image data; The second acquisition unit is used to The original differential image data is subjected to threshold processing to perform a first denoising process, thereby obtaining intermediate differential image data; wherein T is a threshold value, is the intermediate differential image data; The third acquisition unit is used to The intermediate differential image data is subjected to morphological operations to remove continuous fractured regions and perform a second denoising process, thereby obtaining target differential image data; wherein, differential image data of the target; The fourth acquisition unit is used to extract the foreground area of the target differential image data to obtain the material area.
8. The material pile blockage detection system based on background difference and edge detection according to claim 6, characterized in that: include: A first sending module is used to send an alarm instruction to the main control end to remind personnel to handle the pile blockage when it is determined that the position overlap is not less than a preset first position overlap threshold and the area ratio is not less than a preset first area ratio threshold; The alarm instruction includes the conveyor belt number where the blockage occurs, the time when the blockage occurs, the actual position overlap, and the area ratio; The second sending module is used to send an alarm command to the main control end to remind personnel to handle the pile blockage, and send a stop command to the control end of the conveyor belt to automatically stop the conveyor belt when the position overlap is not less than a preset second position overlap threshold and the area ratio is not less than a preset second area ratio threshold; The first position overlap threshold is smaller than the second position overlap threshold, and the first area ratio threshold is smaller than the second area ratio threshold.
9. An electronic device, characterized in that: The method comprises at least one processor, wherein the processor is coupled to a memory, wherein a computer program is stored in the memory, and wherein the computer program is configured to execute the method according to any one of claims 1 to 5 when executed by the processor.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
