Steel bar detection method and related equipment and devices
Through multi-dimensional feature extraction and fusion processing technology, combined with deep aggregation extraction network and feature map pyramid network, the problems of high cost and unstable performance of existing steel bar detection methods are solved, and efficient and low-cost steel bar detection is achieved.
Patent Information
- Application Number
- CN202010610013.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-29
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2040-06-29
AI Technical Summary
Existing steel bar detection methods rely on sensors or image processing, which are costly, sensitive to changes in illumination and background, and have unstable detection performance.
Using multi-dimensional feature extraction and fusion processing technology, through deep aggregation extraction network, deep aggregation upsampling network and feature map pyramid network, semantic and spatial features are integrated to achieve steel bar detection and reduce dependence on sensors.
It improves the performance and accuracy of steel bar detection, reduces detection costs, does not require special equipment, and can adapt to different lighting and background conditions.
Smart Images

Figure CN111815594B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to a steel bar detection method and related equipment and devices. Background Art
[0002] With the rapid advancement of urbanization, steel bars, as essential building materials for construction projects such as houses and bridges, are piled up in construction sites, building material warehouses, etc. In order to verify the number of steel bars, it is generally necessary to test the steel bars.
[0003] Generally, sensors or other special equipment are used, or traditional image processing technology is used for detection. However, the use of sensors or other special equipment for detection increases the cost; the use of traditional image processing technology for detection is heavily dependent on image quality. Once the image background changes or the lighting conditions are poor, it is very easy to cause the detection performance to decline. In view of this, how to improve the performance of steel bar detection and reduce the cost of steel bar detection has become an urgent problem to be solved. Summary of the invention
[0004] The main technical problem solved by the present application is to provide a steel bar detection method and related equipment and devices, which can improve the performance of steel bar detection and reduce the cost of steel bar detection.
[0005] In order to solve the above problems, the first aspect of the present application provides a steel bar detection method, including: obtaining an end face image of the steel bar to be tested; performing feature extraction on the end face image to obtain first feature maps of multiple dimensions; performing a first fusion process on the first feature map of each dimension and the corresponding high-dimensional feature map to obtain a second feature map of the corresponding dimension, wherein the high-dimensional feature map is a first feature map with a higher dimension than the corresponding first feature map; performing a second fusion process on the second feature maps of different dimensions to obtain a third feature map; performing prediction processing on the third feature map to obtain a prediction result of the steel bar end face in the end face image.
[0006] In order to solve the above problem, the second aspect of the present application provides an electronic device, including a memory and a processor coupled to each other, the memory stores program instructions, and the processor is used to execute the program instructions to implement the steel bar detection method in the above first aspect.
[0007] In order to solve the above-mentioned problem, the third aspect of the present application provides a storage device storing program instructions that can be executed by a processor, and the program instructions are used in the steel bar detection method in the above-mentioned first aspect.
[0008] The above scheme obtains first feature maps of multiple dimensions by performing feature extraction on the obtained cross-sectional image of the steel bar to be tested, and performs a first fusion process on the first feature map of each dimension and the corresponding high-dimensional feature map to obtain a second feature map of the corresponding dimension. The high-dimensional feature map is a first feature map with a higher dimension than the corresponding first feature map, so the semantic features in the high-dimensional feature map and the spatial features in the low-dimensional feature map can be fused, so that the obtained second feature map of the corresponding dimension contains both high-dimensional semantic features and low-dimensional spatial features, and the second feature maps of different dimensions are subjected to a second fusion process to obtain a third feature map, and then the multi-dimensional semantic and spatial features can be fully fused, so that when the third feature map is predicted, the steel bar detection performance can be improved, and since there is no need to use sensors or other special equipment, the detection cost can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 It is a schematic diagram of the process of an embodiment of the steel bar detection method of the present application;
[0010] Figure 2 It is a schematic diagram of the framework of an embodiment of a steel bar detection model;
[0011] Figure 3 It is a flow chart of another embodiment of the steel bar detection method of the present application;
[0012] Figure 4 is a schematic diagram of a framework of an embodiment of obtaining end face shape characteristics;
[0013] Figure 5 is a schematic diagram of an embodiment of a target end face region detected in an end face image;
[0014] Figure 6 It is a schematic diagram of the framework of an embodiment of the steel bar detection device of the present application;
[0015] Figure 7 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application;
[0016] Figure 8 It is a schematic diagram of the framework of an embodiment of the storage device of the present application. DETAILED DESCRIPTION
[0017] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0018] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0019] The terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.
[0020] See also Figure 1 , Figure 1 This is a flow chart of an embodiment of the steel bar detection method of the present application. Specifically, it may include the following steps:
[0021] Step S11: Acquire the end face image of the steel bar to be tested.
[0022] The steel bars to be tested may be steel bars stacked in factories, warehouses and other places, or they may be steel bars stacked on-site at construction sites, without limitation here. The end face of a steel bar refers to a cross section perpendicular to the axis of the steel bar. In one implementation scenario, the end face image of the steel bar to be tested may be obtained through a surveillance camera installed at the location where the steel bar to be tested is located; in another implementation scenario, the end face image of the steel bar to be tested may also be obtained by photographing it through a mobile device such as a mobile phone or a tablet computer, without limitation here.
[0023] Step S12: extracting features from the end face image to obtain first feature maps of multiple dimensions.
[0024] The first feature maps of different dimensions can contain feature information at different levels. For example, the first feature map of low dimension can contain the spatial feature information of the end face of the steel bar to be tested. As the dimension increases, the resolution of the first feature map decreases, while the number of channels of the first feature map increases, so that the first feature map can contain more abstract semantic feature information.
[0025] In an implementation scenario, in order to improve the efficiency of steel bar detection, a steel bar detection model can be pre-trained, and the steel bar detection model includes a feature extraction sub-network, so that the feature extraction sub-network of the steel bar detection model can be used to extract features from the end face image, thereby obtaining the first feature map of multiple dimensions. Figure 2 , Figure 2 Schematic diagram of the framework of an embodiment of a steel bar detection model. Figure 2 As shown, the steel bar detection model includes an input layer (INPUT) for inputting the end face image of the steel bar to be tested. The size of the end face image of the steel bar to be tested can be set according to the actual situation. For example, it can be set to Figure 2As shown in FIG. 3 , the size of the end face image is 512*512, and each pixel contains 3 channels (e.g., RGB channels). The feature extraction subnetwork of the steel bar detection model can use a deep layer aggregation extraction network (DLA). For example, Figure 2 The DLA34 network shown in the figure is Figure 2 The DLA34 network shown can extract first feature maps of four different dimensions, namely, a first feature map of size 64*128*128 obtained by a 4-fold downsampling rate, a first feature map of size 128*64*64 obtained by a 8-fold downsampling rate, a first feature map of size 256*32*32 obtained by a 16-fold downsampling rate, and a first feature map of size 512*16*16 obtained by a 32-fold downsampling rate. In the above first feature maps, 128*128, 64*64, 32*32, and 16*16 respectively represent the resolution of the first feature map, and the values before the resolution represent the number of channels of the first feature map. Therefore, the dimension of the feature map can be measured by the resolution and number of channels of the feature map, and the higher the dimension, the smaller the resolution, the larger the number of channels, and the more abstract the feature information represented by the feature map. In other implementation scenarios, the feature extraction subnetwork can also be used except Figure 2 Other networks other than the DLA34 shown, such as residual networks (res-net), dense networks (dense-net), etc., are not limited here.
[0026] Step S13: performing a first fusion process on the first feature map of each dimension and the corresponding high-dimensional feature map to obtain a second feature map of the corresponding dimension.
[0027] A high-dimensional feature map is a first feature map with a higher dimension than the corresponding first feature map. Please continue to refer to Figure 2 For example, for a first feature map of 64*128*128, the corresponding high-dimensional feature map may include at least one of a first feature map of 128*64*64, a first feature map of 256*32*32, and a first feature map of 512*16*16.
[0028] In an implementation scenario, the first feature map of each dimension and all high-dimensional feature maps with higher dimensions can be subjected to a first fusion process to obtain a second feature map of the corresponding dimension. Figure 2Taking the first feature map shown as an example, the first feature map of 64*128*128, the first feature map of 128*64*64, the first feature map of 256*32*32, and the first feature map of 512*16*16 can be subjected to a first fusion process to obtain a second feature map of 64*128*128. The same applies to other first feature maps, which are not given examples one by one here.
[0029] In another implementation scenario, the first feature map of each dimension and the high-dimensional feature map of a dimension higher than the first dimension may be subjected to a first fusion process to obtain a second feature map of the corresponding dimension. Figure 2 Taking the first feature map shown as an example, the first feature map of 64*128*128 and the first feature map of 128*64*64 can be subjected to a first fusion process to obtain a second feature map of 64*128*128. The same applies to other first feature maps, which are not given examples one by one here.
[0030] In an implementation scenario, in order to improve the efficiency of steel bar detection, a steel bar detection model can be pre-trained, and the steel bar detection model includes a first fusion sub-network, so that the first fusion sub-network of the steel bar detection model can be used to perform a first fusion process on the first feature map of each dimension and the corresponding high-dimensional feature map to obtain the second feature map of the corresponding dimension. Figure 2 , the first fusion sub-network can use a deep layer aggregation upsampling network (Deep Layer Aggregation Upsampling, DLAUP), such as Figure 2 As shown, the DLAUP network contains multiple processing units, and each processing unit performs the same operation, that is, first a 3*3 convolution is performed on the high-dimensional feature map corresponding to the first feature map of each dimension, so that the number of output channels is the same as the number of channels of the first feature map, and then upsampling is performed to make the output resolution the same as the resolution of the first feature map, and then element by element is superimposed with the first feature map, and finally a 3*3 convolution is performed again, so that the number of output channels is the same as the number of channels of the first feature map. Through the DLAUP network, the first feature map of each dimension can be finally fused with all high-dimensional feature maps with higher dimensions, so as to output the second feature map of the corresponding dimension, so that all second feature maps except the highest dimension can fuse low-dimensional spatial features and high-dimensional semantic features. Figure 2Taking the first feature map of 256*32*32 as an example, the corresponding high-dimensional feature map is 512*16*16. The high-dimensional feature map of 512*16*16 is first subjected to a 3*3 convolution process to obtain a feature map of 256*16*16, and then upsampled to obtain a feature map of 256*32*32, which is then superimposed element by element with the first feature map of 256*32*32 to obtain a feature map of 512*32*32, which is then subjected to a 3*3 convolution process to obtain a second feature map of 256*32*32, that is, Figure 2 The second feature map of 256*32*32 in the third row and first column of the DLAUP network shown in FIG. Figure 2 As shown, the second feature map of 256*32*32 is further input into the processing layer corresponding to the first feature map of one dimension lower than it (i.e., 128*64*64) for corresponding fusion processing, and so on, so that Figure 2 In the DLAUP network shown, the second feature map of 64*128*128 can be obtained by fusing all first feature maps with higher dimensions than 64*128*128, the second feature map of 128*64*64 can be obtained by fusing all first feature maps with higher dimensions than 128*64*64, and the second feature map of 256*32*32 can be obtained by fusing all first feature maps with higher dimensions than 256*32*32. In addition, Figure 2 The up process in the DLAUP network shown represents an upsampling operation.
[0031] Step S14: performing a second fusion process on the second feature maps of different dimensions to obtain a third feature map.
[0032] In an implementation scenario, the second feature maps of all different dimensions may be subjected to a second fusion process to obtain a third feature map, thereby further fully integrating high-dimensional semantic features and low-dimensional spatial features, making the feature information in the third feature map richer.
[0033] In an implementation scenario, in order to improve the efficiency of steel bar detection, a steel bar detection model can be pre-trained, and the steel bar detection model includes a second fusion sub-network, and then the second fusion sub-network of the steel bar detection model can be used to perform a second fusion process on the second feature maps of different dimensions to obtain a third feature map. Figure 2 , the second fusion sub-network can use feature pyramid networks (FPN), such as Figure 2As shown in the figure, the FPN network contains multiple processing units, each of which performs the same operation, that is, firstly performing 3*3 convolution processing on the high-dimensional feature map corresponding to the second feature map of each dimension to obtain a feature map with the same number of channels as the second feature map, and then performing upsampling processing to make the resolution of the output feature map the same as the second feature map, and then superimposing it element by element with the second feature map, and then performing a 3*3 convolution processing to reduce the number of channels of the feature map. Figure 2 Taking the 64*128*128 second feature map in as an example, the high-dimensional feature map, that is, the 128*64*64 second feature map, can be subjected to 3*3 convolution processing to obtain a 64*64*64 feature map, and then the feature map is upsampled to obtain a 64*128*128 feature map, and then the 64*128*128 feature map is superimposed element by element with the 64*128*128 second feature map to obtain a 128*128*128 feature map, and then the feature map is subjected to a 3*3 convolution processing to obtain Figure 2 The top 64*128*128 feature map in the FPN network is similarly Figure 2 The second feature map of 256*32*32 in the network is subjected to 3*3 convolution to reduce its number of channels, and then upsampled after convolution to increase its resolution, and finally a feature map of 64*128*128 is obtained, which is then superimposed element by element with the feature map of 64*128*128 on the top layer of the FPN network to obtain a feature map of 128*128*128, and then a 3*3 convolution is performed to obtain a feature map of 64*128*128 on the second layer of the FPN network. Similarly, Figure 2 The second feature map of 512*16*16 in the FPN network is subjected to 3*3 convolution processing to reduce its number of channels, and then upsampled after the convolution processing to increase its resolution, and finally a feature map of 64*128*128 is obtained, which is then superimposed element by element with the feature map of 64*128*128 in the second layer of the FPN network to obtain a feature map of 128*128*128, and then a 3*3 convolution is performed to obtain the feature map of the last layer of 64*128*128 in the FPN network, that is, the third feature map, so that the third feature map can fully integrate the semantic and spatial feature information of the multi-dimensional second feature map. Therefore, through the above-mentioned first fusion processing and second fusion processing, the multi-dimensional semantic feature information and spatial feature information can be fully integrated, so that the network depth can be reduced, the network calculation amount can be reduced, and the feature extraction speed can be improved while ensuring the accuracy of steel bar detection.
[0034] Step S15: performing prediction processing on the third feature map to obtain a prediction result of the end face of the steel bar in the end face image.
[0035] In one implementation scenario, the prediction result may include the center position of the end face of the steel bar, the prediction area containing the end face of the steel bar (such as the length and width of the prediction area), and the prediction confidence, wherein the prediction confidence represents the credibility of the center position obtained by each prediction, and the higher the prediction confidence, the higher the credibility. In a specific implementation scenario, in order to further improve the accuracy of steel bar detection, the center position and prediction area with a prediction confidence greater than a preset confidence threshold (for example, 85%, 80%, 75%, etc.) can be selected as the final detection result. In another specific implementation scenario, in order to further improve the integrity of steel bar detection and avoid omissions as much as possible, the end face image can also be traversed with a certain traversal step length (such as 10 pixels, 20 pixels, etc.) to check whether there are omissions in the prediction result. In another specific implementation scenario, in order to realize the automatic inventory of the steel bars to be tested, the prediction results can also be statistically analyzed to determine the number of steel bars to be tested, and the determined number can be output to improve the user experience.
[0036] In an implementation scenario, in order to improve the efficiency of steel bar detection, a steel bar detection model can be pre-trained, and the steel bar detection model includes a prediction processing sub-network, so that the prediction processing sub-network of the steel bar detection model can be used to predict the third feature map to obtain the prediction result of the steel bar end face in the end face image. Figure 2 , Figure 2 The output layer (OUTPUT) shown is the prediction result obtained after the prediction processing. The prediction result includes a heat map (Heat Map, HM) with the same resolution (i.e. 128*128) as the third feature map. The value of each pixel in the heat map is the prediction confidence that the pixel is the center position of the end face of the steel bar. Since the resolution of the heat map is four times smaller than the resolution of the end face image in the input layer (INPUT) (512*512), each pixel in the heat map represents the position of four pixels of the end face image. In addition, the prediction result also includes a two-channel width and height (Width & Height, WH) data with a resolution of 128*128. The value of each pixel in the first channel indicates the width (width) of the prediction area where the end face of the steel bar is located if the pixel is the center position of the end face of the steel bar. The value of each pixel in the second channel indicates the height (height) of the prediction area where the end face of the steel bar is located if the pixel is the center position of the end face of the steel bar. In addition, the prediction result also includes a two-channel data with a resolution of 128*128 (i.e. Figure 2The REG data in ), which is the offset value of each pixel corresponding to the center point. Since the predicted center position is represented by four pixels of the input end face image, there will be a loss of accuracy when mapping back to the end face image from the feature map. Therefore, the accuracy of the center position can be ensured by calculating the offset values on the horizontal and vertical coordinates in the image. In addition, by Figure 2 The steel bar detection model shown can directly predict the center position of the steel bar end face without preprocessing the frame, which can simplify the detection process.
[0037] In an implementation scenario, the above-mentioned steel bar detection model is obtained by training using sample images, and the sample images are marked with real areas containing steel bar end faces. Specifically, the feature extraction subnetwork of the steel bar detection model can be used to extract features from the sample images to obtain first sample feature maps of multiple dimensions, and the first fusion subnetwork of the steel bar detection model is used to perform a first fusion process on the first sample feature map of each dimension and the corresponding high-dimensional sample feature map to obtain a second sample feature map of the corresponding dimension, and the high-dimensional sample feature map is a first sample feature map with a higher dimension than the corresponding first sample feature map, and then the second fusion subnetwork of the steel bar detection model is used to perform a second fusion process on the second sample feature maps of different dimensions to obtain a third sample feature map, and then the prediction processing subnetwork of the steel bar detection model is used to perform prediction processing on the third sample feature map to obtain a predicted area of the steel bar end face in the sample image, and the loss value of the steel bar detection model is determined using the real area and the predicted area, and the parameters of the steel bar detection model are adjusted using the loss value. Specifically, the parameters of the steel bar detection model can be adjusted by the gradient descent method. For example, the parameters of the steel bar detection model can be adjusted by stochastic gradient descent (SGD), batch gradient descent (BGD), mini-batch gradient descent (MBGD), etc., wherein batch gradient descent refers to using all samples to update parameters at each iteration; stochastic gradient descent refers to using one sample to update parameters at each iteration; mini-batch gradient descent refers to using a batch of samples to update parameters at each iteration, which will not be repeated here. In a specific implementation scenario, a training end condition can also be set. When the training end condition is met, the training of the steel bar detection model can be terminated. Specifically, the training end condition may include: the loss value is less than a preset loss threshold, and the current number of training times reaches a preset number threshold (for example, 500 times, 1000 times, etc.), which is not limited here.
[0038] The above scheme obtains first feature maps of multiple dimensions by performing feature extraction on the obtained cross-sectional image of the steel bar to be tested, and performs a first fusion process on the first feature map of each dimension and the corresponding high-dimensional feature map to obtain a second feature map of the corresponding dimension. The high-dimensional feature map is a first feature map with a higher dimension than the corresponding first feature map, so the semantic features in the high-dimensional feature map and the spatial features in the low-dimensional feature map can be fused, so that the obtained second feature map of the corresponding dimension contains both high-dimensional semantic features and low-dimensional spatial features, and the second feature maps of different dimensions are subjected to a second fusion process to obtain a third feature map, and then the multi-dimensional semantic and spatial features can be fully fused, so that when the third feature map is predicted, the steel bar detection performance can be improved, and since there is no need to use sensors or other special equipment, the detection cost can be reduced.
[0039] See also Figure 3 , Figure 3 This is a flow chart of another embodiment of the steel bar detection method of the present application. Specifically, it may include the following steps:
[0040] Step S11: Acquire the end face image of the steel bar to be tested.
[0041] For details, please refer to the relevant steps in the aforementioned embodiments.
[0042] Step S12: extracting features from the end face image to obtain first feature maps of multiple dimensions.
[0043] For details, please refer to the relevant steps in the aforementioned embodiments.
[0044] Step S13: performing a first fusion process on the first feature map of each dimension and the corresponding high-dimensional feature map to obtain a second feature map of the corresponding dimension.
[0045] The high-dimensional feature map is a first feature map with a higher dimension than the corresponding first feature map. Please refer to the relevant steps in the above embodiment for details.
[0046] Step S14: performing a second fusion process on the second feature maps of different dimensions to obtain a third feature map.
[0047] For details, please refer to the relevant steps in the aforementioned embodiments.
[0048] Step S15: performing prediction processing on the third feature map to obtain a prediction result of the end face of the steel bar in the end face image.
[0049] The prediction result includes: the candidate end face region predicted in the end face image. In an implementation scenario, Figure 2The steel bar detection model shown can predict the confidence that each pixel in the thermal map with a resolution of 128*128 is the center position of the steel bar end face, as well as the bias value of each pixel mapped back to the end face image, and the length and width of the candidate end face area when each pixel is the center position of the end face. Therefore, several candidate end face areas in the end face image and their confidence can be determined by the above bias values.
[0050] Step S16: Analyze the candidate end face area to obtain the end face characteristic information of the steel bar to be tested.
[0051] The end face characteristic information includes at least one of an end face size characteristic, an end face shape characteristic, an end face layout characteristic, and an end face color characteristic.
[0052] In an implementation scenario, the end face characteristic information includes the end face size characteristic, and at least one of the average area and the average aspect ratio of the candidate end face region can be counted as the end face size characteristic. In a specific implementation scenario, the end face of the steel bar is generally circular or elliptical close to a circle, so the average aspect ratio can be obtained by statistics to be approximately equal to 1:1, which is not limited here.
[0053] In another implementation scenario, when the end face feature information includes the end face shape feature, the candidate end face region can be enlarged according to a preset ratio to obtain an enlarged end face region, and the enlarged end face region is subjected to adaptive threshold binarization processing to obtain a mask image, and then the mask area ratio between the mask area of the mask image and the area of the enlarged end face region is used as the end face shape feature. Figure 4 , Figure 4 FIG. 1 is a schematic diagram of a framework for obtaining end face shape characteristics. Figure 4 As shown, for the end faces of the steel bars, most of the shapes are similar Figure 4 The solid circle in Figure 4 Between the solid squares in Figure 4 The length and width of the candidate end face region shown in the figure are enlarged by 1 / 4 of their own to obtain an enlarged end face region, and then the graphic data of the enlarged end face region is adaptively binarized to obtain a mask image, and the mask area ratio between the mask area of the mask image and the area of the enlarged end face region is calculated as the end face shape feature. In theory, the mask area ratio should be greater than Figure 4 The ratio between the area of the square and the area of the enlarged end face area is realized in the actual application. A preset area threshold (for example, 0.21) can be set according to the actual situation. In theory, the mask area ratio should be greater than the preset area threshold. If the condition of being greater than the preset area threshold is not met, it can be considered that the candidate end face area is most likely not to contain the steel bar end face.
[0054] In another implementation scenario, when the end face characteristic information includes the end face layout characteristic, the regional overlap between any two candidate end face regions can be counted, and the regional overlap can be used as the end face layout characteristic. In a specific implementation scenario, the regional overlap can be calculated using the intersection over union (IoU). Since the steel bar ends are arranged adjacent to each other, the probability of overlap should be relatively small in theory. Therefore, when the regional overlap is large, it can be considered that at least one of the two overlapping candidate end face regions has a problem.
[0055] In another implementation scenario, when the end face characteristic information includes the end face color characteristic, the candidate end face regions can be arranged in order of confidence from large to small, and the candidate end face regions located in the front preset proportion (such as 25%, 30%, 35%, etc.) are selected, and the first color distribution of the image data of the selected candidate end face regions is statistically calculated as the end face color characteristic. In a specific implementation scenario, the first color distribution can be a color distribution histogram of the image data of the selected candidate end face regions. Since the colors of the steel bar end faces in the same image are similar, and the color differences of the steel bar end faces of different colors are also large, the first color distribution of the image data of several candidate end face regions with higher confidence is obtained. In theory, if other candidate end face regions are indeed the regions corresponding to the steel bar end faces, their color distribution should also conform to the first color distribution.
[0056] Step S17: Process the candidate end face region using the end face characteristic information to obtain a target end face region including the steel bar end face in the end face image.
[0057] In one implementation scenario, in order to further filter the predicted candidate end face areas to improve the accuracy of the final target end face area, the candidate end face areas can be filtered using at least one of the end face size characteristics, end face shape characteristics, end face layout characteristics, and end face color characteristics to obtain a first end face area, and the first end face area is used as the target end face area.
[0058] In a specific implementation scenario, when filtering using the end face size characteristics, the following processing can be performed on each candidate end face region: determine whether the area and average area of the candidate end face region meet the first preset condition, or determine whether the area aspect ratio and average aspect ratio of the candidate end face region meet the second preset condition. If one of them is not satisfied, it can be considered that the candidate end face region is not the area corresponding to the steel bar end face, and the candidate end face region can be deleted until all candidate end face regions are judged, and the remaining candidate end face regions are used as the first end face region, and when no other end face characteristic information is used for further screening, the first end face region can be used as the target end face region. Specifically, the first preset condition can include that the area of the candidate end face region is not greater than the product of the average area and a preset area ratio (for example, 50%), and the second preset condition can include that the deviation value between the area aspect ratio and the average aspect ratio of the candidate end face region is not greater than a preset value (for example, 0.5). The above preset area ratio and preset value can be adjusted according to actual conditions and are not limited here. Therefore, the candidate end face regions with abnormal sizes can be filtered out by the end face size characteristics.
[0059] In another specific implementation scenario, when filtering using the end face shape characteristics, the following processing can be performed on each candidate end face region: determine whether the mask area ratio corresponding to the candidate end face region is not greater than a preset area threshold (e.g., 0.21). If so, it can be considered that the candidate end face region is highly likely not to contain the steel bar end face, and the candidate end face region can be deleted until all candidate end face regions are judged, and the remaining candidate end face regions are used as the first end face region, and the first end face region can be used as the target end face region without further screening using other end face characteristic information. In addition, filtering can be performed first using the end face size characteristics, and the remaining candidate end face regions after filtering can be further filtered using the end face shape characteristics.
[0060] In another specific implementation scenario, when filtering is performed using the end face layout characteristics, the following processing can be performed on any two candidate end face regions: determine whether the area overlap of the two candidate end face regions is greater than a preset overlap threshold (e.g., 50%), and if so, remove the candidate end face region with a lower confidence in the two candidate end face regions until the area overlap between the remaining candidate end face regions is no greater than the preset overlap threshold, and use the remaining candidate end face regions as the first end face region, and in the case of not using other end face characteristic information for further screening, the first end face region can be used as the target end face region. In addition, filtering can be performed first using the end face size characteristics, and the remaining candidate end face regions after filtering can be further filtered using the end face shape characteristics, and the remaining candidate regions after filtering can be further filtered using the end face layout characteristics.
[0061] In another specific implementation scenario, when filtering is performed using the end face color characteristics, the second color distribution of the image data of the unselected candidate end face regions can be obtained. For example, the second color distribution (e.g., color distribution histogram) of the image data of each candidate end face region after a preset ratio (e.g., 30%) can be obtained, and the following processing is performed on each unselected candidate end face region: determine whether the second color distribution of the candidate end face region matches the first color distribution. If not, delete the candidate end face region until all unselected candidate end face regions have been determined, and the unremoved candidate end face regions are used as the first end face region. Specifically, the match can be determined by calculating the similarity between the first color distribution and the second color distribution. If the similarity is high, the first color distribution and the second color distribution are considered to match. Otherwise, the two can be considered to be mismatched. For example, the similarity between the first color distribution and the second color distribution can be calculated by using the Bhattacharyya coefficient, chi-square test, etc., which is not limited here. In addition, the end face size characteristics can be used for filtering first, and the end face shape characteristics can be used for further filtering of the candidate end face areas remaining after filtering, and the end face layout characteristics can be used for further filtering of the candidate end face areas remaining after filtering, and the end face color characteristics can be used for further filtering of the remaining candidate end face areas, so that the remaining candidate end face areas meet the end face size characteristics, end face shape characteristics, end face layout characteristics, and end face color characteristics at the same time, which is conducive to further improving the detection accuracy.
[0062] In another implementation scenario, in order to avoid omission and improve the integrity of the target end face area finally obtained, the end face size characteristics, end face shape characteristics, end face layout characteristics and end face color characteristics can also be used to add a second end face area in the end face image, and the second end face area is used as the target end face area. Specifically, the end face size characteristics include an average end face area obtained by statistics of the candidate end face area, the end face shape characteristics include a mask area ratio obtained by processing the image data of the expanded average end face area, the end face layout characteristics include the area overlap between the average end face area and the first end face area, and the end face color characteristics include the first color distribution obtained by statistics of the image data of the candidate end face area. For details, please refer to the above steps, which will not be repeated here. Therefore, the average end face area can be used to traverse the end face image with a preset step size (for example, 1 / 3 of the length of the average end face area, etc.). If, during the current traversal, the third color distribution of the image data of the average end face area matches the first color distribution, and the area overlap with the first end face area is not greater than the preset overlap threshold (such as 50%), and the mask area ratio is greater than the preset area threshold (such as 0.21), then the average end face area currently traversed is used as the second end face area until the traversal of the end face image is completed.
[0063] In another implementation scenario, in order to simultaneously improve the accuracy and completeness of the target end face region finally obtained, at least one of the end face size characteristics, end face shape characteristics, end face layout characteristics, and end face color characteristics can be used to filter the candidate end face regions to obtain a first end face region, and the end face size characteristics, end face shape characteristics, end face layout characteristics, and end face color characteristics can be used to add a second end face region to the end face image, so that the first end face region and the second end face region are used as the target end face region. For details, please refer to the relevant steps in the aforementioned implementation scenario, which will not be repeated here.
[0064] In another implementation scenario, in order to count the steel bars to be tested, the number of target end surface areas in the end surface image can also be counted as the number of steel bars to be tested. Figure 5 , Figure 5 FIG. 1 is a schematic diagram of an embodiment of a target end face region detected in an end face image. Figure 5 As shown, the target end surface area (dashed rectangular box in the figure) of the steel bar end surface (solid circle in the figure) and the center position of the steel bar end surface (black dot in the figure) can be obtained.
[0065] Different from the aforementioned embodiment, after obtaining the prediction result including the predicted candidate end face area, the candidate end face area is further analyzed to obtain the end face characteristic information of the steel bar to be tested, and the end face characteristic information includes at least one of the end face size characteristics, end face shape characteristics, end face layout characteristics, and end face color characteristics. The candidate end face area is processed using the end face characteristic information to obtain the target end face area including the steel bar end face in the end face image, which can further improve the performance of steel bar detection.
[0066] See also Figure 6 , Figure 6 It is a schematic diagram of the framework of an embodiment of a steel bar detection device 60 of the present application. The steel bar detection device 60 includes an image acquisition module 61, a feature extraction module 62, a first fusion module 63, a second fusion module 64, and a prediction processing module 65. The image acquisition module 61 is used to acquire the end face image of the steel bar to be tested; the feature extraction module 62 is used to extract features from the end face image to obtain first feature maps of multiple dimensions; the first fusion module 63 is used to perform a first fusion process on the first feature map of each dimension and the corresponding high-dimensional feature map to obtain a second feature map of the corresponding dimension, wherein the high-dimensional feature map is a first feature map with a higher dimension than the corresponding first feature map; the second fusion module 64 is used to perform a second fusion process on the second feature maps of different dimensions to obtain a third feature map; the prediction processing module 65 is used to perform a prediction process on the third feature map to obtain a prediction result of the steel bar end face in the end face image.
[0067] The above scheme obtains first feature maps of multiple dimensions by performing feature extraction on the obtained cross-sectional image of the steel bar to be tested, and performs a first fusion process on the first feature map of each dimension and the corresponding high-dimensional feature map to obtain a second feature map of the corresponding dimension. The high-dimensional feature map is a first feature map with a higher dimension than the corresponding first feature map, so the semantic features in the high-dimensional feature map and the spatial features in the low-dimensional feature map can be fused, so that the obtained second feature map of the corresponding dimension contains both high-dimensional semantic features and low-dimensional spatial features, and the second feature maps of different dimensions are subjected to a second fusion process to obtain a third feature map, and then the multi-dimensional semantic and spatial features can be fully fused, so that when the third feature map is predicted, the steel bar detection performance can be improved, and since there is no need to use sensors or other special equipment, the detection cost can be reduced.
[0068] In some embodiments, the feature extraction module 62 is specifically used to use the feature extraction subnetwork of the steel bar detection model to extract features from the end face image to obtain first feature maps of multiple dimensions. The first fusion module 63 is specifically used to use the first fusion subnetwork of the steel bar detection model to perform a first fusion process on the first feature map of each dimension and the corresponding high-dimensional feature map to obtain a second feature map of the corresponding dimension. The second fusion module 64 is specifically used to use the second fusion subnetwork of the steel bar detection model to perform a second fusion process on the second feature maps of different dimensions to obtain a third feature map. The prediction processing module 65 is specifically used to use the prediction processing subnetwork of the steel bar detection model to perform prediction processing on the third feature map to obtain a prediction result of the steel bar end face in the end face image.
[0069] Different from the aforementioned embodiments, by utilizing the feature extraction subnetwork in the steel bar detection model to perform feature extraction, utilizing the first fusion subnetwork in the steel bar detection model to perform the first fusion processing, utilizing the second fusion subnetwork in the steel bar detection model to perform the second fusion processing, and utilizing the prediction processing subnetwork in the steel bar detection model to perform prediction processing, the efficiency of steel bar detection can be improved.
[0070] In some embodiments, the feature extraction subnetwork includes a deep clustered extraction network, the first fusion subnetwork includes a deep clustered upsampling network, and the second fusion subnetwork includes a feature map pyramid network.
[0071] Different from the previous embodiment, by setting the feature extraction subnetwork to include a deep aggregation extraction network, the first fusion subnetwork to include a deep aggregation upsampling network, and the second fusion subnetwork to include a feature map pyramid network, the spatial feature information and semantic feature information of the feature map can be further fully integrated to improve the accuracy of steel bar detection.
[0072] In some embodiments, the steel bar detection model is trained using sample images, and the sample images are marked with real areas containing the end faces of the steel bars.
[0073] Different from the above-mentioned embodiment, the steel bar detection model is obtained by training with sample images marked with real areas containing steel bar end faces, which can improve the accuracy of the steel bar detection model.
[0074] In some embodiments, the prediction result includes: a candidate end face area predicted in the end face image, the steel bar detection device 60 also includes a regional analysis module, which is used to analyze the candidate end face area to obtain the end face characteristic information of the steel bar to be tested, and the steel bar detection device 60 also includes a regional processing module, which is used to process the candidate end face area using the end face characteristic information to obtain a target end face area containing the steel bar end face in the end face image, wherein the end face characteristic information includes at least one of end face size characteristics, end face shape characteristics, end face layout characteristics, and end face color characteristics.
[0075] Different from the aforementioned embodiment, after obtaining the prediction result including the predicted candidate end face area, the candidate end face area is further analyzed to obtain the end face characteristic information of the steel bar to be tested, and the end face characteristic information includes at least one of the end face size characteristics, end face shape characteristics, end face layout characteristics, and end face color characteristics. The candidate end face area is processed using the end face characteristic information to obtain the target end face area including the steel bar end face in the end face image, which can further improve the performance of steel bar detection.
[0076] In some embodiments, the region processing module includes a region filtering submodule for filtering the candidate end face region using at least one of the end face size characteristics, the end face shape characteristics, the end face layout characteristics, and the end face color characteristics to obtain a first end face region. The region processing module includes a region adding submodule for adding a second end face region in the end face image using the end face size characteristics, the end face shape characteristics, the end face layout characteristics, and the end face color characteristics. The region processing module includes a region collection submodule for taking the first end face region and the second end face region as target end face regions.
[0077] Different from the aforementioned embodiments, at least one of the end face size characteristics, end face shape characteristics, end face layout characteristics, and end face color characteristics is used to filter the candidate end face areas to obtain the first end face area, which can filter the candidate end face areas and improve the accuracy. The second end face area is added to the end face image by using the end face size characteristics, end face shape characteristics, end face layout characteristics, and end face color characteristics to improve the integrity. Therefore, taking the first end face area and the second end face area as the target end face areas can simultaneously improve the accuracy and integrity of the steel bar detection.
[0078] In some embodiments, when the end face size characteristics are used to filter the candidate end face areas, the regional analysis module is specifically used to count the average area and / or average aspect ratio of the candidate end face areas as the end face size characteristics, and the regional filtering sub-mold body is used to eliminate the candidate end face areas when the regional area and the average area of the candidate end face areas do not meet the first preset condition, or when the regional aspect ratio and the average aspect ratio of the candidate end face areas do not meet the second preset condition, and use the remaining candidate end face areas as the first end face areas.
[0079] Different from the above-mentioned embodiment, by filtering the candidate end face regions using the end face size characteristics, the candidate end face regions meeting the end face size characteristics can be obtained, thereby improving the accuracy of steel bar detection.
[0080] In some embodiments, when using the end face shape characteristics to filter the candidate end face area, the regional analysis module is specifically used to expand the candidate end face area according to a preset ratio to obtain an enlarged end face area; perform adaptive threshold binarization processing on the enlarged end face area to obtain a mask image; use the mask area ratio of the mask image to the area of the enlarged end face area as the end face shape characteristics, and the regional filtering sub-mold body is used to eliminate the candidate end face area when the mask area ratio corresponding to the candidate end face area is not greater than the preset area threshold, and use the remaining candidate end face area as the first end face area.
[0081] Different from the above-mentioned embodiment, by filtering the candidate end face regions using the end face shape characteristics, the candidate end face regions that meet the end face shape characteristics can be obtained, thereby improving the accuracy of steel bar detection.
[0082] In some embodiments, the prediction results also include: the confidence of the candidate end face area. When the candidate end face areas are filtered using the end face layout characteristics, the regional analysis module is specifically used to count the regional overlap between any two candidate end face areas, and use the regional overlap as the end face layout characteristics. The regional filtering sub-mold body is used to eliminate the candidate end face areas with lower confidence between the two candidate end face areas when the regional overlap is greater than a preset overlap threshold, until the regional overlap between the remaining candidate end face areas is no greater than the preset overlap threshold, and the remaining candidate end face areas are used as the first end face area.
[0083] Different from the above-mentioned embodiment, by filtering the candidate end face regions using the end face layout characteristics, the candidate end face regions that meet the end face layout characteristics can be obtained, thereby improving the accuracy of steel bar detection.
[0084] In some embodiments, the prediction results also include: the confidence of the candidate end face area. When the candidate end face area is filtered using the end face color characteristics, the regional analysis module is specifically used to sort the candidate end face areas in descending order of confidence; select the candidate end face areas that are located in the front preset proportion, and count the first color distribution of the image data of the selected candidate end face areas as the end face color characteristics. The regional filtering sub-mold body is used to obtain the second color distribution of the image data of the unselected candidate end face areas. When the second color distribution of the candidate end face area does not match the first color distribution, the candidate end face area is eliminated, and the candidate end face area that is not eliminated is used as the first end face area.
[0085] Different from the above-mentioned embodiment, by filtering the candidate end face regions using the end face color characteristics, the candidate end face regions that meet the end face color characteristics can be obtained, thereby improving the accuracy of steel bar detection.
[0086] In some embodiments, the end face size characteristics include the average end face area obtained by statistics of the candidate end face areas, the end face shape characteristics include the mask area ratio obtained by processing the image data of the expanded average end face area, the end face layout characteristics include the area overlap between the average end face area and the first end face area, the end face color characteristics include the first color distribution obtained by statistics of the image data of the candidate end face areas, and the area adding submodule is specifically used to traverse the end face image with a preset step size using the average end face area, and during the current traversal, the third color distribution of the image data of the average end face area matches the first color distribution, and the area overlap is not greater than the preset overlap threshold, and the mask area ratio is greater than the preset area threshold, and the average end face area is used as the second end face area.
[0087] Different from the aforementioned embodiment, the end face size characteristics, end face color characteristics, end face layout characteristics, and end face shape characteristics are used to traverse the end face image, thereby adding a second end face area, so as to obtain the end face missed in the prediction process, thereby improving the integrity of steel bar detection.
[0088] In some embodiments, the steel bar detection device further includes a steel bar counting module for counting the number of target end face areas in the end face image as the number of steel bars to be detected.
[0089] In some embodiments, the dimension includes the resolution and the number of channels of the feature map, and the higher the dimension, the smaller the resolution and the larger the number of channels.
[0090] See also Figure 7 , Figure 7: is a schematic diagram of a framework of an embodiment of an electronic device 70 of the present application. The electronic device 70 includes a memory 71 and a processor 72 coupled to each other, the memory 71 stores program instructions, and the processor 72 is used to execute the program instructions to implement the steps in any of the above-mentioned steel bar detection method embodiments. Specifically, the electronic device may include but is not limited to: a surveillance camera, a mobile phone, a tablet computer, a microcomputer, etc.
[0091] Specifically, the processor 72 is used to control itself and the memory 71 to implement the steps in any of the above-mentioned steel bar detection method embodiments. The processor 72 can also be called a CPU (Central Processing Unit). The processor 72 may be an integrated circuit chip with signal processing capabilities. The processor 72 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 72 can be implemented by multiple integrated circuit chips.
[0092] The above scheme can improve the performance of steel bar detection and reduce the cost of steel bar detection.
[0093] See also Figure 8 , Figure 8 The schematic diagram of the framework of an embodiment of the storage device 80 of the present application. The storage device 80 stores program instructions 801 that can be executed by a processor, and the program instructions 801 are used to implement the steps in any of the above-mentioned steel bar detection method embodiments.
[0094] The above scheme can improve the performance of steel bar detection and reduce the cost of steel bar detection.
[0095] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0096] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0097] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0098] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
Claims
1. A steel bar detection method, characterized in that: include: Acquire the end face image of the steel bar to be tested; Extracting features from the end face image to obtain first feature maps of multiple dimensions; Performing a first fusion process on the first feature map of each dimension and the corresponding high-dimensional feature map to obtain a second feature map corresponding to the dimension, wherein the high-dimensional feature map is a first feature map with a higher dimension than the corresponding first feature map; Performing a second fusion process on the second feature maps of different dimensions to obtain a third feature map; Performing prediction processing on the third feature map to obtain a prediction result of the steel bar end face in the end face image, wherein the prediction result includes a candidate end face region predicted in the end face image; Analyze the candidate end face region to obtain the end face characteristic information of the steel bar to be tested; wherein the end face characteristic information includes at least one of the end face size characteristic, the end face shape characteristic, the end face layout characteristic, and the end face color characteristic; Processing the candidate end face region using the end face characteristic information to obtain a target end face region in the end face image that includes the end face of the steel bar; The number of the target end surface areas in the end surface image is counted as the number of the steel bars to be tested.
2. The method according to claim 1, characterized in that The extracting features of the end face image to obtain a first feature map of multiple dimensions comprises: Using a feature extraction subnetwork of a steel bar detection model to extract features from the end face image, to obtain the first feature maps of the multiple dimensions; The performing a first fusion process on the first feature map of each dimension and the first feature map of a higher dimension to obtain a second feature map corresponding to the dimension includes: Using the first fusion sub-network of the steel bar detection model, the first feature map of each dimension and the corresponding high-dimensional feature map are subjected to a first fusion process to obtain a second feature map corresponding to the dimension; The performing a second fusion process on the second feature maps of different dimensions to obtain a third feature map comprises: Using the second fusion sub-network of the steel bar detection model, the second feature maps of different dimensions are subjected to a second fusion process to obtain the third feature map; The step of performing prediction processing on the third feature map to obtain a prediction result of the end face of the steel bar in the end face image comprises: The third feature map is predicted and processed using the prediction processing subnetwork of the steel bar detection model to obtain a prediction result of the steel bar end face in the end face image.
3. The method according to claim 2, characterized in that The feature extraction subnetwork includes a deep aggregation extraction network, the first fusion subnetwork includes a deep aggregation upsampling network, and the second fusion subnetwork includes a feature map pyramid network; And / or, the steel bar detection model is trained using sample images, and the sample images are marked with a real area containing the end face of the steel bar.
4. The method according to claim 1, characterized in that: The step of processing the candidate end face region by using the end face characteristic information to obtain a target end face region containing the steel bar end face in the end face image comprises: Filtering the candidate end face regions by using at least one of the end face size characteristic, the end face shape characteristic, the end face layout characteristic, and the end face color characteristic to obtain a first end face region; Adding a second end face region in the end face image by using the end face size characteristic, the end face shape characteristic, the end face layout characteristic and the end face color characteristic; The first end surface region and the second end surface region are used as the target end surface regions.
5. The method according to claim 4, characterized in that When the candidate end face regions are filtered using the end face size characteristics, the candidate end face regions are analyzed to obtain the end face characteristic information of the steel bar to be tested, including: Counting the average area and / or average aspect ratio of the candidate end face regions as the end face size characteristic; The filtering the candidate end face regions to obtain the first end face region comprises: If the area of the candidate end face region and the average area do not satisfy the first preset condition, or if the area aspect ratio of the candidate end face region and the average aspect ratio do not satisfy the second preset condition, the candidate end face region is eliminated and the remaining candidate end face region is used as the first end face region.
6. The method according to claim 4, characterized in that When the candidate end face regions are filtered using the end face shape characteristics, the candidate end face regions are analyzed to obtain the end face characteristic information of the steel bar to be tested, including: Enlarging the candidate end face region according to a preset ratio to obtain an enlarged end face region; Performing adaptive threshold binarization processing on the enlarged end face area to obtain a mask image; taking a mask area ratio of the mask image to the area of the enlarged end face region as the end face shape characteristic; The filtering the candidate end face regions to obtain the first end face region comprises: If the mask area ratio corresponding to the candidate end face region is not greater than a preset area threshold, the candidate end face region is eliminated, and the remaining candidate end face region is used as the first end face region.
7. The method according to claim 4, characterized in that The prediction result also includes: the confidence of the candidate end face area. When the candidate end face area is filtered by using the end face layout characteristics, the end face characteristic information of the steel bar to be tested obtained by analyzing the candidate end face area includes: Counting the area overlap between any two of the candidate end face areas, and using the area overlap as the end face layout characteristic; The filtering the candidate end face regions to obtain the first end face region comprises: If the area overlap is greater than a preset overlap threshold, the candidate end face area with a lower confidence level among the two candidate end face areas is eliminated until the area overlap between the remaining candidate end face areas is no greater than the preset overlap threshold, and the remaining candidate end face areas are used as the first end face areas.
8. The method according to claim 4, characterized in that The prediction result also includes: the confidence of the candidate end face region, when the candidate end face region is filtered by using the end face color characteristics, the end face characteristic information of the steel bar to be tested obtained by analyzing the candidate end face region includes: Sorting the candidate end face regions in descending order of the confidence levels; Selecting the candidate end face region located at a preset ratio, and counting the first color distribution of the image data of the selected candidate end face region as the end face color characteristic; The filtering the candidate end face regions to obtain the first end face region comprises: Acquire a second color distribution of the image data of the candidate end surface area that is not selected; If the second color distribution of the candidate end face region does not match the first color distribution, the candidate end face region is eliminated, and the candidate end face region that is not eliminated is used as the first end face region.
9. The method according to claim 4, characterized in that The end face size characteristic includes an average end face area obtained by using the statistics of the candidate end face area, the end face shape characteristic includes a mask area ratio obtained by processing the image data of the enlarged average end face area, the end face layout characteristic includes an area overlap between the average end face area and the first end face area, and the end face color characteristic includes a first color distribution obtained by using the statistics of the image data of the candidate end face area; The adding a second end face region in the end face image by using the end face size characteristic, the end face shape characteristic, the end face layout characteristic and the end face color characteristic comprises: traversing the end face image using the average end face region with a preset step length; If, during the current traversal, the third color distribution of the image data of the average end face area matches the first color distribution, the area overlap is not greater than the preset overlap threshold, and the mask area ratio is greater than the preset area threshold, then the average end face area is used as the second end face area.
10. The method according to claim 1, characterized in that The dimension includes the resolution and the number of channels of the feature map, and the higher the dimension, the smaller the resolution and the larger the number of channels.
11. An electronic device, characterized in that: It comprises a memory and a processor coupled to each other, the memory stores program instructions, and the processor is used to execute the program instructions to implement the steel bar detection method according to any one of claims 1 to 10.
12. A storage device, characterized in that: Program instructions that can be executed by a processor are stored, and the program instructions are used to implement the steel bar detection method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Method for counting somatic cells of milk based on image processing
CN105303568A
Automatic steel bar bundling position identification method
CN110097087A
Steel bar detection method based on deep convolutional neural network
CN110264466A
Steel bar detection method based on Faster R-CNN
CN110298821A
Image processing method and device, electronic equipment and storage medium
CN110348537A
