Conveyor belt deviation rectifying method based on machine vision
By extracting the contrast of conveyor belt images using machine vision technology and performing fitting analysis, correction control commands are generated, solving the problem of slow conveyor belt deviation that is difficult to identify, and improving production stability and equipment lifespan.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-03-31
AI Technical Summary
Existing technologies struggle to identify and correct slow lateral shifts in conveyor belts in a timely manner, leading to production discontinuities and equipment wear, and sensor detection is susceptible to environmental interference.
Machine vision technology is used to acquire images of the conveyor belt surface, extract contrast and perform fitting analysis to generate correction control commands, which are then sent to the drive control system using industrial communication protocols.
It enables timely identification and accurate correction of conveyor belt misalignment, improving production stability and equipment lifespan, and reducing the risk of abnormal operating conditions and unplanned downtime.
Smart Images

Figure CN121764527A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine vision technology, and more specifically to a conveyor belt deviation correction method based on machine vision. Background Technology
[0002] During the long-term continuous operation of industrial conveyor belts, lateral deviation can gradually occur due to factors such as installation errors, uneven load distribution, material impact, and mechanical wear. This type of deviation usually presents as a slow, non-sudden dynamic process, with small initial deviation amplitudes that are difficult to detect in a timely manner through manual inspection or simple limit switches.
[0003] When deviations are not identified and controlled in a timely manner, they can easily lead to problems such as conveyor belt misalignment, material spillage, accelerated edge wear, and even equipment shutdown, seriously affecting production continuity and equipment lifespan. Existing deviation detection methods mostly rely on fixed-position mechanical sensors or edge trigger signals. The detection results are easily affected by dust, vibration, and changes in lighting, and often only respond after the deviation reaches a certain threshold, lacking the ability to effectively distinguish the trend and direction of the deviation. Summary of the Invention
[0004] The purpose of this invention is to provide a conveyor belt deviation correction method based on machine vision to solve the above-mentioned technical problems.
[0005] The objective of this invention can be achieved through the following technical solutions: A machine vision-based conveyor belt deviation correction method includes the following steps: Acquire images of the conveyor belt surface captured by an industrial camera and extract the image contrast. Establish a fitting relationship between contrast and time; Based on the fitting relationship, it is determined whether the conveyor belt has deviated and the direction of the deviation when it does, and a correction control command is generated based on the determination result. The correction control command is sent to the drive control system of the conveyor belt via an industrial communication protocol.
[0006] As a further aspect of the present invention: extracting the contrast of an image includes: Delineate the region to be analyzed from the image, which includes the surface of the conveyor belt, and calculate the gray-level co-occurrence matrix of the region to be analyzed; The contrast of the image is calculated based on the gray-level co-occurrence matrix.
[0007] As a further aspect of the present invention: generating correction control commands includes: Using time as the independent variable and contrast as the dependent variable, a linear regression analysis based on the least squares method is performed to obtain a regression line. The slope of the regression line is taken as the current trend direction. The regression line is the fitted relationship. Obtain the pre-established baseline change direction amount, and calculate the difference A between the current trend direction amount and the contrast baseline change direction amount; If the difference A is zero, it is determined that the conveyor belt has not shifted. If the difference A is not zero, it is determined that the conveyor belt has shifted. When the difference A > 0, the offset direction of the conveyor belt is determined to be to the left; When the difference A < 0, the offset direction of the conveyor belt is determined to be to the right.
[0008] As a further aspect of the present invention: establishing the reference change direction includes: The conveyor belt is controlled to run without offset, and multiple frames of images are acquired during this process and recorded as reference images; A regression line is established based on the baseline image, denoted as the baseline line, and the slope of the baseline line is used as the baseline direction of change.
[0009] As a further aspect of the present invention, generating the correction control command further includes: When the conveyor belt is determined to be offset to the left, a correction control command containing information on rightward adjustment is generated. When the conveyor belt is determined to be offset to the right, a correction control command containing information on adjusting to the left is generated. The magnitude of the adjustment of the motion information to the right and the magnitude of the adjustment of the motion information to the left are both proportional to the absolute value of the difference A. If it is determined that the conveyor belt has not deviated, the correction control command will not be generated.
[0010] As a further aspect of the present invention: sending the correction control command to the drive control system includes: The correction control command is converted into a write register request data frame in Modbus TCP protocol format; The write register request data frame is sent via Ethernet to the preset IP address and port number corresponding to the drive control system, wherein the target register address of the write register request data frame corresponds to the address of the storage unit in the drive control system used to receive correction action instructions.
[0011] As a further aspect of the present invention, it also includes: Record the time interval between two consecutive control commands, and visualize the time interval using methods such as line charts and bar charts.
[0012] The beneficial effects of this invention are as follows: This invention enables continuous monitoring and stable judgment of the conveyor belt's operating status, effectively improving the timeliness and accuracy of conveyor belt deviation identification. Through continuous analysis of changes in objective characteristics during operation, identification can be completed when the deviation is still in its development stage, avoiding abnormal operating conditions caused by accumulated deviation, thereby reducing the risk of equipment wear, material abnormalities, and unplanned downtime due to deviation. This invention can distinguish whether the conveyor belt has deviated and clearly define the direction of deviation, making the correction action more targeted, which is beneficial to improving the stability and consistency of the correction process and reducing interference caused by ineffective or reverse adjustments. Simultaneously, this invention supports dynamic control based on the deviation change trend, ensuring that the correction action is coordinated with the operating status, helping to maintain the long-term stability of the conveyor belt's operation. Furthermore, by recording and visualizing the time characteristics of control commands, the occurrence and changing patterns of correction behavior can be intuitively reflected, providing a basis for operating status assessment and subsequent maintenance. Overall, this invention improves the automation level and operational reliability of conveyor belt correction control, and is suitable for industrial conveying scenarios with high requirements for stability and continuity. Attached Figure Description
[0013] The invention will now be further described with reference to the accompanying drawings.
[0014] Figure 1 This is a schematic flowchart of a conveyor belt correction method based on machine vision according to the present invention. Detailed Implementation
[0015] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0016] Please see Figure 1 As shown, this invention is a conveyor belt deviation correction method based on machine vision, comprising the following steps: Acquire images of the conveyor belt surface captured by an industrial camera and extract the image contrast. In a preferred embodiment of the present invention, extracting the contrast of an image includes: After acquiring images of the conveyor belt surface captured by an industrial camera, the images are loaded into the processing flow as input data. The area to be analyzed is delineated in the image based on the stable position of the conveyor belt within the field of view. This area covers the surface of the conveyor belt and avoids the frame, roller edges, and background areas. The delineation method can be completed by a preset rectangular or polygonal boundary. The preset boundary is determined by a one-time calibration and remains consistent in subsequent frames. At the same time, the boundary is mapped to coordinates based on the imaging position stability brought about by the fixed installation of the camera, so that the area to be analyzed corresponds to the same physical position in different frames.
[0017] After the region to be analyzed is determined, the pixels within the region are converted into grayscale images. The grayscale values are obtained from the original image channels according to a fixed mapping relationship. The grayscale images are then normalized to reduce the impact of overall brightness fluctuations in different frames on statistical features. The normalization process is based on the grayscale distribution within the region to unify the grayscale range. At the same time, the grayscale images are smoothed and denoised to suppress isolated noise points caused by dust and local reflections, resulting in a stable grayscale image for texture statistics.
[0018] When constructing the gray-level co-occurrence matrix based on the gray-level image, the gray levels of the gray-level image are discretized to limit the statistical state space. The discretization is mapped to a finite number of levels according to the gray-level value range and keeps the consistency of each frame. Then, the pixel pairs are traversed in the region to be analyzed according to a fixed spatial relationship. The spatial relationship is jointly limited by the pixel spacing and the direction. The pixel spacing is set to a preset value to cover the main scale of the conveyor belt surface texture, and the direction is set to a preset direction to be consistent with the direction of the conveyor belt operation or the lateral direction, so that the statistical results are more sensitive to texture changes.
[0019] During the traversal, the number of times each pair of gray levels appears simultaneously is recorded and accumulated in the corresponding cell of the matrix. After the traversal, a co-occurrence matrix reflecting the frequency of gray level combinations is obtained. To avoid the influence of changes in area or differences in the number of effective pixels on subsequent contrast calculations, the co-occurrence matrix is probabilistically processed so that each cell of the matrix represents the relative frequency of the corresponding gray level pair in the area to be analyzed.
[0020] When calculating image contrast based on the probabilized gray-level co-occurrence matrix, the probability distribution of different gray-level combinations in the matrix is read, and the gray-level differences are correlated with their occurrence probabilities to form contrast feature values. The more significant the gray-level differences and the higher their occurrence probabilities, the greater their contribution to the feature values. This allows the contrast feature to characterize the strength of gray-level changes in the conveyor belt surface texture during imaging. The contrast feature values are stored as outputs in association with the temporal information of the current image frame. The output format includes the contrast value and the corresponding timestamp or frame number, facilitating the subsequent establishment of a fitting relationship between contrast and time and its use in offset judgment and control command generation processes.
[0021] It should be noted that during the continuous operation of the conveyor belt, its surface texture, edge transitions, and gray-level distribution with the background undergo subtle but regular changes with lateral position. These changes are not consistently reflected in the brightness of a single pixel, but rather in the overall structure of the gray-level relationship between adjacent pixels. By defining the analysis area where the conveyor belt is located in the image, the interference of environmental background and irrelevant structures on feature calculation can be eliminated, ensuring that the subsequent features only reflect the true state of the conveyor belt surface. The gray-level co-occurrence matrix (GLCM) statistically characterizes the co-occurrence relationship of different gray-level values in spatial location. It comprehensively reflects texture coarseness, gray-level change frequency, and boundary transition. When the conveyor belt shifts laterally, the proportion and spatial distribution of the effective texture and background areas in the image change accordingly, causing changes in the statistical characteristics of the GLCM. The contrast calculated based on this essentially reflects the drastic degree of gray-level change within the area. This feature has a continuous response to positional changes and does not depend on local abrupt changes, thus stably characterizing the trend of conveyor belt position changes over time.
[0022] Establish a fitting relationship between contrast and time; Based on the fitting relationship, it is determined whether the conveyor belt has deviated and the direction of the deviation when it does, and a correction control command is generated based on the determination result. In another preferred embodiment of the present invention, generating the correction control command includes: Using time as the independent variable and contrast as the dependent variable, a linear regression analysis based on the least squares method is performed to obtain a regression line. The slope of the regression line is taken as the current trend direction. The regression line is the fitted relationship. Obtain the pre-established baseline change direction amount, and calculate the difference A between the current trend direction amount and the contrast baseline change direction amount; If the difference A is zero, it is determined that the conveyor belt has not shifted. If the difference A is not zero, it is determined that the conveyor belt has shifted. When the difference A > 0, the offset direction of the conveyor belt is determined to be to the left; When the difference A < 0, the offset direction of the conveyor belt is determined to be to the right.
[0023] In a preferred embodiment, the establishment of the reference change direction includes: The conveyor belt is controlled to run without offset, and multiple frames of images are acquired during this process and recorded as reference images; A regression line is established based on the baseline image, denoted as the baseline line, and the slope of the baseline line is used as the baseline direction of change.
[0024] It should be noted that generating corrective control commands also includes: After obtaining the difference A between the current trend direction and the baseline change direction, the difference A is used as the input for the correction decision and enters the instruction generation process. The sign of the difference A is used to represent the offset direction, and the absolute value of the difference A is used to represent the adjustment requirement corresponding to the degree of offset. During processing, the difference A is validated to remove meaningless results introduced by abnormal sampling or fitting failure. The validity validation is completed by judging whether the difference A is a resolvable value and is consistent with the current sampling period. After the validation is passed, the sign of the difference A is read. When the difference A is greater than zero, the offset direction is identified as left and the adjustment branch to the right is entered. When the difference A is less than zero, the offset direction is identified as right and the adjustment branch to the left is entered. When the difference A is zero, the state of not outputting the correction control instruction is maintained to avoid unnecessary actions in the absence of offset.
[0025] After entering the right or left adjustment branch, the absolute value of the difference A is mapped to the action amplitude value. The mapping process uses a pre-set proportional coefficient as the conversion basis. The proportional coefficient is used to convert the dimension of the difference A into an action amplitude quantity that the drive control system can recognize. The mapping result is also constrained by the allowable range of action amplitude to ensure that the output amplitude is within the executable range. The constraint method is to limit the amplitude value so that it does not exceed the preset upper limit and is not lower than the preset lower limit, thereby avoiding abnormal fluctuations in the difference that cause the command amplitude to be too large or too small and lose control meaning.
[0026] After determining the amplitude value, the content structure of the correction control command is generated. The command content includes at least an action direction field, an action amplitude field, and a command sequence number field. The action direction field specifies whether the adjustment is to the right or to the left. The action amplitude field contains the amplitude value after proportional mapping and limiting. The command sequence number field increments according to the order of command output to enable the drive control system to perform timing identification and for subsequent tracing. To ensure that the control action is consistent with the sampling rhythm, time identification information is added to the command content. The time identification information can be obtained from the current frame timestamp or control cycle count and corresponds to the generation time of the difference value A. Subsequently, the generated correction control command is encapsulated into a data object to be sent and enters the communication format conversion process. During encapsulation, the action direction field is encoded according to the register definition of the drive control system, mapping right and left adjustments to different write values and writing them to the data area corresponding to the target register. The action amplitude field is converted into an integer or fixed-point representation matching the register bit width and written to the data area corresponding to the amplitude register. At the same time, the command sequence number field is written to the sequence number register or combined with the amplitude register for encoding to ensure that the receiving end can distinguish continuous commands.
[0027] After the correction control command is generated, the output is a control command data containing direction and amplitude information. The direction information corresponds to the opposite sign of the difference A, indicating a reverse adjustment relationship for correction. The amplitude information is proportional to the absolute value of the difference A and is executable within the allowable range, thus enabling subsequent data sent to the drive control system to directly drive the implementation of the correction action. If it is determined that the conveyor belt has not deviated, the correction control command is not generated.
[0028] Understandably, when the conveyor belt is ideally aligned and operating stably, the way the surface texture of the conveyor belt is presented in the image will exhibit a stable and repeatable pattern of change over time, as the camera's installation position, imaging angle, and ambient lighting conditions remain relatively fixed. This pattern manifests as an overall trend in contrast characteristics over time. By processing continuous image sequences under this condition, this long-term stable trend can be abstracted into a representative directional quantity to characterize the temporal evolution of texture statistical properties under normal operating conditions.
[0029] The least squares method is used to perform linear regression on the contrast time series. Its essence lies in extracting the dominant trend component from the data containing noise and instantaneous disturbances. The linear model can effectively suppress irregular fluctuations introduced by factors such as slight changes in illumination and mechanical vibration while ensuring computational stability, so that the obtained slope has good repeatability and comparability.
[0030] When the conveyor belt shifts laterally during operation, its relative geometric relationship with the camera undergoes a systematic change. This change continuously affects the spatial distribution of the image texture, causing the overall contrast variation over time to deviate from the original baseline. By extracting the real-time trend direction quantity using the same method and comparing it with the baseline change direction quantity, the systematic difference introduced by the shift is amplified and stably presented as a change in the sign of the slope difference, thus enabling the differentiation of whether a shift has occurred and its direction.
[0031] Furthermore, based on the magnitude of this difference, corresponding control commands in terms of direction and amplitude are generated to ensure that the adjustment behavior is consistent with the offset trend, avoiding ineffective or excessive intervention. At the same time, the control output is kept restrained when no trend deviation is detected, thus ensuring the stability and consistency of the correction judgment and execution process as a whole.
[0032] It is worth noting that it also includes: Record the time interval between two consecutive control commands, and visualize the time interval using methods such as line charts and bar charts.
[0033] The correction control command is sent to the drive control system of the conveyor belt via an industrial communication protocol.
[0034] In a preferred embodiment of the present invention, sending the correction control command to the drive control system includes: The correction control command is converted into a write register request data frame in Modbus TCP protocol format; The write register request data frame is sent via Ethernet to the preset IP address and port number corresponding to the drive control system, wherein the target register address of the write register request data frame corresponds to the address of the storage unit in the drive control system used to receive correction action instructions.
[0035] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the present invention should still fall within the scope of the present invention.
Claims
1. A machine vision-based method for correcting a deviation of a conveyor belt, characterized in that, The method comprises the following steps: acquiring an image of a conveying belt surface collected by an industrial camera, extracting the contrast of the image; establishing a fitting relationship of the contrast changing with time; judging whether the conveying belt is deviated and the deviation direction of the conveying belt when deviated based on the fitting relationship, and generating a deviation correction control instruction according to the judging result; sending the deviation correction control instruction to a driving control system of the conveying belt through an industrial communication protocol.
2. The machine vision-based conveyor belt deviation correction method of claim 1, wherein, The extraction of the contrast of the image comprises: defining an analysis region containing the conveying belt surface from the image, and calculating a gray level co-occurrence matrix of the analysis region; calculating the contrast of the image based on the gray level co-occurrence matrix.
3. The machine vision-based conveyor belt deviation correction method of claim 1, wherein, The generation of the deviation correction control instruction comprises: performing linear regression analysis based on the least square method with time as the independent variable and the contrast as the dependent variable to obtain a regression straight line, taking the slope of the regression straight line as a current trend direction quantity, and the regression straight line as the fitting relationship; acquiring a pre-established reference change direction quantity, and calculating a difference A between the current trend direction quantity and the contrast reference change direction quantity; if the difference A is zero, it is determined that the conveying belt is not deviated; if the difference A is not zero, it is determined that the conveying belt is deviated; when the difference A is greater than zero, it is determined that the deviation direction of the conveying belt is left; when the difference A is less than zero, it is determined that the deviation direction of the conveying belt is right.
4. The machine vision-based conveyor belt deviation correction method of claim 3, wherein, The establishment of the reference change direction quantity comprises: controlling the conveying belt to run in a non-deviated state, and collecting multiple images in this process, which are recorded as reference images; establishing a regression straight line based on the reference images, which is recorded as a reference straight line, and taking the slope of the reference straight line as the reference change direction quantity.
5. The machine vision-based conveyor belt deviation correction method of claim 3, wherein, The generation of the deviation correction control instruction further comprises: when it is determined that the deviation direction of the conveying belt is left, generating a deviation correction control instruction containing right adjustment action information; when it is determined that the deviation direction of the conveying belt is right, generating a deviation correction control instruction containing left adjustment action information; the amplitude value of the right adjustment action information and the amplitude value of the left adjustment action information are both determined to be directly proportional to the absolute value of the difference A; when it is determined that the conveying belt is not deviated, the deviation correction control instruction is not generated.
6. The machine vision-based conveyor belt deviation correction method of claim 1, wherein, The sending of the deviation correction control instruction to the driving control system comprises: converting the deviation correction control instruction into a write register request data frame in the Modbus TCP protocol format; sending the write register request data frame to a preset IP address and port number corresponding to the driving control system through Ethernet, wherein the target register address of the write register request data frame corresponds to the storage unit address in the driving control system for receiving the deviation correction action instruction.
7. The machine vision-based conveyor belt deviation correction method of claim 1, wherein, Further comprising: recording the time interval of adjacent two control instructions, and performing visual processing on the time interval, and the visual processing mode comprises a line chart and a column chart.