Conveyor belt displacement detection method and related device
By extracting the anchor area and area images in the conveyor belt displacement detection for matching, the problem of insufficient detection accuracy and real-time performance of conveyor belt displacement is solved, and higher detection accuracy and real-time performance are achieved.
Patent Information
- Application Number
- CN202510290431.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-11
- Publication Date
- 2025-07-18
AI Technical Summary
The existing conveyor belt displacement detection methods have insufficient detection accuracy, real-timeness and classification accuracy, resulting in low detection accuracy.
By obtaining the initial image of the conveyor belt, the anchor area and its matching area image is determined by extracting the target line segment from the initial image of the conveyor belt, and the target extracted image matching the anchor area is extracted in the current target image, the processor executes program instructions for matching, and the current target displacement detection result of the conveyor belt is determined.
It improves the accuracy of conveyor belt displacement detection, reduces detection difficulty, and enhances detection accuracy and real-time performance.
Smart Images

Figure CN120339176A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of image processing, and particularly to a conveyor belt displacement detection method and related devices. Background Art
[0002] As one of the important transportation devices, conveyor belts often have offset faults, resulting in reduced transportation efficiency. Therefore, conveyor belt displacement detection is a technology with high demand and strict standards in industrial production. Currently, traditional conveyor belt displacement detection methods use traditional digital image processing techniques in image detection, mainly including image preprocessing, threshold segmentation processing, and edge discrimination. However, using this detection method, there are still many defects in the detection accuracy, real-time performance, and classification accuracy. The method selection among the three processing steps needs to cooperate with each other and be continuously adjusted according to the actual experimental situation, resulting in low detection accuracy.
[0003] In view of this, how to propose a conveyor belt displacement detection method with higher accuracy has become an urgent problem to be solved. Summary of the Invention
[0004] The main technical problem to be solved by this application is to provide a conveyor belt displacement detection method and related devices, which can improve the accuracy of conveyor belt displacement detection.
[0005] To solve the above technical problem, one technical solution adopted by this application is: to provide a conveyor belt displacement detection method, including: obtaining at least one anchoring area corresponding to the conveyor belt and a regional image matching the anchoring area; wherein, the anchoring area is obtained based on a target line segment extracted from an initial image, and the initial image is obtained by collecting the conveyor belt; obtaining a current target image obtained by collecting an image of the conveyor belt, and obtaining a target extraction image matching the anchoring area from the current target image; based on the target extraction image and the regional image, obtaining a current target displacement detection result corresponding to the conveyor belt.
[0006] To solve the above technical problem, another technical solution adopted by this application is: to provide an electronic device, including a memory and a processor coupled to each other, and program instructions are stored in the memory, and the processor is configured to execute the program instructions to implement the method mentioned in the above technical solution.
[0007] To solve the above technical problem, another technical solution adopted by this application is: to provide a computer-readable storage medium, storing program instructions that can be run by a processor, and the program instructions are used to implement the method mentioned in the above technical solution.
[0008] The beneficial effects of the present application are as follows: Different from the prior art, the conveyor belt displacement detection method proposed in the present application pre-determines at least one anchoring region and a region image matching the anchoring region according to the target line segment extracted from the initial image corresponding to the conveyor belt. During the application process, the current target image obtained by image acquisition of the conveyor belt is acquired, and the target extraction images matching the respective anchoring regions are extracted from the target image, so as to match the target extraction image with the corresponding region image to determine the current target displacement detection result, reducing the difficulty of detecting the displacement of the conveyor belt and improving the detection accuracy at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for description in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts. Among them:
[0010] Figure 1 is a schematic flowchart of an implementation manner of the conveyor belt displacement detection method of the present application;
[0011] Figure 2 is a schematic flowchart of an implementation manner corresponding to the determination process of the anchoring region;
[0012] Figure 3 is Figure 2 a schematic flowchart of another implementation manner corresponding to step S202 in
[0013] Figure 4 is a schematic flowchart of an implementation manner corresponding to the determination process of the length threshold and the angle range;
[0014] Figure 5 is Figure 4 a schematic diagram of an implementation manner corresponding to step S401 in
[0015] Figure 6 is Figure 2 a schematic flowchart of another implementation manner corresponding to step S203 in
[0016] Figure 7 is Figure 2 a schematic flowchart of another implementation manner corresponding to step S204 in
[0017] Figure 8 is Figure 7 a schematic diagram of an implementation manner corresponding to step S602 in
[0018] Figure 9 is a schematic structural diagram of an implementation manner of the electronic device of the present application;
[0019] Figure 10 It is a schematic structural diagram of an embodiment of the computer-readable storage medium of the present application. Specific embodiments
[0020] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments, and different embodiments can be adaptively combined. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative work belong to the scope of protection of the present application.
[0021] Please refer to Figure 1 , Figure 1 It is a schematic flowchart of an embodiment of the conveyor belt displacement detection method of the present application. The method includes:
[0022] S101: Obtain at least one anchoring area corresponding to the conveyor belt and a region image matching the anchoring area; wherein, the anchoring area is obtained based on a target line segment extracted from an initial image, and the initial image is obtained by collecting the conveyor belt.
[0023] In one embodiment, at least one anchoring area corresponding to the conveyor belt and a region image matching each anchoring area are determined in advance. Wherein, the above region image is used to characterize the state of the corresponding area of the conveyor belt when no offset occurs.
[0024] Specifically, a plurality of initial images obtained by collecting images of the area where the conveyor belt is located are obtained in advance, and a target line segment matching the edge of the conveyor belt is extracted from at least some of the initial images, so as to determine the anchoring area according to the target line segment. After determining the anchoring area, the corresponding part of the anchoring area is intercepted from the initial image as the region image.
[0025] In another embodiment, after determining the anchoring area, an initial image corresponding to the area where the conveyor belt is located is collected again, and the determined anchoring area is mapped to the newly collected initial image, and the corresponding part of the anchoring area is used as the region image.
[0026] It should be noted that the above anchoring area and its matching region image are carried out before the conveyor belt displacement detection, and the process of determining the anchoring area and its matching region image only needs to be executed once.
[0027] S102: Obtain a current target image obtained by collecting an image of the conveyor belt, and obtain a target extraction image matching the anchoring area from the current target image.
[0028] In one embodiment, to detect the offset of the conveyor belt during operation and obtain the current target image obtained by collecting images of the conveyor belt in real time. Extract the images corresponding to each anchoring area from the current target image as the target extraction images.
[0029] S103: Based on the target extraction images and the area images, obtain the current target displacement detection result corresponding to the conveyor belt.
[0030] In one embodiment, for each anchoring area, match the target extraction image with the corresponding area image, and determine the current target displacement detection result corresponding to the conveyor belt according to the obtained matching result.
[0031] In one implementation scenario, the area image includes multiple reference feature points. Obtain the target feature points in the target extraction image. For each anchoring area, obtain the target feature points in the corresponding target extraction image, and obtain the target number of the target feature points that match the corresponding reference feature points. Based on the target number, obtain the current reference displacement detection result that matches the corresponding anchoring area.
[0032] Specifically, the reference feature points in the area image are obtained by performing key point detection on the area image, that is, the key points in the area image are used as the corresponding reference feature points. After obtaining the target extraction image, perform key point detection on the target extraction image to obtain the corresponding target feature points. For each anchoring area, match the reference feature points of the area image with the target feature points of the target extraction image to determine the target number of the target feature points in the target extraction image that match the corresponding reference feature points. In response to the above target number being less than the preset first number threshold, obtain the current reference displacement detection result that matches the corresponding anchoring area, and this current reference displacement detection result is used to characterize that the conveyor belt has an offset at the position of this anchoring area. Among them, the above first number threshold can be estimated, or it can also be obtained by reverse deduction through multiple experiments.
[0033] Furthermore, based on the current reference displacement detection results that match all the anchoring areas, obtain the current target displacement detection result that matches the conveyor belt.
[0034] Specifically, when the conveyor belt is matched with multiple anchoring areas, after obtaining the current reference displacement detection results that match each anchoring area, determine whether the number of anchoring areas where the conveyor belt has an offset at the corresponding position is greater than the second number threshold. If so, obtain the current target displacement detection result, and this current target displacement detection result characterizes that the position of the conveyor belt has an offset. If not, obtain the current target displacement detection result, and this current target displacement detection result characterizes that the position of the conveyor belt has not shifted significantly.
[0035] In another embodiment, after matching the target extraction image with the corresponding regional image to obtain the target quantity of target feature points in each anchoring region that match the corresponding reference feature points, the target sum value of all target quantities is acquired. In response to the target sum value being less than a preset third quantity threshold, a current target displacement detection result is obtained, and this current target displacement detection result indicates that the position of the conveyor belt has shifted. In response to the target sum value being greater than or equal to the preset third quantity threshold, a current target displacement detection result is obtained, and this current target displacement detection result indicates that the position of the conveyor belt has not shifted significantly. Among them, the above-mentioned third quantity threshold can be estimated or can also be obtained by backtracking through multiple experiments.
[0036] The conveyor belt displacement detection method proposed in this application pre-determines at least one anchoring region and the regional image matching the anchoring region according to the target line segments extracted from the initial image corresponding to the conveyor belt. During the application process, a current target image obtained by collecting images of the conveyor belt is acquired, and target extraction images matching each anchoring region are extracted from the target image, so as to match the target extraction image with the corresponding regional image to determine the current target displacement detection result, reducing the difficulty of detecting the displacement of the conveyor belt and improving the accuracy of detection at the same time.
[0037] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of the determination process of the anchoring region corresponding to an embodiment. Specifically, the steps for determining the anchoring region corresponding to the conveyor belt include:
[0038] S201: Continuously collect multiple initial images that match the conveyor belt.
[0039] In one embodiment, continuous image collection is performed on the region corresponding to the conveyor belt to obtain corresponding multiple initial images.
[0040] In one implementation scenario, an initial video stream of the scene where the conveyor belt is located is collected by using a camera acquisition device, and multiple consecutive initial images are obtained from the initial video stream, so as to perform initialization processing on the multiple collected initial images later to determine the anchoring region. Among them, the above-mentioned camera acquisition device is a camera, and the specific installation position of the camera acquisition device can be determined according to the actual scene.
[0041] S202: Extract at least one reference line segment from the initial image.
[0042] In one embodiment, for all the obtained initial images, at least some of the initial images are subjected to line detection to identify at least one reference line segment in the initial image.
[0043] In an implementation scenario, the LSD (Line Segment Detector) algorithm is used to process the initial image to obtain the corresponding reference line segments. The specific implementation process will not be elaborated in detail here.
[0044] In another implementation, for all the obtained initial images, at least some of the initial images with higher clarity are screened out, and line detection is performed on the initial images with higher clarity to obtain at least one corresponding reference line segment.
[0045] S203: Based on the reference line segments corresponding to all the initial images, obtain the target line segments corresponding to the conveyor belt edges.
[0046] In one implementation, after obtaining the reference line segments corresponding to each initial image, the target line segments corresponding to the conveyor belt edges are screened out from all the reference line segments.
[0047] Specifically, obtain the length corresponding to each reference line segment, and based on the corresponding length, select at least some of the reference line segments with longer lengths as the target line segments.
[0048] S204: Based on the target line segments, determine at least one anchoring region.
[0049] In one implementation, after obtaining the target line segments, determine the midpoint of each target line segment, use the above midpoint as the center of the corresponding anchoring region, and perform region expansion along the above center to obtain the corresponding anchoring region.
[0050] Specifically, obtain the preset expansion distance. Expand the center of the determined anchoring region by the above expansion distance along the first direction and the opposite direction of the first direction, and expand the center of the determined anchoring region by the above expansion distance along the second direction and the opposite direction of the second direction to obtain the corresponding anchoring region. Wherein, the first direction is parallel to the corresponding side of the conveyor belt, and the second direction is perpendicular to the second direction; the above expansion distance is set according to the actual application scenario, and the expansion distance along the first direction and the opposite direction of the first direction and the expansion distance along the second direction and the opposite direction of the second direction are the same or different.
[0051] In the above solution, by screening out the target line segments corresponding to the conveyor belt edges and determining the anchoring region according to the target line segments, the obtained anchoring region corresponds to the edges with more prominent features on the conveyor belt, which helps to improve the accuracy of displacement detection.
[0052] Please refer to Figure 3 , Figure 3 is Figure 2 the flowchart of another implementation corresponding to step S202 in
[0053] S301: For the initial image, obtain the initial line segments corresponding to the initial image.
[0054] In one embodiment, for each obtained initial image, perform line detection on the initial image to identify at least one reference line segment in the initial image. Among them, the specific implementation process can refer to the corresponding above embodiment.
[0055] S302: Obtain the initial length and the first inclination angle of the initial line segment. Based on the initial length, the first inclination angle, the length threshold, and the angle range, obtain at least one reference line segment from all the initial line segments; wherein, the length threshold and the angle range are determined based on multiple reference corner points matched with the conveyor belt.
[0056] In one embodiment, pre-obtain the length threshold and the angle range for screening the initial line segments. The above length threshold and angle range are determined based on multiple reference corner points matched with the conveyor belt.
[0057] Furthermore, for the initial line segments obtained in each initial image, obtain the initial length and the first inclination angle corresponding to the initial line segments. Compare the initial length corresponding to the initial line segments with the above length threshold, and compare the first inclination angle corresponding to the initial line segments with the above angle range. According to the comparison results, screen out the reference line segments from all the initial line segments corresponding to the initial image.
[0058] In the above solution, by using the determined length threshold and angle range to screen multiple initial line segments, the interference of initial line segments with relatively low reference value to the subsequent processing process is reduced, and the efficiency and accuracy of determining the anchoring area are improved.
[0059] Please refer to Figure 4 , Figure 4 is a schematic flowchart of the process for determining the length threshold and the angle range corresponding to one embodiment. Specifically, the process for determining the above length threshold and angle range includes:
[0060] S401: Based on the initial image, obtain multiple reference corner points matched with the conveyor belt; wherein, the multiple reference corner points include a first reference corner point, a second reference corner point, a third reference corner point, and a fourth reference corner point. The first reference corner point and the second reference corner point are matched with the first side of the conveyor belt, and the third reference corner point and the fourth reference corner point are matched with the second side of the conveyor belt.
[0061] In one embodiment, after obtaining the initial video stream, perform object detection on some of the initial images preferentially collected in the initial video stream to identify multiple reference corner points matched with the conveyor belt.
[0062] Specifically, please refer to Figure 5 ,Figure 5 is Figure 4 It is a schematic diagram corresponding to step S401 in an embodiment. In response to the surface of the conveyor belt being rectangular, the determined multiple reference corner points include a first reference corner point, a second reference corner point, a third reference corner point, and a fourth reference corner point. And, the position coordinates corresponding to the first reference corner point, the second reference corner point, the third reference corner point, and the fourth reference corner point are determined respectively. Among them, the first reference corner point and the second reference corner point are the end points matched with the first side of the conveyor belt, and the third reference corner point and the fourth reference corner point are the end points matched with the second side of the conveyor belt.
[0063] In an implementation scenario, the above reference corner points are obtained by using the Poly-YOLO model to perform object detection on the initial image. Among them, to improve the accuracy of the multiple reference corner points of the conveyor belt recognized by the model, before using the model to recognize the multiple reference corner points matched with the conveyor belt, the model is trained by using multiple training samples and the sample labels matched with the training samples. The above training samples include images of different types of conveyor belts, and the above sample labels include the corner points marked and matched with the corresponding conveyor belts.
[0064] In another embodiment, object detection is performed on some consecutive initial images preferentially collected in the initial video stream to identify multiple initial corner points corresponding to the initial images respectively. Mean shift filtering is performed on the initial corner points in different initial images to obtain multiple reference corner points matched with the conveyor belt, improving the accuracy of determining the multiple reference corner points.
[0065] In yet another embodiment, a pre-trained corner point detection model is obtained, and the initial image is input into the corner point detection model to obtain the output first reference corner point, second reference corner point, third reference corner point, and fourth reference corner point. Among them, the specific structure of the above corner point detection model can refer to the existing neural network model structure.
[0066] S402: Obtain a first distance between the first reference corner point and the second reference corner point, and a second distance between the third reference corner point and the fourth reference corner point.
[0067] In an embodiment, according to the position coordinates corresponding to the first reference corner point and the second reference corner point respectively, the first distance between the first reference corner point and the second reference corner point is calculated. And, according to the position coordinates corresponding to the third reference corner point and the fourth reference corner point respectively, the second distance between the third reference corner point and the fourth reference corner point is calculated.
[0068] Specifically, the specific calculation formulas of the above first distance and second distance are as follows:
[0069]
[0070] Among them, the coordinates of the first reference corner point are (x1, y1), the coordinates of the second reference corner point are (x2, y2), the coordinates of the first reference corner point are (x3, y3), and the coordinates of the first reference corner point are (x4, y4). d1 represents the first distance, and d2 represents the second distance.
[0071] S403: Obtain a length threshold based on the minimum distance among the first distance and the second distance.
[0072] In one embodiment, determine the minimum distance between the first distance and the second distance, and determine the length threshold according to this minimum distance.
[0073] Specifically, obtain a preset reference coefficient, and use the product of the minimum distance and the reference coefficient as the length threshold. Among them, the specific calculation formula of the length threshold is as follows:
[0074] D = min(d1, d2) × α
[0075] Among them, D represents the length threshold, and α represents the reference coefficient.
[0076] In a specific implementation scenario, the above reference coefficient α is 0.2; alternatively, the specific value of the above reference coefficient can also be set according to the actual scenario.
[0077] S404: Determine a first angle range based on the inclination angle of the line where the first reference corner point and the second reference corner point are located.
[0078] In one embodiment, calculate the inclination angle of the line where the first reference corner point and the second reference corner point are located according to the position coordinates corresponding to the first reference corner point and the second reference corner point respectively.
[0079] Specifically, the specific calculation formula of the inclination angle of the line where the first reference corner point and the second reference corner point are located is as follows:
[0080]
[0081] Among them, θ1 represents the inclination angle of the line where the first reference corner point and the second reference corner point are located.
[0082] Further, determine a first angle range according to the inclination angle of the line where the first reference corner point and the second reference corner point are located.
[0083] Specifically, obtain a preset angle, use the difference between the inclination angle of the line where the first reference corner point and the second reference corner point are located and the preset angle as the first value, and use the sum of the inclination angle of the line where the first reference corner point and the second reference corner point are located and the preset angle as the second value. Obtain the first angle range according to the first value and the second value. Among them, any angle within the first angle range is greater than the first value and less than the second value.
[0084] In a specific application scenario, the above preset angle is 5°; alternatively, the above preset angle can also be set according to the actual scenario.
[0085] S405: Determine the second angle range based on the inclination angle of the line where the third reference corner point and the fourth reference corner point are located.
[0086] In one embodiment, according to the position coordinates corresponding to the third reference corner point and the fourth reference corner point respectively, the inclination angle of the line where the third reference corner point and the fourth reference corner point are located is calculated.
[0087] Specifically, the specific calculation formulas for the inclination angle of the line where the first reference corner point and the second reference corner point are located, and the inclination angle of the line where the third reference corner point and the fourth reference corner point are located are as follows:
[0088]
[0089] Among them, θ2 represents the inclination angle of the line where the third reference corner point and the fourth reference corner point are located.
[0090] Furthermore, based on the inclination angle of the line where the third reference corner point and the fourth reference corner point are located, the second angle range is determined.
[0091] Specifically, obtain the preset angle, take the difference between the inclination angle of the line where the third reference corner point and the fourth reference corner point are located and the preset angle as the third value, and take the sum of the inclination angle of the line where the third reference corner point and the fourth reference corner point are located and the preset angle as the fourth value. According to the third value and the fourth value, the second angle range is obtained. Among them, any angle within the second angle range is greater than the third value and less than the fourth value.
[0092] It should be noted that in the actual application process, the acquisition order of the above length threshold, the first angle range, and the second angle range can also be other, for example, the length threshold, the first angle range, and the second angle range are obtained simultaneously.
[0093] The above solution determines the length threshold, the first angle range, and the second angle range, so as to screen the obtained initial line segments subsequently, and obtain reference line segments with a high degree of matching with the first side and the second side of the conveyor belt.
[0094] In another embodiment, in response to obtaining the length threshold, the first angle range, and the second angle range, the determination process of the reference line segment includes: for each initial image, screening out the reference line segment from all the corresponding initial line segments. Among them, the initial length corresponding to the reference line segment is greater than or equal to the length threshold, and the first inclination angle corresponding to the reference line segment is within the first angle range or the second angle range.
[0095] Specifically, for each initial line segment in the initial image, it is determined whether the corresponding initial length is greater than or equal to the length threshold, and whether the corresponding first inclination angle is within the first angle range or the second angle range. In response to the initial length corresponding to the initial line segment being greater than or equal to the length threshold, and the first inclination angle corresponding to the initial line segment being within the first angle range or the second angle range, the initial line segment is used as a reference line segment. Alternatively, in response to the initial length corresponding to the initial line segment being less than the length threshold, or the first inclination angle corresponding to the initial line segment being outside the first angle range and the second angle range, the initial line segment is removed from the corresponding initial image to avoid interference with subsequent processing.
[0096] Please refer to Figure 6 , Figure 6 is Figure 2 a schematic flowchart corresponding to another implementation manner of step S203 in
[0097] S501: Obtain the identification information corresponding to each reference line segment; wherein, in different initial images, the difference in inclination angle and the difference in distance between different reference line segments corresponding to the same identification information satisfy preset conditions.
[0098] In one implementation manner, for adjacent initial images in the initial video stream, it is determined whether the difference in inclination angle and the difference in distance between the reference line segments respectively included in the two initial images satisfy preset conditions. If so, it indicates that the reference line segments respectively included in the two initial images satisfy the merging condition, and the same identification information is assigned to both.
[0099] In one implementation scenario, for the previous frame of the initial image in the initial video stream, each reference line segment in the previous frame of the initial image corresponds to identification information, and the identification information corresponding to different reference line segments in the same initial image is different. After obtaining the corresponding reference line segments for the current initial image adjacent to the previous frame of the initial image in the initial video stream, it is determined whether the difference in inclination angle between the reference line segments in the current initial image and the reference line segments in the previous frame of the initial image is less than the angle threshold, and whether the difference in distance between the reference line segments in the current initial image and the reference line segments in the previous frame of the initial image is less than the distance threshold. In response to the difference in inclination angle between the reference line segments in the current initial image and the reference line segments in the previous frame of the initial image being less than the angle threshold, and the difference in distance being less than the distance threshold, it is determined that the two are the same reference line segment, and the same identification information is assigned to both.
[0100] S502: Based on the identification information corresponding to all the initial images, at least one target line segment is screened out from all the reference line segments.
[0101] In one embodiment, for the reference line segments in all the initial images, the counting information of the corresponding identification information is obtained. According to the counting information, at least one target line segment is screened out from all the reference line segments. Wherein, the above-mentioned counting information is used to represent the number of times the corresponding identification information appears in all the initial images.
[0102] Specifically, a preset counting threshold is obtained. In response to the counting information corresponding to the identification information being greater than or equal to the counting threshold, in the last initial image corresponding to the initial video stream, the reference line segment corresponding to the identification information is used as the target line segment.
[0103] In another embodiment, in response to the counting information corresponding to the identification information being greater than or equal to the counting threshold, the reference line segments corresponding to the identification information are obtained from all the initial images, and all the reference line segments corresponding to the identification information are fitted to obtain the corresponding target line segment.
[0104] In the above solution, by merging the reference line segments in different initial images to obtain at least one target line segment, the interference of redundant target line segments is avoided, and the consumption of computing resources for subsequent processing is saved.
[0105] Please refer to Figure 7 , Figure 7 is Figure 2 the schematic flowchart of another embodiment corresponding to step S204 in
[0106] S601: Obtain the target length of the target line segment, and based on the target length, determine the first extension distance and the second extension distance of the corresponding anchoring region.
[0107] In one embodiment, the target length of the target line segment is obtained. The target length is compared with a preset threshold to determine the first extension distance and the second extension distance.
[0108] Specifically, according to the position coordinates of the endpoints of the target line segment, the corresponding target length is calculated. In response to the target length being greater than the preset threshold, the preset threshold is used as the first extension distance. Or, in response to the target length being less than or equal to the preset threshold, the target length is used as the first extension distance.
[0109] Further, the product of the first extension distance and a preset coefficient is used as the second extension distance.
[0110] In a specific application scenario, the above-mentioned preset threshold is 128 pixel distances, or the preset threshold can also be set according to the actual scenario. And, the above-mentioned preset coefficient is 0.5; or, the preset coefficient can also be set according to the actual scenario.
[0111] S602: Obtain the midpoint of the target line segment, and based on the first extension distance, obtain an anchoring region with a length of the first extension distance and a width of the second extension distance.
[0112] In one embodiment, please refer to Figure 8 , Figure 8 is Figure 7 a schematic diagram corresponding to step S602 in one embodiment. Obtain the midpoint of the target line segment, and use the midpoint of the target line segment as the center of the corresponding anchoring region. Expand the above center along the first direction and the opposite direction of the first direction, and expand the above center along the second direction and the opposite direction of the second direction to obtain an anchoring region with a length of the first extension distance and a width of the second extension distance. Wherein, the first direction is parallel to the corresponding side of the conveyor belt, and the second direction is perpendicular to the second direction.
[0113] It should be noted that Figure 8 only one anchoring region matching one side of the conveyor belt is schematically drawn in
[0114] Please refer to Figure 9 , Figure 9 is a schematic structural diagram of an electronic device according to one embodiment of the present application. The electronic device includes: a memory 10 and a processor 20 that are coupled to each other. Program instructions are stored in the memory 10, and the processor 20 is configured to execute the program instructions to implement the methods mentioned in any of the above embodiments. Specifically, the electronic device includes, but is not limited to: desktop computers, laptop computers, tablet computers, servers, etc., which are not limited here. In addition, the processor 20 can also be referred to as a CPU (Center Processing Unit, central processing unit). The processor 20 may be an integrated circuit chip with signal processing capabilities. The processor 20 may also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Additionally, the processor 20 can be implemented jointly by integrated circuit chips.
[0115] Please refer to Figure 10 , Figure 10It is a schematic structural diagram of an embodiment of the computer-readable storage medium of the present application. Program instructions 40 that can be run by a processor are stored on the storage medium 30. When the program instructions 40 are executed by the processor, the methods described in any of the above embodiments are implemented.
[0116] In several embodiments provided by the present application, it should be understood that the disclosed methods and apparatuses can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the apparatus or unit can be in an electrical, mechanical or other form.
[0117] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0118] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0119] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods in various embodiments of the present application. And the aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks or optical discs that can store program codes.
[0120] The above are only the embodiments of the present application, and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be similarly included in the patent protection scope of the present application.
Claims
1. A conveyor belt displacement detection method, characterized in that, Including: Obtain at least one anchoring region corresponding to the conveyor belt and a region image matching the anchoring region; wherein, the anchoring region is obtained based on a target line segment extracted from an initial image, and the initial image is obtained by collecting the conveyor belt. Obtain a current target image obtained by collecting an image of the conveyor belt, and obtain a target extraction image matching the anchoring region from the current target image. Based on the target extraction image and the region image, obtain a current target displacement detection result corresponding to the conveyor belt.
2. The method according to claim 1, wherein The determining step of the anchoring region includes: Continuously collect a plurality of the initial images matching the conveyor belt. Extract at least one reference line segment from the initial images. Based on the reference line segments corresponding to all the initial images, obtain a target line segment corresponding to the edge of the conveyor belt. Based on the target line segment, determine at least one of the anchoring regions.
3. The method according to claim 2, wherein The extracting at least one reference line segment from the initial images includes: For the initial image, obtain an initial line segment corresponding to the initial image. Obtain an initial length and a first inclination angle of the initial line segment, and filter at least one of the reference line segments from all the initial line segments based on the initial length, the first inclination angle, a length threshold, and an angle range; wherein, the length threshold and the angle range are determined based on a plurality of reference corner points matching the conveyor belt.
4. The method according to claim 3, wherein The determining step of the length threshold and the angle range includes: Based on the initial image, obtain a plurality of reference corner points matching the conveyor belt; wherein, the plurality of reference corner points include a first reference corner point, a second reference corner point, a third reference corner point, and a fourth reference corner point, the first reference corner point and the second reference corner point match the first side of the conveyor belt, and the third reference corner point and the fourth reference corner point match the second side of the conveyor belt. Obtain a first distance between the first reference corner point and the second reference corner point, and a second distance between the third reference corner point and the fourth reference corner point. Based on the minimum distance among the first distance and the second distance, obtain the length threshold; and Based on the inclination angle of the line where the first reference corner point and the second reference corner point are located, determine a first angle range; and Based on the inclination angle of the line where the third reference corner point and the fourth reference corner point are located, determine a second angle range.
5. The method according to claim 2, wherein The obtaining a target line segment corresponding to the edge of the conveyor belt based on the reference line segments corresponding to all the initial images includes: Obtain identification information corresponding to each of the reference line segments; wherein, among different initial images, the difference in inclination angle and the difference in distance between different reference line segments corresponding to the same identification information satisfy a preset condition. Based on the identification information corresponding to all the initial images, screen at least one of the target line segments from all the reference line segments.
6. The method according to claim 2, characterized in that The determining at least one of the anchoring regions based on the target line segment includes: Obtain the target length of the target line segment, and based on the target length, determine a first extension distance and a second extension distance corresponding to the anchoring region; Obtain the midpoint of the target line segment, and based on the first extension distance, obtain the anchoring region with a length of the first extension distance and a width of the second extension distance.
7. The method according to claim 6, wherein The determining the first extension distance and the second extension distance corresponding to the anchoring region based on the target length includes: In response to the target length being greater than a preset threshold, use the preset threshold as the first extension distance; In response to the target length being less than or equal to the preset threshold, use the target length as the first extension distance; and, Use the product of the first extension distance and a preset coefficient as the second extension distance.
8. The method according to claim 1, characterized in that The region image includes a plurality of reference feature points. The obtaining the current target displacement detection result corresponding to the conveyor belt based on the target extraction image and the region image includes: For each of the anchoring regions, obtain the target feature points in the corresponding target extraction image, and determine the target number of the target feature points that match the corresponding reference feature points; Based on the target number, obtain the current reference displacement detection result that matches the corresponding anchoring region; Based on the current reference displacement detection results that match all the anchoring regions, obtain the current target displacement detection result that matches the conveyor belt.
9. An electronic device, characterized in that, It includes a memory and a processor that are coupled to each other. Program instructions are stored in the memory, and the processor is configured to execute the program instructions to implement the method according to any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, Stored with program instructions that can be run by a processor, and the program instructions are used to implement the method according to any one of claims 1-8.