CN-115222652-B - Identification counting and center positioning method for end faces of bundled reinforcing steel bars and memory thereof
Abstract
The invention relates to the technical field of machine vision, in particular to a method for identifying, counting and centering end faces of bundled reinforcing steel bars and a memory thereof, wherein the method comprises the following steps of S1, shooting images of the end faces of the reinforcing steel bars, and obtaining images to be identified after processing; S2, performing data enhancement operation on the image to be identified by adopting a first preset algorithm, S3, forming a final detection frame in the image to be identified by adopting a second preset algorithm with a lightweight convolutional neural network, and calculating the number of the final detection frames, and S4, generating a counting result. The invention solves the problems that the existing reinforcing steel bar end face recognition technology is usually carried out by adopting a common machine vision algorithm, so that the counting result is inaccurate and the practical requirement cannot be met.
Inventors
- HUANG SIBO
- QIU JIAWEI
- HUANG JIANFENG
- CUI HAN
- WEI XIAOHUI
- CAI ZHAOQUAN
- LUO ZHONGLIANG
Assignees
- 惠州学院
Dates
- Publication Date
- 20260508
- Application Date
- 20220505
Claims (6)
- 1. The method for identifying, counting and centering the end faces of bundled reinforcing steel bars is characterized by comprising the following steps of: s1, shooting an image of the end face of a steel bar, and obtaining an image to be identified after processing; S2, performing data enhancement operation on the image to be identified by adopting a first preset algorithm, wherein the first preset algorithm is Fmix for enhancing mixing; S21, randomly extracting a picture from the dirty data set; s22, performing threshold processing on the low-frequency gray level image sampled through Fourier space to obtain a mask; S23, carrying out mask mixing on the image obtained in the step S21 and the mask obtained in the step S22; converting the data into a format which can be processed by a convolution network; S3, forming a final detection frame in the image to be identified by adopting a second preset algorithm with a lightweight convolutional neural network, and calculating the number of the final detection frames; s4, generating a counting result; The step S3 specifically includes the steps of, S31, a second preset algorithm comprising a lightweight convolutional neural network is preformed, wherein the second preset algorithm is to replace a Darknet backbone characteristic extraction network in a YoloV original network with a SHFFLENETV backbone characteristic extraction network by improving the backbone characteristic extraction network, and the number of network input and output channels is the same by introducing CHANNEL SPLIT; the step S31 specifically includes: S311, clustering the training images to form anchor frames; S312, dividing the training image and forming a plurality of small blocks; S313, generating a plurality of rectangular frames in each small block, wherein the length and the width of each rectangular frame are determined by the anchor frame; s314, performing fine adjustment on a plurality of rectangular frames under the same small block to form a primary detection frame; s315, judging whether any small block contains a target detection object, if so, calculating IOU values between a plurality of primary detection frames in the current small block and a real frame of a training image, and if all the primary detection frames are larger than a set threshold value, selecting the primary detection frame with the largest IOU value as a positive sample; s316, a second preset algorithm with a lightweight convolutional neural network is generated after the frame shape of the positive sample is stored; s32, forming a final detection frame in the image to be identified by adopting the second preset algorithm, and calculating the number of the final detection frames; The second preset algorithm in step S31 is specifically to replace the Darknet backbone feature extraction network in the YoloV original network with the SHFFLENETV backbone feature extraction network by improving the backbone feature extraction network.
- 2. The method for identifying, counting and centering end faces of bundles of reinforcing steel bars according to claim 1, wherein the step S314 specifically comprises: s314a, acquiring a plurality of parameter values of the anchor frame; S314b, adjusting the rectangular frame according to the acquired parameter values to form a primary detection frame; Wherein, the step S314a further includes an offset (c x ,c y ) of the anchor frame relative to the training image; In the step S314b, the adjustment of the rectangular frame includes the following formula, ; ; ; ; ; The width of the rectangular frame is recorded as p w , the height of the rectangular frame is recorded as p h , and the true value of the coordinates of the rectangular frame is recorded as , Is a preset coordinate value.
- 3. The method for identifying, counting and centering end faces of bundles of reinforcing steel bars according to claim 2, wherein after said step S315, before step S316, the steps of: the loss calculation is performed using the following formula, Wbox = 2.0 tw * th Loss = lossbox + lossconf + lossclass Wherein, therein The size of the representative training image is S times S, B represents the detection frame, Representing that if the detection frame at the coordinates [ i, j ] has a target, the value is 1, otherwise, the detection frame is 0, 3 loss functions are calculated mainly, namely, the loss between the detection frame and the center coordinates of the real frame and the width and the height of the real frame are respectively calculated, whether the detection frame contains the loss of the detection object or not is predicted, the 3 losses are finally added to be used as a loss function value of one level, and the average of the three level loss functions is used as a final loss value when the loss is finally calculated.
- 4. The method for identifying, counting and centering end faces of bundled reinforcing steel bars according to any one of claims 1-3, which is characterized by comprising the following steps: In the step S1, the image to be identified is obtained after the processing, which includes random image overturn, random scaling, random clipping, and random brightness change.
- 5. The method for identifying, calculating and centering end faces of bundled reinforcing steel bars according to any one of claims 1-3, which is characterized by comprising the following steps: in the step S2, the performing data enhancement operation on the image to be identified by using a first preset algorithm includes performing Fmix enhancement mixing on a data set such as dirt or texture.
- 6. A computer readable memory, wherein the computer readable memory comprises a stored computer program, wherein the computer program when run controls a device in which the computer readable memory resides to perform the method according to any one of claims 1-5.
Description
Identification counting and center positioning method for end faces of bundled reinforcing steel bars and memory thereof Technical Field The invention relates to the technical field of machine vision, in particular to a method for identifying, counting and centering end faces of bundled reinforcing steel bars and a memory thereof. Background The machine vision is to use a robot to replace human eyes to measure and judge. The machine vision system converts the shot object into image signals through the visual products thereof, transmits the image signals to a special image processing system to obtain the form information of the shot object, converts the form information into digital signals according to the information of pixel distribution, brightness, color and the like, and the image system performs various operations on the signals to extract the characteristics of the object, and further controls the on-site equipment action according to the judging result. YOLOv3 algorithm can be used for solving the problem of how to detect two similar objects which are very close to each other or different objects which are very close to each other, and has good robustness on the objects which are very close to each other or small objects. The existing reinforcing steel bar end face recognition technology is usually carried out by adopting a common machine vision algorithm, but because the algorithm cannot accurately obtain a result, the machine vision applied to the field of reinforcing steel bar end face counting cannot obtain an accurate result, and the practicality requirement cannot be met, so that a recognition counting and center positioning method of bundled reinforcing steel bar end faces and a memory thereof are generated. Disclosure of Invention The invention aims to provide a method for identifying, counting and centering end faces of bundled reinforcing steel bars and a memory thereof, and mainly solves the problems that the counting result is inaccurate and the practical requirement cannot be met due to the fact that the conventional reinforcing steel bar end face identification technology is generally carried out by adopting a common machine vision algorithm. The invention provides a method for identifying, counting and centering end faces of bundled reinforcing steel bars, which comprises the following steps: s1, shooting an image of the end face of a steel bar, and obtaining an image to be identified after processing; s2, performing data enhancement operation on the image to be identified by adopting a first preset algorithm; S3, forming a final detection frame in the image to be identified by adopting a second preset algorithm with a lightweight convolutional neural network, and calculating the number of the final detection frames; S4, generating a counting result. Preferably, the step S3 specifically includes: S31, a second preset algorithm comprising a lightweight convolutional neural network is preformed; s32, forming a final detection frame in the image to be identified by adopting the second preset algorithm, and calculating the number of the final detection frames. The second preset algorithm in step S31 is specifically to replace the Darknet backbone feature extraction network in the YoloV original network with the SHFFLENETV backbone feature extraction network by improving the backbone feature extraction network. Preferably, the step S31 specifically includes: S311, clustering the training images to form anchor frames; S312, dividing the training image and forming a plurality of small blocks; S313, generating a plurality of rectangular frames in each small block, wherein the length and the width of each rectangular frame are determined by the anchor frame; s314, performing fine adjustment on a plurality of rectangular frames under the same small block to form a primary detection frame; S315, judging whether any small block contains target detection errors, if so, calculating IOU values between a plurality of primary detection frames in the current small block and a real frame of a training image, and if all the primary detection frames are larger than a set threshold value, selecting the primary detection frame with the largest IOU value as a positive sample; s316, a second preset algorithm with a lightweight convolutional neural network is generated after the frame shape of the positive sample is saved. Preferably, the step S314 specifically includes: s314a, acquiring a plurality of parameter values of the anchor frame; S314b, adjusting the rectangular frame according to the acquired parameter values to form a primary detection frame; Wherein, the step S314a further includes an offset (c x,cy) of the anchor frame relative to the training image; In the step S314b, the adjustment of the rectangular frame includes the following formula, ; ; ; ; ; The width of the rectangular frame is recorded as p w, the height of the rectangular frame is recorded as p h, and the true value of the coordinates