Target detection method and device, equipment, storage medium and program product
By combining monitoring video images and target detection model, the wellhead cover situation is detected in real time, which solves the problem of inefficient manual inspection and improves safety and detection efficiency.
Patent Information
- Application Number
- CN202411022848.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-07-29
AI Technical Summary
During the oil mining process, manual inspection of unsealed wellheads poses safety hazards and low detection efficiency, resulting in high labor costs.
By obtaining the monitoring video image, inputting the trained target detection model, calculating the overlap area of the wellhead cap candidate box and the wellhead candidate box, if it is less than the preset threshold, alarm information will be generated to detect whether the wellhead is covered in real time.
It improves the detection efficiency of unsealed wellheads, prompt warnings, avoids the occurrence of safety problems, and reduces the cost of manual inspection.
Smart Images

Figure CN119251722A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer vision technology, and in particular, relates to a method, device, equipment, storage medium and program product for target detection. Background Art
[0002] Currently, during the oil extraction process, workers conduct geological surveys by placing radioactive sources into logging instruments and determine subsequent oil extraction plans based on the survey results.
[0003] When the staff operates the logging instrument, they need to take out the radioactive source from the source tank where the radioactive source is stored, and then put the radioactive source into the logging instrument. After the survey is completed, the radioactive source is taken out of the logging instrument and put back into the source tank. In the process of taking and placing the radioactive source, after opening the wellhead of the logging instrument, the wellhead needs to be capped in time to avoid safety problems caused by the wellhead not being capped in time.
[0004] In order to find the uncapped wellhead in time, it is usually necessary to manually inspect the oil production site. When the uncapped wellhead is found, corrective measures are taken in time to avoid the occurrence of safety problems. However, the above manual inspection method has high labor costs and low detection efficiency. Summary of the invention
[0005] The embodiments of the present application provide a method, device, equipment, storage medium and program product for target detection, which can improve the detection efficiency of uncapped wellheads.
[0006] In a first aspect, an embodiment of the present application provides a method for target detection, comprising:
[0007] Acquire surveillance video images;
[0008] Inputting the surveillance video image into a trained target detection model to obtain a detection result output by the target detection model;
[0009] In a case where the detection result includes the coordinates of the target action candidate frame, the coordinates of the wellhead cover candidate frame, and the coordinates of the wellhead candidate frame in the monitoring video image, based on the coordinates of the wellhead cover candidate frame and the coordinates of the wellhead candidate frame, calculating the overlapping area of the wellhead cover candidate frame and the wellhead candidate frame;
[0010] When the overlap area is smaller than a preset threshold, an alarm message is generated.
[0011] In a possible implementation, before inputting the surveillance video image into a trained target detection model to obtain a detection result output by the target detection model, the method further includes:
[0012] Acquire a labeled image data set, wherein the labeled image data set includes a labeled image and label data corresponding to the labeled image, wherein the labeled image includes a target action labeling frame, a wellhead labeling frame, and a wellhead cover labeling frame;
[0013] Performing image enhancement processing on the annotated image to obtain a target annotated image;
[0014] The target annotated image and label data corresponding to the target annotated image are used to train a neural network model to obtain the target detection model.
[0015] In a possible implementation manner, the number of the annotated images is at least one; and performing image enhancement processing on the annotated images to obtain a target annotated image includes:
[0016] For each annotated image, image enhancement processing is performed to obtain multiple enhanced annotated images;
[0017] Multiple enhanced annotated images are spliced onto a blank image to obtain the target annotated image.
[0018] In a possible implementation, before stitching the multiple enhanced annotated images onto the blank image to obtain the target annotated image, the method further includes:
[0019] Get the preset resolution;
[0020] For each enhanced annotated image, calculating a scaling ratio between each enhanced annotated image and the preset resolution;
[0021] Scaling the enhanced annotated image in equal proportion according to the scaling ratio to obtain an equal proportion annotated image;
[0022] Scaling the enhanced annotated image according to the preset resolution to obtain a scaled annotated image;
[0023] Placing the proportional annotated image in the scaled annotated image to obtain a target enhanced annotated image;
[0024] The step of splicing the plurality of enhanced annotated images onto a blank image to obtain the target annotated image comprises:
[0025] The target enhanced annotated image is spliced onto the blank image to obtain the target annotated image.
[0026] In a possible implementation manner, the calculating the scaling ratio between each enhanced annotated image and the preset resolution includes:
[0027] Obtaining size information of the enhanced annotated image;
[0028] Determining a correspondence between a side length of the enhanced annotation image and the preset resolution according to the size information;
[0029] The ratio of the side length of the enhanced annotated image to the preset resolution is calculated according to the corresponding relationship to obtain the scaling ratio.
[0030] In a second aspect, an embodiment of the present application provides a device for target detection, including:
[0031] An acquisition module, used to acquire surveillance video images;
[0032] A detection module, used to input the surveillance video image into a trained target detection model to obtain a detection result output by the target detection model;
[0033] a calculation module for calculating the overlap area of the wellhead cover candidate frame and the wellhead candidate frame based on the coordinates of the wellhead cover candidate frame and the coordinates of the wellhead candidate frame when the detection result includes the coordinates of the target action candidate frame, the coordinates of the wellhead cover candidate frame and the coordinates of the wellhead candidate frame in the monitoring video image;
[0034] The alarm module is used to generate an alarm message when the overlapping area is smaller than a preset threshold.
[0035] In a possible implementation manner, the device further includes:
[0036] An acquisition module is used to acquire a labeled image data set, wherein the labeled image data set includes a labeled image and label data corresponding to the labeled image, wherein the labeled image includes a target action labeling frame, a wellhead labeling frame, and a wellhead cover labeling frame;
[0037] An enhancement module, used for performing image enhancement processing on the annotated image to obtain a target annotated image;
[0038] The training module is used to train a neural network model using the target annotated image and the label data corresponding to the target annotated image to obtain the target detection model.
[0039] In a third aspect, an embodiment of the present application provides an electronic device, the device comprising: a processor and a memory storing computer program instructions;
[0040] When the processor executes the computer program instructions, the method for target detection as described in any one of the first aspects is implemented.
[0041] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, a method for target detection as described in any one of the first aspects is implemented.
[0042] In a fifth aspect, an embodiment of the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device performs a target detection method as described in any one of the first aspects.
[0043] The method, device, equipment, storage medium and sequence product of the target detection of the embodiment of the present application, after acquiring the monitoring video image, use the target detection model to detect the target action, wellhead and wellhead cover in the monitoring video image, and the target detection model outputs the candidate frame coordinates corresponding to the target action, wellhead and wellhead cover. Among them, the detection result includes the coordinates of the target action candidate frame, indicating that the staff is taking and placing the radioactive source. At this time, the staff may operate the wellhead cover. Therefore, it is necessary to detect the wellhead cover in the current monitoring video image. When the coordinates of the wellhead cover candidate frame and the coordinates of the wellhead candidate frame are included in the detection result, by calculating the overlap area of the wellhead cover candidate frame and the wellhead candidate frame, judging the ratio of the overlap area and the preset threshold, it can be determined whether the wellhead cover is placed on the wellhead and the wellhead is covered. If the overlap area is less than the preset threshold, it means that the wellhead cover is not placed at the wellhead, and the wellhead is in an open state, thereby generating an alarm message to warn the staff. In this way, through real-time collected monitoring video images and target detection models, it is possible to promptly determine whether the wellhead is sealed when the staff is taking or placing radioactive sources, thereby avoiding safety problems and improving detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0045] Figure 1 It is a flowchart of a method for target detection provided by an embodiment of the present application;
[0046] Figure 2 is an exemplary schematic diagram of annotating an image provided in an embodiment of the present application;
[0047] Figure 3 It is a flowchart of a method for acquiring a target enhanced and annotated image provided in an embodiment of the present application;
[0048] Figure 4 is an exemplary schematic diagram of a method for acquiring a target enhanced annotated image provided in an embodiment of the present application;
[0049] Figure 5 is an exemplary schematic diagram of a method for target detection provided in an embodiment of the present application;
[0050] Figure 6 is a structural schematic diagram of a target detection device provided by another embodiment of the present application;
[0051] Figure 7 It is a structural schematic diagram of an electronic device provided in yet another embodiment of the present application. DETAILED DESCRIPTION
[0052] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0053] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0054] In order to solve the problems in the prior art, the embodiments of the present application provide a method, device, equipment, storage medium and program product for target detection. The method for target detection provided by the embodiments of the present application is first introduced below.
[0055] Figure 1 A schematic flow chart of a method for target detection provided in one embodiment of the present application is shown.
[0056] like Figure 1 As shown, the method includes:
[0057] S101, acquiring surveillance video images.
[0058] In the scenario of oil extraction, a camera is installed at each wellhead, and the camera collects monitoring video images at each wellhead in real time.
[0059] S102: Input the surveillance video image into the trained target detection model to obtain the detection result output by the target detection model.
[0060] It should be noted that the surveillance video images can be subjected to frame extraction processing, and the video frames obtained by the frame extraction processing can be used as the input of the target detection model. In this way, the number of video frames detected by the target detection model can be reduced, thereby improving the detection efficiency.
[0061] Specifically, a video frame may be extracted every preset number of video frames as input to the target detection model.
[0062] In one example, the Fast Forward Moving Picture Experts Group (FFmpeg) is used to extract frames from the surveillance video image, where FFmpeg refers to extracting specific frames from a video file. Specifically, a frame can be extracted every N frames as the surveillance video image. The value of N can be set according to the actual scenario, and the default value of N can be set to 10.
[0063] In addition, since the image data transmission is encoded in base64 format, before the electronic device inputs the surveillance video image into the target detection model, the Python Image Library (PIL) is used to decode the image data, and the decoded surveillance video image is input into the target detection model. Python is a programming language.
[0064] S103. When the detection results include the coordinates of the target action candidate frame, the coordinates of the wellhead cover candidate frame and the coordinates of the wellhead candidate frame in the monitoring video image, calculate the overlapping area of the wellhead cover candidate frame and the wellhead candidate frame based on the coordinates of the wellhead cover candidate frame and the coordinates of the wellhead candidate frame.
[0065] The target action is used to indicate that the current staff is operating the wellhead, which may involve the action of opening the wellhead. Therefore, it is determined whether the wellhead is in an open state based on the monitoring video image. For example, the target action may be the action of the staff taking out the radioactive source from the source tank.
[0066] The wellhead cover may be felt or an anti-drop chuck. The embodiment of the present application does not limit the wellhead cover. In actual implementation, the wellhead cover is not limited thereto.
[0067] It is understandable that, in the case where the monitoring video image includes a wellhead candidate frame and a wellhead cover candidate frame, it is necessary to further determine whether the wellhead cover is placed on the wellhead to cover the wellhead. Therefore, by calculating the overlap area of the wellhead cover candidate frame and the wellhead candidate frame, the positional relationship between the wellhead cover and the wellhead can be determined, thereby determining whether the wellhead cover has completed covering the wellhead.
[0068] Specifically, the detection results output by the target detection model include the coordinates of multiple candidate boxes, the category to which each candidate box belongs, and the confidence level. The electronic device can filter redundant and repeated candidate boxes through multi-scale non-maximum suppression (NMS) to obtain a candidate box with the highest confidence level. Among them, the coordinates of the target action candidate box, the coordinates of the wellhead candidate box, and the coordinates of the wellhead cover candidate box are b∈R 4×n , category c∈R 1 ×n and confidence s∈R 1×n , n is the total number of annotation boxes detected in the surveillance video image.
[0069] S104: When the overlapping area is smaller than a preset threshold, an alarm message is generated.
[0070] The preset threshold is preset based on experience.
[0071] It can be understood that when the overlapping area is smaller than a preset threshold, it means that the wellhead cover does not cover the wellhead, that is, there is a safety problem at the wellhead, and an alarm message can be generated to alert the staff.
[0072] By adopting the above method, after acquiring the monitoring video image, the target detection model is used to detect the target action, wellhead and wellhead cover in the monitoring video image, and the target detection model outputs the candidate frame coordinates corresponding to the target action, wellhead and wellhead cover. Among them, the detection result includes the coordinates of the target action candidate frame, indicating that the staff is taking and placing the radioactive source. At this time, the staff may operate the wellhead cover. Therefore, it is necessary to detect the wellhead cover in the current monitoring video image. When the detection result includes the coordinates of the wellhead cover candidate frame and the coordinates of the wellhead candidate frame, by calculating the overlap area of the wellhead cover candidate frame and the wellhead candidate frame, judging the ratio of the overlap area and the preset threshold, it can be determined whether the wellhead cover is placed on the wellhead and the wellhead is covered. If the overlap area is less than the preset threshold, it means that the wellhead cover is not placed at the wellhead, and the wellhead is in an open state, thereby generating an alarm message to warn the staff. In this way, through real-time collected monitoring video images and target detection models, it is possible to promptly determine whether the wellhead is sealed when the staff is taking or placing radioactive sources, thereby avoiding safety problems and improving detection efficiency.
[0073] In some embodiments of the present application, when the above detection results include the coordinates of the target action candidate box and the coordinates of the wellhead candidate box, the electronic device can directly generate an alarm message to remind the staff that the wellhead is not covered.
[0074] The following describes how to train the target detection model. Before the above S102, inputting the surveillance video image into the trained target detection model to obtain the detection result output by the target detection model, the method further includes:
[0075] Step A: Obtain annotated image dataset.
[0076] The annotated image dataset includes annotated images and label data corresponding to the annotated images, and the annotated images include target action annotation boxes, wellhead annotation boxes, and wellhead cover object annotation boxes.
[0077] In one example, annotating an image such as Figure 2 As shown:
[0078] in, Figure 2 The dotted box on the left is the target action labeling box, which is the worker taking out the radioactive source from the source tank. Figure 2 The upper surface of the right cylinder represents the wellhead, the quadrilateral frame above the wellhead represents the wellhead cover, the dotted frame outside the quadrilateral frame above the wellhead is the wellhead cover marking frame, and the dotted frame inside the quadrilateral frame above the wellhead is the wellhead marking frame.
[0079] Step B: perform image enhancement processing on the annotated image to obtain a target annotated image.
[0080] Among them, in order to prevent the target action in the target annotated image from being deformed, the image enhancement processing in the embodiment of the present application includes horizontal normalization, image blurring, and contrast reduction methods. Among them, the target annotated image obtained by reducing the contrast is used to simulate the surveillance video image collected when the camera is exposed, blocked or distorted during the surveillance video image acquisition process. In this way, after the image enhancement processing, the target annotated image is used to train the neural network model to improve the generalization ability and robustness of the model after training.
[0081] Step C: train a neural network model using the target annotated image and the label data corresponding to the target annotated image to obtain a target detection model.
[0082] By using the method provided in the embodiment of the present application, image enhancement processing is performed on the annotated images containing the target action annotation box, the wellhead annotation box, and the wellhead cover annotation box, and more target annotated images can be obtained using fewer annotated images. The more training data the neural network model uses, the higher the accuracy of the target detection model obtained by training. Therefore, by performing image enhancement processing on the annotated images, the training data of the neural network model can be expanded on the basis of fewer annotated images, thereby improving the detection accuracy of the neural network model and improving the generalization ability and robustness of the model after training.
[0083] For the above step B, image enhancement processing is performed on the annotated image to obtain the target annotated image, which can be specifically implemented as follows:
[0084] For each annotated image, image enhancement processing is performed to obtain multiple enhanced annotated images.
[0085] Multiple enhanced annotated images are spliced onto a blank image to obtain a target annotated image.
[0086] In one implementation, the electronic device may obtain a video image from the annotated image data set, perform multiple image enhancement processes on the video image to obtain multiple enhanced video images, and splice the multiple enhanced video images onto a blank image to obtain a target annotated image.
[0087] In another implementation, the electronic device may obtain multiple video images from the annotated image data set, perform image enhancement processing on each video image to obtain multiple enhanced video images, and splice the multiple enhanced video images onto a blank image to obtain a target annotated image.
[0088] By using the method provided in the embodiment of the present application, the target annotated image includes multiple enhanced annotated images. In this way, the electronic device can use multiple annotated images to train the neural network model at the same time, thereby improving the training efficiency.
[0089] It should be noted that the resolutions of the annotated images in the above annotated image dataset are different, while the images actually captured by the camera have a fixed resolution. In order to improve the detection accuracy of the target detection model, when training the neural network model, the annotated images can be scaled to obtain annotated images with the same fixed resolution as above. By training the neural network model with the annotated images with fixed resolution, a target detection model with higher accuracy can be obtained. Based on this, Figure 3 As shown, before the above-mentioned multiple enhanced annotated images are spliced onto the blank image to obtain the target annotated image, the method can be specifically implemented as follows:
[0090] S301, obtaining a preset resolution.
[0091] The preset resolution is determined according to the resolution of the camera deployed in the actual well logging operation site. For example, the preset resolution may be 1920*1080.
[0092] S302: For each enhanced annotated image, calculate a scaling ratio between each enhanced annotated image and a preset resolution.
[0093] Specifically, the scaling ratio can be calculated as follows:
[0094] Step 1: Obtain the size information of the enhanced annotated image.
[0095] The size information includes the length information and width information of the enhanced annotation image.
[0096] Step 2: Determine the correspondence between the side length of the enhanced annotation image and the preset resolution according to the size information.
[0097] Step 3: Calculate the ratio of the side length of the enhanced annotation image to the preset resolution according to the corresponding relationship to obtain the scaling ratio.
[0098] Continuing the above example, the preset resolution is 1920*1080, that is, the length of the image corresponding to the preset resolution is 1920 pixels and the width is 1080 pixels. The length of the longer side of the enhanced annotation image is used as the length of the enhanced annotation image, and the length of the shorter side of the enhanced annotation image is used as the width of the enhanced annotation image. The ratio of the length of the image corresponding to the preset resolution and the length of the enhanced annotation image is calculated to obtain the scaling ratio.
[0099] S303 , scaling the enhanced annotated image in equal proportion according to the scaling ratio to obtain an equal proportion annotated image.
[0100] It can be understood that scaling the enhanced annotated image in equal proportion can avoid deformation of the target action in the proportional annotated image.
[0101] Continuing with the above example, after calculating the scaling ratio, the length of the longer side of the enhanced annotation image is enlarged to 1920 pixels, the scaling ratio*the width of the enhanced annotation image is calculated to obtain the scaled width value, and the length of the shorter side of the enhanced annotation image is enlarged to the scaled width value.
[0102] S304: Scale the enhanced annotated image according to a preset resolution to obtain a scaled annotated image.
[0103] Continuing with the above example, the enhanced annotation image is directly scaled to a scaled annotation image of 1920*1080 size.
[0104] S305 , placing the proportional annotated image in the scaled annotated image to obtain a target enhanced annotated image.
[0105] In one example, the method for constructing the target enhanced annotation image is as follows: Figure 4 As shown, Image 1 is an enhanced annotated image. After the scaling ratio is calculated, Image 1 is scaled proportionally according to the scaling ratio to obtain Image 2, which is the above-mentioned proportional annotated image. Image 1 is directly scaled to a preset resolution size to obtain Image 3, which is the above-mentioned scaled annotated image. Image 2 is placed in Figure 3 In the middle, the target enhanced and labeled image shown in Image 4 is obtained.
[0106] Accordingly, the above-mentioned splicing of multiple enhanced annotated images onto a blank image to obtain a target annotated image can be specifically implemented as follows:
[0107] The target enhanced annotated image is spliced onto the blank image to obtain the target annotated image.
[0108] By using the method provided in the embodiment of the present application, the scaling ratio of each enhanced annotation image and the preset resolution is determined, and after the enhanced annotation image is scaled in proportion according to the scaling ratio, the proportional annotation image is placed in the scaled annotation image scaled according to the preset resolution to obtain the target enhanced annotation image. In this way, the target enhanced annotation image has the same resolution as the preset resolution, and the target enhanced annotation image only contains the information in the annotation image, avoiding the addition of additional features, thereby improving the accuracy of the target detection model.
[0109] The following combination Figure 5 The target detection method provided in the embodiment of the present application is introduced, such as Figure 5 As shown, the method includes S501-S506:
[0110] S501, obtaining on-site monitoring video images.
[0111] Among them, the monitoring video images collected by the camera at the logging operation site are obtained.
[0112] S502: scaling the surveillance video image in equal proportion.
[0113] It can be understood that if the resolution of the surveillance video image captured by the camera and the annotated image used in model training are different, the surveillance video image can be processed by proportional scaling so that the resolution of the scaled surveillance video image is consistent with the resolution of the annotated image, thereby improving the detection accuracy of the target detection model.
[0114] S503: Perform model reasoning.
[0115] The scaled surveillance video image is input into the target detection model to obtain the detection result output by the target detection model.
[0116] S504: Determine whether there is a "source acquisition action" in the monitoring video image.
[0117] If yes, execute S505, if no, execute S501.
[0118] It is understandable that at the logging operation site, when the staff uses the drill pipe at the wellhead to load and unload the source, the staff's actions are diverse, and it is impossible to accurately determine whether the staff is performing logging operations. In actual tests, the staff's actions of taking out the radioactive source from the source tank are consistent, and the staff's actions of taking out or putting down the radioactive source occur before the staff performs the logging operation or after the logging operation. At this time, the staff is about to move the wellhead cover or has already moved the wellhead cover. Therefore, it is necessary to detect the wellhead cover to determine whether the wellhead is covered. Therefore, in the embodiment of the present application, the "source removal action" is used as the target action.
[0119] S505, judging whether there is "felt" or "anti-drop chuck".
[0120] If not, execute S506; if so, execute S501.
[0121] Among them, "felt" or "anti-fall chuck" is the above-mentioned wellhead cover.
[0122] S506: Generate alarm information and issue an alarm prompt.
[0123] In the above S506, before generating the alarm information and giving the alarm prompt, the overlap area of the wellhead cover candidate frame and the wellhead candidate frame can also be calculated, and whether to generate the alarm information is determined based on the overlap area. The specific content is referred to the relevant description in the above embodiment, which will not be repeated here.
[0124] By adopting the method provided by the embodiment of the present application, after acquiring the monitoring video image, the target detection model is used to detect the source-taking action, wellhead, felt or anti-drop chuck in the monitoring video image, and the target detection model outputs the source-taking action, wellhead, felt or anti-drop chuck. Among them, the detection result includes the coordinates of the candidate frame of the source-taking action, indicating that the staff is taking and placing the radioactive source. At this time, the staff may operate the felt or anti-drop chuck. Therefore, it is necessary to detect the felt or anti-drop chuck in the current monitoring video image. When the coordinates of the candidate frame of the felt or anti-drop chuck and the coordinates of the wellhead candidate frame are included in the detection result, by calculating the overlap area of the candidate frame of the felt or anti-drop chuck and the candidate frame of the wellhead, the ratio of the overlap area to the preset threshold is judged, and it can be determined whether the felt or anti-drop chuck is placed on the wellhead, and the wellhead is capped. If the overlap area is less than the preset threshold, it means that the wellhead capping object is not placed at the wellhead, and the wellhead is in an open state, thereby generating an alarm message to warn the staff. In this way, through real-time collected monitoring video images and target detection models, it is possible to promptly determine whether the wellhead is sealed when the staff is taking or placing radioactive sources, thereby avoiding safety issues and improving detection efficiency.
[0125] Based on the same concept, the present application embodiment provides a device for target detection, such as Figure 6 As shown, the device comprises:
[0126] An acquisition module 601 is used to acquire surveillance video images;
[0127] The detection module 602 is used to input the surveillance video image into the trained target detection model to obtain the detection result output by the target detection model;
[0128] A calculation module 603 is used to calculate the overlap area of the wellhead cover candidate frame and the wellhead candidate frame based on the coordinates of the wellhead cover candidate frame and the coordinates of the wellhead candidate frame when the detection result includes the coordinates of the target action candidate frame, the coordinates of the wellhead cover candidate frame and the coordinates of the wellhead candidate frame in the monitoring video image;
[0129] The alarm module 604 is used to generate an alarm message when the overlapping area is smaller than a preset threshold.
[0130] In a possible implementation, the device further includes:
[0131] An acquisition module is used to acquire a labeled image data set, wherein the labeled image data set includes a labeled image and label data corresponding to the labeled image, wherein the labeled image includes a target action labeling frame, a wellhead labeling frame, and a wellhead cover labeling frame;
[0132] The enhancement module is further used to perform image enhancement processing on the annotated image to obtain a target annotated image;
[0133] The training module is used to train a neural network model using the target annotated image and the label data corresponding to the target annotated image to obtain the target detection model.
[0134] In a possible implementation manner, the number of the annotated images is at least one; and the enhancement module is specifically configured to:
[0135] For each annotated image, image enhancement processing is performed to obtain multiple enhanced annotated images;
[0136] Multiple enhanced annotated images are spliced onto a blank image to obtain the target annotated image.
[0137] In a possible implementation, the enhancement module is specifically configured to:
[0138] Get the preset resolution;
[0139] For each enhanced annotated image, calculating a scaling ratio between each enhanced annotated image and the preset resolution;
[0140] Scaling the enhanced annotated image in equal proportion according to the scaling ratio to obtain an equal proportion annotated image;
[0141] Scaling the enhanced annotated image according to the preset resolution to obtain a scaled annotated image;
[0142] Placing the proportional annotated image in the scaled annotated image to obtain a target enhanced annotated image;
[0143] The target enhanced annotated image is spliced onto the blank image to obtain the target annotated image.
[0144] In a possible implementation, the enhancement module is specifically configured to:
[0145] Obtaining size information of the enhanced annotated image;
[0146] Determining a correspondence between a side length of the enhanced annotation image and the preset resolution according to the size information;
[0147] The ratio of the side length of the enhanced annotated image to the preset resolution is calculated according to the corresponding relationship to obtain the scaling ratio.
[0148] It should be noted that the target detection device is a device corresponding to the above-mentioned target detection method, and all implementation methods in the above-mentioned method embodiment are applicable to the embodiment of the device and can achieve the same technical effect.
[0149] Figure 7 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.
[0150] The electronic device may include a processor 701 and a memory 702 storing computer program instructions.
[0151] Specifically, the processor 701 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0152] The memory 702 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 702 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 702 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 702 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 702 is a non-volatile solid-state memory.
[0153] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0154] The processor 701 implements any one of the target detection methods in the above embodiments by reading and executing computer program instructions stored in the memory 702 .
[0155] In one example, the electronic device may further include a communication interface 703 and a bus 704. Figure 7 As shown, the processor 701, the memory 702, and the communication interface 703 are connected via a bus 704 and communicate with each other.
[0156] The communication interface 703 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0157] Bus 704 includes hardware, software or both, and the parts of electronic equipment are coupled to each other.For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 704 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.
[0158] In addition, in combination with the target detection method in the above embodiment, the embodiment of the present application can provide a computer storage medium to implement. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any target detection method in the above embodiment is implemented.
[0159] In combination with the target detection method in the above embodiments, an embodiment of the present application may provide a computer program product, the computer product including a computer program, which implements the target detection method as any one of the above embodiments when executed by a processor.
[0160] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0161] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0162] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0163] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0164] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A method for target detection, characterized in that: include: Acquire surveillance video images; Inputting the surveillance video image into a trained target detection model to obtain a detection result output by the target detection model; In a case where the detection result includes the coordinates of the target action candidate frame, the coordinates of the wellhead cover candidate frame, and the coordinates of the wellhead candidate frame in the monitoring video image, based on the coordinates of the wellhead cover candidate frame and the coordinates of the wellhead candidate frame, calculating the overlapping area of the wellhead cover candidate frame and the wellhead candidate frame; When the overlap area is smaller than a preset threshold, an alarm message is generated.
2. The method according to claim 1, characterized in that: Before inputting the surveillance video image into the trained target detection model to obtain the detection result output by the target detection model, the method further includes: Acquire a labeled image data set, wherein the labeled image data set includes a labeled image and label data corresponding to the labeled image, wherein the labeled image includes a target action labeling frame, a wellhead labeling frame, and a wellhead cover labeling frame; Performing image enhancement processing on the annotated image to obtain a target annotated image; The target annotated image and label data corresponding to the target annotated image are used to train a neural network model to obtain the target detection model.
3. The method according to claim 2, characterized in that The number of the annotated images is at least one; and performing image enhancement processing on the annotated images to obtain a target annotated image includes: For each annotated image, image enhancement processing is performed to obtain multiple enhanced annotated images; Multiple enhanced annotated images are spliced onto a blank image to obtain the target annotated image.
4. The method according to claim 3, characterized in that Before splicing the plurality of enhanced annotated images onto the blank image to obtain the target annotated image, the method further includes: Get the preset resolution; For each enhanced annotated image, calculating a scaling ratio between each enhanced annotated image and the preset resolution; Scaling the enhanced annotated image in equal proportion according to the scaling ratio to obtain an equal proportion annotated image; Scaling the enhanced annotated image according to the preset resolution to obtain a scaled annotated image; Placing the proportional annotated image in the scaled annotated image to obtain a target enhanced annotated image; The step of splicing the plurality of enhanced annotated images onto a blank image to obtain the target annotated image comprises: The target enhanced annotated image is spliced onto the blank image to obtain the target annotated image.
5. The method according to claim 4, characterized in that The calculating the scaling ratio between each enhanced annotated image and the preset resolution includes: Obtaining size information of the enhanced annotated image; Determining a correspondence between a side length of the enhanced annotation image and the preset resolution according to the size information; The ratio of the side length of the enhanced annotated image to the preset resolution is calculated according to the corresponding relationship to obtain the scaling ratio.
6. A target detection device, characterized in that: include: An acquisition module, used to acquire surveillance video images; A detection module, used to input the surveillance video image into a trained target detection model to obtain a detection result output by the target detection model; a calculation module for calculating the overlap area of the wellhead cover candidate frame and the wellhead candidate frame based on the coordinates of the wellhead cover candidate frame and the coordinates of the wellhead candidate frame when the detection result includes the coordinates of the target action candidate frame, the coordinates of the wellhead cover candidate frame and the coordinates of the wellhead candidate frame in the monitoring video image; The alarm module is used to generate an alarm message when the overlapping area is smaller than a preset threshold.
7. The device according to claim 6, characterized in that The device also includes: An acquisition module is used to acquire a labeled image data set, wherein the labeled image data set includes a labeled image and label data corresponding to the labeled image, wherein the labeled image includes a target action labeling frame, a wellhead labeling frame, and a wellhead cover labeling frame; An enhancement module, used for performing image enhancement processing on the annotated image to obtain a target annotated image; The training module is used to train a neural network model using the target annotated image and the label data corresponding to the target annotated image to obtain the target detection model.
8. An electronic device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the method for target detection according to any one of claims 1 to 5 is implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method for target detection according to any one of claims 1 to 5 is implemented.
10. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the target detection method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Can surface character recognition method
CN112085024A
People flow density detection method and system for indoor dense scene, storage medium and terminal
CN112733624A
Safety helmet wearing detection method, electronic device and storage medium
CN113283296A
Manhole cover anti-theft method and device based on image recognition
CN113807212A
Deep learning-based Chinese handwritten signature recognition method and system
CN114581922A
