A method and system for detecting the density of pollinating bees in a pollination area
By distinguishing between static and dynamic regions, judging the distance between feature points, and fusing video frames in the pollination area, the problem of inaccurate pollination bee density detection was solved, and more accurate bee counts were achieved.
Patent Information
- Application Number
- CN202411389019.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-10-08
AI Technical Summary
Existing technologies simply average the number of pollinating bees at each time point, which cannot accurately represent the bee density in the pollination area over a period of time, resulting in poor detection results.
By acquiring target videos of the pollination area, an image recognition model is used to distinguish between static and dynamic regions, video frames are sorted, a sliding window is used to determine the distance between feature points, video frames are fused, and the data is input into different density detection models for accurate statistics.
It enables precise statistics on bee density within the pollination area, improving detection accuracy and avoiding errors caused by simple averaging.
Smart Images

Figure CN118898795B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of insect density detection, and in particular relates to a method and a system for detecting the density of pollinating bees in a pollination area. Background Art
[0002] Bees pollinate crops, improving their yield and quality. In modern agriculture, bee pollination is crucial to the fertilization of many plants. Therefore, detecting the density of pollinating bees is an important means of analyzing the degree of pollination of plants over a period of time.
[0003] However, in the prior art, by counting the pollinating bees at each time node, only the number of pollinating bees at the corresponding time node can be obtained. Since the movement of bees is random, some bees may not move within a period of time, or there may be many batches of bees in the time period from one time node to another. Therefore, simply averaging the number of pollinating bees at each time node will not well represent the bee density in the pollination area within a period of time, resulting in poor detection of pollinating bee density. Summary of the invention
[0004] The present invention provides a method and system for detecting the density of pollinating bees in a pollination area, which are used to solve the technical problem that simply averaging the number of pollinating bees at each time node will not well represent the bee density in the pollination area within a period of time, resulting in poor detection effect of the pollinating bee density.
[0005] In a first aspect, the present invention provides a method for detecting the density of pollinating bees in a pollination area, comprising:
[0006] Acquire a target video of a pollination area within a preset time period, wherein the pollination area includes a static area and a dynamic area;
[0007] Input each video frame in the target video into a pre-built image recognition model, the image recognition model outputting at least one single video frame and at least one mixed video frame, wherein the single video frame is a video frame in which bees exist only in the static area, and the mixed video frame is a video frame in which bees exist in both the static area and the dynamic area;
[0008] Sorting the at least one single video frame and the at least one mixed video frame according to a time sequence to obtain a first video frame sequence and a second video frame sequence, wherein the first video frame sequence only includes single video frames, and the second video frame sequence only includes mixed video frames;
[0009] Sliding the first video frame sequence and the second video frame sequence using a preset sliding step size according to the sliding window, and obtaining a video frame set each time the sliding is performed, wherein the video frame set only includes a single video frame and a mixed video frame;
[0010] Determine whether the distance between a first feature point in a single video frame in a set of video frames and any second feature point in a mixed video frame is greater than a dynamically preset distance threshold, wherein the dynamically preset distance threshold is obtained by multiplying the interval time between a single video frame and a mixed video frame by the average flight speed of the bees;
[0011] If it is greater than a dynamically preset distance threshold, the certain first feature point is merged into the certain mixed video frame based on a preset fusion rule to obtain an updated certain target video frame set, wherein the certain target video frame set includes a certain target single video frame with a certain first feature point removed, and a certain target mixed video frame with a certain first feature point added;
[0012] Inputting both the single video frame and the target single video frame into a pre-constructed first density detection model, and inputting both the mixed video frame and the target mixed video frame into a pre-constructed second density detection model, wherein the first density detection model outputs a first detection result, and the second density detection model outputs a second detection result;
[0013] The density of pollinating bees in the pollination area within a preset time period is determined according to the first detection result and the second detection result.
[0014] In a second aspect, the present invention provides a pollination bee density detection system in a pollination area, comprising:
[0015] An acquisition module configured to acquire a target video of a pollination area within a preset time period, wherein the pollination area includes a static area and a dynamic area;
[0016] A first output module is configured to input each video frame in the target video into a pre-built image recognition model, wherein the image recognition model outputs at least one single video frame and at least one mixed video frame, wherein the single video frame is a video frame in which bees exist only in the static area, and the mixed video frame is a video frame in which bees exist in both the static area and the dynamic area;
[0017] a sorting module, configured to sort the at least one single video frame and the at least one mixed video frame according to a time sequence to obtain a first video frame sequence and a second video frame sequence, wherein the first video frame sequence only includes single video frames, and the second video frame sequence only includes mixed video frames;
[0018] a sliding module configured to slide on the first video frame sequence and the second video frame sequence according to a sliding window with a preset sliding step length, and obtain a video frame set each time the sliding is performed, wherein the video frame set only includes a single video frame and a mixed video frame;
[0019] A judgment module is configured to judge whether the distance between a first feature point in a single video frame in a set of video frames and any second feature point in a mixed video frame is greater than a dynamically preset distance threshold, wherein the dynamically preset distance threshold is obtained by multiplying the interval time between a single video frame and a mixed video frame by an average flight speed of bees;
[0020] An updating module is configured to fuse the certain first feature point into the certain mixed video frame based on a preset fusion rule if the distance is greater than a dynamically preset distance threshold, to obtain an updated certain target video frame set, wherein the certain target video frame set includes a certain target single video frame with a certain first feature point removed, and a certain target mixed video frame with a certain first feature point added;
[0021] A second output module is configured to input both the single video frame and the target single video frame into a pre-constructed first density detection model, and to input both the mixed video frame and the target mixed video frame into a pre-constructed second density detection model, wherein the first density detection model outputs a first detection result, and the second density detection model outputs a second detection result;
[0022] A determination module is configured to determine the density of pollinating bees in the pollination area within a preset time period based on the first detection result and the second detection result.
[0023] According to a third aspect, an electronic device is provided, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the steps of the method for detecting the density of pollinating bees in a pollination area according to any embodiment of the present invention.
[0024] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein when the program instructions are executed by a processor, the processor executes the steps of the method for detecting the density of pollinating bees in a pollination area of any embodiment of the present invention.
[0025] The pollination bee density detection method and system of the pollination area of the present application can determine whether the bees in a single video frame and a mixed video frame under the same sliding window are the same bee by judging whether the distance between a first feature point in a single video frame in a video frame set and any second feature point in a mixed video frame is greater than a dynamically preset distance threshold, thereby facilitating the subsequent more accurate statistics of the number of bees in a preset time period, and adopts a method and system for detecting the density of pollination bees in the pollination area within the preset time period by inputting both the single video frame and the target single video frame into a pre-constructed first density detection model, and inputting both the mixed video frame and the target mixed video frame into a pre-constructed second density detection model, the first density detection model outputs a first detection result, and the second density detection model outputs a second detection result, so as to obtain the number of bees in the pollination area within the preset time period, which can solve the problem that simply averaging the number of pollination bees at each time node will not well represent the bee density in the pollination area within a period of time, resulting in poor detection effect of pollination bee density. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0027] Figure 1 A flow chart of a method for detecting the density of pollinating bees in a pollination area provided by one embodiment of the present invention;
[0028] Figure 2 A schematic diagram of a sliding window sliding on a single video frame and a mixed video frame according to a specific embodiment of the present invention is provided;
[0029] Figure 3 A structural block diagram of a pollination bee density detection system in a pollination area provided by an embodiment of the present invention;
[0030] Figure 4 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0032] See also Figure 1 , which shows a flow chart of a method for detecting the density of pollinating bees in a pollination area of the present application.
[0033] like Figure 1 As shown, the method for detecting the density of pollinating bees in the pollination area specifically includes the following steps:
[0034] Step S101, obtaining a target video of a pollination area within a preset time period, wherein the pollination area includes a static area and a dynamic area.
[0035] In this embodiment, the static area is set as the flower area where bees can stay on the flowers to collect nectar, and the dynamic area is the spatial area where the flowers are located, for example, the area where the bees stay in the air.
[0036] Step S102, input each video frame in the target video into a pre-built image recognition model, and the image recognition model outputs at least one single video frame and at least one mixed video frame, wherein the single video frame is a video frame in which bees exist only in the static area, and the mixed video frame is a video frame in which bees exist in both the static area and the dynamic area.
[0037] In this step, the convolutional neural network is iteratively trained according to the historical video frames and the regional labels corresponding to the historical video frames to obtain an image recognition model. After the image recognition model is trained, each video frame in the target video is input into the image recognition model, and the image recognition model outputs at least one single video frame and at least one mixed video frame. For example, when video frame A is input into the image recognition model, if the image recognition model recognizes that there are bee features in the dynamic area of video frame A, video frame A is defined as a mixed video frame. If the image recognition model recognizes that there are no bee features in the dynamic area of video frame A, video frame A is defined as a single video frame.
[0038] Step S103, sorting the at least one single video frame and the at least one mixed video frame according to time order to obtain a first video frame sequence and a second video frame sequence, wherein the first video frame sequence only includes single video frames and the second video frame sequence only includes mixed video frames.
[0039] Step S104: sliding the first video frame sequence and the second video frame sequence with a preset sliding step size according to the sliding window, and obtaining a video frame set each time, wherein the video frame set only includes a single video frame and a mixed video frame.
[0040] In this step, the first video frame sequence and the second video frame sequence are aligned vertically. After alignment, a sliding window is slid on the first video frame sequence and the second video frame sequence using a preset sliding step length, and a video frame set is obtained each time the sliding is performed.
[0041] In a specific implementation process, there may be a first situation where the length of the first video frame sequence is greater than the second video frame sequence, or there may be a second situation where the length of the first video frame sequence is less than the second video frame sequence. For the first situation or the second situation, when the sliding window slides to only a single video frame or a mixed video frame, the sliding window stops sliding.
[0042] Step S105, determining whether the distance between a first feature point in a single video frame in a set of video frames and any second feature point in a mixed video frame is greater than a dynamically preset distance threshold, wherein the dynamically preset distance threshold is obtained by multiplying the interval time between a single video frame and a mixed video frame by the average flight speed of the bees.
[0043] In this step, by judging whether the distance between a first feature point in a single video frame in a set of video frames and any second feature point in a mixed video frame is greater than a dynamically preset distance threshold, the newly added bees in a mixed video frame and a single video frame can be analyzed. For example, bee a in a single video frame is at position point A, bee b and bee c in a mixed video frame are at position point B and position point C respectively, and the first distance between position point A and position point B, and the second distance between position point A and position point C are calculated. By comparison, it is found that both the first distance and the second distance are greater than the dynamically preset distance threshold, indicating that bee b and bee c at the time corresponding to a mixed video frame are not bee a at the time corresponding to a mixed video frame. Therefore, it is necessary to embed the feature point of bee a into a mixed video frame, so as to achieve a more accurate bee count over a period of time.
[0044] In a specific embodiment, after determining whether the distance between a first feature point in a single video frame in a video frame set and any second feature point in a mixed video frame is greater than a dynamic preset distance threshold, if it is not greater than the dynamic preset distance threshold, the video frame set is not updated.
[0045] It should be noted that if it is not greater than the dynamically preset distance threshold, it means that the two bee features in a single video frame and a mixed video frame are produced by the same bee. Therefore, there is no need to deliberately crop the bee features in a single video frame, but instead perform statistics through the subsequent first density detection model.
[0046] Step S106, if it is greater than the dynamically preset distance threshold, the certain first feature point is fused into the certain mixed video frame based on the preset fusion rule to obtain an updated certain target video frame set, wherein the certain target video frame set includes a certain target single video frame with a certain first feature point removed, and includes a certain target mixed video frame with a certain first feature point added.
[0047] In this step, the feature points in a single video frame are matched with the feature points in a mixed video frame based on the SIFT algorithm to obtain a first matching result; a first feature point in the single video frame is intercepted to obtain an updated single video frame, and the intercepted first feature point is embedded in a mixed video frame according to the first matching result to obtain an updated mixed video frame.
[0048] Step S107, input both the single video frame and the target single video frame into a pre-constructed first density detection model, and input both the mixed video frame and the target mixed video frame into a pre-constructed second density detection model, the first density detection model outputs a first detection result, and the second density detection model outputs a second detection result.
[0049] In this step, both the single video frame and the target single video frame are input into a pre-constructed first density detection model, and the first density detection model recognizes the single video frame and the target single video frame frame by frame to obtain a first sub-detection result corresponding to each single video frame, and a second sub-detection result corresponding to each target single video frame; each first sub-detection result and each second sub-detection result are superimposed to obtain a third sub-detection result, and the third sub-detection result is averaged to obtain a first detection result, wherein the first detection result is half of the third sub-detection result; the mixed video frame and the target mixed video frame are feature fused to obtain a final mixed video frame, and the final mixed video frame is input into a pre-constructed second density detection model to obtain a second detection result.
[0050] It should be noted that the final mixed video frame determination rule is: take the mixed video frame or target mixed video frame that is last in the time sequence in the second video frame sequence as the mixed video frame to be fused; match the feature points in the remaining mixed video frames with the feature points in the mixed video frame to be fused based on the SIFT algorithm to obtain a second matching result, wherein the remaining mixed video frames are all mixed video frames or target mixed video frames in the second video frame sequence except the mixed video frame to be fused; determine whether the target feature points in the remaining mixed video frames exist in the mixed video frame to be fused, wherein the target feature points are feature points containing bees; if not, intercept the target feature points, and embed the intercepted target feature points into the mixed video frame to be fused according to the second matching result to obtain the final mixed video frame; if existing, do not intercept the target feature points, and directly use the mixed video frame to be fused as the final mixed video frame.
[0051] Specifically, the feature points and the target feature points may be acquired through a feature extraction model, and the first density detection model and the second density detection model may be neural network models such as FCN (Fully Convolutionl Networks) models.
[0052] For example, in practice, at the first moment, bee a stays in the static area; at the second moment, bee a continues to stay in the static area, bee b and bee c stay in the static area and the dynamic area respectively; at the third moment, bee a and bee b continue to stay in the static area, and bee c flies away from the pollination area; at the fourth moment, bee a and bee b continue to stay in the static area, and bee d, bee e and bee f all stay in the dynamic area; at the fifth moment, bee d, bee e and bee f all stay in the static area, and bee a and bee b fly away from the pollination area; at the sixth moment, bee d, bee e and bee f all continue to stay in the static area, and bee g, bee h and bee k also stay in the static area.
[0053] In summary, during the time period from the first moment to the sixth moment, a total of 9 bees actually appeared, so the actual pollination bee density is 9 / 6=1.5.
[0054] If the average estimation method is used directly, the minimum number of bees in the time period from the first moment to the sixth moment should be 6 (the bees that appear from the first moment to the fifth moment are all old bees), and the maximum number of bees should be 20 (the bees that appear from the first moment to the sixth moment are all new bees). Therefore, in the time period from the first moment to the sixth moment, an average of 6+20 / 2=13 bees appeared, so the estimated pollination bee density is 13 / 6.
[0055] Using the method of the present invention, please refer to Figure 2, the video frames of the first moment, the third moment, and the fifth moment can be defined as a single video frame, and the video frames of the second moment, the fourth moment, and the sixth moment can be defined as a mixed video frame. Then the mixed video frame is input into the pre-constructed second density detection model, and the second detection result obtained by the second density detection model output is 9 bees. The single video frame is input into the pre-constructed first density detection model, and the second detection result obtained by the density detection model output is (1+2+3) / 2=3 bees. Therefore, in the time period from the first moment to the sixth moment, 9+3=12 bees appear. Therefore, the estimated pollination bee density using the present invention is 12 / 6=2, which is closer to the actual pollination bee density than the estimated results of other methods, so that the pollination bee density can be detected more accurately.
[0056] Step S108, determining the density of pollinating bees in the pollination area within a preset time period according to the first detection result and the second detection result.
[0057] In this step, the first detection result and the second detection result are superimposed, and the ratio of the superimposed result to the length of the preset time period is used as the pollination bee density in the pollination area within the preset time period.
[0058] In summary, the method of the present application can determine whether the bees in a single video frame and a mixed video frame under the same sliding window are the same bee by judging whether the distance between a first feature point in a single video frame in a video frame set and any second feature point in a mixed video frame is greater than a dynamically preset distance threshold, thereby facilitating the subsequent more accurate statistics on the number of bees within a preset time period, and adopts a method of inputting both the single video frame and the target single video frame into a pre-constructed first density detection model, and inputting both the mixed video frame and the target mixed video frame into a pre-constructed second density detection model, the first density detection model outputs a first detection result, and the second density detection model outputs a second detection result, so as to obtain the number of bees in the pollination area within the preset time period, which can solve the problem that simply averaging the number of pollinating bees at each time node will not well represent the bee density in the pollination area within a period of time, resulting in poor detection effect of pollination bee density.
[0059] See also Figure 3 , which shows a structural block diagram of a pollination bee density detection system in a pollination area of the present application.
[0060] like Figure 3As shown, the pollination bee density detection system 200 includes an acquisition module 210, a first output module 220, a sorting module 230, a sliding module 240, a judgment module 250, an update module 260, a second output module 270 and a determination module 280.
[0061] The acquisition module 210 is configured to acquire a target video of a pollination area within a preset time period, wherein the pollination area includes a static area and a dynamic area;
[0062] A first output module 220 is configured to input each video frame in the target video into a pre-built image recognition model, wherein the image recognition model outputs at least one single video frame and at least one mixed video frame, wherein the single video frame is a video frame in which bees exist only in the static area, and the mixed video frame is a video frame in which bees exist in both the static area and the dynamic area;
[0063] A sorting module 230 is configured to sort the at least one single video frame and the at least one mixed video frame according to a time sequence to obtain a first video frame sequence and a second video frame sequence, wherein the first video frame sequence only includes single video frames and the second video frame sequence only includes mixed video frames;
[0064] A sliding module 240 is configured to slide on the first video frame sequence and the second video frame sequence using a preset sliding step size according to a sliding window, and obtain a video frame set each time the sliding is performed, wherein the video frame set only includes a single video frame and a mixed video frame;
[0065] The determination module 250 is configured to determine whether the distance between a first feature point in a single video frame in a set of video frames and any second feature point in a mixed video frame is greater than a dynamically preset distance threshold, wherein the dynamically preset distance threshold is obtained by multiplying the interval time between a single video frame and a mixed video frame by the average flight speed of the bees;
[0066] The updating module 260 is configured to fuse the certain first feature point into the certain mixed video frame based on a preset fusion rule if the distance is greater than a dynamically preset distance threshold, to obtain an updated certain target video frame set, wherein the certain target video frame set includes a certain target single video frame with a certain first feature point removed, and a certain target mixed video frame with a certain first feature point added;
[0067] The second output module 270 is configured to input both the single video frame and the target single video frame into a pre-constructed first density detection model, and input both the mixed video frame and the target mixed video frame into a pre-constructed second density detection model, wherein the first density detection model outputs a first detection result, and the second density detection model outputs a second detection result;
[0068] The determination module 280 is configured to determine the density of pollinating bees in the pollination area within a preset time period according to the first detection result and the second detection result.
[0069] It should be understood that Figure 3 Modules and references documented in Figure 1 Therefore, the operations and features described above for the method and the corresponding technical effects are also applicable to Figure 3 The modules in the
[0070] In some other embodiments, the embodiments of the present invention further provide a computer-readable storage medium having a computer program stored thereon, wherein when the program instructions are executed by a processor, the processor is caused to execute the method for detecting the density of pollinating bees in a pollination area in any of the above method embodiments;
[0071] As an implementation mode, the computer-readable storage medium of the present invention stores computer-executable instructions, and the computer-executable instructions are configured as follows:
[0072] Acquire a target video of a pollination area within a preset time period, wherein the pollination area includes a static area and a dynamic area;
[0073] Input each video frame in the target video into a pre-built image recognition model, the image recognition model outputting at least one single video frame and at least one mixed video frame, wherein the single video frame is a video frame in which bees exist only in the static area, and the mixed video frame is a video frame in which bees exist in both the static area and the dynamic area;
[0074] Sorting the at least one single video frame and the at least one mixed video frame according to a time sequence to obtain a first video frame sequence and a second video frame sequence, wherein the first video frame sequence only includes single video frames, and the second video frame sequence only includes mixed video frames;
[0075] Sliding the first video frame sequence and the second video frame sequence using a preset sliding step size according to the sliding window, and obtaining a video frame set each time the sliding is performed, wherein the video frame set only includes a single video frame and a mixed video frame;
[0076] Determine whether the distance between a first feature point in a single video frame in a set of video frames and any second feature point in a mixed video frame is greater than a dynamically preset distance threshold, wherein the dynamically preset distance threshold is obtained by multiplying the interval time between a single video frame and a mixed video frame by the average flight speed of the bees;
[0077] If it is greater than a dynamically preset distance threshold, the certain first feature point is merged into the certain mixed video frame based on a preset fusion rule to obtain an updated certain target video frame set, wherein the certain target video frame set includes a certain target single video frame with a certain first feature point removed, and a certain target mixed video frame with a certain first feature point added;
[0078] Inputting both the single video frame and the target single video frame into a pre-constructed first density detection model, and inputting both the mixed video frame and the target mixed video frame into a pre-constructed second density detection model, wherein the first density detection model outputs a first detection result, and the second density detection model outputs a second detection result;
[0079] The density of pollinating bees in the pollination area within a preset time period is determined according to the first detection result and the second detection result.
[0080] The computer-readable storage medium may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the pollination bee density detection system in the pollination area, etc. In addition, the computer-readable storage medium may include a high-speed random access memory, and may also include a memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the computer-readable storage medium may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the pollination bee density detection system in the pollination area via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0081] Figure 4 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Figure 4 As shown, the device includes: a processor 310 and a memory 320. The electronic device may also include: an input device 330 and an output device 340. The processor 310, the memory 320, the input device 330 and the output device 340 may be connected via a bus or other means. Figure 4In the example, the bus connection is used. The memory 320 is the above-mentioned computer-readable storage medium. The processor 310 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 320, that is, the pollination bee density detection method of the pollination area of the above-mentioned method embodiment is realized. The input device 330 can receive input digital or character information, and generate key signal input related to user settings and function control of the pollination bee density detection system of the pollination area. The output device 340 may include a display device such as a display screen.
[0082] The electronic device can execute the method provided by the embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not described in detail in this embodiment, please refer to the method provided by the embodiment of the present invention.
[0083] As an embodiment, the electronic device is applied to a pollination bee density detection system in a pollination area, and is used for a client, and includes: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can:
[0084] Acquire a target video of a pollination area within a preset time period, wherein the pollination area includes a static area and a dynamic area;
[0085] Input each video frame in the target video into a pre-built image recognition model, the image recognition model outputting at least one single video frame and at least one mixed video frame, wherein the single video frame is a video frame in which bees exist only in the static area, and the mixed video frame is a video frame in which bees exist in both the static area and the dynamic area;
[0086] Sorting the at least one single video frame and the at least one mixed video frame according to a time sequence to obtain a first video frame sequence and a second video frame sequence, wherein the first video frame sequence only includes single video frames, and the second video frame sequence only includes mixed video frames;
[0087] Sliding the first video frame sequence and the second video frame sequence using a preset sliding step size according to the sliding window, and obtaining a video frame set each time the sliding is performed, wherein the video frame set only includes a single video frame and a mixed video frame;
[0088] Determine whether the distance between a first feature point in a single video frame in a set of video frames and any second feature point in a mixed video frame is greater than a dynamically preset distance threshold, wherein the dynamically preset distance threshold is obtained by multiplying the interval time between a single video frame and a mixed video frame by the average flight speed of the bees;
[0089] If it is greater than a dynamically preset distance threshold, the certain first feature point is merged into the certain mixed video frame based on a preset fusion rule to obtain an updated certain target video frame set, wherein the certain target video frame set includes a certain target single video frame with a certain first feature point removed, and a certain target mixed video frame with a certain first feature point added;
[0090] Inputting both the single video frame and the target single video frame into a pre-constructed first density detection model, and inputting both the mixed video frame and the target mixed video frame into a pre-constructed second density detection model, wherein the first density detection model outputs a first detection result, and the second density detection model outputs a second detection result;
[0091] The density of pollinating bees in the pollination area within a preset time period is determined according to the first detection result and the second detection result.
[0092] Through the description of the above implementation modes, those skilled in the art can clearly understand that each implementation mode can be implemented by means of software plus a necessary general hardware platform, or of course by hardware. Based on such an understanding, the above technical solution can essentially or in other words be embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting the density of pollinating bees in a pollination area, characterized in that: include: Acquire a target video of a pollination area within a preset time period, wherein the pollination area includes a static area and a dynamic area; Input each video frame in the target video into a pre-built image recognition model, the image recognition model outputting at least one single video frame and at least one mixed video frame, wherein the single video frame is a video frame in which bees exist only in the static area, and the mixed video frame is a video frame in which bees exist in both the static area and the dynamic area; Sorting the at least one single video frame and the at least one mixed video frame according to a time sequence to obtain a first video frame sequence and a second video frame sequence, wherein the first video frame sequence only includes single video frames, and the second video frame sequence only includes mixed video frames; Sliding the first video frame sequence and the second video frame sequence using a preset sliding step size according to the sliding window, and obtaining a video frame set each time the sliding is performed, wherein the video frame set only includes a single video frame and a mixed video frame; Determine whether the distance between a first feature point in a single video frame in a set of video frames and any second feature point in a mixed video frame is greater than a dynamically preset distance threshold, wherein the dynamically preset distance threshold is obtained by multiplying the interval time between a single video frame and a mixed video frame by the average flight speed of the bees; If it is greater than a dynamically preset distance threshold, the certain first feature point is merged into the certain mixed video frame based on a preset fusion rule to obtain an updated certain target video frame set, wherein the certain target video frame set includes a certain target single video frame with a certain first feature point removed, and a certain target mixed video frame with a certain first feature point added; Inputting both the single video frame and the target single video frame into a pre-constructed first density detection model, and inputting both the mixed video frame and the target mixed video frame into a pre-constructed second density detection model, wherein the first density detection model outputs a first detection result, and the second density detection model outputs a second detection result; The density of pollinating bees in the pollination area within a preset time period is determined according to the first detection result and the second detection result.
2. The method for detecting the density of pollinating bees in a pollination area according to claim 1, characterized in that: The sliding on the first video frame sequence and the second video frame sequence using a preset sliding step length according to the sliding window, and obtaining a video frame set each time by sliding, comprises: Aligning the first video frame sequence and the second video frame sequence vertically, After alignment, a sliding window is used to slide on the first video frame sequence and the second video frame sequence with a preset sliding step size, and a video frame set is obtained each time the sliding is performed.
3. The method for detecting the density of pollinating bees in a pollination area according to claim 1, characterized in that: After determining whether the distance between a first feature point in a single video frame in a set of video frames and any second feature point in a mixed video frame is greater than a dynamically preset distance threshold, the method further includes: If it is not greater than the dynamically preset distance threshold, the certain video frame set is not updated.
4. The method for detecting the density of pollinating bees in a pollination area according to claim 1, characterized in that: The step of fusing the first feature point into the mixed video frame based on a preset fusion rule to obtain an updated target video frame set includes: Matching the feature points in the single video frame with the feature points in the mixed video frame based on the SIFT algorithm to obtain a first matching result; A first feature point in the single video frame is intercepted to obtain an updated single video frame, and the intercepted first feature point is embedded into the mixed video frame according to the first matching result to obtain an updated mixed video frame.
5. The method for detecting the density of pollinating bees in a pollination area according to claim 1, characterized in that: The step of inputting both the single video frame and the target single video frame into a pre-constructed first density detection model, and inputting both the mixed video frame and the target mixed video frame into a pre-constructed second density detection model, wherein the first density detection model outputs a first detection result, and the second density detection model outputs a second detection result, comprises: Inputting the single video frame and the target single video frame into a pre-constructed first density detection model, wherein the first density detection model recognizes the single video frame and the target single video frame frame by frame to obtain a first sub-detection result corresponding to each single video frame and a second sub-detection result corresponding to each target single video frame; After superimposing each first sub-detection result and each second sub-detection result, a third sub-detection result is obtained, and the third sub-detection results are averaged to obtain a first detection result, wherein the first detection result is half of the third sub-detection result; The mixed video frame and the target mixed video frame are feature-fused to obtain a final mixed video frame, and the final mixed video frame is input into a pre-constructed second density detection model to obtain a second detection result.
6. The method for detecting the density of pollinating bees in a pollination area according to claim 5, characterized in that: The step of fusing the mixed video frame with the target mixed video frame to obtain a final mixed video frame includes: Taking the mixed video frame or the target mixed video frame which is at the end in time order in the second video frame sequence as the mixed video frame to be fused; Matching feature points in the remaining mixed video frames with feature points in the mixed video frame to be fused based on the SIFT algorithm, respectively, to obtain a second matching result, wherein the remaining mixed video frames are all mixed video frames or target mixed video frames in the second video frame sequence except the mixed video frame to be fused; Determine whether the target feature point in the remaining mixed video frames exists in the mixed video frame to be fused, wherein the target feature point is a feature point including a bee; If not, intercepting the target feature point, and embedding the intercepted target feature point into the mixed video frame to be fused according to the second matching result, to obtain a final mixed video frame; If it exists, the target feature point is not intercepted, and the mixed video frame to be fused is directly used as the final mixed video frame.
7. The method for detecting the density of pollinating bees in a pollination area according to claim 1, characterized in that: The step of determining the density of pollinating bees in a pollination area within a preset time period according to the first detection result and the second detection result includes: The first detection result and the second detection result are superimposed, and the ratio of the superimposed result to the length of the preset time period is used as the pollination bee density in the pollination area within the preset time period.
8. A pollination bee density detection system in a pollination area, characterized in that: include: An acquisition module configured to acquire a target video of a pollination area within a preset time period, wherein the pollination area includes a static area and a dynamic area; A first output module is configured to input each video frame in the target video into a pre-built image recognition model, wherein the image recognition model outputs at least one single video frame and at least one mixed video frame, wherein the single video frame is a video frame in which bees exist only in the static area, and the mixed video frame is a video frame in which bees exist in both the static area and the dynamic area; a sorting module, configured to sort the at least one single video frame and the at least one mixed video frame according to a time sequence to obtain a first video frame sequence and a second video frame sequence, wherein the first video frame sequence only includes single video frames, and the second video frame sequence only includes mixed video frames; a sliding module configured to slide on the first video frame sequence and the second video frame sequence according to a sliding window with a preset sliding step length, and obtain a video frame set each time the sliding is performed, wherein the video frame set only includes a single video frame and a mixed video frame; A judgment module is configured to judge whether the distance between a first feature point in a single video frame in a set of video frames and any second feature point in a mixed video frame is greater than a dynamically preset distance threshold, wherein the dynamically preset distance threshold is obtained by multiplying the interval time between a single video frame and a mixed video frame by an average flight speed of bees; An updating module is configured to fuse the certain first feature point into the certain mixed video frame based on a preset fusion rule if the distance is greater than a dynamically preset distance threshold, to obtain an updated certain target video frame set, wherein the certain target video frame set includes a certain target single video frame with a certain first feature point removed, and a certain target mixed video frame with a certain first feature point added; A second output module is configured to input both the single video frame and the target single video frame into a pre-constructed first density detection model, and to input both the mixed video frame and the target mixed video frame into a pre-constructed second density detection model, wherein the first density detection model outputs a first detection result, and the second density detection model outputs a second detection result; A determination module is configured to determine the density of pollinating bees in the pollination area within a preset time period based on the first detection result and the second detection result.
9. An electronic device, characterized in that: include: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Non-marking image detection method and system of bee motion tracks
CN103034992A
Intelligent construction method for ecological environment of strawberry and bee composite facilities
CN111859672A