Belt buckle service life analysis algorithm based on machine vision technology

Through the belt buckle life analysis algorithm of machine vision technology, the problem of low belt buckle detection efficiency and insufficient accuracy is solved, real-time and accurate detection and life prediction of belt buckle are achieved, and the stable operation of the belt machine is ensured.

CN120259229AActive Publication Date: 2025-07-04ANHUI TUOBANG CONVEYING EQUIP CO LTD
View PDF 13 Cites 0 Cited by

Patent Information

Application Number
CN202510329646.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-07-04
Estimated Expiration
2045-03-18

AI Technical Summary

Technical Problem

In the prior art, belt buckle detection relies on manual inspection or simple sensors, which has low efficiency and limited accuracy, making it difficult to accurately detect minor defects of belt buckles in complex environments, resulting in frequent belt drive failures.

Method used

The belt buckle life analysis algorithm based on machine vision is adopted, including image acquisition, regional semantic analysis, visual correction, belt buckle segmentation, edge analysis, linear detection and life analysis. The belt buckle area is accurately positioned through the FastSCNN model and the HoughLines algorithm, the line spacing and wear degree are calculated, and the life is predicted by combining linear fitting.

Benefits of technology

Real-time and accurate detection of belt buckles is realized, false alarm rate is reduced, detection efficiency is improved, scientific decision-making support is provided, and the stable operation of belt conveyors is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120259229A_ABST
    Figure CN120259229A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of visual inspection, and discloses a belt buckle life analysis algorithm based on a machine vision technology, which comprises the steps of image acquisition and processing, regional semantic analysis, visual correction, belt buckle segmentation, edge analysis, straight line detection, straight line non-maximum suppression, line spacing measurement and life analysis. A belt buckle area is captured in real time, video streams are rapidly analyzed, abnormity can be found in time and fed back to a control center, the detection real-time performance is remarkably improved, and stable operation of the belt conveyor is guaranteed; the belt fastener area is accurately positioned by analyzing the video stream based on the difference method, the boundary of the belt fastener is clearly identified in combination with the semantic segmentation method, the detection precision is improved, false alarm and missing alarm are reduced, the abrasion degree and the service life state can be accurately evaluated, manual intervention is not needed in automatic detection, the detection period is greatly shortened, and the detection efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of visual detection, and specifically to a service life analysis algorithm for belt buckles based on machine vision technology. Background Art

[0002] As a key component of a belt conveyor, the belt buckle serves to connect the belt into a closed loop to ensure the normal operation of the belt conveyor. However, during actual use, belt buckles are prone to problems such as uneven stress, wear, or inherent quality defects, leading to damage such as broken teeth. Once the belt buckle is damaged, it is highly likely to cause the overall failure of the belt conveyor, thereby affecting the entire production process and resulting in adverse consequences such as production stagnation and economic losses.

[0003] Currently, the detection methods for belt buckles mainly rely on manual inspection or simple sensors. Manual inspection is not only inefficient but also greatly affected by human factors, with limited detection accuracy. Simple sensors are unable to detect subtle defects of belt buckles in a timely and accurate manner in a complex industrial environment, making it difficult to effectively predict faults, which often leads to problems such as belt conveyor shutdowns and seriously affects production efficiency and enterprise benefits.

[0004] With the development of machine vision technology, various abnormal detection methods for key components based on machine vision have been proposed. However, in the field of belt buckle detection, many challenges still remain. Firstly, abnormal problems such as broken teeth of belt buckles occur less frequently, resulting in a scarcity of abnormal data, which greatly limits the training and optimization of machine learning models and makes it difficult to build a high-precision detection model. Secondly, belt conveyors mostly operate in harsh environments such as dim and humid conditions, and belt buckles are prone to problems such as shadows and being contaminated by surface stains, which poses high requirements for the ability of machine vision detection to exclude interference factors. Thirdly, when the belt is running at high speed, clearly capturing the belt buckle area becomes a key difficulty. How to accurately locate the belt buckle area in abnormal detection is an urgent problem to be solved. Summary of the Invention

[0005] The purpose of the present invention is to provide a service life analysis algorithm for belt buckles based on machine vision technology, which solves the technical problems presented in the background art.

[0006] The purpose of the present invention can be achieved through the following technical solutions:

[0007] A service life analysis algorithm for belt buckles based on machine vision technology includes the following steps:

[0008] The first step, image acquisition and processing:

[0009] Obtain the video stream of the belt buckle during operation through an industrial camera, then extract the video frames containing the belt buckle from the video stream, and record them as belt buckle images;

[0010] Step 2, Regional semantic analysis:

[0011] Manually mark the pixel points of the buckle area on multiple buckle images to obtain sample images, then use the sample images to train the FastSCNN model. Subsequently, input the collected buckle images into the trained model, and obtain a binary mask image through threshold processing to determine the buckle area image;

[0012] Step 3, Visual correction:

[0013] Place a square grid in the same shooting scene as the buckle image, mark the pixel coordinates of its four vertices in the video frame, and according to the principle of projective transformation, use the projective transformation algorithm to adjust the vertices so that the lengths of the enclosing rectangles are the same and the four corners are 90 degrees to complete the visual correction of the buckle image;

[0014] Step 4, Buckle segmentation:

[0015] Extract the buckle area image after visual correction, mark the coordinates of the upper left and lower right corners of its boundary, calculate the lengths in the x and y axis directions, determine the segmentation side length according to the long and short sides, calculate the number of segments, and sequentially cut out the corresponding number of small squares from the upper left corner and segment the buckle area picture according to the small squares;

[0016] Step 5, Edge analysis:

[0017] Perform edge detection on the input binary mask image by the Canny method, which first smooths through Gaussian filtering, then calculates the gradients in the x and y directions using the Sobel operator, then suppresses non-maximum values to refine the edges, determines the edges according to high and low thresholds, and finally performs dilation and erosion operations to finally determine the edge image;

[0018] Step 6, Line detection:

[0019] Use the HoughLines line detection algorithm to perform line detection on the edge image and obtain multiple groups of lines and their corresponding endpoint coordinates respectively;

[0020] Step 7, Line non-maximum suppression:

[0021] Calculate the lengths of the lines according to the line endpoint coordinates and sort them, select the longest line segment as the candidate line, then calculate the slopes and intercepts of each group of lines, and retain the longest two non-intersecting lines according to the slopes and intercepts;

[0022] Step 8, Line spacing measurement:

[0023] Obtain the slopes and intercepts of the two non-intersecting lines determined in the seventh step, and then calculate their line spacing;

[0024] Step 9, Life analysis:

[0025] Extract the vertical distances corresponding to multiple video frames to form a data sequence, calculate the average value and standard deviation, and compare with the preset critical vertical distance value to determine whether the belt buckle is damaged; when it is not damaged, use linear fitting to calculate the historical width change rate, substitute the critical value and the average value to calculate the maximum and the current usage time respectively, and subtract to obtain the remaining life.

[0026] As a further solution of the present invention: the method for extracting the belt buckle image is as follows:

[0027] StepA1. Select two adjacent video frames from the video stream, and mark the pixel values of the pixel points at the coordinate (x, y) in the two video frames as S n (x, y) and S n+1 (x, y);

[0028] where x represents the abscissa of the pixel point in the video frame, represents the ordinate of the pixel point in the video frame, and n represents the serial number of the video frame;

[0029] StepA2. Select a column of pixel points, that is, the pixel points with a fixed x value and different y values;

[0030] First, through: S0(x, y) = |S n (x, y) - S n+1 (x, y)|, calculate the difference value of the pixel values in the y-axis direction of two adjacent video frames;

[0031] Then accumulate the difference values of this column of pixel values in the y-axis direction to obtain the accumulated difference value;

[0032] The calculation formula for the accumulated difference value is:

[0033] In the formula, y = 1, 2,..., h, and h is the height of the video frame;

[0034] StepA3. Calculate the accumulated difference value of each column in the manner of StepA2;

[0035] Then extract the peak value of the accumulated difference value from the accumulated difference values of each column;

[0036] Among them, the peak value of the accumulated difference value represents the position where the difference value between two adjacent video frames is the largest in the corresponding column;

[0037] StepA4. Extract the preset accumulated difference threshold;

[0038] When the peak value of the accumulated difference value is greater than the accumulated difference threshold, track and record the peak value generated by each frame of image until it returns to the normal level;

[0039] All the peaks within the shooting time corresponding to the video stream are recorded accordingly, and the magnitudes of all the peaks are compared. Then, the frame corresponding to the largest peak is taken as the buckle image.

[0040] As a further solution of the present invention: The specific method of regional semantic analysis is as follows:

[0041] StepB1: On multiple pre-prepared images containing buckles, manually mark the pixel points of the buckle area to obtain a buckle sample image;

[0042] StepB2: Then, use multiple buckle sample images as the training data set and perform model training through a pre-built FastSCNN model;

[0043] StepB3: Next, input the buckle image collected in the first step into the trained FastSCNN model, and the FastSCNN model outputs a probability map for each pixel belonging to the "buckle" or "non-buckle" category;

[0044] StepB4: Then, by performing threshold processing on the probability map, a binary mask image is obtained, that is, the buckle area image is obtained;

[0045] In the binary mask image, 1 represents the buckle area and 0 represents the non-buckle area.

[0046] As a further solution of the present invention: Among them, FastSCNN is a lightweight semantic segmentation network, mainly composed of three modules:

[0047] Learning downsampling module, which is used to quickly reduce the resolution of the input image and reduce the subsequent calculation amount;

[0048] It consists of three convolutional layers, namely a common convolutional layer and two depthwise separable convolutional layers;

[0049] Global feature extractor, which is used to extract global features by using an inverted residual block;

[0050] The inverted residual block first performs pointwise convolution to increase the dimension, then performs depth convolution, and finally performs pointwise convolution to reduce the dimension;

[0051] Feature fusion module, which is used to fuse the output of the learning downsampling module and the output of the global feature extractor;

[0052] It first performs bilinear interpolation upsampling on the output of the global feature extractor to make its resolution consistent with the output of the learning downsampling module, then splices the two, and finally performs feature fusion through a convolutional layer;

[0053] A classifier for performing a convolution operation on the fused feature map and outputting a probability map of each pixel belonging to different classes.

[0054] As a further solution of the present invention: The specific method of visual correction is as follows:

[0055] Prepare a 1m x 1m square grid and place it in the same scene as the belt buckle image is taken;

[0056] Among them, the content captured by the industrial camera includes the image of the square grid and the belt buckle area;

[0057] In the obtained video frame, manually mark the pixel coordinates of the four vertices of the square grid in the image coordinate system;

[0058] Based on the four vertices of the marked square grid, perform visual correction on the belt buckle image in combination with the principle of projective transformation;

[0059] The method of visual correction is: Adjust the four vertices of the square grid in the video frame until the side lengths of the rectangle enclosed by the four vertices are all the same and the four corners of the rectangle are 90 degrees. At this time, the visual correction of the belt buckle image is completed;

[0060] As a further solution of the present invention: Among them, the method of adjusting the four vertices of the square grid is as follows:

[0061] Use the projective transformation algorithm to map the vertices of the quadrilateral in the image to a new coordinate system, so that the quadrilateral presents a shape closer to a square in the new coordinate system. Then, by adjusting the parameters of the transformation matrix, the vertices of the quadrilateral satisfy the conditions of the same side length and 90-degree corners after transformation.

[0062] As a further solution of the present invention: The specific method of belt buckle segmentation is as follows:

[0063] StepW1: Extract the belt buckle area image after visual correction, and then extract the upper left corner coordinate and the lower right corner coordinate of the belt buckle area in the belt buckle area image, and mark them as (x0, y0) and (x1, y1) respectively;

[0064] StepW2: Then, through W = x1 - x0 and H = y1 - y0, calculate the length W of the belt buckle area in the x-axis direction and the length H in the y-axis direction respectively;

[0065] StepW3: Then, based on the lengths W and H, calculate the segmentation quantity of the belt buckle area image;

[0066] The method is as follows:

[0067] When H > W, use the length W in the x-axis direction as the side length, and through calculate the number N of segments of the buckle area image;

[0068] When W > H, use the length H in the y-axis direction as the side length, and through calculate the number N of segments of the buckle area image;

[0069] In the formula, is the floor operation;

[0070] StepW4. When using the length W in the x-axis direction as the side length, then starting from the upper left corner of the buckle area image, successively cut out N small squares with side length W downward. Among them, the upper left coordinates of each small square are (x0, y0 + i×W), and the lower right coordinates are (x0 + W, y0 + (i + 1)×W);

[0071] StepW5. Then cut the buckle area picture according to the segmented small squares.

[0072] As a further solution of the present invention: The specific method of edge analysis is as follows:

[0073] StepU1. Use a Gaussian filter to smooth the binarized mask image;

[0074] StepU2. Use the Sobel operator to calculate the gradient values of the image in the x and y directions respectively, and denote them as Gx and Gy;

[0075] StepU3. Perform non-maximum suppression on the gradient magnitude, and only retain the pixels with the local gradient maximum to refine the edge;

[0076] Specifically, for each pixel, check the two adjacent pixels in its gradient direction. If the gradient magnitude of this pixel is not the local maximum, set its gradient magnitude to 0;

[0077] StepU4. Determine the edge according to the preset low threshold and high threshold;

[0078] Pixels with a gradient magnitude greater than the high threshold are defined as strong edge pixels;

[0079] Pixels with a gradient magnitude between the low threshold and the high threshold are defined as weak edge pixels;

[0080] Among them, the weak edge pixels connected to the strong edge pixels are determined as the retained edge pixels;

[0081] StepU5. Then perform dilation operation and erosion operation using a 5×5 kernel;

[0082] Among them, the Canny method is a prior art;

[0083] StepU6. Then, based on the pixels of all foreground regions, determine the edge image;

[0084] As a further solution of the present invention: The dilation operation method is as follows: Expand the foreground region in the binary mask image, that is, the region of white pixels. Then, slide the structuring element on the image. If the structuring element overlaps with the foreground region in the image, set the pixel corresponding to the center of the structuring element as a pixel in the foreground region;

[0085] Among them, the structuring element is a 5×5 kernel;

[0086] The erosion operation is opposite to the dilation operation. It is to shrink the foreground region in the image. Then, slide the structuring element on the image. Only when the structuring element is completely contained in the foreground region of the image, set the pixel corresponding to the center of the structuring element as a pixel in the foreground region.

[0087] As a further solution of the present invention: Step 6. The straight-line detection method is as follows:

[0088] Among them, the edge image is a binary image, where white points represent edge pixels and black points represent non-edge pixels;

[0089] StepC1. Construct an accumulator matrix:

[0090] First, establish the equation of a straight line in the polar coordinate system: ρ = xcosθ + ysinθ

[0091] Among them, ρ is the distance from the straight line to the upper left corner of the image, and θ is the angle between the straight line and the x-axis;

[0092] Then, discretize ρ with a step size of 1 and discretize θ with a step size of 1 degree;

[0093] Next, determine that the size of the accumulator matrix is Q×G, where Q is the value range of ρ and G is the value range of θ;

[0094] StepC2. Parameter voting:

[0095] For each edge pixel point in the edge detection result, according to the polar coordinate equation ρ = xcosθ + ysinθ, when θ changes from 0° to 180° with a step size of 1 degree, calculate a series of corresponding ρ values.

[0096] For each group (ρ, θ), add 1 to the value at the corresponding position (ρ, θ) in the accumulator matrix. Then, obtain the voting count of each [ρ, θ] combination recorded in the accumulator matrix;

[0097] StepC3. Peak detection:

[0098] Find the local maximum in the accumulator matrix where the number of votes exceeds a preset voting threshold;

[0099] Among them, the local maximum indicates that under the corresponding (ρ, θ) combination, there are more edge points supporting the existence of the straight line;

[0100] StepC4. Straight line length screening:

[0101] For each detected straight line, find the intersection points of the straight line and the image boundary in the edge image, and then calculate the distance between these two intersection points through the Euclidean distance formula to obtain the length of the relevant straight line in the edge image;

[0102] Subsequently, compare the length of the relevant straight line in the edge image with the preset minimum straight line length: if the length in the edge image is greater than or equal to the minimum straight line length, retain the straight line; otherwise, do not retain it;

[0103] Finally, obtain the retained straight lines and their corresponding endpoint coordinates respectively, and save them.

[0104] As a further solution of the present invention: the specific method of non-maximum suppression of straight lines is as follows:

[0105] StepY1. According to the corresponding endpoint coordinates of multiple groups of straight lines, calculate the lengths of each group of straight lines through the Euclidean distance formula, then sort all the straight lines from largest to smallest according to their lengths, and select the longest line segment as the candidate straight line;

[0106] The Euclidean distance formula is as follows:

[0107]

[0108] In the formula, L j is the length of the j-th straight line, (xa j , ya j ) and (xb j , yb j ) are the two endpoint coordinates on the j-th straight line, and j is the serial number of the straight line;

[0109] StepY2. Subsequently, according to the two endpoint coordinates of the straight line, calculate the slope and intercept of the straight line through the two-point formula;

[0110] The calculation formula of the slope is as follows:

[0111]

[0112] In the formula, E j is the slope of the j-th straight line;

[0113] The calculation formula for the intercept is as follows:

[0114] B j = yb j - E j × xb j

[0115] Wherein, B j is the slope of the j-th straight line;

[0116] StepY3. Then traverse the sorted list of straight lines. For each candidate straight line, compare it with other straight lines;

[0117] If the slope difference between the candidate straight line and another straight line is less than 0.02 or the intercept difference is less than 10 pixels, it is considered that the candidate straight line and the other straight line belong to the same straight line;

[0118] StepY4. Finally, retain the two longest non-intersecting straight lines.

[0119] As a further solution of the present invention: the line spacing calculation method is as follows:

[0120] Obtain the slopes and intercepts corresponding to two non-intersecting straight lines, and mark them as E1, E2, B1, and B2 respectively;

[0121] Then through:

[0122] Calculate the perpendicular distance D between the two non-intersecting straight lines.

[0123] As a further solution of the present invention: the specific method of life analysis is as follows:

[0124] StepH1. According to the method from the second step to the eighth step, extract the perpendicular distances corresponding to two non-intersecting straight lines in multiple video frames, and form them into a line spacing data sequence that changes with time, and mark it as D0 = {D1, D2,... Dg}, where g is the number of multiple video frames;

[0125] StepH2. Then calculate the average value and standard deviation of all the perpendicular distances in the line spacing data sequence;

[0126] The calculation method is as follows:

[0127]

[0128] Wherein, s is the serial number of multiple video frames, and s = 1, 2,... g, Ds is the perpendicular distance corresponding to the s-th video frame, and D1 and D2 are respectively the average value and standard deviation of all the perpendicular distances in the line spacing data sequence;

[0129] Step H3. Extract the preset vertical distance critical value Dy, which represents the vertical distance threshold for belt buckle damage or wear;

[0130] Then compare the average value D1 of all vertical distances in the line spacing data sequence measured during the shooting time corresponding to the current video stream with the vertical distance critical value Dy;

[0131] If D1 > Dy, it is determined that the belt buckle is damaged or worn;

[0132] If D1 ≤ Dy, then compare each vertical distance Ds in the line spacing data sequence with the vertical distance critical value Dy respectively. If there is a group of Ds > Dy, it is determined that the belt buckle is damaged or worn; otherwise, it is determined that the belt buckle is not damaged or worn;

[0133] Meanwhile, extract the preset fluctuation threshold Dz of the vertical distance;

[0134] If D2 > Dz, it indicates that the line spacing data fluctuates greatly, the wear condition of the belt buckle may not be very stable, and there is a risk of abnormal wear;

[0135] If D2 ≤ Dz, it indicates that the line spacing data is relatively stable and the wear of the belt buckle is relatively uniform;

[0136] Step H4. When the belt buckle is not damaged, calculate the historical width change rate corresponding to the belt buckle based on the method of linear fitting;

[0137] The method is as follows:

[0138] Represent the change relationship of the vertical distance with time through the linear fitting equation y = ax + b;

[0139] Among them, x represents the time serial number of the video frame, and y represents the vertical distance;

[0140] Then solve a and b in the linear fitting equation by the least square method; among them, a is the historical width change rate corresponding to the belt buckle;

[0141] Step H5. Extract the vertical distance critical value Dy corresponding to belt buckle damage, then substitute it into the linear fitting equation y = ax + b, and record the obtained x value as the maximum service time;

[0142] Then substitute the average value D1 of all vertical distances in the line spacing data sequence measured during the shooting time corresponding to the current video stream into the linear fitting equation y = ax + b, and record the obtained x value as the current service time;

[0143] Then subtract the current service time from the maximum service time to calculate the remaining life of the belt buckle.

[0144] Advantages of the present invention:

[0145] Significantly improved real-time performance: Traditional belt buckle detection methods mostly rely on manual inspections, making it difficult to monitor the operating status of belt buckles in real time and prone to delays in fault detection. The present invention utilizes machine vision technology to capture the belt buckle area in real time during the operation of the belt conveyor. Through rapid analysis of the video stream, it can promptly detect abnormal conditions of the belt buckle and quickly feedback the results to the control center, providing strong support for the control center to make timely decisions, greatly shortening the time interval from fault occurrence to detection, effectively improving the real-time performance of belt buckle anomaly detection, and ensuring the continuous and stable operation of the belt conveyor.

[0146] Accurate regional capture and positioning: Innovatively, it is proposed to analyze the video stream based on the difference method, which can efficiently capture and accurately locate the belt buckle area. Compared with traditional methods, this approach can more accurately extract the belt buckle from the complex belt operation background, avoiding detection errors caused by inaccurate regional positioning, laying a solid foundation for subsequent detection steps, and greatly improving the detection accuracy.

[0147] Precise regional recognition: The belt buckle area is recognized using the semantic segmentation method. This method can clearly distinguish the belt buckle from other background parts, accurately identify the boundary and scope of the belt buckle, further improving the detection accuracy of the belt buckle, reducing false alarms and missed detections caused by inaccurate recognition, and ensuring the reliability of the detection results.

[0148] Accurate life detection: Based on the life detection method of the distance between the edges of the belt buckle, by achieving the detection of the target straight line, calculating the line distance, and performing linear regression analysis on the change of the line distance in the time domain, it can accurately evaluate the wear degree and life status of the belt buckle, providing accurate basis for the replacement and maintenance of the belt buckle, avoiding premature or late replacement of the belt buckle due to inaccurate life assessment, and improving the operating efficiency and safety of the equipment.

[0149] Greatly improved detection efficiency: Traditional belt buckle detection methods usually require a large amount of manpower and time for segment-by-segment inspections, with low efficiency. The automated detection method of the present invention realizes rapid and continuous detection of belt buckles without manual intervention, greatly shortening the detection cycle and improving the detection efficiency. At the same time, through rapid processing of a large amount of video stream data, it can complete the comprehensive detection of belt buckles during the entire belt operation process in a short time, improving the continuity and efficiency of production operations.

[0150] Reducing false alarm rate: In the processes of feature extraction, model training, and anomaly comparison and analysis, through learning a large amount of data and precise algorithm design, the system can accurately distinguish the normal state and abnormal state of the belt buckle, effectively reducing the false alarm rate. Compared with traditional detection methods, the present invention reduces unnecessary alarms caused by human judgment errors or inaccurate detection methods, improves the credibility of detection results, and avoids unnecessary interference and losses to production caused by false alarms.

[0151] Providing decision support: Real-time feedback of detection results provides comprehensive and accurate information on the operating state of the belt buckle to the control center, helping the control center make scientific and reasonable decisions in a timely manner. For example, when an anomaly occurs in the belt buckle, the control center can arrange maintenance personnel for processing in a timely manner according to the detection results to avoid further expansion of the fault; when the life of the belt buckle is about to expire, make preparations for replacement in advance to ensure the smooth progress of production. Brief Description of the Drawings

[0152] The present invention will be further described below in conjunction with the accompanying drawings.

[0153] Figure 1 is the system block diagram of the life analysis algorithm of the belt buckle based on machine vision technology of the present invention.

[0154] Figure 2 is a schematic diagram of the belt buckle image obtained by image acquisition and processing in the life analysis algorithm of the belt buckle based on machine vision technology of the present invention.

[0155] Figure 3 is the binary mask image obtained by region semantic analysis in the life analysis algorithm of the belt buckle based on machine vision technology of the present invention;

[0156] Figure 4 is a schematic diagram of the belt buckle images before and after visual correction in the life analysis algorithm of the belt buckle based on machine vision technology of the present invention;

[0157] Figure 5 is a schematic diagram of the belt buckle segmentation in the life analysis algorithm of the belt buckle based on machine vision technology of the present invention. Detailed Embodiments

[0158] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0159] Embodiment 1

[0160] Please refer toFigure 1 , Figure 2 , Figure 3 , Figure 4 , Figure 5 As shown in Figure 5 , the present invention is a service life analysis algorithm for belt buckles based on machine vision technology, including the following steps:

[0161] First step, image acquisition and processing:

[0162] Obtain the video stream of the belt buckle during operation through an industrial camera, then extract the video frames containing the belt buckle from the video stream, and record them as belt buckle images;

[0163] Second step, regional semantic analysis:

[0164] Manually mark the pixel points of the belt buckle area on multiple belt buckle images to obtain sample images, then train the FastSCNN model with the sample images, and then input the collected belt buckle images into the trained model. After threshold processing, a binary mask image is obtained to determine the belt buckle area image;

[0165] The specific method is as follows:

[0166] StepB1. Manually mark the pixel points of the belt buckle area on multiple pre-prepared images containing belt buckles, and obtain belt buckle sample images;

[0167] StepB2. Then use multiple belt buckle sample images as the training data set, and train the model through a pre-built FastSCNN model;

[0168] StepB3. Then input the belt buckle images collected in the first step into the trained FastSCNN model, and the FastSCNN model outputs a probability map of each pixel belonging to the "belt buckle" or "non-belt buckle" category;

[0169] StepB4. Then, by performing threshold processing on the probability map, in this embodiment, for example, pixels with a probability greater than 0.5 are determined as belt buckle pixels, and then a binary mask image is obtained, so as to determine the specific area of the belt buckle in the video frame, that is, the belt buckle area image is obtained;

[0170] In the binary mask image, 1 represents the belt buckle area, and 0 represents the non-belt buckle area;

[0171] Third step, visual correction:

[0172] Place a square grid in the same shooting scene as the belt buckle image, mark the pixel coordinates of its four vertices in the video frame, and according to the principle of projective transformation, use the projective transformation algorithm to adjust the vertices so that the lengths of the enclosing rectangle are the same and the four corners are 90 degrees, completing the visual correction of the belt buckle image;

[0173] The specific method is as follows:

[0174] Prepare a 1m x 1m square grid and place it in the same scene as the belt buckle image is taken;

[0175] Among them, the content captured by the industrial camera includes the image of the square grid and the belt buckle area;

[0176] In the obtained video frame, manually mark the pixel coordinates of the four vertices of the square grid in the image coordinate system;

[0177] Based on the four vertices of the square grid obtained by the annotation, combined with the principle of projective transformation, perform visual correction on the belt buckle image;

[0178] The method of visual correction is: in the video frame, adjust the four vertices of the square grid until the side lengths of the rectangle enclosed by the four vertices are all the same and the four corners of the rectangle are 90 degrees. At this time, the visual correction of the belt buckle image is completed;

[0179] Step 4. Belt buckle segmentation:

[0180] Extract the belt buckle area image after visual correction, mark the coordinates of the upper left corner and the lower right corner of its boundary, calculate the lengths in the x and y axis directions, determine the segmentation side length according to the long and short sides, calculate the number of segments, and sequentially cut out the corresponding number of small squares from the upper left corner and cut the belt buckle area picture according to the small squares;

[0181] The specific method is as follows:

[0182] StepW1. Extract the belt buckle area image after visual correction, then extract the coordinates of the upper left corner and the lower right corner of the belt buckle area in the belt buckle area image, and mark them as (x0, y0) and (x1, y1) respectively;

[0183] StepW2. Then, through W = x1 - x0 and H = y1 - y0, calculate the length W of the belt buckle area in the x-axis direction and the length H in the y-axis direction respectively;

[0184] StepW3. Then, calculate the number of segments of the belt buckle area image according to the lengths W and H;

[0185] The method is as follows:

[0186] When H > W, use the length W in the x-axis direction as the side length, and through Calculate the number of segments N of the belt buckle area image;

[0187] When W > H, use the length H in the y-axis direction as the side length, and through Calculate the number of segments N of the belt buckle area image;

[0188] In the formula, is the floor operation;

[0189] StepW4: When the side length is W in the x-axis direction, starting from the upper left corner of the buckle area image, N small squares with side length W are sequentially cut out downward. Among them, the upper left corner coordinates of each small square are (x0, y0 + i×W), and the lower right corner coordinates are (x0 + W, y0 + (i + 1)×W);

[0190] StepW5: Subsequently, the buckle area picture is cut according to the cut small squares;

[0191] Fifth step: Edge analysis:

[0192] Edge detection is performed on the input binary mask image by the Canny method. First, it is smoothed by Gaussian filtering, then the Sobel operator is used to calculate the gradients in the x and y directions. Subsequently, non-maximum suppression is used to refine the edges. The edges are determined based on the low and high thresholds, and then dilation and erosion operations are performed to finally determine the edge image;

[0193] The specific method is as follows:

[0194] StepU1: Use a Gaussian filter to smooth the binary mask image;

[0195] StepU2: Use the Sobel operator to calculate the gradient values of the image in the x and y directions respectively, and denote them as Gx and Gy;

[0196] StepU3: Perform non-maximum suppression on the gradient magnitude, only retaining the pixels with the local gradient maximum to refine the edges;

[0197] Specifically, for each pixel, check the two adjacent pixels in its gradient direction. If the gradient magnitude of this pixel is not the local maximum, set its gradient magnitude to 0;

[0198] StepU4: Determine the edges according to the preset low threshold and high threshold;

[0199] Pixels with gradient magnitude greater than the high threshold are defined as strong edge pixels;

[0200] Pixels with gradient magnitude between the low threshold and the high threshold are defined as weak edge pixels;

[0201] Among them, the weak edge pixels connected to the strong edge pixels are determined as the retained edge pixels;

[0202] StepU5: Subsequently, dilation and erosion operations are performed using a 5×5 kernel;

[0203] The dilation operation method is as follows: expand the foreground region in the binary mask image, that is, the region of white pixels. Then, slide the structuring element over the image. If the structuring element overlaps with the foreground region in the image, set the pixel corresponding to the center of the structuring element as a pixel in the foreground region;

[0204] Among them, the structuring element is a 5×5 kernel;

[0205] The erosion operation is opposite to the dilation operation. It is to shrink the foreground region in the image. Then, slide the structuring element over the image. Only when the structuring element is completely contained within the foreground region of the image, set the pixel corresponding to the center of the structuring element as a pixel in the foreground region;

[0206] Among them, the Canny method is a prior art;

[0207] StepU6. Then, based on the pixels of all foreground regions, determine the edge image;

[0208] Sixth step: Line detection:

[0209] Use the HoughLines line detection algorithm to perform line detection on the edge image and obtain multiple groups of lines and their corresponding endpoint coordinates respectively;

[0210] In this embodiment, before performing line detection, it is necessary to ensure that the edge detection step has been completed and the result image of edge detection has been obtained; this result image is a binary image, where white points represent edge pixels and black points represent non-edge pixels;

[0211] The line detection method is as follows:

[0212] StepC1. Construct an accumulator matrix:

[0213] First, establish the equation of a line in the polar coordinate system: ρ = xcosθ + ysinθ

[0214] Among them, ρ is the distance from the line to the upper left corner of the image, and θ is the angle between the line and the x-axis, and the range of θ is 0° - 180°;

[0215] Then, discretize ρ with a step size of 1 and discretize θ with a step size of 1 degree;

[0216] Next, determine that the size of the accumulator matrix is Q×G, where Q is the range of ρ values and G is the range of θ values;

[0217] In this embodiment, for a 1920×1080 image, the maximum possible value of ρ is the length of the image diagonal, approximately Considering positive and negative values, the range of ρ values is approximately from -2202 to 2202, a total of 4405 values;

[0218] In this embodiment, for the convenience of calculation, M is taken as 1920×1080 = 2073600; the value range of θ is 0° - 180°, and the step size is 1 degree, so the value of N is 180;

[0219] Therefore, the accumulator matrix is a 2073600×180 matrix;

[0220] Among them, for edge images of different sizes, the value of M needs to be adjusted according to the length and width of the edge image.

[0221] StepC2. Parameter Voting:

[0222] For each edge pixel point in the edge detection result, according to the polar coordinate equation ρ = xcosθ + ysinθ, when θ changes from 0° to 180° with a step size of 1 degree, a series of corresponding ρ values are calculated.

[0223] For each group (ρ, θ), the value at the corresponding position (ρ, θ) in the accumulator matrix is incremented by 1, and then the voting count for each [ρ, θ] combination recorded in the accumulator matrix is obtained;

[0224] StepC3. Peak Detection:

[0225] Find the local maximum value in the accumulator matrix whose voting count exceeds the preset voting threshold;

[0226] Among them, the local maximum value indicates that under the corresponding (ρ, θ) combination, there are more edge points supporting the existence of this straight line;

[0227] In this embodiment, it is assumed that the voting threshold is set to 60, that is, only when the value of [ρ, θ] is greater than or equal to 60, it is considered that the (ρ, θ) combination corresponds to a straight line in the image space;

[0228] StepC4. Straight Line Length Screening:

[0229] For each detected straight line, by finding the intersection points of the straight line and the image boundary in the edge image, and then calculating the distance between these two intersection points through the Euclidean distance formula, the length of the relevant straight line in the edge image is obtained;

[0230] Then compare the length of the relevant straight line in the edge image with the preset minimum straight line length: when the length in the edge image is greater than or equal to the minimum straight line length, the straight line is retained; otherwise, it is not retained;

[0231] In this embodiment, it is assumed that the preset minimum straight line length is 300, so only the straight lines with a length greater than or equal to 300 are retained;

[0232] Finally, obtain the remaining straight lines and their corresponding endpoint coordinates respectively, and save them;

[0233] Step 7. Non-maximum suppression of straight lines:

[0234] Calculate the lengths of the straight lines based on the endpoint coordinates of the straight lines and sort them. Select the longest line segment as the candidate straight line. Then calculate the slopes and intercepts of each group of straight lines, and based on the slopes and intercepts, retain the two longest non-intersecting straight lines;

[0235] The specific method is as follows:

[0236] StepY1. According to the corresponding endpoint coordinates of multiple groups of straight lines, calculate the lengths of each group of straight lines through the Euclidean distance formula. Then sort all the straight lines in descending order according to their lengths, and select the longest line segment as the candidate straight line;

[0237] The Euclidean distance formula is as follows:

[0238]

[0239] Where L j is the length of the j-th straight line, (xa j , ya j ) and (xb j , yb j ) are the coordinates of the two endpoints on the j-th straight line, and j is the serial number of the straight line;

[0240] StepY2. Subsequently, according to the coordinates of the two endpoints of the straight line, calculate the slope and intercept of the straight line through the two-point formula;

[0241] The calculation formula for the slope is as follows:

[0242]

[0243] Where E j is the slope of the j-th straight line;

[0244] The calculation formula for the intercept is as follows:

[0245] B j = yb j - E j × xb j

[0246] Where B j is the slope of the j-th straight line;

[0247] StepY3. Then traverse the sorted list of straight lines. For each candidate straight line, compare it with other straight lines;

[0248] If the slope difference between the candidate straight line and another straight line is less than 0.02 or the intercept difference is less than 10 pixels, it is considered that the candidate straight line and the other straight line belong to the same straight line;

[0249] StepY4. Finally, retain the two longest non-intersecting straight lines;

[0250] Eighth step, line spacing measurement:

[0251] Obtain the slopes and intercepts of the two non-intersecting straight lines determined in the seventh step, and then calculate the line spacing for them;

[0252] The line spacing calculation method is as follows:

[0253] Obtain the slopes and intercepts corresponding to the two non-intersecting straight lines, and mark them as E1, E2, B1, and B2 respectively;

[0254] Then through:

[0255] Calculate the perpendicular distance D between the two non-intersecting straight lines;

[0256] In this embodiment, since the two straight lines are parallel, the slopes are equal, that is, E1 = E2;

[0257] Ninth step, life analysis:

[0258] Extract the vertical distances corresponding to the straight lines in multiple video frames to form a data sequence, calculate the average value and standard deviation, and compare with the preset vertical distance critical value to determine whether the belt buckle is damaged; when not damaged, use linear fitting to calculate the historical width change rate, substitute the critical value and the average value to calculate the maximum and current usage time respectively, and subtract to obtain the remaining life;

[0259] The specific method is as follows:

[0260] StepH1. According to the methods in the second step to the eighth step, extract the vertical distances corresponding to the two non-intersecting straight lines in multiple video frames, and form them into a line spacing data sequence that changes with time, and mark it as D0 = {D1, D2,... Dg}, where g is the number of multiple video frames;

[0261] StepH2. Then calculate the average value and standard deviation of all the vertical distances in the line spacing data sequence;

[0262] The calculation method is as follows:

[0263]

[0264] Where s is the sequence number of multiple video frames, and s = 1, 2, ... g, Ds is the vertical distance corresponding to the s-th video frame, D1 and D2 are the average and standard deviation of all vertical distances in the line spacing data sequence, respectively;

[0265] Step H3, extracting a preset vertical distance critical value Dy, which represents the vertical distance threshold value of the belt buckle being damaged or worn;

[0266] Then, the average value D1 of all vertical distances in the line spacing data sequence measured within the corresponding shooting time of the current video stream is compared with the vertical distance critical value Dy;

[0267] If D1>Dy, it is determined that the belt buckle is damaged or worn;

[0268] If D1≤Dy, then compare each vertical distance Ds in the line spacing data sequence with the vertical distance critical value Dy. If there is a set of Ds>Dy, it is determined that the belt buckle is damaged or worn, otherwise it is determined that the belt buckle is not damaged or worn;

[0269] At the same time, the pre-set vertical distance fluctuation threshold Dz is extracted;

[0270] If D2>Dz, it means that the line spacing data fluctuates greatly, the wear of the belt buckle may be unstable, and there is a risk of abnormal wear;

[0271] If D2≤Dz, it means that the line spacing data is relatively stable and the belt buckle wears more evenly;

[0272] This embodiment uses an industrial camera to obtain video streams and extract frame images, accurately determines the belt buckle area through regional semantic analysis, uses square grids for visual correction to make the image more regular, and reasonably divides the belt buckle area image for detailed analysis. The Canny method and HoughLines algorithm are used for edge and line detection respectively, and the redundancy is reduced by non-maximum suppression of straight lines to accurately measure the line spacing. By calculating the statistical value of the vertical distance data sequence and comparing it with the preset value, the remaining life is calculated in combination with linear fitting, which realizes a scientific, systematic and accurate analysis of the belt buckle life, providing a reliable basis for belt buckle maintenance and replacement.

[0273] Embodiment 2

[0274] See also Figure 1 , Figure 2 , Figure 3 , Figure 4 , Figure 5 As shown, as the second embodiment of the present invention, when the present application is implemented, compared with the first embodiment, the technical solution of this embodiment is different from that of the first embodiment only in that: in this embodiment, the belt buckle image extraction method is as follows:

[0275] Step A1. Select two adjacent video frames from the video stream, and mark the pixel values of the pixel points at the coordinate (x, y) in the two video frames as S n (x, y) and S n+1 (x, y);

[0276] where x represents the abscissa of the pixel point in the video frame, represents the ordinate of the pixel point in the video frame, and n represents the serial number of the video frame;

[0277] Step A2. Select a column of pixel points, that is, pixel points with a fixed x value and different y values;

[0278] First, through: S0(x, y) = |S n (x, y) - S n+1 (x, y)|, calculate the difference value of the pixel values of the two adjacent video frames in the y-axis direction;

[0279] Then accumulate the difference values of this column of pixel values in the y-axis direction and obtain the accumulated difference value;

[0280] The calculation formula of the accumulated difference value is:

[0281] In the formula, y = 1, 2,... h, and h is the height of the video frame;

[0282] Step A3. Calculate the accumulated difference value of each column in the way of Step A2;

[0283] Then extract the peak value of the accumulated difference value from the accumulated difference value of each column;

[0284] Among them, the peak value of the accumulated difference value represents the position where the difference value between the two adjacent video frames is the largest in the corresponding column. In this embodiment, the peak value of the accumulated difference value is the position where the belt buckle passes through the industrial camera;

[0285] Step A4. Extract the preset accumulated difference threshold;

[0286] When the peak value of the accumulated difference value is greater than the accumulated difference threshold, then track and record the peak value generated by each frame of image until it returns to the normal level;

[0287] Then record all the peak values during the corresponding shooting time of the video stream, compare the sizes of all the peak values, and then take the frame corresponding to the largest peak value as the belt buckle image;

[0288] The unique method for extracting the belt buckle image in this embodiment calculates the pixel value differences in the y-axis direction between adjacent video frames and accumulates the difference values, extracts the peaks to determine the position where the belt buckle passes, and then selects more representative images, effectively improving the accuracy and reliability of image acquisition, making the subsequent analysis based on this image more targeted and accurate.

[0289] Embodiment III

[0290] Please refer to Figure 1 、 Figure 2 、 Figure 3 、 Figure 4 、 Figure 5 As shown in

[0291] a learning downsampling module, which is used to quickly reduce the resolution of the input image and reduce the subsequent calculation amount;

[0292] It consists of three convolutional layers, namely a common convolutional layer and two depthwise separable convolutional layers;

[0293] a global feature extractor, which is used to extract global features by using inverted residual blocks;

[0294] The inverted residual block first performs pointwise convolution for dimensionality increase, then performs depth convolution, and finally performs pointwise convolution for dimensionality reduction;

[0295] a feature fusion module, which is used to fuse the output of the learning downsampling module and the output of the global feature extractor;

[0296] It first performs bilinear interpolation upsampling on the output of the global feature extractor to make its resolution consistent with the output of the learning downsampling module, then splices the two, and finally performs feature fusion through a convolutional layer;

[0297] a classifier, which is used to perform convolutional operations on the fused feature map and output the probability map of each pixel belonging to different categories;

[0298] In this embodiment, the FastSCNN lightweight semantic segmentation network quickly reduces the image resolution through the learning downsampling module to reduce the calculation amount, effectively extracts the belt buckle features by using the global feature extractor of the inverted residual block, the feature fusion module improves the feature expression ability, and the classifier accurately outputs the pixel category probability map, realizing efficient and accurate semantic segmentation of the belt buckle image and providing high-quality feature information for subsequent analysis.

[0299] Example 4

[0300] Please refer to Figure 1 、 Figure 2 、 Figure 3 、 Figure 4 、 Figure 5 As shown in the figures, as Example 4 of the present invention, in the specific implementation of this application, compared with Example 1, Example 2, and Example 3, the difference between this example and Example 1, Example 2, and Example 3 is only that in this example: the method of adjusting the four vertices of the square grid is as follows: using the projection transformation algorithm to map the vertices of the quadrilateral in the image to a new coordinate system, so that the quadrilateral presents a shape closer to a square in the new coordinate system, and then by adjusting the parameters of the transformation matrix, the vertices of the quadrilateral satisfy the conditions of consistent side lengths and four corners of 90 degrees after the transformation;

[0301] In this example, the projection transformation algorithm is used to map the vertices of the square grid quadrilateral to a new coordinate system and adjust the parameters, so that the quadrilateral meets the side length and angle conditions, further improving the accuracy of the visual correction of the buckle image, making the image more in line with the standards and requirements of subsequent analysis, and helping to improve the accuracy and reliability of the entire analysis process.

[0302] Example 5

[0303] Please refer to Figure 1 、 Figure 2 、 Figure 3 、 Figure 4 、 Figure 5 As shown in the figures, as Example 5 of the present invention, in the specific implementation of this application, compared with Example 1, Example 2, Example 3, and Example 4, the technical solution of this example is to combine and implement the solutions of the above Example 1, Example 2, Example 3, and Example 4. The difference between this example and Example 1, Example 2, Example 3, and Example 4 is only that in this example, the life analysis step further includes the following content:

[0304] StepH4: When the buckle is not damaged, calculate the historical width change rate corresponding to the buckle based on the method of linear fitting;

[0305] The method is as follows:

[0306] The change relationship of the vertical distance with time is represented by the linear fitting equation y = ax + b;

[0307] Where x represents the time serial number of the video frame, and y represents the vertical distance;

[0308] Then, a and b in the linear fitting equation are solved by the least square method; where a is the historical width change rate corresponding to the buckle;

[0309] Step H5: Extract the vertical distance critical value Dy corresponding to the damage of the belt buckle, then substitute it into the linear fitting equation y = ax + b, and record the obtained x value as the maximum service time;

[0310] Substitute the average value D1 of all vertical distances in the line spacing data sequence measured during the shooting time corresponding to the current video stream into the linear fitting equation y = ax + b, and record the obtained x value as the current service time;

[0311] Then subtract the current service time from the maximum service time to calculate the remaining life of the belt buckle.

[0312] In the life analysis section, in this embodiment, when the belt buckle is not damaged, the historical width change rate is calculated based on linear fitting, the wear trend can be clearly grasped, the vertical distance critical value and the current average value are substituted into the linear fitting equation to calculate the maximum and current service times, so as to obtain the remaining life, providing an accurate time reference for the maintenance and replacement of the belt buckle, facilitating the reasonable planning of the maintenance plan, and reducing the risk of equipment failure caused by belt buckle problems.

[0313] Embodiment Six

[0314] Please refer to Figure 1 、 Figure 2 、 Figure 3 、 Figure 4 、 Figure 5 As shown in, as Embodiment Six of the present invention, when the present application is specifically implemented, compared with Embodiment One, Embodiment Two, Embodiment Three, Embodiment Four and Embodiment Five, the technical solution of this embodiment is to combine and implement the solutions of the above Embodiment One, Embodiment Two, Embodiment Three, Embodiment Four and Embodiment Five.

[0315] This embodiment integrates the advantages of the previous five embodiments, forming a complete, comprehensive and accurate belt buckle life analysis system. Each link from image acquisition to life assessment has been optimized and improved, and can analyze the life and wear condition of the belt buckle more comprehensively and deeply, providing a more powerful and reliable technical support for practical applications, and effectively ensuring the stability and reliability of equipment operation.

[0316] The above formulas are all dimensionless and take their numerical values for calculation. The formulas are obtained by collecting a large amount of data for software simulation to obtain a formula closest to the actual situation. The preset parameters and threshold selection in the formulas are set by those skilled in the art according to the actual situation.

[0317] As described above, it is only the specific implementation manner of the present application. However, the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims described above.

Claims

1. Belt buckle life analysis algorithm based on machine vision technology, characterized in that, It includes the following steps: Use an industrial camera to obtain the video stream during the operation of the buckle, extract the video frames containing the buckle, and record them as buckle images; then manually label the pixel points in the buckle area to obtain sample images, and then train the FastSCNN model. Input the buckle image, obtain the binary mask image through threshold processing, and determine the buckle area image; Place a square grid in the same shooting scene and label the pixel coordinates of its vertices. Then use the projective transformation algorithm to adjust the vertices to complete image visual correction; then extract the corrected buckle area image and mark the boundary coordinates. Then calculate the cutting side length and quantity, and cut out small squares; Use the Canny method to detect the edges of the binary mask image. Determine the edge image through Gaussian filtering, Sobel operator calculation, non-maximum suppression, threshold determination, dilation and erosion operations; then use the HoughLines algorithm to detect the straight lines in the edge image to obtain the straight lines and their endpoint coordinates; then calculate the lengths of the straight lines through the endpoint coordinates of the straight lines and sort them. Select the longest line segment as the candidate, calculate the slope and intercept, and retain the two longest non-intersecting straight lines; Calculate the vertical distance according to the slopes and intercepts of the two retained non-intersecting straight lines; then extract the data sequence composed of the vertical distances of the straight lines, and then calculate the average value and standard deviation corresponding to the data sequence, and judge whether the buckle is damaged based on them. When the buckle is not damaged, calculate its remaining life.

2. The lifespan analysis algorithm of the belt buckle based on machine vision technology according to claim 1, characterized in that, The method for extracting the buckle image is as follows: Step A1: Select two adjacent video frames from the video stream, and mark the pixel values of the pixel points at the coordinate (x, y) in the two video frames as S n (x, y) and S n+1 (x, y); Among them, x represents the abscissa of the pixel point in the video frame, represents the ordinate of the pixel point in the video frame, and n represents the serial number of the video frame; StepA2: Select a column of pixel points, that is, pixel points with a fixed x value and different y values; First, calculate the difference value of the pixel values of two adjacent video frames in the y-axis direction through: S0(x, y) = |S n (x, y) - S n+1 (x, y)| Then accumulate the difference values of the pixel values in this column in the y-axis direction to obtain the accumulated difference value; StepA3: Calculate the accumulated difference value of each column in the manner of StepA2; Then extract the peak value of the accumulated difference value from the accumulated difference value of each column. The peak value of the accumulated difference value represents the position with the largest difference value between two adjacent video frames in the corresponding column; StepA4: Extract the preset accumulated difference threshold; When the peak value of the accumulated difference value is greater than the accumulated difference threshold, track and record the peak value generated by each frame of image until it returns to the normal level; Then record all the peak values during the corresponding shooting time of the video stream, compare the sizes of all the peak values, and then take the frame corresponding to the largest peak value as the buckle image.

3. The life analysis algorithm of the belt buckle based on machine vision technology according to claim 1, wherein The specific method of regional semantic analysis is as follows: StepB1: Manually label the pixel points in the buckle area on multiple pre-prepared images containing the buckle to obtain buckle sample images; StepB2: Then use multiple buckle sample images as the training data set and perform model training through the pre-built FastSCNN model; StepB3: Then input the buckle image collected in the first step into the trained FastSCNN model. The FastSCNN model outputs a probability map of each pixel belonging to the "buckle" or "non-buckle" category; StepB4. Subsequently, by performing threshold processing on the probability map, a binary mask image is obtained, that is, the image of the buckle area is obtained; In the binary mask image, 1 represents the buckle area, and 0 represents the non-buckle area.

4. The lifespan analysis algorithm of the belt buckle based on machine vision technology according to claim 1, characterized in that, The specific method of visual correction is as follows: Prepare a 1m x 1m square grid and place it in the same scene as the buckle image is taken; In the acquired video frame, manually mark the pixel coordinates of the four vertices of the square grid in the image coordinate system; Based on the four vertices of the marked square grid, combined with the principle of projective transformation, perform visual correction on the buckle image; The method of visual correction is: in the video frame, adjust the four vertices of the square grid until the side lengths of the rectangle enclosed by the four vertices are all the same and the four corners of the rectangle are 90 degrees. At this time, the visual correction of the buckle image is completed.

5. The lifespan analysis algorithm of the belt buckle based on machine vision technology according to claim 1, wherein The specific method of buckle segmentation is as follows: StepW1. Extract the buckle area image after visual correction, and then extract the upper left corner coordinate and the lower right corner coordinate of the buckle area in the buckle area image, and mark them as (x0, y0) and (x1, y1) respectively; StepW2. Then, through W = x1 - x0 and H = y1 - y0, calculate the length W of the buckle area in the x-axis direction and the length H in the y-axis direction respectively; StepW3. Subsequently, based on the lengths W and H, calculate the segmentation quantity of the buckle area image; The method is as follows: When H > W, the length W in the x-axis direction is used as the side length, and by calculate the number of segments N of the buckle area image; When W > H, use the length H in the y-axis direction as the side length, and through calculate the number of segments N of the buckle area image; In the formula, is the floor operation; StepW4. When the side length is W in the x-axis direction, starting from the upper left corner of the buckle area image, sequentially cut out N small squares with a side length of W downward. Among them, the upper left corner coordinates of each small square are (x0, y0 + i×W), and the lower right corner coordinates are (x0 + W, y0 + (i + 1)×W); StepW5. Then, segment the buckle area picture according to the segmented small squares.

6. The life analysis algorithm of the belt buckle based on machine vision technology according to claim 1, characterized in that, The specific method of edge analysis is as follows: StepU1. Use a Gaussian filter to smooth the binary mask image; StepU2. Use the Sobel operator to calculate the gradient values of the image in the x and y directions respectively, and mark them as Gx and Gy; StepU3. Perform non-maximum suppression on the gradient magnitude, only retaining the pixels of the local gradient maximum to refine the edge; Specifically, for each pixel, check the two adjacent pixels in its gradient direction. If the gradient magnitude of this pixel is not the local maximum, set its gradient magnitude to 0; StepU4. Determine the edge according to the preset low threshold and high threshold; Pixels whose gradient magnitude is greater than the high threshold are defined as strong edge pixels; Pixels whose gradient magnitude is between the low threshold and the high threshold are defined as weak edge pixels; Among them, the weak edge pixels connected to the strong edge pixels are determined as the retained edge pixels; StepU5. Then perform dilation operation and erosion operation using a 5×5 kernel; StepU6. Subsequently, determine the edge image according to all the pixels of the foreground area.

7. The lifespan analysis algorithm of the belt buckle based on machine vision technology according to claim 1, characterized in that, The line detection method is as follows: Among them, the edge image is a binary image, and its white points represent edge pixels, and black points represent non-edge pixels; StepC1. Construct the accumulator matrix: First, establish the equation of a straight line in the polar coordinate system: ρ = xcosθ + ysinθ; where ρ is the distance from the straight line to the upper left corner of the image, and θ is the angle between the straight line and the x-axis; Subsequently, discretize ρ with a step size of 1 and discretize θ with a step size of 1 degree; Next, determine the size of the accumulator matrix as Q×G, where Q is the value range of ρ and G is the value range of θ; StepC2. Parameter voting: For each edge pixel point in the edge detection result, according to the polar coordinate equation ρ = xcosθ + ysinθ, when θ changes from 0° to 180° with a step size of 1 degree, calculate a series of corresponding ρ values; For each group of (ρ, θ), add 1 to the value at the corresponding position (ρ, θ) in the accumulator matrix, and then obtain the voting count of each [ρ, θ] combination recorded in the accumulator matrix; StepC3. Peak detection: Find the local maximum value in the accumulator matrix whose voting count exceeds the preset voting threshold; Among them, the local maximum value represents the straight line with the most corresponding edge points under the corresponding (ρ, θ) combination; StepC4. Straight line length screening: For each detected straight line, find the intersection points of the straight line and the image boundary in the edge image, and then calculate the distance between these two intersection points through the Euclidean distance formula to obtain the length of the relevant straight line in the edge image; Subsequently, compare the length of the relevant straight line in the edge image with the preset minimum straight line length: when the length in the edge image is greater than or equal to the minimum straight line length, retain the straight line; otherwise, do not retain it; Finally, obtain the retained straight lines and their corresponding endpoint coordinates respectively, and save them.

8. The lifespan analysis algorithm of the belt buckle based on machine vision technology according to claim 1, wherein, The specific method of non-maximum suppression of straight lines is as follows: StepY1. According to the corresponding endpoint coordinates of multiple groups of straight lines, calculate the lengths of each group of straight lines through the Euclidean distance formula, then sort all the straight lines from largest to smallest according to their lengths, and select the longest line segment as the candidate line; StepY2. Subsequently, according to the two endpoint coordinates of the straight line, calculate the slope and intercept of the straight line through the two-point form formula; StepY3. Then traverse the sorted straight line list. For each candidate line, compare it with other lines; If the slope difference between the candidate line and another line is less than 0.02 or the intercept difference is less than 10 pixels, it is considered that the candidate line and another line belong to the same straight line; StepY4. Finally, retain the two longest non-intersecting straight lines.

9. The lifespan analysis algorithm of the belt buckle based on machine vision technology according to claim 1, wherein, The calculation method of line spacing is as follows: Obtain the slopes and intercepts corresponding to two non-intersecting straight lines, and mark them as E1, E2, B1, and B2 respectively; Then by: Calculate the perpendicular distance D between the two non-intersecting straight lines.

10. The life analysis algorithm of the belt buckle based on machine vision technology according to claim 1, characterized in that, The specific method of life analysis is as follows: StepH1. In the manner of the second step to the eighth step, extract the perpendicular distances corresponding to two non-intersecting straight lines in multiple video frames, and form them into a line spacing data sequence that changes with time, and mark it as D0 = {D1, D2,... Dg}, where g is the number of multiple video frames; Step H2. Next, calculate the average value and standard deviation of all vertical distances in the line spacing data sequence, and mark them as D1 and D2 respectively; Step H3. Extract the preset vertical distance critical value Dy, which represents the vertical distance threshold for belt buckle damage or wear; Then compare the average value D1 of all vertical distances in the line spacing data sequence measured during the shooting time corresponding to the current video stream with the vertical distance critical value Dy; If D1 > Dy, it is determined that the belt buckle is damaged or worn; If D1 ≤ Dy, then compare each vertical distance Ds in the line spacing data sequence with the vertical distance critical value Dy respectively. If there is a group of Ds > Dy, it is determined that the belt buckle is damaged or worn, otherwise it is determined that the belt buckle is not damaged or worn; Meanwhile, extract the preset fluctuation threshold Dz of the vertical distance; If D2 > Dz, it indicates that there is a risk of abnormal wear of the belt buckle; If D2 ≤ Dz, it indicates that the wear of the belt buckle is relatively uniform; Step H4. When the belt buckle is not damaged, calculate the historical width change rate corresponding to the belt buckle based on the method of linear fitting; The method is as follows: The relationship between the vertical distance and time is represented by the linear fitting equation y = ax + b; Where x represents the time sequence number of the video frame, and y represents the vertical distance; Then solve a and b in the linear fitting equation by the least square method; where a is the historical width change rate corresponding to the belt buckle; Step H5. Extract the vertical distance critical value Dy corresponding to belt buckle damage, then substitute it into the linear fitting equation y = ax + b, and record the obtained x value as the maximum service time; Then substitute the average value D1 of all vertical distances in the line spacing data sequence measured during the shooting time corresponding to the current video stream into the linear fitting equation y = ax + b, and record the obtained x value as the current service time; Then subtract the current service time from the maximum service time to calculate the remaining life of the belt buckle.

Citation Information

Patent Citations

  • Modeling method of sea wave significant wave height inversion model

    CN103839104A

  • Straight line detection-based safety belt detecting algorithm

    CN103871052A

  • Belt edge tearing detection method

    CN114926446A

  • Anti-counterfeiting identification method based on automobile parts

    CN115100210A

  • Real-time detection and early warning method for abrasion state of parts of high-speed elevator

    CN116703924A