Target detection method, device, equipment, storage medium and program product

By using the target detection model to calculate the overlapping area between the wellhead cover and the wellhead candidate frame during the oil production process, the problem of low efficiency of manual inspections is solved, and automated detection and early warning of uncovered wellheads is achieved.

CN119251722BActive Publication Date: 2025-09-26JIAYANG SMART SECURITY TECH (BEIJING) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411022848.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2025-09-26
Estimated Expiration
2044-07-29

AI Technical Summary

Technical Problem

In the existing technology, the detection of uncapped wellheads during oil production relies on manual inspections, resulting in high labor costs and low detection efficiency.

Method used

By acquiring surveillance video images, the trained target detection model is used to calculate the overlapping area between the wellhead cover and the wellhead candidate frame, and an alarm message is generated to indicate the uncovered state.

Benefits of technology

It realizes the automated detection of uncovered wellheads, improves detection efficiency and avoids safety hazards.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119251722B_ABST
    Figure CN119251722B_ABST
Patent Text Reader

Abstract

The present application discloses a method, apparatus, device, storage medium, and program product for target detection, which are applied to the field of computer vision technology. The specific technical solution includes: obtaining a surveillance video image; inputting the surveillance video image into a trained target detection model to obtain a detection result output by the target detection model; 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 surveillance video image, calculating 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; when the overlapping area is less than a preset threshold, generating an alarm message. In this way, the detection efficiency of unsealed wellheads can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer vision technology, and in particular to a method, apparatus, device, 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 operating a well logging instrument, workers must remove the radioactive source from its storage canister and then load it into the logging instrument. After the survey is complete, the radioactive source must be removed from the logging instrument and returned to the canister. During this process, the wellhead of the logging instrument must be capped immediately after opening it to avoid safety issues.

[0004] In order to promptly detect uncapped wellheads, manual inspections are usually required at oil production sites. When uncapped wellheads are discovered, corrective measures are taken promptly to avoid safety issues. However, this manual inspection method is labor-intensive and inefficient. Summary of the Invention

[0005] The embodiments of the present application provide a method, apparatus, device, 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] 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, calculating 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;

[0010] When the overlapping area is smaller than a preset threshold, an alarm message is generated.

[0011] In one 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 dataset, wherein the labeled image dataset includes labeled images and label data corresponding to the labeled images, wherein the labeled images include a target action labeled frame, a wellhead labeled frame, and a wellhead cover labeled frame;

[0013] Performing image enhancement processing on the annotated image to obtain a target annotated image;

[0014] The target annotated image and the 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, 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] Perform image enhancement processing on each annotated image 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, 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, comprising:

[0031] An acquisition module is used to acquire surveillance video images;

[0032] A detection module is used to input the monitoring 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 an overlapping area between 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, the apparatus further includes:

[0036] an acquisition module, configured to acquire a labeled image dataset, wherein the labeled image dataset includes a labeled image and label data corresponding to the labeled image, wherein the labeled image includes a target action labeled frame, a wellhead labeled frame, and a wellhead cover labeled frame;

[0037] An enhancement module, configured to perform 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 having computer program instructions stored thereon, and 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 the instructions in the computer program product are executed by a processor of an electronic device, the electronic device performs the target detection method as described in any one of the first aspects.

[0043] The target detection method, device, equipment, storage medium and sequence product of the embodiment of the present application, after acquiring a surveillance video image, uses a target detection model to detect the target action, wellhead and wellhead cover in the surveillance video image, and the target detection model outputs the coordinates of the candidate frames 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 surveillance 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 overlapping area of ​​the wellhead cover candidate frame and the wellhead candidate frame, determining the ratio of the overlapping area to a preset threshold, it can be determined whether the wellhead cover is placed on the wellhead and the wellhead is sealed. If the overlapping 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 removing and placing the radioactive source, thereby avoiding safety issues and improving detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions 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 This is a flow chart of a target detection method provided in 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 This is a flow chart of a method for acquiring target enhanced and annotated images provided in an embodiment of the present application;

[0048] Figure 4 This is an exemplary schematic diagram of a method for acquiring target enhanced and annotated images provided in an embodiment of the present application;

[0049] Figure 5 is an exemplary schematic diagram of a target detection method provided in an embodiment of the present application;

[0050] Figure 6 is a structural diagram of a target detection device provided by another embodiment of the present application;

[0051] Figure 7 This is a structural 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 merely 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 document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, the elements defined by the phrase "comprising..." do not exclude the presence of other identical elements in the process, method, article, or device comprising the elements.

[0054] In order to solve the problems of the prior art, the embodiments of the present application provide a method, apparatus, device, storage medium and program product for target detection. The target detection method provided by the embodiments of the present application is first introduced below.

[0055] Figure 1 A flow chart of a target detection method provided in one embodiment of the present application is shown.

[0056] like Figure 1 As shown, the method includes:

[0057] S101: Acquire surveillance video images.

[0058] In the oil extraction scenario, a camera is installed at each wellhead, and the camera collects monitoring video images at each wellhead in real time.

[0059] S102: Input the monitoring 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 processed by frame extraction, and the video frames obtained by frame extraction 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 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 a video file. Specifically, every N frames can be extracted as the surveillance video image. The value of N can be set based on the actual scenario, and the default value of N can be set to 10.

[0063] Furthermore, because image data is transmitted in Base64 format, the electronic device uses Python Image Library (PIL) to decode the image data before inputting it 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 indicates that the worker is currently operating the wellhead, which may involve opening the wellhead. Therefore, the monitoring video image is used to determine whether the wellhead is open. For example, the target action could be a worker removing a radioactive source from a source tank.

[0066] The wellhead cover may be felt or an anti-fall 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 understood that when the surveillance 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 overlapping 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 completely covered the wellhead.

[0068] Specifically, the detection results output by the target detection model include the coordinates of multiple candidate frames, the category to which each candidate frame belongs, and the confidence level. The electronic device can filter out redundant candidate frames through multi-scale non-maximum suppression (NMS) to obtain a candidate frame with the highest confidence level. Among them, the coordinates of the target action candidate frame, the coordinates of the wellhead candidate frame, and the coordinates of the wellhead cover candidate frame 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 set in advance based on experience.

[0071] It can be understood that when the overlapping area is smaller than the 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] Using the above method, after acquiring a surveillance video image, the target action, wellhead, and wellhead cover are detected in the surveillance video image using a target detection model. The target detection model outputs the coordinates of candidate frames corresponding to the target action, wellhead, and wellhead cover. The detection results include the coordinates of the target action candidate frame, indicating that a worker is removing or placing a radioactive source. At this time, the worker may be manipulating the wellhead cover. Therefore, it is necessary to detect the wellhead cover in the current surveillance video image. When the detection results include the coordinates of the wellhead cover candidate frame and the wellhead candidate frame, the overlap area between the wellhead cover candidate frame and the wellhead candidate frame is calculated. The ratio of the overlap area to a preset threshold is then determined to determine whether the wellhead cover is in place and to seal the wellhead. If the overlap area is less than the preset threshold, it indicates that the wellhead cover is not in place and the wellhead is open, thereby generating an alarm message to alert the worker. 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 removing and placing the radioactive source, thereby avoiding safety issues 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 frame and the coordinates of the wellhead candidate frame, the electronic device can directly generate an alarm message to remind the staff that the wellhead is not sealed.

[0074] The following describes how to train the target detection model. Before the above step S102, inputting the surveillance video image into the trained target detection model and obtaining 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. 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 marking 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 the target annotated image.

[0080] To prevent the target action in the target annotation image from being distorted, the image enhancement processing in the embodiments of the present application includes horizontal normalization, image blurring, and contrast reduction. The target annotation image obtained by reducing contrast is used to simulate the surveillance video image captured during the surveillance video image acquisition process when the camera is exposed, blocked, or distorted. In this way, after image enhancement processing, using the target annotation image to train the neural network model can improve the generalization ability and robustness of the trained model.

[0081] Step C: Use the target annotated image and the label data corresponding to the target annotated image to train a neural network model to obtain a target detection model.

[0082] By using the method provided in the embodiments of the present application, image enhancement processing is performed on annotated images containing target action annotation boxes, wellhead annotation boxes, and wellhead cover object annotation boxes. This allows for the generation of more target annotated images using fewer annotated images. The more training data a neural network model uses, the higher the accuracy of the trained target detection model. Therefore, image enhancement processing of annotated images can expand the training data for the neural network model based on fewer annotated images, thereby improving the detection accuracy of the neural network model and enhancing the generalization and robustness of the trained model.

[0083] Regarding 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 the target annotated image.

[0086] In one implementation, the electronic device may obtain a video image from a labeled image dataset, perform multiple image enhancement processes on the video image to obtain multiple enhanced video images, and then splice the multiple enhanced video images onto a blank image to obtain a target labeled image.

[0087] In another implementation, the electronic device may obtain multiple video images from the annotated image dataset, perform image enhancement processing on each video image to obtain multiple enhanced video images, and then splice the multiple enhanced video images onto a blank image to obtain the 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 are of 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 using the annotated images with fixed resolution to train the neural network model, a target detection model with higher accuracy can be obtained. Based on this, Figure 3 As shown, before the above-mentioned steps of splicing multiple enhanced annotated images onto a blank image to obtain a target annotated image, the method can be specifically implemented as follows:

[0090] S301: Obtain a preset resolution.

[0091] The preset resolution is determined based on the resolution of the cameras deployed at the actual well logging operation site. For example, the preset resolution may be 1920*1080.

[0092] S302: For each enhanced and annotated image, calculate a scaling ratio between each enhanced and 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 annotated image.

[0096] Step 2: Determine the correspondence between the side length of the enhanced annotation image and the preset resolution based on 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 with the above example, let's assume the preset resolution is 1920*1080. That is, the image corresponding to the preset resolution is 1920 pixels long and 1080 pixels wide. The length of the enhanced annotation image is calculated as the length of the longer side, and the width as the shorter side. The ratio of the length of the image corresponding to the preset resolution to the length of the enhanced annotation image is calculated to determine 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 proportions can avoid deformation of the target action in the proportional annotated image.

[0101] Continuing with the above example, after calculating the scaling ratio, the longer side of the enhanced annotation image is enlarged to 1920 pixels. The scaling ratio is calculated multiplied by the width of the enhanced annotation image to obtain the scaled width value. The shorter side of the enhanced annotation image is then 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: Place 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 the enhanced annotation 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 scaled annotation image. Image 1 is directly scaled to the preset resolution size to obtain Image 3, which is the above-mentioned scaled annotation image. Place Image 2 in Figure 3 In the middle, the target enhanced and labeled image shown in Image 4 is obtained.

[0106] Accordingly, the above-mentioned process of splicing 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] Using the method provided in the embodiments of this application, the scaling ratio of each enhanced annotated image to the preset resolution is determined. After scaling the enhanced annotated image proportionally according to the scaling ratio, the proportionally scaled annotated image is placed within a scaled annotated image scaled to the preset resolution to obtain the target enhanced annotated image. This ensures that the target enhanced annotated image has the same resolution as the preset resolution and contains only the information from the annotated image, avoiding the need for adding additional features and 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. Figure 5 As shown, the method includes S501-S506:

[0110] S501: Acquire on-site surveillance 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.

[0113] It is understandable that if the resolution of the surveillance video image captured by the camera is different from that of the annotated image used in model training, 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 use 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 are performing logging operations. In actual tests, the staff's actions of removing the radioactive source from the source tank are consistent, and the staff's actions of removing or putting down the radioactive source occur before or after the staff perform 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 inspect 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: Determine whether there is a "felt" or an "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] Before generating the alarm information and issuing the alarm prompt in S506, the overlapping 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 overlapping area. The specific content is referred to the relevant description in the above embodiment and will not be repeated here.

[0124] Using the method provided in an embodiment of the present application, after acquiring a surveillance video image, a target detection model is used to detect the source extraction action, wellhead, felt, or anti-drop chuck in the surveillance video image. The target detection model outputs the source extraction action, wellhead, felt, or anti-drop chuck. The detection result includes the coordinates of a candidate frame for the source extraction action, indicating that a worker is performing the act of removing or placing a radioactive source. At this time, the worker may operate the felt or anti-drop chuck. Therefore, it is necessary to detect the felt or anti-drop chuck in the current surveillance video image. When the detection result includes the coordinates of the candidate frame for the felt or anti-drop chuck and the coordinates of the wellhead candidate frame, by calculating the overlapping area of ​​the candidate frame for the felt or anti-drop chuck and the candidate frame for the wellhead, and determining the ratio of the overlapping area to a preset threshold, it can be determined whether the felt or anti-drop chuck is placed at the wellhead, and the wellhead can be sealed. If the overlapping area is less than the preset threshold, it indicates that the wellhead cover is not placed at the wellhead, and the wellhead is open, thereby generating an alarm message to warn the worker. 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 removing and placing the radioactive source, thereby avoiding safety issues and improving detection efficiency.

[0125] Based on the same concept, the present application provides a device for target detection, such as Figure 6 As shown, the device includes:

[0126] Acquisition module 601, used to acquire surveillance video images;

[0127] Detection module 602, used to input the surveillance video image into the trained target detection model and obtain the detection result output by the target detection model;

[0128] a calculation module 603 for calculating an overlapping area between 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 surveillance video image;

[0129] The alarm module 604 is configured 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, configured to acquire a labeled image dataset, wherein the labeled image dataset includes a labeled image and label data corresponding to the labeled image, wherein the labeled image includes a target action labeled frame, a wellhead labeled frame, and a wellhead cover labeled frame;

[0132] The enhancement module is further configured 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, the number of the annotated images is at least one; the enhancement module is specifically configured to:

[0135] Perform image enhancement processing on each annotated image 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. All implementation methods in the above-mentioned method embodiments are applicable to the embodiments of the device and can achieve the same technical effects.

[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. Where appropriate, the memory 702 may include removable or non-removable (or fixed) media. Where appropriate, 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, generally, 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 comprises hardware, software or both, couples the parts of electronic equipment to each other.For example, and not limitation, bus can comprise accelerated graphics port (AGP) or other graphics bus, enhanced industry standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industry 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 suitable cases, bus 704 can comprise one or more buses.Although the present application embodiment describes and shows specific bus, the application considers any suitable bus or interconnection.

[0158] In addition, in conjunction with the target detection method in the above embodiments, embodiments of the present application may provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any of the target detection methods in the above embodiments 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, which includes a computer program. When the computer program is executed by a processor, it implements the target detection method as any one of the above embodiments.

[0160] It should be understood that the present application is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present application is not limited to the specific steps described and illustrated. Those skilled in the art can make various changes, modifications, and additions, or change the order of 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, they can be, for example, electronic circuits, application specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, 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 that can store or transmit information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memories, erasable ROMs (EROMs), 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. In other words, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0163] Aspects of the present disclosure have been described above with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments 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 is also understood that each box in the block diagram and / or flowchart and the combination of the boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0164] The above description is only a specific embodiment of the present application. Those skilled in the art will clearly understand that for the convenience and brevity 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 scope of protection of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the scope of protection of the present 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; 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 surveillance video image, calculating 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, and the target action is an action of a worker taking or placing a radioactive source; When the overlapping area is smaller than a preset threshold, an alarm message is generated; 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 dataset, wherein the labeled image dataset includes labeled images and label data corresponding to the labeled images, wherein the labeled images include a target action labeled frame, a wellhead labeled frame, and a wellhead cover labeled frame; Performing image enhancement processing on the annotated image to obtain a target annotated image; Training a neural network model using the target annotated image and label data corresponding to the target annotated image to obtain the target detection model; 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: Perform image enhancement processing on each annotated image to obtain multiple enhanced annotated images; splicing the multiple enhanced annotated images onto a blank image to obtain the target annotated image; Before stitching the plurality of enhanced annotated images onto the blank image to obtain the target annotated image, the method further includes: Obtaining a preset resolution, where the preset resolution is the resolution of a camera deployed at an actual well logging operation site; 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.

2. The method according to claim 1, 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.

3. A target detection device, characterized in that: include: An acquisition module is used to acquire surveillance video images; A detection module is used to input the monitoring video image into a trained target detection model to obtain a detection result output by the target detection model; a calculation module for calculating, 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, based on the coordinates of the wellhead cover candidate frame and the coordinates of the wellhead candidate frame, an overlapping area between the wellhead cover candidate frame and the wellhead candidate frame, where the target action is an action of a worker taking or placing a radioactive source; An alarm module, configured to generate an alarm message when the overlapping area is smaller than a preset threshold; The device further comprises: The acquisition module is further configured to acquire a labeled image dataset, wherein the labeled image dataset includes a labeled image and label data corresponding to the labeled image, wherein the labeled image includes a target action labeled frame, a wellhead labeled frame, and a wellhead cover labeled frame; An image enhancement module, configured to perform image enhancement processing on the annotated image to obtain a target annotated image; A training module, configured to train a neural network model using the target annotated image and label data corresponding to the target annotated image to obtain the target detection model; The number of the annotated images is at least one; the image enhancement module is specifically configured to: Perform image enhancement processing on each annotated image to obtain multiple enhanced annotated images; splicing the multiple enhanced annotated images onto a blank image to obtain the target annotated image; The image enhancement module is specifically used to: Before the step of splicing the plurality of enhanced annotated images onto the blank image to obtain the target annotated image, a preset resolution is obtained, where the preset resolution is the resolution of a camera deployed at an actual well logging operation site; 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.

4. An electronic device, characterized in that: The device includes: 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 2 is implemented.

5. 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 2 is implemented.

6. 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 according to any one of claims 1 to 2.

Citation Information

Patent Citations

  • 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

  • Method for judging abnormal condition of well lid and computing equipment

    CN117197050A