A wheel hub recognition and positioning method and system based on machine vision

The high-speed wheel hub is accurately positioned and marked by the machine vision system, which solves the problem of low efficiency of manual vision and realizes efficient and safe hub surface information marking.

CN116580104BActive Publication Date: 2025-10-14CHANGZHOU XIAOYUN SHENSUO INTELLIGENT TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310448826.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-24
Publication Date
2025-10-14
Estimated Expiration
2043-04-24

AI Technical Summary

Technical Problem

In the existing technology, it is impossible to accurately and efficiently mark traceability information on the surface of high-speed wheel hubs after quenching, and manual vision is inefficient and poses safety risks.

Method used

A wheel hub identification and positioning method based on machine vision is adopted. The wheel hub is captured by an industrial camera and processed by a visual processing module. Combined with the self-occlusion algorithm, wheel hub identification algorithm, tempering zone positioning algorithm and quenching zone positioning algorithm, the precise positioning and marking of the wheel hub can be achieved.

Benefits of technology

It improves the efficiency and accuracy of wheel hub surface marking, reduces manual work, reduces safety risks, and reduces operation and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116580104B_ABST
    Figure CN116580104B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on machine vision's wheel hub identification positioning method and system, belong to image processing technical field, system includes first industrial camera, second industrial camera, vision processing module, marking device, two door type supports, roller;The first industrial camera, second industrial camera are respectively installed on two the door type supports, located above the roller, for shooting the work area and waiting area of roller, the vision processing module is respectively connected with first industrial camera, second industrial camera communication, wherein hub identification algorithm, self-block algorithm, annealing zone positioning algorithm and quenching zone positioning algorithm are deployed.The application has the advantages of low cost, convenient deployment, etc., can effectively replace artificial vision to carry out wheel hub surface marking operation;Especially in high-temperature dangerous environment, it can effectively reduce the number of human operation, reduce safety accidents, save operation and maintenance cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a wheel hub identification and positioning method and system based on machine vision. Background Art

[0002] Currently, after high-speed wheel hubs undergo quenching and tempering processes, traceability management information such as production date, wheel model, and size needs to be marked on the hub surface. Since the hub is still at a high temperature after tempering, using a clamp to fix it will affect the internal structure of the hub. Therefore, manual vision is the only way to mark the wheel model, size and other information on the hub quenching strip after tempering and cooling.

[0003] Due to the inherent properties of artificial vision, such as limited accuracy, slow processing speed, fatigue and errors, it is impossible to accurately and efficiently mark information on the wheel hub quenching strip. Therefore, a wheel hub recognition and positioning method based on machine vision is proposed. Summary of the Invention

[0004] The technical problem to be solved by the present invention is how to improve the efficiency of high-speed wheel hub surface marking operations, and provides a wheel hub identification and positioning method based on machine vision.

[0005] The present invention solves the above-mentioned technical problems through the following technical solutions, which include the following steps:

[0006] S1: The working area is photographed by the first industrial camera, while the waiting area is photographed by the second industrial camera. The real-time images are sent to the visual processing module. The visual processing module uses the self-blocking algorithm to predict whether the wheel hub arriving at the waiting area will collide with the wheel hub parked in the working area. If not, the process goes to step S2. Otherwise, the roller conveyor stopping device is triggered to stop the wheel hub in the waiting area and release the wheel hub after the stopping time expires.

[0007] S2: The visual processing module calls the wheel recognition algorithm to identify whether a wheel exists in the workspace image. If a wheel is detected in the workspace image, the target detection frame position coordinates are given and the process goes to step S3. Otherwise, the first industrial camera continues to capture the workspace and sends the real-time image to the visual processing module.

[0008] S3: The visual processing module adjusts the tempering zone positioning algorithm to detect the center point of the inner ring of the wheel hub and the area where the tempering zone is located;

[0009] S4: The visual processing module calls the quenching belt positioning algorithm to detect the area where the quenching belt is located and sends the position coordinates to the labeling device. The labeling device uses the area where the quenching belt is located as the restricted range to formulate a labeling plan and then performs the labeling operation.

[0010] Further, in the step S1, the first industrial camera is fixed relative to the working area position, and the second industrial camera is fixed relative to the waiting area position, and the first industrial camera and the second industrial camera shoot the working area and the waiting area above the roller way, and send the real-time images shot to the visual processing module, wherein the running speed of the roller way is a fixed value.

[0011] Further, in the step S1, the self-blocking algorithm comprises the following steps:

[0012] S11: A rectangular frame pixel coordinate of the waiting area is set in advance in a picture area of the waiting area shot by the second industrial camera;

[0013] S12: After receiving the real-time image shot by the second industrial camera, a wheel hub rectangular frame is set as box1 by a wheel hub recognition algorithm, a waiting area rectangular frame is set as box2, and an intersection-over-union of the box1 and the box2 is calculated, that is:

[0014]

[0015] The criterion 1 is set as follows:

[0016]

[0017] Wherein, a is a threshold constant, that is, when the intersection-over-union of the wheel hub rectangular frame and the waiting area rectangular frame is greater than the threshold, it is considered that the wheel hub completely enters the waiting area, at this time, f1=1, and the value of the counter A with an initial value of-1 is added by 1; otherwise, if f1=0, the step S12 is continuously executed;

[0018] S13: Whether the value in the counter A is-1 is judged, if yes, a time stamp variable t0 is used to record the time when the wheel hub completely arrives at the waiting area, and the step S02 is turned to; if no, a time stamp variable t1 is used to record the time when the wheel hub completely arrives at the waiting area, and a time difference Δt=t1-t0 is calculated, and then a marking device action time T w is calculated, and the criterion 2 is set as follows:

[0019]

[0020] Wherein: ΔT is the time length that each wheel hub should be stopped when arriving at the waiting area, that is: when the marking device action time T w is greater than the time difference of the two wheel hubs arriving at the waiting area, the wheel hub arriving at the roller way later will affect the wheel hub being marked, at this time, ΔT=T w -Δt; otherwise, the wheel hub arriving at the roller way later will not affect the marking of the wheel hub, at this time, ΔT=0;

[0021] S14: Trigger the waiting area roller stop device to stop the wheel hub in the waiting area for ΔT. When ΔT=0, the roller stop device does not move. Then, the variable t0 is updated according to the stop time, that is:

[0022] t0=t1+ΔT

[0023] Wherein, t1 is the moment when the wheel hub arrives at the waiting area, ΔT is the time length that the wheel hub needs to be stopped in the waiting area, t0 is the moment when the wheel hub is released, and then go to step S12.

[0024] Furthermore, in the step S1, after receiving the stopping information from the visual processing module, the roller conveyor stopping device separates the transmission shaft of the waiting area roller conveyor motor from the waiting area roller conveyor.

[0025] Furthermore, in step S2, the wheel hub recognition algorithm specifically includes the following steps:

[0026] S21: Model Training

[0027] Images of wheel hubs from the wheel hub production line were collected and a dataset was created. The dataset was then used to train the improved Yolov5s network. The Adam optimizer was used to optimize network learning, and the Step learning rate scheduling strategy was used to control the training process. This resulted in a trained network model.

[0028] S22: Input Prediction

[0029] The image to be recognized is input into the trained network model for prediction. The network model generates a detection frame based on the input image features.

[0030] S23: Output results

[0031] The non-maximum suppression (NMS) algorithm is used to remove duplicate detection frames and select the detection frame with the highest confidence as the final detection result. The detection result includes the position coordinates of the rectangular frame where the wheel hub is located, and the detection frame is a rectangular frame.

[0032] Furthermore, in step S21, the CSP residual block in the original Yolov5s network is replaced with a Faster-CSP module to reduce the number of model parameters and computational complexity; an effective channel attention mechanism module is introduced to deepen the network's attention to target features, and finally CDice Loss is used as the boundary loss function to obtain an improved Yolov5s network.

[0033] Furthermore, in step S2, the tempering zone positioning algorithm includes the following steps:

[0034] S31: Set the hub rectangular box given by the hub recognition algorithm to box3, set the workspace rectangular box to box4, and calculate the intersection and union ratio of box3 and box4, that is:

[0035]

[0036] Set criterion 3 as follows:

[0037]

[0038] Wherein, β is a threshold constant, that is, when the intersection-and-union ratio of the rectangular box where the wheel hub is located and the rectangular box of the working area is greater than the threshold, it is considered that the wheel hub has completely entered the working area. At this time, f3=1, triggering the roller stop device to stop the wheel hub at the working area roller stop device, and intercepting the rectangular box area corresponding to box3 as the area of ​​interest Area1; on the contrary, if f3=0, at this time the wheel hub has not completely entered the working area, and the position coordinates of box3 are updated according to the results of the wheel hub recognition algorithm, and then continue to execute step S31;

[0039] S32: Perform Gaussian noise reduction on the image of Area1, and then extract the R channel image Img of the image R According to Img R Grayscale histogram of Img R Perform adaptive image binarization to obtain the binarized image Img B Then, the image is eroded twice and expanded twice to obtain a connected image. Then, all connected domains in the connected image are extracted and the areas S1, S2, ..., S of each connected domain are calculated. n , extract the connected area with the largest area as the target area, and set the pixel values ​​of other connected areas to 0 to obtain the binary image Area1 containing only the tempering zone area img ; Then use the Canny operator to calculate Area1 img Edge extraction is performed to obtain the outer contour of the tempering zone, which is recorded as: L1, and the inner contour is recorded as: L2. Then the moment of the contour L1 is calculated, that is:

[0040]

[0041] Among them, i and j represent the order of the moment, I(x, y) represents the pixel value at the position (x, y), and the center of gravity coordinates (x) of the hub are calculated based on the second moment. c ,y c ),Right now:

[0042]

[0043] Among them, M 00Represents the contour area, that is, the center of gravity of the contour is determined by the first-order moment and the zero-order moment, and the center of gravity of the contour in the binary image can be considered as the coordinates of the center point of the tempering zone: (x c ,y c ), and then through the point (x c ,y c ) and the edge point are divided into the outer contour L1 and the inner contour L2, and then all points on the outer contour L1 and the inner contour L2 of the tempering strip are obtained respectively to perform the circle optimal parameter fitting by the least square method, that is:

[0044]

[0045] Among them, F(x) is the predicted value, y i is the actual observed value, that is, when the residual between the actual observed value and the predicted value is the smallest, the fitted circle parameters are most consistent with the actual parameters. Finally, according to the fitting results, the center of the inner contour of the tempering zone is recorded as O: (x f ,y f ), the radius is recorded as: r f , the outer contour radius is recorded as: R f , then the tempering zone area is O: (x f ,y f ) is the center of the circle and the outer diameter is R f , inner diameter is r f The circular area is used to identify the tempering zone area.

[0046] Furthermore, in step S4, the quenching zone positioning algorithm includes the following steps:

[0047] S41: The R channel image Img obtained in step S32 R Perform Canny edge detection with a threshold of (100, 200) and get the edge image as: Img E , and then Img E All pixels in the image located in the contour L1 are removed, and the binary image containing the outer contour edge of the quenching zone is obtained and recorded as: Img H ;

[0048] S42: Traverse all edge points to generate edge point coordinate set: P i =[P1(x,y),P2(x,y),…,P n (x,y)], calculate the coordinate set P i All elements in the tempering zone inner contour center O obtained in step S32: (x f ,y f )The length of the connection is obtained

[0049]

[0050] S43: Perform K-Means clustering on the set D, with a K value of 2, to obtain radius clusters and non-radius clusters, and then record the cluster center of the radius cluster as: Considered to be the radius length of the hub;

[0051] S44: The quenching zone area of ​​the wheel is O: (x f ,y f ) is the center of the circle and the outer diameter is Inner diameter is R f The circular area is recorded as C, and area C is the marked area on the hub surface. Finally, the coordinates of the marked area are converted into world coordinates using the internal and external parameters of the camera and sent to the marking device. The marking device uses the area where the quenching zone is located as the restricted range to formulate a marking plan and then perform the marking operation.

[0052] The present invention also provides a wheel hub identification and positioning system based on machine vision, which adopts the above-mentioned wheel hub identification and positioning method to realize the positioning of the marking range of the wheel hub surface, including: a first industrial camera, a second industrial camera, a visual processing module, a marking device, two gantry brackets, and a roller conveyor; the first industrial camera and the second industrial camera are respectively installed on the two gantry brackets, located above the roller conveyor, and are used to shoot the working area and waiting area of ​​the roller conveyor; the visual processing module is respectively communicated with the first industrial camera and the second industrial camera, and is deployed with a wheel hub identification algorithm, a self-blocking algorithm, a tempering zone positioning algorithm and a quenching zone positioning algorithm, which are used to receive and process real-time images taken by the first industrial camera and the second industrial camera; the marking device is used to formulate a marking plan according to the marking area and perform marking operations on the wheel hub surface.

[0053] Compared with the existing technology, the present invention has the following advantages: the wheel hub identification and positioning method and system based on machine vision have the advantages of low cost and convenient deployment, and can effectively replace manual vision for wheel hub surface marking operations; especially in high-temperature and dangerous environments, it can effectively reduce the number of manual operations, reduce safety accidents, and save operation and maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 1 is a system deployment diagram of a wheel hub recognition and positioning system based on machine vision in an embodiment of the present invention;

[0055] Figure 2 Schematic diagram of the positions of the tempering zone and the quenching zone in an embodiment of the present invention;

[0056] Figure 3 1 is a flow chart of a method for identifying and locating a wheel hub based on machine vision in an embodiment of the present invention;

[0057] Figure 4aThis is a schematic diagram showing a low confidence level of prediction using the original Yolov5s network in Example 2 of the present invention;

[0058] Figure 4b This is a schematic diagram of the missed detection phenomenon in the original Yolov5s network in Example 2 of the present invention;

[0059] Figure 4c Schematic diagram of the false detection phenomenon occurring through the original Yolov5s network in the second embodiment of the present invention;

[0060] Figure 5a Schematic diagram of the improved Yolov5s network prediction with higher confidence in the second embodiment of the present invention;

[0061] Figure 5b Schematic diagram showing that the improved Yolov5s network does not miss detections in the second embodiment of the present invention;

[0062] Figure 5c Schematic diagram showing that the improved Yolov5s network does not have false detection in the second embodiment of the present invention;

[0063] Figure 6a is an image (one frame) in the video captured by the industrial camera 2 in the second embodiment of the present invention;

[0064] Figure 6b This is a schematic diagram of a rectangular box 1 obtained by the wheel hub recognition algorithm in the second embodiment of the present invention;

[0065] Figure 6c This is a schematic diagram of a rectangular box 3 obtained by the wheel hub recognition algorithm in the second embodiment of the present invention;

[0066] Figure 6d is a schematic diagram of the region of interest Aear1 obtained by intercepting in the second embodiment of the present invention;

[0067] Figure 6e is a connected image obtained after corrosion and expansion in the second embodiment of the present invention;

[0068] Figure 6f This is a binary image containing only the tempering zone area in the second embodiment of the present invention;

[0069] Figure 6g Schematic diagram of the outer contour L1 and inner contour L2 of the tempering zone in the second embodiment of the present invention;

[0070] Figure 6h Schematic diagram of the outer contour of the quenching zone extracted by Canny edge detection in the second embodiment of the present invention;

[0071] Figure 6lThis is a schematic diagram of the detection results in Example 2 of the present invention (wherein the blue outline is the detected outer outline of the quenching band, the red outline is the detected inner outline of the quenching band, and the central green dot is the detected center of the wheel hub). DETAILED DESCRIPTION

[0072] The following is a detailed description of an embodiment of the present invention. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process. However, the protection scope of the present invention is not limited to the following embodiment.

[0073] Example 1

[0074] like Figure 1 As shown, this embodiment provides a technical solution: a wheel hub identification and positioning system based on machine vision, comprising: industrial cameras 1, 2, a visual processing module 3, a labeling device 4, a gantry bracket 5, and a roller 6; wherein, the industrial camera 1 and the industrial camera 2 are installed above the roller 6 for photographing the working area and the waiting area of ​​the roller 6, the visual processing module 2 is communicatively connected with the industrial cameras 1, 2, and the visual processing module 2 is deployed with a wheel hub identification algorithm, a self-blocking algorithm, a tempering zone positioning algorithm, and a quenching zone positioning algorithm for receiving and processing wheel hub images; the labeling device 4 is installed on one side of the roller 6 for performing labeling operations on the wheel hub surface according to the coordinates of the operation starting point; the gantry bracket 5 is used to fix the industrial cameras 1, 2.

[0075] like Figure 2-3 As shown, this embodiment also provides a wheel hub identification and positioning method based on machine vision, which is used to implement the positioning work of the marked range on the wheel hub surface using the above-mentioned wheel hub identification and positioning system based on machine vision, including the following steps:

[0076] Step (1): Industrial camera 1 captures the working area, while industrial camera 2 captures the waiting area, and sends the real-time image to the visual processing module; the visual processing module calls the self-blocking algorithm to determine whether the wheel hub entering the waiting area will affect the wheel hub being marked. If not, go to step (2); otherwise, trigger the roller stop device to stop the wheel hub in the waiting area, and release the wheel hub after the stop time ends;

[0077] Step (2): The visual processing module calls the wheel recognition algorithm to identify whether there is a wheel in the work area. If a wheel is detected in the work area image, the position coordinates of the target detection frame are given and the process goes to step (3). Otherwise, the industrial camera 1 continues to shoot the work area and sends the real-time image to the visual processing module.

[0078] Step (3): The visual processing module calls the tempering zone positioning algorithm to detect the center point position of the inner ring of the wheel hub and the location of the tempering zone;

[0079] Step (4): The visual processing module calls the quenching zone positioning algorithm to determine the tempering zone area, and then uses the marking device 4 to formulate a marking plan according to the area where the tempering zone is located, and then performs the marking operation.

[0080] In step (1), the position of the industrial camera 2 and the waiting area is relatively fixed, the running speed of the roller is also fixed, and the action time of the marking device 4 is stabilized at a specific time T w ,Industrial camera 2 shoots the waiting area downward and sends the real-time image to the visual processing module.

[0081] In step (1), the self-occlusion algorithm includes the following steps:

[0082] S11: Pre-set pixel coordinates of a rectangular frame of the waiting area in the waiting area image captured by the industrial camera 2;

[0083] S12: After receiving the video captured by industrial camera 2, the wheel hub rectangular box is set as box1 through the wheel hub recognition algorithm, and the waiting area rectangular box is set as box2. The intersection and union ratio of box1 and box2 is calculated, that is:

[0084]

[0085] Set criterion 1 as follows:

[0086]

[0087] Wherein, α is a threshold constant. That is, when the intersection-and-joint ratio of the wheel hub rectangular frame and the waiting area rectangular frame is greater than the threshold, it is considered that the wheel hub has completely entered the waiting area. At this time, f1=1, and the value of the counter A with an initial value of -1 is increased by 1. On the contrary, if f1=0, continue to step S12.

[0088] S13: Determine whether the value in counter A is -1. If so, use timestamp variable t0 to record the moment when the wheel hub completely arrives at the waiting area, and go to step S02; if not, use timestamp variable t1 to record the moment when the wheel hub completely arrives at the waiting area, and calculate the time difference Δt = t1-t0, and then calculate T w The difference with Δt, set the criterion 2 as follows:

[0089]

[0090] Where: ΔT is the time that each wheel hub should be stopped when it arrives at the waiting area, that is: when the marking device action time T w When the time difference between the front and rear hubs arriving at the waiting area is greater than the time difference between the front and rear hubs, the hub that arrives at the roller conveyor later will affect the hub that is being marked. At this time, ΔT = T work -Δt; On the contrary, the wheel hub that arrives at the roller table later will not affect the marking operation of the previous wheel hub. In this case, ΔT = 0;

[0091] S14: Trigger the waiting area roller stop device to stop the wheel hub in the waiting area for ΔT. When ΔT=0, the roller stop device does not move. Then, the variable t0 is updated according to the stop time, that is:

[0092] t0=t1+ΔT

[0093] Wherein, t1 is the moment when the wheel hub arrives at the waiting area, ΔT is the time length that the wheel hub needs to be stopped in the waiting area, t0 is the moment when the wheel hub is released, and then go to step S12.

[0094] It should be noted that after receiving the stopping information from the visual processing module, the roller stopping device separates the drive shaft of the roller motor in the waiting area from the roller in the waiting area. Even if the wheel hub continues to move for a certain distance, adjustments can still be made by selecting the anchoring frame of the waiting area so that the wheel hub will eventually stay in the waiting area.

[0095] In step (2), the industrial camera 1 is relatively fixed to the working area. The industrial cameras 1 and 2 shoot the working area and the waiting area above the roller 6, and send the captured real-time images to the visual processing module. The wheel hub recognition algorithm includes the following steps:

[0096] S21: Model training: Images of wheel hubs on the wheel hub production line are collected and a data set is created. In order to improve the algorithm efficiency while ensuring recognition accuracy, the CSP residual block in the original Yolov5s network is replaced with a lighter-weight Faster-CSP module to reduce the number of model parameters and computational complexity. The main difference between the Faster-CSP module and the CSP residual block is that the CSP residual block uses standard convolution (Con) while the Faster-CSP module uses partial convolution (PCon). When Con performs convolution on the input feature map (h, w, c), each convolution kernel (k×k) performs convolution operations with all feature maps. Its FLOPs can be expressed by the formula, namely:

[0097] Con FLOPs =h×w×k 2 ×c

[0098] PCon takes into account the existence of more information redundancy between different channels by introducing a ratio parameter To control the number of channels for convolution, the remaining channels do not perform convolution operations in this layer. Its FLOPs can be expressed by the formula:

[0099] Con FLOPs =h×w×k 2 ×c p

[0100] Among them, c is the number of channels of the input feature layer, that is, when When PCon's FLOPs is only 100% of Con's The memory access of PCon is only The relatively lightweight Effective Channel Attention (ECA) module is introduced to deepen the network's attention to target features, thereby improving the generalization ability of the model. Compared with the channel compression attention mechanism (SE), the ECA module avoids the effect of channel compression on channel attention prediction by executing a fast 1D convolution kernel Sigmod activation function of size k to achieve local cross-channel interaction and generate weight ω. The calculation formula of ω is:

[0101]

[0102] in: for There are k domain channels, σ is the Sigmod activation function, k is determined by the mapping adaptively of the channel dimension C, and the calculation formula of k is:

[0103]

[0104] Where: γ = 2, b = 1, the ECA module effectively avoids the adverse effects of dimensionality reduction, while reducing the complexity of the attention model and improving the role of the attention mechanism in the network;

[0105] Finally, in order to alleviate the problem of network prediction bias caused by the long-tail distribution of data, CDice Loss is used as the boundary loss function to obtain the improved Yolov5s network. The wheel data is obtained according to the actual production line, and it is difficult to obtain multi-background wheel images. Due to the recognition needs of the industrial site, only the wheel is used as the true value, resulting in an imbalance in the ratio of positive and negative samples. The collaborative cross entropy loss and Dice Loss act on the bounding box regression loss, that is: the cross entropy loss function can provide the optimal gradient direction, but when used for foreground and background recognition of two categories, if the background accounts for a large proportion, the foreground component in the loss function will be overwhelmed by the background, and the model is biased towards background recognition, resulting in poor recognition effect. Dice Loss minimizes the DiceLoss value by maximizing the Dice coefficient, which can effectively solve the problem of inconsistency between positive and negative samples in the recognition task. However, when dealing with small target true values, Dice Loss is prone to lose the correct gradient direction guidance, resulting in drastic fluctuations in Loss, so cross entropy loss is used to provide gradient direction guidance Dice Loss provides an unbiased loss value to alleviate the long-tail distribution problem of the dataset. The improved Yolov5s network is obtained. During training, the Adam optimizer is used to optimize network learning and the Step learning rate scheduling strategy is used to control the training process.

[0106] In the embodiment, the improved Yolov5s network is still composed of Backbone, SPP, Neck and Head. Different from the Backbone and Neck part of the original Yolov5s network, the CSP module is replaced by a lightweight Fast-CSP module in the Backbone and Neck of the improved Yolov5s network. Different from the three feature layers obtained by the Backbone and SPP in the original Yolov5s network, which are directly used as input feature layers of the Neck part, the three feature layers obtained by the Backbone and SPP in the improved Yolov5s network are first input into the ECA attention mechanism module for feature weighting, and then used as input feature layers of the Neck part.

[0107] S22: input prediction: input the picture to be recognized into the trained network model for prediction, and the network model generates a detection frame according to the input image features.

[0108] S23: output result: using the non-maximum suppression (NMS) algorithm, remove the repeated detection frame, and select the detection frame with the highest confidence as the final detection result, which contains the position coordinates of the rectangular detection frame of the hub.

[0109] In the step (3), the method of limiting the fitting range is applied to the fitting of the specified circular domain of the hub surface (quenching band contour and tempering band contour) for the Hough transform and other improved Hough transform, and the fitting of the concentric circular domain of the hub surface is proposed. K-LSM concentric circle fitting method, specifically: first, the contour obtained by Blob analysis is subjected to moment analysis to obtain the center of gravity of the contour, then the center of gravity is used to divide the circular domain range to which the contour belongs, then the most complete circle of the contour is fitted by LSM, and the center of the circle is taken as the center point of the hub, then the LSM is used to fit the tempering band circular domain outward, finally, the K-Means clustering is used to fit the quenching band outer contour with large edge defects, which can accurately divide the multiple concentric circular domains on the hub surface. For the convenience of description, the step of fitting the tempering band is referred to as the tempering band positioning algorithm, and the step of fitting the outer contour is referred to as the quenching band positioning algorithm. The tempering band positioning algorithm includes the following steps:

[0110] S31: set the rectangular frame of the hub given by the hub recognition algorithm as box3, and set the rectangular frame of the work area as box4, and calculate the intersection-over-union of box3 and box4, that is:

[0111]

[0112] Criterion 3 is set as follows:

[0113]

[0114] Among them, β is a threshold constant, that is, when the intersection and union ratio of the rectangular box where the wheel hub is located and the rectangular box of the working area is greater than the threshold, it is considered that the wheel hub has completely entered the working area. At this time, let f3 = 1, trigger the roller stop device to stop the wheel hub in the working area, and intercept the rectangular box area corresponding to box3 as the area of ​​interest Area1; on the contrary, if f3 = 0, the wheel hub has not completely entered the working area at this time, and the position coordinates of box3 are updated according to the results of the wheel hub recognition algorithm, and then continue to execute step S31.

[0115] S32: Perform Gaussian noise reduction on the image of Area1, and then extract the R channel image Image R ;According to Image R Grayscale histogram of Image R Perform adaptive image binarization to obtain the binarized image Img B Then, the image is eroded twice and expanded twice to obtain a connected image. Then, all connected domains in the connected image are extracted and the areas S1, S2, ..., S of each connected domain are calculated. n , extract the connected area with the largest area as the target area, and set the pixel values ​​of other connected areas to 0 to obtain the binary image Area1 containing only the tempering zone area img ; Then use the Canny operator to calculate Area1 img Edge extraction is performed to obtain the outer contour L1 and inner contour L2 of the tempering zone, and then the moment of the contour L1 is calculated, namely:

[0116]

[0117] Among them, i and j represent the order of the moment, I(x, y) represents the pixel value at the position (x, y), and the center of gravity coordinates (x) of the hub are calculated based on the second moment. c ,y c ),Right now:

[0118]

[0119] Among them, M 00 Represents the contour area, that is, the center of gravity of the contour is determined by the first-order moment and the zero-order moment, and the center of gravity of the contour in the binary image can be considered as the coordinates of the center point of the tempering zone: (x c ,y c ), and then through the point (x c ,y c ) and the edge point are divided into the outer contour L1 and the inner contour L2, and then all points on the outer contour L1 and the inner contour L2 of the tempering strip are obtained respectively to perform the circle optimal parameter fitting of the least square method, that is:

[0120]

[0121] Among them, F(x) is the predicted value, y i is the actual observed value, that is, when the residual between the actual observed value and the predicted value is the smallest, the fitted circle parameters are most consistent with the actual parameters. Finally, according to the fitting results, the center of the inner contour of the tempering zone is recorded as O: (x f ,y f ), the radius is recorded as: r f , the outer contour radius is recorded as: R f , then the tempering zone area is O: (x f ,y f ) is the center of the circle and the outer diameter is R f , inner diameter is r f The circular area is used to identify the tempering zone area.

[0122] In the step (4), the quenching belt positioning method includes the following steps:

[0123] S41: The R channel image Img obtained in step S32 R Perform Canny edge detection with a threshold of (100, 200) and get the edge image as: Img E , and then Img E All pixels in the image located in the contour L1 are removed, and the binary image containing the outer contour edge of the quenching zone is obtained and recorded as: Img H ;

[0124] S42: Traverse all edge points to generate edge point coordinate set: P i =[P1(x,y),P2(x,y),…,P n (x,y)], calculate the coordinate set P i All elements in the tempering zone inner contour center O obtained in step S32: (x f ,y f )The length of the connection is obtained

[0125]

[0126] S43: Perform K-Means clustering on the set D, with a K value of 2, to obtain radius clusters and non-radius clusters, and then record the cluster center of the radius cluster as: Considered to be the radius length of the hub;

[0127] S44: The quenching zone area of ​​the wheel is O: (x f ,y f ) is the center of the circle and the outer diameter is Inner diameter is R fThe circular area is recorded as C, and area C is the marked area on the hub surface. Finally, the coordinates of the marked area are converted into world coordinates using the internal and external parameters of the camera and sent to the marking device 4. The marking device 4 uses the area where the quenching zone is located as the restricted range to formulate a marking plan and then perform the marking operation.

[0128] Example 2

[0129] This embodiment uses Figure 1 Taking the system deployment diagram shown in FIG. 1 as an example, the first embodiment is further described. A wheel hub identification and positioning system based on machine vision mainly includes industrial cameras 1 and 2, a visual processing module 3, a labeling device 4, a gantry 5, and a roller conveyor 6. Specifically, industrial cameras 1 and 2 are mounted above roller conveyor 6; visual processing module 3 is connected to industrial cameras 1 and 2; labeling device 4 is mounted on one side of roller conveyor 6; and gantry 5 is used to secure industrial cameras 1 and 2.

[0130] It should be pointed out that the number, model, installation method and other parameters of the industrial cameras 1 and 2, visual processing module 3, marking device 4, portal bracket 5, and roller 6 can be adjusted according to the site environment and the requirements of identification and positioning accuracy.

[0131] This embodiment also provides a wheel hub identification and positioning method based on machine vision, which is used to implement positioning of the operation starting point range on the wheel hub surface using the above-mentioned wheel hub identification and positioning system based on machine vision, and includes the following steps:

[0132] Step (1), such as Figure 1 As shown, industrial camera 1 shoots the working area while industrial camera 2 shoots the waiting area, and sends the real-time image to the visual processing module; the visual processing module calls the self-blocking algorithm to determine whether the wheel hub entering the waiting area will affect the wheel hub of the marking operation. If not, go to step (2); otherwise, trigger the roller stop device to stop the wheel hub in the waiting area, and release the wheel hub after the stop time ends.

[0133] During specific implementation: the position of industrial camera 2 and the waiting area is relatively fixed, the running speed of the roller is also fixed, and the action time of the marking device should be stable at a specific time T w , industrial camera 2 shoots the waiting area downward and sends the real-time image to the visual processing module, and then performs the following steps:

[0134] S11: Pre-set pixel coordinates of a rectangular frame of the waiting area in the waiting area image captured by the industrial camera 2 .

[0135] S12: Receive the video shot by industrial camera 2 ( Figure 6a ), the hub rectangular frame given by the hub recognition algorithm is set to: box1, and the waiting area rectangular frame ( Figure 6b) is set to: box2, calculate the intersection and union ratio of box1 and box2, that is:

[0136]

[0137] Set criterion 1 as follows:

[0138]

[0139] Wherein: α is a threshold constant, that is, when the intersection ratio of the rectangular frame where the wheel hub is located and the rectangular frame of the waiting area is greater than the threshold, it is considered that the wheel hub has completely entered the waiting area. At this time, f1=1, and the value of the counter A with an initial value of -1 is increased by 1; otherwise, if f1=0, continue to execute step S12.

[0140] S13: Determine whether the value in counter A is -1. If so, use timestamp variable t0 to record the moment when the wheel hub completely arrives at the waiting area, and go to step S02; if not, use timestamp variable t1 to record the moment when the wheel hub completely arrives at the waiting area, and calculate the time difference Δt=t1-t0. Since the wheel hub will be stopped in the working area for marking when it enters the working area, the stop time is T w During the stop period, the rear wheel will collide with the hub of the work area, affecting the marking operation, so the calculation of T w The difference with Δt, set the criterion 2 as follows:

[0141]

[0142] Where: ΔT is the time that each wheel hub should be stopped when it arrives at the waiting area, that is: when the marking device action time T w When the time difference between the front and rear hubs arriving at the waiting area is greater than the time difference between the front and rear hubs, the hub that arrives at the roller conveyor later will affect the hub that is being marked. At this time, ΔT = T w -Δt; on the contrary, the wheel hub that arrives at the roller table later will not affect the marking operation of the previous wheel hub. At this time, ΔT=0.

[0143] S14: Trigger the waiting area roller stop device to stop the wheel hub in the waiting area for ΔT. When ΔT=0, the roller stop device does not move. Then, the variable t0 is updated according to the stop time, that is:

[0144] t0=t1+ΔT

[0145] Wherein: t1 is the moment when the wheel hub arrives at the waiting area, ΔT is the time length that the wheel hub needs to be stopped in the waiting area, t0 is the moment when the wheel hub is released, and then go to step S12.

[0146] Step (2), such as Figure 2 As shown, the visual processing module 3 calls the wheel recognition algorithm to identify whether there is a wheel in the work area.

[0147] In specific implementation: Although the position of the hub on the roller is ever-changing, due to the rainbow color phenomenon, the characteristics of the hub surface after the same tempering process are relatively stable. Therefore, the following steps can be carried out in sequence:

[0148] S21: Model training: Images of wheel hubs on the wheel hub production line are collected and a data set is created. In order to improve the algorithm efficiency while ensuring recognition accuracy, the CSP residual block in the original Yolov5s network is replaced with a lighter-weight Faster-CSP module to reduce the number of model parameters and computational complexity. The main difference between the Faster-CSP module and the CSP residual block is that the CSP residual block uses standard convolution (Con) while the Faster-CSP module uses partial convolution (PCon). When Con performs convolution on the input feature map (h, w, c), each convolution kernel (k×k) performs convolution operations with all feature maps. Its FLOPs can be expressed by the formula, namely:

[0149] Con FLOPs =h×w×k 2 ×c

[0150] PCon takes into account the existence of more information redundancy between different channels by introducing a ratio parameter To control the number of channels for convolution, the remaining channels do not perform convolution operations in this layer. Its FLOPs can be expressed by the formula:

[0151] Con FLOPs =h×w×k 2 ×c p

[0152] Among them, c is the number of channels of the input feature layer, that is, when When PCon's FLOPs is only 100% of Con's The memory access of PCon is only The relatively lightweight Effective Channel Attention (ECA) module is introduced to deepen the network's attention to target features, thereby improving the generalization ability of the model. Compared with the channel compression attention mechanism (SE), the ECA module avoids the effect of channel compression on channel attention prediction by executing a fast 1D convolution kernel Sigmod activation function of size k to achieve local cross-channel interaction and generate weight ω. The calculation formula of ω is:

[0153]

[0154] in: for There are k domain channels, σ is the Sigmod activation function, k is determined by the mapping adaptively of the channel dimension C, and the calculation formula of k is:

[0155]

[0156] Where: γ = 2, b = 1, the ECA module effectively avoids the adverse effects of dimensionality reduction, while reducing the complexity of the attention model and improving the role of the attention mechanism in the network;

[0157] Finally, in order to alleviate the problem of network prediction bias caused by the long-tail distribution of data, CDice Loss is used as the boundary loss function to obtain the improved Yolov5s network. The wheel data is obtained according to the actual production line, and it is difficult to obtain multi-background wheel images. Due to the recognition needs of the industrial site, only the wheel is used as the true value, resulting in an imbalance in the ratio of positive and negative samples. The collaborative cross entropy loss and Dice Loss act on the bounding box regression loss, that is: the cross entropy loss function can provide the optimal gradient direction, but when used for foreground and background recognition of two categories, if the background accounts for a large proportion, the foreground component in the loss function will be overwhelmed by the background, and the model is biased towards background recognition, resulting in poor recognition effect. Dice Loss minimizes the DiceLoss value by maximizing the Dice coefficient, which can effectively solve the problem of inconsistency between positive and negative samples in the recognition task. However, when dealing with small target true values, Dice Loss is prone to lose the correct gradient direction guidance, resulting in drastic fluctuations in Loss, so cross entropy loss is used to provide gradient direction guidance Dice Loss provides an unbiased loss value to alleviate the long-tail distribution problem of the dataset. The improved Yolov5s network is obtained. During training, the Adam optimizer is used to optimize network learning and the Step learning rate scheduling strategy is used to control the training process.

[0158] In this embodiment, the improved Yolov5s network is still composed of Backbone, SPP, Neck, and Head. The difference is that compared with the Backbone and Neck parts of the original Yolov5s network, the CSP module is replaced by a lightweight Fast-CSP module in the Backbone and Neck of the improved Yolov5s network; compared with the three feature layers obtained by Backbone and SPP in the original Yolov5s network directly as the input feature layers of the Neck part, the three feature layers obtained by Backbone and SPP in the improved Yolov5s network are first input into the ECA attention mechanism module for feature weighting, and then used as the input feature layers of the Neck part.

[0159] S22: Input prediction: The image to be recognized is input into the trained network model for prediction. The network model generates a detection box based on the input image features.

[0160] S23: Output result: Use the non-maximum suppression (NMS) algorithm to remove duplicate detection frames and select the detection frame with the highest confidence as the final detection result. The detection result includes the position coordinates of the rectangular frame (detection frame) where the wheel hub is located.

[0161] Step (3), such as Figure 2 As shown, the visual processing module 3 calls the tempering zone positioning algorithm to detect the position of the tempering zone on the hub surface and the wheel center coordinates.

[0162] In specific implementation: although the width of the quenching band will change, the color of the quenching band is relatively stable dark red, and the gray value on the R channel is quite different from other parts of the image, while the center point surrounded by the quenching band is relatively fixed. Therefore, the hub rectangular frame ( Figure 6c ) is set to box3, the workspace rectangle is set to box4, and the intersection and union ratio of box3 and box4 is calculated, that is:

[0163]

[0164] Set criterion 3 as follows:

[0165]

[0166] Where: β is the threshold constant, that is, when the intersection and union ratio of the rectangular box where the wheel hub is located and the rectangular box of the working area is greater than the threshold, it is considered that the wheel hub has completely entered the working area. At this time, let f3 = 1, triggering the roller stop device to stop the wheel hub in the working area, and intercepting the rectangular box area corresponding to box3 as the area of ​​interest ( Figure 6d ): Area1; On the contrary, if f3 = 0, the wheel hub has not completely entered the working area, and the position coordinates of box3 are updated according to the results of the wheel hub recognition algorithm, and then step S31 is continued.

[0167] Secondly: perform Gaussian noise reduction on the image of Area1, and then extract the R channel image of the image: Img R According to Img R Grayscale histogram of Img R Perform adaptive image binarization to obtain the binarized image: Img B Then, the image is subjected to two erosion operations and two dilation operations in sequence to obtain a connected image ( Figure 6e ). Then extract all connected domains in the connected image and calculate the areas S1, S2, ..., S n , extract the connected area with the largest area as the target area, and set the pixel values ​​of other connected areas to 0 to obtain a binary image containing only the tempering zone area ( Figure 6f ): Area1 imgThen use the Canny operator to calculate Area1 img The outer contour of the tempering zone is recorded as L1 and the inner contour is recorded as L2 ( Figure 6g ), and then calculate the moment of the contour L1, namely:

[0168]

[0169] Among them, i and j represent the order of the moment, I(x, y) represents the pixel value at the position (x, y), and the center of gravity coordinates (x) of the hub are calculated based on the second moment. c ,y c ),Right now:

[0170]

[0171] Among them, M 00 Represents the contour area, that is, the center of gravity of the contour is determined by the first-order moment and the zero-order moment, and the center of gravity of the contour in the binary image can be considered as the coordinates of the center point of the tempering zone: (x c ,y c ), and then through the point (x c ,y c ) and the edge point are divided into the outer contour L1 and the inner contour L2, and then all points on the outer contour L1 and the inner contour L2 of the tempering strip are obtained respectively to perform the circle optimal parameter fitting of the least square method, that is:

[0172]

[0173] Among them, F(x) is the predicted value, y i is the actual observed value, that is, when the residual between the actual observed value and the predicted value is the smallest, the fitted circle parameters are most consistent with the actual parameters. Finally, according to the fitting results, the center of the inner contour of the tempering zone is recorded as O: (x f ,y f ), the radius is recorded as: r f , the outer contour radius is recorded as: R f , then the tempering zone area is O: (x f ,y f ) is the center of the circle and the outer diameter is R f , inner diameter is r f The circular area is used to identify the tempering zone area.

[0174] Step (4), such as Figure 2As shown, the visual processing module calls the quenching band positioning algorithm to determine the wheel hub surface marking range coordinates. In specific implementation: the quenching bands are more evenly distributed outside the tempering band. Although the gray value of the tempering band is relatively close to the roller, only part of the outer contour edge information of the tempering band can be extracted, but the center point and radius of the quenching area can be used to remove part of the non-tempering band outer contour edge, thereby increasing the proportion of the tempering band outer contour edge. Therefore, the Canny edge detection is performed on the image, and the threshold is (100, 200) to obtain an edge image, which is denoted as Img R . E ( Figure 6h ) , and then all the pixel points in the contour L1 in the Img E image are removed to obtain a binary image containing the quenching band outer contour edge, which is denoted as Img H . Then, all the edge points are traversed to generate an edge point coordinate set P i = [P1(x, y), P2(x, y), …, P n (x, y)], and the length of the line connecting all the elements in the coordinate set P i and O: (x f , y f ) is calculated to obtain a set D . Finally, the set D is clustered by K-Means clustering, the K value is 2, to obtain a radius cluster and a non-radius cluster, and then the radius cluster center is denoted as: , which is considered as the radius length of the wheel hub, and the quenching band region of the wheel hub is a circular ring region with O: (x f , y f ) as the center, an outer diameter of , and an inner diameter of R f , which is denoted as C Figure 6l . The C region is the wheel hub surface marking region, and finally the pixel coordinates of the marking region are converted into world coordinates by the camera internal and external parameters and sent to the marking device. The marking device determines the limiting region and formulates a marking plan according to the world coordinates of the C region, and then performs the marking work.

[0175] In this embodiment, the experimental comparison table of the improved Yolov5s network and the original Yolov5s network is shown in Table 1.

[0176] Table 1 Experimental comparison table of improved Yolov5s network and original Yolov5s network

[0177]

[0178] (Note: pytorch1.2.0; python3.6; CPU: Intel B460MD2V; GPU: NVIDIA GeForce GTX1650; Learning rate: 1e-3 epoch=200)

[0179] In this embodiment, the improved YoloV5s network recognition result example graph is as shown in Figures 4a-4c The original YoloV5s network recognition result example graph is as shown in Figures 5a-5c As can be seen from the figure, due to the complex background environment of the wheel hub production line and the long-tail distribution of the specific hub data set, etc., the original YoloV5s network applied to the hub detection will have problems such as missed detection, false detection, low confidence and large floating point calculation amount, etc. In view of this, first, the original YoloV5s introduces a relatively lightweight effective channel attention mechanism (ECA) module to deepen the network's attention to target features and improve the model's generalization ability. Secondly, in order to alleviate the network prediction bias problem caused by the long-tail distribution of the data, CDice Loss is used as the boundary loss function, thereby improving the false detection, missed detection and low confidence phenomenon. In addition, the CSP residual block in the original YoloV5s network is replaced with a more lightweight Faster-CSP module, which reduces the model parameter amount and computational complexity while ensuring model accuracy, further reducing the system hardware cost.

[0180] In summary, the machine vision-based wheel hub recognition and positioning method of the above-mentioned embodiments has the advantages of low cost, convenient deployment, etc., and can effectively replace manual visual inspection to perform wheel hub surface labeling work. Especially in high-temperature dangerous environments, it can effectively reduce the number of manual work, reduce safety accidents, and save operation and maintenance costs.

[0181] Although the embodiments of the present application have been shown and described above, it should be understood that the above-mentioned embodiments are exemplary and should not be construed as limiting the present application. Those skilled in the art can make changes, modifications, replacements and variations to the above-mentioned embodiments within the scope of the present application.

Claims

1. A wheel hub identification and positioning method based on machine vision, characterized in that: The following steps are involved: S1: The working area is photographed by the first industrial camera, while the waiting area is photographed by the second industrial camera. The real-time images are sent to the visual processing module. The visual processing module uses the self-blocking algorithm to predict whether the wheel hub arriving at the waiting area will collide with the wheel hub parked in the working area. If not, the process goes to step S2. Otherwise, the roller conveyor stopping device is triggered to stop the wheel hub in the waiting area and release the wheel hub after the stopping time expires. S2: The visual processing module calls the wheel recognition algorithm to identify whether a wheel exists in the workspace image. If a wheel is detected in the workspace image, the target detection frame position coordinates are given and the process goes to step S3. Otherwise, the first industrial camera continues to capture the workspace and sends the real-time image to the visual processing module. S3: The visual processing module adjusts the tempering zone positioning algorithm to detect the center point of the inner ring of the wheel hub and the area where the tempering zone is located; S4: The visual processing module calls the quenching belt positioning algorithm to detect the area where the quenching belt is located and sends the position coordinates to the labeling device. The labeling device uses the area where the quenching belt is located as the restricted range to formulate a labeling plan and then performs the labeling operation.

2. The wheel hub identification and positioning method based on machine vision according to claim 1, characterized in that: In step S1, the first industrial camera is relatively fixed to the working area, and the second industrial camera is relatively fixed to the waiting area. The first industrial camera and the second industrial camera shoot the working area and the waiting area above the roller conveyor, and send the captured real-time images to the visual processing module, wherein the running speed of the roller conveyor is a fixed value.

3. The wheel hub identification and positioning method based on machine vision according to claim 1, characterized in that: In step S1, the self-occlusion algorithm includes the following steps: S11: Pre-set pixel coordinates of a rectangular frame of the waiting area in the image area of ​​the waiting area captured by the second industrial camera; S12: After receiving the real-time image captured by the second industrial camera, the wheel hub rectangular box is set as box1 and the waiting area rectangular box is set as box2 through the wheel hub recognition algorithm. The intersection and union ratio of box1 and box2 is calculated, that is: Set criterion 1 as follows: Wherein, α is a threshold constant. That is, when the intersection-and-joint ratio of the wheel hub rectangular frame and the waiting area rectangular frame is greater than the threshold, it is considered that the wheel hub has completely entered the waiting area. At this time, f1=1, and the value of the counter A with an initial value of -1 is increased by 1. On the contrary, if f1=0, continue to step S12. S13: Determine whether the value in counter A is -1. If so, use timestamp variable t0 to record the moment when the wheel hub completely arrives at the waiting area, and go to step S02; if not, use timestamp variable t1 to record the moment when the wheel hub completely arrives at the waiting area, and calculate the time difference Δt = t1-t0, and then calculate the marking device action time T w The difference with Δt, set the criterion 2 as follows: Where: ΔT is the time that each wheel hub should be stopped when it arrives at the waiting area, that is: when the marking device action time T w When the time difference between the front and rear hubs arriving at the waiting area is greater than the time difference between the front and rear hubs, the hub that arrives at the roller conveyor later will affect the hub that is being marked. At this time, ΔT = T w -Δt; On the contrary, the wheel hub that arrives at the roller table later will not affect the marking operation of the previous wheel hub. In this case, ΔT = 0; S14: Trigger the waiting area roller stop device to stop the wheel hub in the waiting area for ΔT. When ΔT=0, the roller stop device does not move. Then, the variable t0 is updated according to the stop time, that is: t0=t1+ΔT Wherein, t1 is the moment when the wheel hub arrives at the waiting area, ΔT is the time length that the wheel hub needs to be stopped in the waiting area, t0 is the moment when the wheel hub is released, and then go to step S12.

4. The wheel hub identification and positioning method based on machine vision according to claim 3, characterized in that: In step S1, after receiving the stopping information from the visual processing module, the roller conveyor stopping device separates the transmission shaft of the waiting area roller conveyor motor from the waiting area roller conveyor.

5. The wheel hub identification and positioning method based on machine vision according to claim 3, characterized in that: In step S2, the wheel hub identification algorithm specifically includes the following steps: S21: Model Training Images of wheel hubs from the wheel hub production line were collected and a dataset was created. The dataset was then used to train the improved Yolov5s network. The Adam optimizer was used to optimize network learning, and the Step learning rate scheduling strategy was used to control the training process. This resulted in a trained network model. S22: Input Prediction The image to be recognized is input into the trained network model for prediction. The network model generates a detection frame based on the input image features. S23: Output results The non-maximum suppression (NMS) algorithm is used to remove duplicate detection frames and select the detection frame with the highest confidence as the final detection result. The detection result includes the position coordinates of the rectangular frame where the wheel hub is located, and the detection frame is a rectangular frame.

6. The wheel hub identification and positioning method based on machine vision according to claim 5, characterized in that: In step S21, the CSP residual block in the original Yolov5s network is replaced with a Faster-CSP module to reduce the number of model parameters and computational complexity; an effective channel attention mechanism module is introduced to deepen the network's attention to target features, and finally CDice Loss is used as the boundary loss function to obtain an improved Yolov5s network.

7. The wheel hub identification and positioning method based on machine vision according to claim 5, characterized in that: In step S3, the tempering zone positioning algorithm includes the following steps: S31: Set the hub rectangular box given by the hub recognition algorithm to box3, set the workspace rectangular box to box4, and calculate the intersection and union ratio of box3 and box4, that is: Set criterion 3 as follows: Wherein, β is a threshold constant, that is, when the intersection-and-union ratio of the rectangular box where the wheel hub is located and the rectangular box of the working area is greater than the threshold, it is considered that the wheel hub has completely entered the working area. At this time, f3=1, triggering the roller stop device to stop the wheel hub at the working area roller stop device, and intercepting the rectangular box area corresponding to box3 as the area of ​​interest Area1; on the contrary, if f3=0, at this time the wheel hub has not completely entered the working area, and the position coordinates of box3 are updated according to the results of the wheel hub recognition algorithm, and then continue to execute step S31; S32: Perform Gaussian noise reduction on the image of Area1, and then extract the R channel image Img of the image R According to Img R Grayscale histogram of Img R Perform adaptive image binarization to obtain the binarized image Img B Then, the image is eroded twice and expanded twice to obtain a connected image. Then, all connected domains in the connected image are extracted and the areas S1, S2, ..., S of each connected domain are calculated. n , extract the connected area with the largest area as the target area, and set the pixel values ​​of other connected areas to 0 to obtain the binary image Area1 containing only the tempering zone area img ; Then use the Canny operator to calculate Area1 img Edge extraction is performed to obtain the outer contour of the tempering zone, which is recorded as: L1, and the inner contour is recorded as: L2. Then the moment of the contour L1 is calculated, that is: Among them, i and j represent the order of the moment, I(x, y) represents the pixel value at the position (x, y), and the center of gravity coordinates (x) of the hub are calculated based on the second moment. c ,y c ),Right now: Among them, M 00 Represents the contour area, that is, the center of gravity of the contour is determined by the first-order moment and the zero-order moment, and the center of gravity of the contour in the binary image can be considered as the coordinates of the center point of the tempering zone: (x c ,y c ), and then through the point (x c ,y c ) and the edge point are divided into the outer contour L1 and the inner contour L2, and then all points on the outer contour L1 and the inner contour L2 of the tempering strip are obtained respectively to perform the circle optimal parameter fitting of the least square method, that is: Among them, F(x) is the predicted value, y i is the actual observed value, that is, when the residual between the actual observed value and the predicted value is the smallest, the fitted circle parameters are most consistent with the actual parameters. Finally, according to the fitting results, the center of the inner contour of the tempering zone is recorded as O: (x f ,y f ), the radius is recorded as: r f , the outer contour radius is recorded as: R f , then the tempering zone area is O: (x f ,y f ) is the center of the circle and the outer diameter is R f , inner diameter is r f The circular area is used to identify the tempering zone area.

8. The wheel hub identification and positioning method based on machine vision according to claim 7, characterized in that: In step S4, the quenching zone positioning algorithm includes the following steps: S41: The R channel image Img obtained in step S32 R Perform Canny edge detection with a threshold of (100, 200) and get the edge image as: Img E , and then Img E All pixels in the image located in the contour L1 are removed, and the binary image containing the outer contour edge of the quenching zone is obtained and recorded as: Img H ; S42: Traverse all edge points to generate edge point coordinate set: P i =[P1(x,y),P2(x,y),…,P n (x,y)], calculate the coordinate set P i All the elements in the tempering zone inner contour center O obtained in step S32: (x f ,y f )The length of the connection is obtained S43: Perform K-Means clustering on the set D, with a K value of 2, to obtain radius clusters and non-radius clusters, and then record the cluster center of the radius cluster as: Considered to be the radius length of the hub; S44: The quenching zone area of ​​the wheel is O: (x f ,y f ) is the center of the circle and the outer diameter is Inner diameter is R f The circular area is recorded as C, and area C is the marked area on the hub surface. Finally, the coordinates of the marked area are converted into world coordinates using the internal and external parameters of the camera and sent to the marking device. The marking device uses the area where the quenching zone is located as the restricted range to formulate a marking plan and then perform the marking operation.

9. A wheel hub identification and positioning system based on machine vision, characterized in that: The wheel hub identification and positioning method as described in claim 8 is used to implement the marking operation on the wheel hub surface, including: a first industrial camera, a second industrial camera, a visual processing module, a marking device, two gantry brackets, and a roller conveyor; the first industrial camera and the second industrial camera are respectively installed on the two gantry brackets, located above the roller conveyor, and are used to shoot the working area and waiting area of ​​the roller conveyor; the visual processing module is respectively communicated with the first industrial camera and the second industrial camera, and is deployed with a wheel hub identification algorithm, a self-blocking algorithm, a tempering zone positioning algorithm, and a quenching zone positioning algorithm, which are used to receive and process real-time images captured by the first industrial camera and the second industrial camera; the marking device is used to formulate a marking plan according to the marking area and perform marking operations on the wheel hub surface.

Citation Information

Patent Citations

  • Multi-senor control system of tunnel inspection vehicle

    CN106403893A

  • Roller line hub detecting and positioning method and system based on cameras and machine learning

    CN110992339A