Prey capturing method, device, electronic device and storage medium
By collecting images of the hunting device and identifying it using prey recognition models, the problems of inaccurate prey capture and prey escape in the prior art are solved, and high accuracy capture of target prey is achieved.
Patent Information
- Application Number
- CN202111357441.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-16
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2041-11-16
AI Technical Summary
The prior art easily captures non-target prey when prey is captured and easily escapes when it is on the edge of a hunter.
By collecting images on the hunting device, identifying the collected images using the prey recognition model, determining whether the prey to be captured is the target prey, and determining whether it is in the hunting device. If the conditions are met, the hunting device is controlled to close.
Improves the accuracy of the capture of the target prey, preventing the target prey from escaping when it is captured.
Smart Images

Figure CN114049655B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a prey capturing method, device, electronic device and storage medium. Background Art
[0002] When capturing prey, the prior art is to place a trap at a pre-set location, and when prey touches the trap, the trap is triggered, and the prey is captured by the trap.
[0003] The problem with capturing prey by setting up traps is that no matter what prey it is, as long as the trap is triggered, it will be captured, causing non-target prey to trigger the trap. In addition, when the prey triggers the trap, it may not be completely in the trap, causing the prey to easily escape after the trap is triggered. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a prey capture method, device, electronic device and storage medium to improve the accuracy of capturing target prey.
[0005] In a first aspect, an embodiment of the present application provides a prey capturing method, comprising: acquiring a monitoring image, wherein the monitoring image is obtained by an image acquisition device performing real-time image acquisition on a hunting device; inputting the monitoring image into a prey recognition model constructed in advance to obtain a recognition result output by the prey recognition model; if the recognition result includes an object to be prey and an identification frame of the object to be prey, then acquiring a target point in the identification frame; judging whether the object to be prey is in an area of the hunting device based on the target point; wherein the area of the hunting device is smaller than an area of the hunting device in the monitoring image; if the object to be prey is in the area of the hunting device, then controlling the hunting device to close.
[0006] The embodiment of the present application performs image recognition on the prey that enters the hunting device to determine whether the prey is the target prey and whether the position of the prey is within the hunting device. When the prey is the target prey and the target prey is within the hunting device, the hunting device is controlled to close, thereby ensuring that the target prey can be captured and prevented from escaping during capture.
[0007] In any embodiment, the identification frame is a rectangular frame, and obtaining the target point in the identification frame includes: determining the center point of any side of the identification frame as the target point. The embodiment of the present application ensures that the prey to be captured is within the hunting device by limiting the specific position of the target point.
[0008] In any embodiment, the identification frame is a rectangular frame, and obtaining the target point in the identification frame includes: determining the center point of the identification frame as the target point. The embodiment of the present application ensures that the prey to be captured is within the hunting device by limiting the specific position of the target point.
[0009] In any embodiment, the identification frame is a rectangular frame, and obtaining the target point in the identification frame includes: determining any two diagonal points of the identification frame as the target point. The embodiment of the present application ensures that the prey to be captured is within the hunting device by limiting the specific position of the target point.
[0010] In any embodiment, judging whether the prey is in the hunting device area according to the target point includes: judging whether the target point is in the hunting device area, and if so, determining that the prey is in the hunting device; otherwise, determining that the prey is not in the hunting device. The embodiment of the present application determines whether the prey is in the hunting device by judging whether the target point is in the hunting device area, thereby avoiding the situation where the prey escapes when capturing the prey, and improving the accuracy of capturing the prey.
[0011] In any embodiment, after controlling the hunting device to close, the method further includes: sending the image of the hunting device before closing and the image of the hunting device after closing to a designated terminal. In the embodiment of the present application, the designated terminal is notified in time after the target prey is captured, thereby reducing the possibility of the captured target prey being stolen.
[0012] In any embodiment, the prey recognition model is obtained by the following training method: obtaining positive training samples and negative training samples; wherein the positive training samples include an image containing the prey to be caught and a corresponding first annotation result, and the annotation result includes an annotation box annotating the prey to be caught on the image; the negative training samples include an image not containing the prey to be caught and a corresponding second annotation result; inputting the positive training samples and the negative training samples into the model to be trained to obtain corresponding prediction results; calculating a loss value based on the prediction result and the first annotation result of the positive training sample, and the prediction result and the second annotation result of the negative training sample; optimizing the parameters in the model to be trained based on the loss value to obtain the prey recognition model. The embodiment of the present application improves the accuracy of identifying the prey to be caught by training the prey recognition model.
[0013] In a second aspect, an embodiment of the present application provides a prey capture device, comprising: an image acquisition module, used to acquire a monitoring image, wherein the monitoring image is obtained by an image acquisition device performing real-time image acquisition on a hunting device; a prey recognition module, used to input the monitoring image into a prey recognition model constructed in advance, and obtain a recognition result output by the prey recognition model; a target point determination module, used to acquire a target point in the identification frame if the recognition result includes an object to be prey and an identification frame of the object to be prey; a judgment module, used to judge whether the object to be prey is in the area of the hunting device according to the target point; and a control module, used to control the hunting device to close if the object to be prey is in the area of the hunting device.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory and a bus, wherein the processor and the memory communicate with each other through the bus; the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the method of the first aspect.
[0015] In a fourth aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium, comprising: the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions enable the computer to execute the method of the first aspect.
[0016] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the embodiments of the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 A schematic diagram of a prey capture method provided in an embodiment of the present application;
[0019] Figure 2 A schematic diagram of a hunting device area provided in an embodiment of the present application;
[0020] Figure 3 A schematic diagram of determining a target point provided in an embodiment of the present application;
[0021] Figure 4 A schematic diagram of a model training method flow provided in an embodiment of the present application;
[0022] Figure 5 A schematic diagram of the structure of a prey capture system provided in an embodiment of the present application;
[0023] Figure 6 A schematic diagram of the structure of a prey capture device provided in an embodiment of the present application;
[0024] Figure 7 A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to solve the problem in the prior art that non-target prey may be captured when hunting by setting an automatic trap, and that the prey may escape because the prey is at the edge of the trap when the trap is triggered, the embodiment of the present application provides a prey capture method, which collects images of a hunting device, uses a prey recognition model to recognize the collected images, determines whether there is target prey entering the hunting device, and controls the hunting device to close when it is determined that the target prey is in the hunting device, so as to successfully capture the target prey.
[0026] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0027] It is understandable that the prey capture method provided in the embodiment of the present application can be applied to a terminal device (also referred to as an electronic device) and a server; the terminal device can be a smart phone, a tablet computer, a computer, a personal digital assistant (PDA), etc.; the server can be an application server or a Web server. In addition, the model training method and the prey capture method can be executed by the same terminal device or by different terminal devices.
[0028] To facilitate understanding of the technical solution provided in the embodiments of the present application, the application scenarios of the prey capture method and model training method provided in the embodiments of the present application are introduced below, taking the terminal device as the execution subject as an example.
[0029] Figure 1 A schematic diagram of a prey capture method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes:
[0030] Step 101: Acquire a monitoring image, where the monitoring image is obtained by an image acquisition device performing real-time image acquisition on a hunting device.
[0031] Among them, the image acquisition device is arranged above the hunting device, and is used to acquire images of the hunting device. In addition, the image acquisition device can be a separate camera or video recorder, or it can be integrated in the terminal device. If the image acquisition device is a camera, the image acquisition cycle of the image acquisition device can be preset, for example: it can be set to acquire images once every 2 seconds, or once every 3 seconds, and it can also be set according to actual conditions, and the acquired monitoring image can be sent to the terminal device. If the image acquisition device is a video recorder, it can record in real time to obtain monitoring video, and then perform frame processing on the monitoring video, and send the monitoring image obtained after framing to the terminal device. Of course, the monitoring video can also be sent to the terminal device, and the terminal device can perform frame processing.
[0032] Step 102: Input the monitoring image into a pre-built prey recognition model to obtain a recognition result output by the prey recognition model.
[0033] After acquiring the monitoring image, the terminal is set to input the monitoring image into the prey recognition model, and the prey recognition model recognizes the monitoring image, and its recognition result includes whether the monitoring image includes the prey to be captured. When the prey to be captured is included, the recognition result also includes an identification frame of the prey to be captured. It can be understood that the identification frame can be the minimum circumscribed rectangle of the prey to be captured, or it can be a circumscribed circle. The embodiment of the present application does not specifically limit the shape of the identification frame.
[0034] Step 103: If the recognition result includes the prey to be caught and the recognition frame of the prey to be caught, then the target point in the recognition frame is obtained.
[0035] If the recognition result is that the monitoring image includes the prey to be captured, and the prey to be captured is marked with an identification frame, the target point in the identification frame can be obtained. It should be noted that the target point is used to determine whether the prey to be captured is in the hunting device.
[0036] Step 104: Determine whether the prey to be hunted is in the hunting device area according to the target point; wherein the hunting device area is smaller than the area of the hunting device in the monitoring image.
[0037] It is understandable that the hunting device area is smaller than the area actually occupied by the hunting device in the monitoring image. For example, the hunting device is a round net bag, such as Figure 2As shown, in the monitoring image 201, the area actually occupied is a circle 202 with a diameter of 960 pixels, so the hunting device area can be a circle 203 with a diameter of 600 pixels, and the circle is concentric with the circle corresponding to the actual area of the hunting device. It should be noted that the hunting device can also be a rectangular net bag or a rectangular animal trap, which is displayed as a rectangle in the monitoring image. Then in the monitoring image, the hunting device area is a rectangle that is concentric with the real area and has a length and width that are smaller than the real area.
[0038] It should be noted that the purpose of setting the hunting device area to be smaller than the actual area of the hunting device in the monitoring image in the embodiment of the present application is to ensure that the prey is as completely as possible within the hunting device.
[0039] Since the target point is used to mark the positional relationship between the prey and the hunting device, it is possible to determine whether the prey is in the hunting device through the target point.
[0040] Step 105: If the prey is in the hunting device area, control the hunting device to close.
[0041] The embodiment of the present application performs image recognition on the prey that enters the hunting device to determine whether the prey is the target prey and whether the position of the prey is within the hunting device. When the prey is the target prey and the target prey is within the hunting device, the hunting device is controlled to close, thereby ensuring that the target prey can be captured and prevented from escaping during capture.
[0042] On the basis of the above embodiment, the identification frame is a rectangular frame, and obtaining the target point in the identification frame includes: determining the center point of any side of the identification frame as the target point.
[0043] In the specific implementation process, Figure 3 A schematic diagram of determining a target point provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the hunting device area is a trapezoid, the identification frame is a rectangle, and the embodiment of the present application uses the center point A of the bottom edge of the identification frame as the target point. Of course, the center point of the left, right or top edge can also be used as the target point.
[0044] After determining the target point, it is determined whether the prey is within the hunting device. The specific judgment method can be: determine whether the sum of the areas of the triangles formed by the target point and the sides of the trapezoid is equal to the area of the trapezoid. If so, it means that the target point is within the hunting device area, otherwise it means that the target point is not within the hunting device area.
[0045] In another embodiment, Figure 3For example, the center point B of the identification frame can also be used as the target point. The method for determining whether the prey is in the hunting device is similar to the above embodiment and will not be repeated here.
[0046] In another embodiment, Figure 3 For example, any two diagonal points C and D in the identification frame can also be determined as target points. After determining the target points, it is determined whether the prey is in the hunting device. The specific determination method can be: determine whether the sum of the areas of the triangles formed by the diagonal point C and the sides of the trapezoid is equal to the area of the trapezoid, and determine whether the sum of the areas of the triangles formed by the diagonal point D and the sides of the trapezoid is equal to the area of the trapezoid. If they are both equal to the area of the trapezoid, it means that the prey is in the hunting device, otherwise it means that the prey is not in the hunting device.
[0047] It should be noted that the fundamental principle of judging whether the prey is within the hunting device based on whether the areas are equal is to judge whether the target point is within the hunting device area. If the target point is within the hunting device area, it is considered that the prey is within the hunting device.
[0048] In addition, the present application is introduced by taking the marking box as a rectangular frame and the shape of the hunting device area as a trapezoid as an example. In actual situations, the shapes of the marking box and the hunting device area can be other shapes, and whether the prey is in the hunting device can be determined by judging whether the center point of the marking box is in the hunting device area.
[0049] The embodiment of the present application determines whether the prey is in the hunting device by judging whether the target point is in the area of the hunting device, thereby avoiding the prey escaping when capturing the prey, and improving the accuracy of capturing the prey.
[0050] Based on the above embodiment, after controlling the hunting device to close, the method further includes:
[0051] The image before and after the hunting device is closed are sent to a designated terminal.
[0052] In a specific implementation process, after the prey is captured, in order to allow the monitoring personnel to be informed in time, the image of the hunting device before closing and the image after closing can be sent to the designated terminal. It is understandable that only the last image before closing and the first image after closing can be sent to the designated terminal, which can reduce the consumption of network traffic.
[0053] The embodiment of the present application sends the image before closing to the designated terminal, so that the monitoring personnel can know the state of the target before being captured. Based on this, it can be known whether there is a false trigger due to mechanical failure or image recognition error, or whether other creatures have escaped. In addition, because the state of the prey in the image before closing is more normal than the state after being captured, the monitoring personnel can know in advance more accurate characteristics of the prey to be captured, such as body size, and prepare tools of appropriate size.
[0054] Figure 4 A flow chart of a model training method provided in an embodiment of the present application is as follows: Figure 4 As shown, the method includes:
[0055] Step 401: Acquire positive training samples and negative training samples; wherein the positive training samples include an image containing an object to be preyed and a corresponding first annotation result, and the annotation result includes an annotation box annotating the object to be preyed on the image; the negative training samples include an image not containing the object to be preyed and a corresponding second annotation result.
[0056] It should be noted that in the embodiment of the present application, a specific species of organism is to be captured, so the organisms of this species are all referred to as prey. Therefore, it should be understood that the prey in the training sample is different from the prey in the training sample. Figure 1 The prey to be caught described in the above example is only the same in species, but not the same prey. The images in the negative training samples may not contain any creatures, and may also contain prey of different species than the prey to be caught.
[0057] Step 402: Input the positive training samples and the negative training samples into the model to be trained to obtain corresponding prediction results; it can be understood that the model to be trained can be constructed by a deep neural network, a convolutional neural network, etc., and the embodiment of the present application does not specifically limit the specific network structure of the model to be trained.
[0058] Step 403: Calculate a loss value according to the prediction result and the first labeling result of the positive training sample, and the prediction result and the second labeling result of the negative training sample.
[0059] Step 404: Optimize the parameters in the model to be trained according to the loss value to obtain the prey recognition model.
[0060] When the model to be trained meets the conditions for the end of training, the model to be trained can be used as a prey recognition model. To determine whether the model to be trained meets the conditions for the end of training, the first model can be verified using a test sample. It can be understood that the test sample is similar to the training sample, including images and annotations of the images. The first model is a model obtained after the first round of training of the model to be trained using multiple training samples. Specifically, the terminal device inputs the image in the test sample into the first model, and the first model processes the input image and outputs the corresponding test result. The accuracy of the first model prediction is calculated based on the test results and the annotations of the test sample. When the accuracy is greater than the preset threshold, it can be considered that the model performance of the first model has been able to meet the requirements, and the first model is used as a prey recognition model.
[0061] It should be noted that the preset threshold can be set according to actual conditions, and the embodiment of the present application does not limit the preset threshold.
[0062] In addition, the condition for determining whether to stop training can also be to determine whether to continue training the model to be trained based on the models obtained after multiple rounds of training, so as to obtain the prey recognition model. Specifically: the models obtained by multiple rounds of training can be verified using test samples. If the difference between the prediction accuracy of the models obtained after multiple rounds of training is small, it is considered that there is no room for improvement in the performance of the model to be trained, and the model to be trained with the highest prediction accuracy can be selected as the prey recognition model. If the difference between the prediction accuracy of the models to be trained obtained after multiple rounds of training is large, it means that there is still room for improvement in the performance of the model to be trained, and the model to be trained can continue to be trained until a model to be trained with stable model performance is obtained.
[0063] Figure 5 A schematic diagram of the structure of a prey capture system provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the system includes a monitoring camera 501, an intelligent computing box 502, a motor 503 and a net bag trap 504, wherein the intelligent computing box 502 is communicatively connected to the monitoring camera and the motor 503 respectively, and the motor is connected to the net bag trap 504.
[0064] The intelligent computing box 502 is consistent with the terminal device in the above embodiment and can execute the processes in the above method embodiments. The monitoring camera 501 is used to collect images of the net bag trap in real time and send the collected monitoring images to the intelligent computing box 502. The intelligent computing box 502 performs image recognition on the monitoring image to determine whether the monitoring image includes the prey to be captured and whether the prey to be captured is in the net bag trap 504. After determining that the prey to be captured is in the net bag trap 504, the intelligent computing box 502 controls the motor 503 to work, so that the net bag trap 504 is closed to achieve the purpose of capturing prey.
[0065] Figure 6 The schematic diagram of the structure of the prey capture device provided in the embodiment of the present application is shown in FIG. 1 , which may be a module, program segment or code on an electronic device. It should be understood that the device is similar to the above-mentioned Figure 1 The method embodiment corresponds to and can be executed Figure 1 The various steps involved in the method embodiment and the specific functions of the device can be found in the above description. To avoid repetition, detailed description is appropriately omitted here. The device includes: an image acquisition module 601, a prey recognition module 602, a target point determination module 603, a judgment module 604 and a control module 605, wherein:
[0066] The image acquisition module 601 is used to acquire monitoring images, which are obtained by real-time image acquisition of the hunting device by the image acquisition device; the prey recognition module 602 is used to input the monitoring image into a pre-constructed prey recognition model to obtain the recognition result output by the prey recognition model; the target point determination module 603 is used to obtain the target point in the identification frame if the recognition result includes the prey to be hunted and the identification frame of the prey to be hunted; the judgment module 604 is used to judge whether the prey to be hunted is in the hunting device area according to the target point; the control module 605 is used to control the hunting device to close if the prey to be hunted is in the hunting device area.
[0067] On the basis of the above embodiment, the identification frame is a rectangular frame, and the target point determination module 603 is specifically used to: determine the center point of any edge in the identification frame as the target point.
[0068] On the basis of the above embodiment, the identification frame is a rectangular frame, and the target point determination module 603 is specifically used to: determine the center point of the identification frame as the target point.
[0069] On the basis of the above embodiment, the identification frame is a rectangular frame, and the target point determination module 603 is specifically used to: determine any two diagonal points of the identification frame as the target points.
[0070] Based on the above embodiment, the determination module 604 is specifically used for:
[0071] It is determined whether the target point is within the hunting device area. If so, it is determined that the prey is within the hunting device; otherwise, it is determined that the prey is not within the hunting device.
[0072] Based on the above embodiment, the device further includes: a sending module for:
[0073] The image before and after the hunting device is closed are sent to a designated terminal.
[0074] Based on the above embodiment, the prey recognition model is obtained by the following training method:
[0075] Acquire positive training samples and negative training samples; wherein the positive training samples include images containing prey to be caught and corresponding first annotation results, and the annotation results include annotation boxes annotating the prey to be caught on the images; the negative training samples include images not containing the prey to be caught and corresponding second annotation results;
[0076] Inputting the positive training samples and the negative training samples into the model to be trained to obtain corresponding prediction results;
[0077] Calculating a loss value according to the prediction result and the first labeling result of the positive training sample, and the prediction result and the second labeling result of the negative training sample;
[0078] The parameters in the model to be trained are optimized according to the loss value to obtain the prey recognition model.
[0079] Figure 7 A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present application, such as Figure 7 As shown, the electronic device includes: a processor (processor) 701, a memory (memory) 702 and a bus 703; wherein,
[0080] The processor 701 and the memory 702 communicate with each other via the bus 703;
[0081] The processor 701 is used to call the program instructions in the memory 702 to execute the methods provided by the above-mentioned method embodiments, for example, including: acquiring a monitoring image, wherein the monitoring image is obtained by an image acquisition device performing real-time image acquisition on a hunting device; inputting the monitoring image into a prey recognition model constructed in advance to obtain a recognition result output by the prey recognition model; if the recognition result includes an object to be prey and an identification frame of the object to be prey, then obtaining a target point in the identification frame; judging whether the object to be prey is in the hunting device area according to the target point; wherein the hunting device area is smaller than the area of the hunting device in the monitoring image; if the object to be prey is in the hunting device area, then controlling the hunting device to close.
[0082] The processor 701 may be an integrated circuit chip with signal processing capabilities. The processor 701 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. It may implement or execute various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0083] The memory 702 may include but is not limited to random access memory (RAM), read only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable read-only memory (EEPROM), etc.
[0084] The present embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the methods provided by the above-mentioned method embodiments, for example, including: acquiring a monitoring image, wherein the monitoring image is obtained by an image acquisition device performing real-time image acquisition on a hunting device; inputting the monitoring image into a prey recognition model constructed in advance to obtain a recognition result output by the prey recognition model; if the recognition result includes an object to be prey and an identification frame of the object to be prey, then obtaining a target point in the identification frame; judging whether the object to be prey is in the hunting device area according to the target point; wherein the hunting device area is smaller than the area of the hunting device in the monitoring image; if the object to be prey is in the hunting device area, then controlling the hunting device to close.
[0085] The present embodiment provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions enable the computer to execute the methods provided by the above-mentioned method embodiments, for example, including: acquiring a monitoring image, wherein the monitoring image is obtained by an image acquisition device performing real-time image acquisition on a hunting device; inputting the monitoring image into a prey recognition model constructed in advance to obtain a recognition result output by the prey recognition model; if the recognition result includes an object to be prey and an identification frame of the object to be prey, then obtaining a target point in the identification frame; judging whether the object to be prey is in the hunting device area according to the target point; wherein the hunting device area is smaller than the area of the hunting device in the monitoring image; if the object to be prey is in the hunting device area, then controlling the hunting device to close.
[0086] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0087] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0088] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0089] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0090] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A prey capture method, characterized in that: include: Acquire a monitoring image, where the monitoring image is obtained by an image acquisition device performing real-time image acquisition on the hunting device; Inputting the monitoring image into a pre-built prey recognition model to obtain a recognition result output by the prey recognition model; If the recognition result includes the prey to be caught and the recognition frame of the prey to be caught, obtaining the target point in the recognition frame; Determining whether the prey to be captured is in a hunting device area according to the target point; wherein the hunting device area is smaller than an area of the hunting device in the monitoring image; If the prey to be caught is in the area of the hunting device, controlling the hunting device to close; The identification frame is a rectangular frame, and the hunting device area is a trapezoid; obtaining the target point in the identification frame includes: Determine the center point or any two diagonal points of the identification frame as the target point; The step of judging whether the prey to be captured is in the area of the hunting device according to the target point comprises: In the case where the center point of the identification frame is the target point, it is determined whether the sum of the areas of the triangles formed by the target point and the sides of the trapezoid is equal to the area of the trapezoid. If so, it indicates that the target point is within the hunting device area; otherwise, it indicates that the target point is not within the hunting device area. For the case where any two diagonal points of the identification frame are the target points, determine whether the sum of the areas of the triangles formed by the first diagonal point and the sides of the trapezoid is equal to the area of the trapezoid, and determine whether the sum of the areas of the triangles formed by the second diagonal point and the sides of the trapezoid is equal to the area of the trapezoid; if both are equal to the area of the trapezoid, it means that the prey to be captured is in the hunting device, otherwise it means that the prey to be captured is not in the hunting device.
2. The method according to claim 1, characterized in that The identification frame is a rectangular frame, and obtaining the target point in the identification frame includes: The center point of any edge in the identification frame is determined as the target point.
3. The method according to claim 1 or 2, characterized in that: The step of judging whether the prey to be captured is in the area of the hunting device according to the target point comprises: It is determined whether the target point is within the hunting device area. If so, it is determined that the prey is within the hunting device; otherwise, it is determined that the prey is not within the hunting device.
4. The method according to claim 1, characterized in that: After controlling the hunting device to close, the method further includes: The image before and after the hunting device is closed are sent to a designated terminal.
5. The method according to claim 1, characterized in that The prey recognition model is obtained by the following training method: Acquire positive training samples and negative training samples; wherein the positive training samples include images containing prey to be caught and corresponding first annotation results, and the annotation results include annotation boxes annotating the prey to be caught on the images; the negative training samples include images not containing the prey to be caught and corresponding second annotation results; Inputting the positive training samples and the negative training samples into the model to be trained to obtain corresponding prediction results; Calculating a loss value according to the prediction result and the first labeling result of the positive training sample, and the prediction result and the second labeling result of the negative training sample; The parameters in the model to be trained are optimized according to the loss value to obtain the prey recognition model.
6. A prey capture device, characterized in that: include: An image acquisition module is used to acquire a monitoring image, wherein the monitoring image is acquired by an image acquisition device performing real-time image acquisition on the hunting device; A prey recognition module, used to input the monitoring image into a prey recognition model constructed in advance, and obtain a recognition result output by the prey recognition model; A target point determination module, configured to obtain a target point in the identification frame if the identification result includes the prey to be captured and the identification frame of the prey to be captured; A judging module, used for judging whether the prey to be captured is in the hunting device area according to the target point; A control module, used for controlling the hunting device to close if the prey to be caught is in the hunting device area; The identification frame is a rectangular frame, and the hunting device area is a trapezoid; the target point determination module is specifically used for: Determine the center point or any two diagonal points of the identification frame as the target point; The judgment module is specifically used for: In the case where the center point of the identification frame is the target point, it is determined whether the sum of the areas of the triangles formed by the target point and the sides of the trapezoid is equal to the area of the trapezoid. If so, it indicates that the target point is within the hunting device area; otherwise, it indicates that the target point is not within the hunting device area. For the case where any two diagonal points of the identification frame are the target points, determine whether the sum of the areas of the triangles formed by the first diagonal point and the sides of the trapezoid is equal to the area of the trapezoid, and determine whether the sum of the areas of the triangles formed by the second diagonal point and the sides of the trapezoid is equal to the area of the trapezoid; if both are equal to the area of the trapezoid, it means that the prey to be captured is in the hunting device, otherwise it means that the prey to be captured is not in the hunting device.
7. An electronic device, characterized in that: include: processor, memory and bus, wherein, The processor and the memory communicate with each other via the bus; The memory stores program instructions executable by the processor, and the processor can execute the method according to any one of claims 1 to 5 by calling the program instructions.
8. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions, which, when executed by a computer, enable the computer to perform the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Target object positioning method and device, image processing method and device and computer equipment
CN111914809A
Intelligent mouse searching and trapping system based on A star algorithm
CN210076419U