Armour block identifying and counting method, equipment, medium and product
The waterfall image is obtained by a drone and the recognition and counting model is used to automatically count the face protection block, which solves the problem of low on-site counting of the breakwater, and achieves efficient and accurate recognition and counting of face protection blocks.
Patent Information
- Application Number
- CN202510457658.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-07-18
AI Technical Summary
In the prior art, the on-site surface protection block counting of breakwater is inefficient and prone to errors, and requires manual participation.
The breakwater field image is obtained through the drone, and the surface protection block recognition and counting is used to automatically use a pre-trained recognition and counting model, including object detection and image segmentation model, combined with the backbone network, neck network and decoder for feature extraction and segmentation, and use the feature extraction network and counting model for accurate counting.
The automation and high efficiency of face protection block counting is achieved, manual intervention is reduced, and the accuracy and rate of counting is improved.
Smart Images

Figure CN120339882A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of engineering monitoring, and particularly to a method, device, medium and product for identifying and counting armor blocks. Background Art
[0002] At the breakwater site of various projects, the number of armor blocks is of great significance for the evaluation of the stability and safety of the project.
[0003] The traditional method of manually counting at the breakwater site is inefficient and error-prone. With the development of unmanned aerial vehicle (UAV) technology, the prospect of improving the counting efficiency of armor blocks has been seen. Therefore, in order to improve the counting efficiency, images of the breakwater site are obtained by UAVs, and then the armor blocks in the images are manually counted. In order to improve the accuracy of counting, multiple counts can also be carried out.
[0004] As can be seen from the above, the prior art has at least the following distinguishing features: Although the prior art has improved the method of manually counting at the breakwater site, it still requires human participation and there is still the problem of low counting efficiency. Summary of the Invention
[0005] The purpose of this application is to provide a method, device, medium and product for identifying and counting armor blocks to solve the problem of low counting efficiency described in the background art.
[0006] To achieve the above purpose, this application provides the following solutions: In a first aspect, this application provides a method for identifying and counting armor blocks, including: Obtaining a target image corresponding to a target area, where the target area is a breakwater area for which the number of armor blocks is to be calculated; Sending the target image to a pre-trained identification and counting model so that the identification and counting model outputs the number of armor blocks included in the target image; Sending the number of armor blocks to a terminal device so that the terminal device displays the number of armor blocks.
[0007] Optionally, after obtaining the target image corresponding to the target area, the method further includes: Preprocessing the target image to obtain a new target image, where the preprocessing includes denoising, enhancing contrast, and adjusting brightness.
[0008] Optionally, the identification and counting model is a target detection and image segmentation model.
[0009] Optionally, the identification and counting model includes an identification model, and the identification model includes a backbone network, a neck network, a decoder, and a feature extraction network connected in sequence; The backbone network is used to perform semantic and feature extraction on the target image to generate a feature map with multi-semantic information and multiple scales; The neck network is used to fuse the feature maps to obtain a fused image; The decoder is used to restore the resolution of the fused image to obtain a restored image, and perform mask segmentation on the restored image to obtain a mask image, and the mask image is divided into a face shield block area and a background area; The feature extraction network is used to identify each face shield block from the face shield block area of the mask image, and mark each identified face shield block with a specific bounding box.
[0010] Optionally, the recognition and counting model further includes a counting model, which is connected to the feature extraction network, used to identify the bounding boxes output by the feature extraction network, count the number of the bounding boxes, and determine the number of the bounding boxes as the number of face shield blocks.
[0011] Optionally, after obtaining the target image corresponding to the target area, the method further includes: Obtain the confidence of the bounding box, where the confidence is used to reflect the probability that the image content within the bounding box is a face shield block; When the confidence is greater than or equal to a predetermined threshold, determine that the image content within the bounding box is a face shield block; When the confidence is less than the predetermined threshold, determine that the image content within the bounding box is a non-face shield block.
[0012] Optionally, the confidence is set by the following method: Obtain the first light intensity, where the first light intensity is the light intensity of the target area when the target image is collected; Query the confidence setting value corresponding to the first light intensity from the pre-set correspondence between different light intensities and confidence setting values; Set the queried confidence setting value as the confidence corresponding to the target image.
[0013] In a second aspect, the present application provides a computer device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the computer program to implement the steps of the method according to any one of the first aspects above.
[0014] In a third aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method according to any one of the first aspects above are implemented.
[0015] Fourthly, the present application provides a computer program product, including a computer program which, when executed by a processor, implements the steps of the method described in any one of the above first aspects.
[0016] According to the specific embodiments provided by the present application, the present application discloses the following technical effects: For the method for identifying and counting armor blocks provided in the embodiments of the present application, by obtaining a target image of a target area arranged with armor blocks to be counted, and then sending the target image to a pre-trained identification and counting model, the identification and counting model can output the number of armor blocks included in the target image. Compared with the prior art of manually counting the armor blocks in the target image, the armor block counting method provided in the embodiments of the present application is not only accurate in counting, but also high in speed. Description of the Drawings
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0018] Figure 1 It is an application environment diagram of a method for identifying and counting armor blocks in an embodiment of the present application; Figure 2 It is a schematic flowchart of a method for identifying and counting armor blocks provided in an embodiment of the present application; Figure 3 It is a schematic diagram of a target image provided in an embodiment of the present application; Figure 4 It is a schematic flowchart of a method for identifying and counting armor blocks provided in another embodiment of the present application; Figure 5 It is a schematic diagram of a segmented target image provided in an embodiment of the present application; Figure 6 It is a schematic diagram in which the armor blocks in the target image are marked with bounding boxes in another embodiment of the present application; Figure 7 It is a schematic flowchart of a method for determining whether the image content within the bounding box is an armor block according to the confidence level in another embodiment of the present application; Figure 8 It is a schematic flowchart of a method for setting the confidence level of the target image in another embodiment of the present application; Figure 9 It is a schematic flowchart of a method for classifying armor blocks in another embodiment of the present application; Figure 10 The structural schematic diagram of a computer device provided by an embodiment of the present application. Specific embodiments
[0019] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0020] To make the above objects, features, and advantages of the present application more obvious and understandable, the present application will be further described in detail below in conjunction with the drawings and specific embodiments.
[0021] The method for identifying and counting facing blocks provided by the embodiments of the present application can be applied to an application environment as Figure 1 shown. The application environment includes a terminal and a server. Among them, the terminal communicates with the server through a network. The data storage system can store the data that the server needs to process. The data storage system can be set separately, integrated on the server, placed in the cloud or on other servers. The terminal can send the target image to be processed to the server. After receiving the target image to be processed, the server can first store the target image, and when it needs to process it, obtain it from the storage location, or perform a processing task while storing. The server sends the target image to the identification and counting model so that the identification and counting model outputs the number of facing blocks. The server can feedback the obtained number to the terminal. In addition, in some embodiments, the method for identifying and counting facing blocks can also be implemented separately by the server or the terminal. For example, the terminal can directly process the target image to calculate the number of facing blocks, or the server can obtain the target image to be processed from the data storage system and perform identification and counting of facing blocks on the target image to be processed.
[0022] Among them, the terminal can be, but is not limited to, various desktop computers, laptop computers, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented by an independent server or a server cluster composed of multiple servers, and can also be a cloud server.
[0023] In an exemplary embodiment, refer to Figure 2As shown, a method for identifying and counting armor blocks is provided. This method is executed by a computer device, which can be specifically executed by a computer device such as a terminal or a server alone, or jointly executed by a terminal and a server. In the embodiments of the present application, taking the case where this method is applied to the Figure 1 server in it as an example for illustration, it includes the following steps 201 to step 203: Step 201, obtain a target image corresponding to a target area, where the target area is a breakwater area for which the number of armor blocks is to be calculated.
[0024] Among them, a certain number of armor blocks are arranged in the breakwater area.
[0025] Among them, the target image is obtained by the following method: Shoot a video of the target area by a drone, and extract an image corresponding to the target area from the video. There may be non-target areas in the image. Therefore, the non-target area part can be cropped by cropping the image to obtain the target area. Among them, cropping the image can be achieved manually. See Figure 3 As shown, it is a target image.
[0026] In addition, when the target area is large, when using a drone to shoot the breakwater site of the construction site, it is necessary to ensure that the shooting angle, height, and coverage range can comprehensively reflect the distribution of the armor blocks.
[0027] Step 202, send the target image to a pre-trained recognition and counting model so that the recognition and counting model outputs the number of armor blocks included in the target image.
[0028] The recognition and counting model is used to separate the armor blocks from the background and mark each armor block with a predetermined marking graphic, such as enclosing each armor block with a rectangular frame, and finally counting the rectangular frames. The number of rectangular frames is the number of armor blocks.
[0029] Step 203, send the number of the armor blocks to the terminal device so that the terminal device displays the number of the armor blocks.
[0030] If there are multiple target areas, or one target area is too large, it can be divided into multiple smaller target areas. For each target area, steps 201 - step 203 are respectively used to count the armor blocks in it. Then add up the counts of each small area to obtain the final target area.
[0031] The method for identifying and counting armor blocks provided by the embodiments of the present application obtains a target image of a target area arranged with armor blocks to be counted, and then sends the target image to a pre-trained identification and counting model, which can output the number of armor blocks included in the target image. Compared with the prior art of manually counting the armor blocks in the target image, the armor block counting method provided by the embodiments of the present application is not only accurate in counting, but also high in speed.
[0032] In addition, the present application has a high degree of automation, reduces manual intervention, and realizes an automated process from image acquisition to output of counting results.
[0033] Optionally, referring to Figure 4 , in another exemplary embodiment of the present application, after the above step 201, the method further includes the following step 301: Step 301, preprocess the target image to obtain a new target image, and the preprocessing includes denoising, enhancing contrast, and adjusting brightness.
[0034] By performing preprocessing operations such as denoising, enhancing contrast, and adjusting brightness on the target image, the quality of the target image is improved, thereby improving the accuracy of subsequent image processing.
[0035] After preprocessing the target image, the image input into the identification and counting model is the new target image.
[0036] In addition, the image input into the identification and counting model also needs to meet certain requirements. For example, the collected target image is adjusted to a fixed size (640x640) and normalized (the gray value of the pixel is adjusted from 0-255 to 0-1) to meet the input requirements of the identification and counting model, and then input into the identification and counting model.
[0037] Optionally, the identification and counting model is a target detection and image segmentation model (full English name: You OnlyLook Once Version 8; English abbreviation: YOLOv8). This model is an advanced convolutional neural network model and is part of the YOLO series.
[0038] The YOLOv8 model adopts a unified network architecture based on Anchor-Free. Its core is composed of a backbone network, a neck network, and a decoder.
[0039] Optionally, in another exemplary embodiment of the present application, the identification and counting model includes an identification model, and the identification model includes a backbone network, a neck network, a decoder, and a feature extraction network connected in sequence; The backbone network is used to perform semantic and feature extraction on the target image to generate a feature map with multi-semantic information and multiple scales.
[0040] The backbone network usually adopts a Cross Stage Partial (CSP) structure, which includes a series of convolutional layers and pooling layers to perform feature extraction of different scales on the target image through convolutional operations and pooling operations, quickly generating a feature map containing rich semantic information and multi-scale features, thereby generating feature maps at different levels. The shallow feature map retains the detail information of the image, while the deep feature map contains more abstract semantic information.
[0041] The neck network is used to fuse the feature maps to obtain a fused image.
[0042] The neck network receives the multi-scale feature maps output by the backbone network, and performs feature fusion on the multi-scale feature maps through structures such as the Feature Pyramid Network (FPN) or the Path Aggregation Network (PAN), enhancing the information interaction between feature maps of different scales, thereby enhancing the expression ability of the feature maps and enabling the model to better capture facing blocks of different sizes.
[0043] The decoder is used to restore the resolution of the fused image to obtain a restored image, and perform mask segmentation on the restored image to obtain a mask image, which is divided into a facing block body area and a background area.
[0044] The decoder is used to perform an upsampling operation on the fused image, gradually restoring the resolution of the fused image to a resolution close to that of the target image, and denoting the image at this time as the restored image. Then, a per-pixel convolutional classification operation is performed on the restored image to predict the probability that each pixel belongs to a facing block body or the background, generating a probability map for each pixel belonging to a facing block body or the background. When the probability is greater than a predetermined value, the pixel is marked as a facing block body or the background, thereby assigning a class label to each pixel, keeping the gray value of the pixel with the class of the facing block body unchanged, and setting the gray value of the pixel with the class of the background to 1 (255 becomes 1 after normalization), thereby realizing semantic segmentation. Finally, a mask image of the same size as the target image is generated, thereby separating the facing block body from the background.
[0045] In addition, other methods can also be used to segment the facing block body and the background. For example, as shown in Figure 5 By using the method of edge detection, the facing block body can be detected.
[0046] Among them, the predetermined value can be an empirical value.
[0047] The feature extraction network is used to identify each facing block from the facing block area of the mask image, and mark each identified facing block with a specific bounding box.
[0048] When identifying each facing block from the mask image, methods such as edge detection, texture recognition, and color feature recognition can be used.
[0049] Furthermore, the specific bounding box can be set artificially. For example, a rectangular bounding box is used to enclose each facing block.
[0050] Optionally, in another exemplary embodiment of the present application, the recognition and counting model further includes a counting model, which is connected to the feature extraction network and is used to identify the bounding boxes output by the feature extraction network, count the number of the bounding boxes, and determine the number of the bounding boxes as the number of facing blocks.
[0051] See Figure 6 As shown, the part enclosed by the rectangular frame is an identified facing block.
[0052] Furthermore, in order to improve the counting accuracy, during the counting process, the confidence of the bounding box can also be determined. The confidence is used to represent the probability that the image content within the bounding box is a facing block, so as to filter out unreliable prediction results, and then count the remaining reliable bounding boxes to obtain the number of facing blocks, realizing the automatic identification and accurate counting of facing blocks. Whether a bounding box is reliable can be measured by the confidence. When the confidence of the bounding box is greater than a predetermined threshold, it is determined that the image content within the bounding box is a facing block, and when the confidence is less than the predetermined threshold, it is determined that the image content within the bounding box is not a facing block. Therefore, optionally, see Figure 7 In another exemplary implementation of the present application, after step 201, the method further includes: Step 401: Obtain the confidence of the bounding box, where the confidence is used to reflect the probability that the image content within the bounding box is a facing block.
[0053] Step 402: When the confidence is greater than or equal to the predetermined threshold, determine that the image content within the bounding box is a facing block.
[0054] Step 403: When the confidence is less than the predetermined threshold, determine that the image content within the bounding box is not a facing block.
[0055] Among them, the confidence of the bounding box is calculated by a calculation model. Further, how the calculation model calculates the confidence of the bounding box can refer to the relevant prior art, and the present application will not elaborate here.
[0056] Among them, the predetermined threshold can be an empirical value set manually.
[0057] Optionally, referring to Figure 8 , in another exemplary implementation of this application, the confidence level is set through the following steps 501 to 503: Step 501, obtain the first light intensity, where the first light intensity is the light intensity of the target area when the target image is collected.
[0058] The first light intensity can be directly obtained from the network or manually queried and then input into the server. For example, first determine the date of collecting the target image, and then obtain the corresponding light intensity according to the date.
[0059] Step 502, query the confidence level setting value corresponding to the first light intensity from the pre-set correspondence between different light intensities and confidence level setting values.
[0060] For the convenience of use and to improve the efficiency of setting the confidence level, the correspondence between the light intensity and the predetermined threshold can be determined in advance so that it can be queried in time when in use.
[0061] Step 503, set the queried confidence level setting value as the confidence level corresponding to the target image.
[0062] After the confidence level is set, the parameter of the confidence level in the recognition counting model can be modified, so as to use the new confidence level to determine the bounding box.
[0063] Since different construction site environments have a greater impact on the recognition of armor blocks. For example, for the lighting conditions of the target area, when the lighting conditions are strong or dark, the brightness of the target image will be too high or too low. At this time, it is difficult to mark the bounding box, and a lower confidence level can be set. For example, it can be set to 0.3. When the light intensity is moderate, a higher confidence level can be set. For example, it can be set to 0.8, so as to change the size of the confidence level according to the environmental conditions and improve the adaptability of the recognition counting model to different application scenarios.
[0064] Optionally, referring to Figure 9 , in another exemplary embodiment of this application, the counting model is further used to output the type of armor block included in the target image, and the counting model determines the type of armor block through the following steps 601 to 603: Step 601, for any armor block enclosed by the bounding box in the mask image, determine the first external shape feature of the armor block.
[0065] Among them, the external shape feature includes the shape and the volume size.
[0066] Step 602: In the pre-determined correspondence between the armor block types and the second shape features, query for the second shape feature that is the same as the first shape feature.
[0067] Step 603: Determine the armor block type corresponding to the queried second shape feature as the type of the armor block enclosed by the bounding box.
[0068] Optionally, in another exemplary embodiment of the present application, the recognition and counting model is trained through the following steps 701 - 708: Step 701: Obtain a predetermined number of initial images and first annotated images. The first annotated image is an image obtained by performing mask segmentation and bounding box marking operations on the initial image in advance, and the initial image is an unannotated image.
[0069] The first annotated image can be understood as first performing mask segmentation on the initial image and then marking the bounding box on the segmented image. Further, mask segmentation and bounding box marking can be performed manually in advance.
[0070] Step 702: Divide the initial images and the first annotated images into a training set and a validation set.
[0071] Among them, the number of the training set is relatively large, and the number of the validation set is relatively small. Further, a part can also be set as a test set for testing after the validation set has completed validation to improve the accuracy of the model.
[0072] In addition, the first annotated image corresponding to each initial image is divided into the same set.
[0073] Step 703: Obtain one of the initial images and send it to the initial model so that the initial model outputs a second annotated image. The initial model is the model of the recognition and counting model before training.
[0074] Among them, the second annotated image is an image obtained by performing mask segmentation and bounding box marking operations on the initial image using the initial model.
[0075] Step 704: Determine the first loss value of the second annotated image compared to the first annotated image.
[0076] Among them, the first loss value can be an empirical value.
[0077] Step 705: When the first loss value is less than the first preset value, record the current model as an intermediate model.
[0078] When the first loss value is greater than or equal to the first preset value, repeat steps 603 and 604 until the loss value is less than the first preset value.
[0079] Step 706: Send the initial image of the validation set to the intermediate model so that the intermediate model outputs a third labeled image.
[0080] Step 707: Calculate a second loss value, which is the loss value between the third benchmark labeled image and the initial image of the validation set.
[0081] Step 708: When the second loss value is less than a second preset value, stop training.
[0082] When the second loss value is greater than the second preset value, repeatedly execute steps 601 - 607 until the second loss value is less than the second preset value.
[0083] In the above process, through the backpropagation algorithm, calculate the gradient of the loss value with respect to the model parameters, and use an optimizer (Adam) to update the model parameters according to the gradient. During training, continuously adjust hyperparameters such as the learning rate and batch size, and at the same time monitor the loss and evaluation metrics (mAP, IoU, etc.) on the validation set to prevent the model from overfitting and enable the model to achieve good performance on both the training set and the validation set.
[0084] In addition, in addition to determining whether to continue training the model through the second loss value, it is also possible to determine whether to continue training the model through the performance of the validation set. For example, when the performance of the model on the validation set no longer improves (the magnitude of the loss value no longer changes), stop training and save the trained model for the recognition and counting of facing blocks.
[0085] Different from traditional methods, during the training process of YOLOv8, through a specific loss function, simultaneously optimize the object detection and semantic segmentation tasks, enabling the model to achieve good performance on both tasks.
[0086] Among them, the above loss function can be the following formula: Among them, is the semantic segmentation loss (cross - entropy loss), which is used to measure the prediction accuracy of the segmentation mask; is the classification loss, which is used for target class prediction; is the regression loss, which is used for the prediction of the position and size of the bounding box. and are the weight coefficients for balancing different losses.
[0087] Furthermore, during the training process, calculate the gradient of the loss function with respect to the model parameters through the backpropagation algorithm. For the weight W of the convolutional layer, calculate through the chain rule, and then use the optimizer Adam to update the parameters.
[0088] Use the Adam optimizer, and its parameter update formula is as follows:
[0089]
[0090]
[0091]
[0092]
[0093] Among them, is the estimate of the first moment ; is the estimate of the second moment ; is the gradient at the current moment, and are hyperparameters (common values = 0.9, = 0.999), is the learning rate, is a small constant to prevent the denominator from being zero ( ), are the model parameters at time t. For the further meanings of each model parameter, reference can be made to the prior art, and details are not described herein. During the training process, the learning rate can be dynamically adjusted according to the loss and evaluation metrics on the validation set (adopting a learning rate decay strategy) to improve the accuracy and generalization ability of the model.
[0094] In an exemplary embodiment, a computer device is provided. The computer device can be a server or a terminal, and its internal structure diagram can be as shown in Figure 10 . The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data related to the identification and counting of armor blocks. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, a method for identifying and counting armor blocks can be implemented.
[0095] Those skilled in the art can understand that Figure 10 the structure shown in is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.
[0096] In an exemplary embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.
[0097] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0098] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0099] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.
[0100] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, in the various embodiments provided by the present application, any reference to a memory, database, or other medium can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0101] In the various embodiments provided by the present application, the databases involved can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. In the various embodiments provided by the present application, the processors involved can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0102] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0103] Specific examples are used in this article to elaborate on the principles and implementation manners of the present application. The descriptions of the above embodiments are only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A method for identifying and counting armor blocks, characterized in that, Including: Obtain a target image corresponding to a target area, where the target area is a breakwater area for which the number of armor blocks is to be calculated; Send the target image to a pre-trained recognition and counting model so that the recognition and counting model outputs the number of armor blocks included in the target image; Send the number of armor blocks to a terminal device so that the terminal device displays the number of armor blocks.
2. The method for identifying and counting the facing blocks according to claim 1, wherein After obtaining the target image corresponding to the target area, the method further includes: Preprocess the target image to obtain a new target image, where the preprocessing includes denoising, enhancing contrast, and adjusting brightness.
3. The method for identifying and counting the facing blocks according to claim 1, characterized in that, The recognition and counting model is a target detection and image segmentation model.
4. The method for identifying and counting the facing blocks according to claim 3, characterized in that, The recognition and counting model includes a recognition model, and the recognition model includes a backbone network, a neck network, a decoder, and a feature extraction network connected in sequence; The backbone network is used to perform semantic and feature extraction on the target image to generate a feature map with multi-semantic information and multiple scales; The neck network is used to fuse the feature maps to obtain a fused image; The decoder is used to restore the resolution of the fused image to obtain a restored image, and perform mask segmentation on the restored image to obtain a mask image, where the mask image is divided into an armor block area and a background area; The feature extraction network is used to identify each armor block from the armor block area of the mask image and mark each identified armor block with a specific bounding box.
5. The method for identifying and counting the facing blocks according to claim 4, characterized in that, The recognition and counting model further includes a counting model, and the counting model is connected to the feature extraction network, and is used to identify the bounding boxes output by the feature extraction network, count the number of the bounding boxes, and determine the number of the bounding boxes as the number of armor blocks.
6. The method for identifying and counting the facing blocks according to claim 5, characterized in that, After obtaining the target image corresponding to the target area, the method further includes: Obtain the confidence of the bounding box, where the confidence is used to reflect the probability that the image content within the bounding box is an armor block; When the confidence is greater than or equal to a predetermined threshold, determine that the image content within the bounding box is an armor block; When the confidence is less than the predetermined threshold, determine that the image content within the bounding box is a non-armor block.
7. The method for identifying and counting the facing blocks according to claim 6, wherein Set the confidence by the following method: Obtain a first light intensity, where the first light intensity is the light intensity of the target area when the target image is collected; Query the confidence setting value corresponding to the first light intensity from the pre-set correspondence between different light intensities and confidence setting values; Set the queried confidence setting value as the confidence corresponding to the target image.
8. A computer device, comprising: A memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the armor block recognition and counting method according to any one of claims 1-7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the armor block recognition and counting method according to any one of claims 1-7.
10. A computer program product comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the armor block recognition and counting method according to any one of claims 1-7.