Weed positioning method, system, device and storage medium
Through the combination of the main camera and the auxiliary camera, efficient weed identification and laser action are achieved, which solves the problem of low weeding efficiency under multiple weeds and bending phenomena, and improves weeding efficiency and adaptability.
Patent Information
- Application Number
- CN202410990096.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-23
AI Technical Summary
Existing laser weeding technology has low weeding efficiency and is difficult to adapt to the bending phenomenon of weed stems under the influence of multiple weed targets and weather or robot movement, resulting in identification errors and missed weeding.
Using the method of combining the main camera and the auxiliary camera, the main camera identifies and selects weeds in large areas, and the auxiliary camera performs more detailed image acquisition and laser action coordinate generation, converting large area identification into small area tasks, improving weeding efficiency, and Adapt to changes by understanding target shape and characteristics by identifying rhizome locations.
It improves weeding efficiency, reduces missed weeding, enhances the system's adaptability to changes in weed shape and characteristics, and ensures more efficient weed removal.
Smart Images

Figure CN118521780B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of agricultural technology, and in particular to a weed positioning method, system, equipment and storage medium. Background Art
[0002] With the development of agriculture, the growth and reproduction of weeds have a serious impact on the yield and quality of crops. Laser weeding technology uses lasers on the surface of plants to affect the development and regrowth of weeds or seeds. The laser parameters can be adjusted according to different applicable scenarios. It has high flexibility, strong directionality and stable energy output. Compared with commonly used pesticide weeding technology and mechanical weeding technology, laser weeding technology reduces pesticide residues and has higher operating efficiency.
[0003] The implementation of laser weeding can be simply divided into two parts: identification and weeding. After the camera obtains the environmental information of the area to be weeded, the image processing module is used to complete the identification of the weed roots and stems, and the laser position is adjusted according to the identification results to achieve weeding. Weed identification in the prior art is only completed using a single camera image, and a light target is generated based on the weed position determined by the single camera. When multiple weed targets appear in the field of view of a single camera, the laser needs to complete multiple moving tasks, and the weeding efficiency is low. It does not take into account the fact that the stems of the weeds are easily bent due to the influence of weather (wind) or the movement of the robot, which affects the weeding effect. Summary of the invention
[0004] The main purpose of the present invention is to provide a weed positioning method, system, device and storage medium. After the main camera selects the area where the weeds are located, the auxiliary camera corresponding to the selected area acquires the image and obtains the laser action coordinates, so that the weed recognition problem in a large recognition area is converted into laser action tasks in several small areas and solved at one time, thereby improving the weeding efficiency. In addition, the stems of weeds are easily bent due to the influence of weather (wind) or the movement of the robot, resulting in the situation that they cannot be recognized. After the selection, the root and stem position are identified to better understand the shape and characteristics of the target, helping the system to adapt to these changes more quickly and prevent omissions.
[0005] In order to achieve the above objectives, the embodiments of the present application provide the following technical solutions:
[0006] According to a first aspect of an embodiment of the present application, a weed locating method for a weeding robot is provided, which is applied to a weed locating device, wherein the device includes a plurality of main cameras and a plurality of auxiliary cameras, each auxiliary camera is provided with a laser, and the method includes:
[0007] The weed positioning model is called to identify the image acquired by the main camera in real time to obtain the coordinates of the weed detection frame;
[0008] Verifying the weed detection frames, and selecting weed detection frames that pass the verification;
[0009] Start the corresponding auxiliary camera according to each weed detection frame;
[0010] The auxiliary camera image is acquired through the auxiliary camera, and the weed meristem is identified to generate the laser action coordinates.
[0011] Optionally, calling the weed positioning model to identify the image acquired in real time by the main camera to obtain the coordinates of the weed detection frame includes:
[0012] The weight of the weed positioning model is called to call the detect file interface to obtain the weight of the weed category to complete the distinction between weeds and crops in the weed removal area, and obtain the weed detection frame coordinates. The center coordinates of the detection frame are calculated based on the weed detection frame coordinates.
[0013] Optionally, verifying the weed detection frame and selecting the weed detection frame that passes the verification includes:
[0014] The image captured by the main camera is converted from RGB color space to HSV color space to complete the segmentation of weeds, crops and background;
[0015] Perform opening operation and connected area marking on the segmented image to obtain the maximum boundary area of several white areas:
[0016] For the maximum boundary area of each white area, the distance between the center coordinates of the detection frame and the center coordinates of the white area is compared, and the weed detection frame whose distance meets the set conditions is determined as a weed detection frame that has passed the verification.
[0017] Optionally, starting a corresponding auxiliary camera according to each weed detection frame includes:
[0018] The center coordinates of each detection frame in the main camera's field of view are calculated and brought into the field of view of each auxiliary camera, and the auxiliary camera corresponding to the center coordinates of each detection frame is started.
[0019] Optionally, starting the auxiliary camera corresponding to the center coordinates of each detection frame includes:
[0020] When the center coordinates of the detection frame only exist in the field of view of a single auxiliary camera, start the single auxiliary camera;
[0021] When the coordinates of the center of the detection frame exist in the fields of view of two auxiliary cameras at the same time, the auxiliary camera whose field of view center is closer to the center of the detection frame is started.
[0022] Optionally, the identifying weed meristem and generating laser action coordinates includes:
[0023] Calling the weed positioning model to identify the meristem in the auxiliary camera image, and obtaining the center coordinates of the meristem;
[0024] The center coordinates of the meristem are determined as the laser action coordinates of the laser corresponding to the auxiliary camera.
[0025] Optionally, before calling the weed location model to identify the image acquired by the main camera in real time, the method further includes training the weed location model, which specifically includes the following steps:
[0026] A main camera is used to take a number of images containing weeds of different categories at a set height, and the area where each type of weed is located and the area where the meristem corresponding to each type of weed is located in each image are marked, so as to complete the classification of each type of weed and the meristem corresponding to each type of weed;
[0027] The data enhancement method is used to randomly rotate and scale the image to expand the data set, and the detect file of the neural network model is encapsulated as an interface, in which each type of weed and its corresponding meristem correspond to different categories in the interface;
[0028] The expanded data set is input into the neural network model for training to obtain a weed location model, and a weight file is output.
[0029] According to a second aspect of an embodiment of the present application, a weed positioning system for a weeding robot is provided, which is applied to a weed positioning device, wherein the device comprises a plurality of main cameras and a plurality of auxiliary cameras, each auxiliary camera being provided with a laser, and the system comprises:
[0030] A detection frame recognition module is used to call the weed positioning model to recognize the image acquired by the main camera in real time and obtain the coordinates of the weed detection frame;
[0031] A detection frame verification module, used to verify the weed detection frame and select the weed detection frame that has passed the verification;
[0032] Auxiliary camera start module, used to start the corresponding auxiliary camera according to each weed detection frame;
[0033] The laser action coordinate module is used to obtain the auxiliary camera image through the auxiliary camera, identify the weed meristem, and generate the laser action coordinate.
[0034] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in the first aspect above.
[0035] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which computer-readable instructions are stored. The computer-readable instructions can be executed by a processor to implement the method described in the first aspect above.
[0036] In summary, the embodiments of the present application provide a weed positioning method, system, device and storage medium, which are applied to a weed positioning device. The device includes several main cameras and several auxiliary cameras, each auxiliary camera is provided with a laser, and the weed detection frame coordinates are obtained by calling the weed positioning model to identify the image acquired by the main camera in real time; the weed detection frame is verified, and the weed detection frame that passes the verification is screened out; the corresponding auxiliary camera is started according to each weed detection frame; the auxiliary camera image is acquired through the auxiliary camera, and the weed meristem is identified to generate the laser action coordinates. After the main camera selects the area where the weeds are located, the auxiliary camera corresponding to the selected area acquires the image and obtains the laser action coordinates, converting the weed identification problem in a large identification area into the laser action tasks in several small areas to be solved at one time, thereby improving the weeding efficiency; in addition, the stems of weeds are easily bent due to the influence of weather (wind) or the movement of the robot, resulting in the situation that cannot be identified. After the selection, the root and stem position can be identified to better understand the shape and characteristics of the target, helping the system to adapt to these changes more quickly and prevent omission. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0038] The structures, proportions, sizes, etc. illustrated in this specification are only used to match the contents disclosed in the specification so as to facilitate understanding and reading by persons familiar with the technology. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantial technical significance. Any structural modification, change in proportion or adjustment of size shall still fall within the scope of the technical contents disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention.
[0039] Figure 1 A schematic diagram of a weed location method provided in an embodiment of the present application;
[0040] Figure 2 A schematic diagram of the overall process provided for the embodiments of the present application;
[0041] Figure 3 A block diagram of a weed positioning system provided in an embodiment of the present application;
[0042] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown;
[0043] Figure 5A schematic diagram of a computer-readable storage medium provided in an embodiment of the present application is shown.
[0044] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0046] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0047] In addition, in the present invention, descriptions such as "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0048] In the present invention, unless otherwise clearly specified and limited, the terms "connection", "fixation", etc. should be understood in a broad sense. For example, "fixation" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0049] In addition, the technical solutions between the various embodiments of the present invention can be combined with each other, but it must be based on the fact that ordinary technicians in the field can implement it. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0050] Figure 1A weed positioning method provided by an embodiment of the present application is shown, which is applied to a weed positioning device, and a plurality of main cameras and auxiliary cameras are installed on the weed positioning device. The main camera is responsible for acquiring images of a large area, while the auxiliary camera assists the main camera in more detailed positioning. The main camera and the auxiliary camera work simultaneously to acquire images of the field. If there are multiple main cameras, image stitching processing is required to obtain a continuous, seamless image. The auxiliary camera further identifies the weed meristem to assist in positioning and generate laser action coordinates. Each auxiliary camera is provided with a laser, and the laser emitted by the laser acts on the weeds to achieve weed removal. The method comprises:
[0051] Step 101: calling a weed positioning model to identify the image acquired in real time by the main camera to obtain the coordinates of the weed detection frame;
[0052] Step 102: verifying the weed detection frames, and selecting weed detection frames that pass the verification;
[0053] Step 103: activating a corresponding auxiliary camera according to each weed detection frame;
[0054] Step 104: Acquire the auxiliary camera image through the auxiliary camera, identify the weed meristem, and generate the laser action coordinates.
[0055] In a possible implementation, in step 101, calling the weed positioning model to identify the image acquired in real time by the main camera to obtain the coordinates of the weed detection frame includes:
[0056] The weight of the weed positioning model is called to call the detect file interface to obtain the weight of the weed category to complete the distinction between weeds and crops in the weed removal area, and obtain the weed detection frame coordinates. The center coordinates of the detection frame are calculated based on the weed detection frame coordinates.
[0057] In a possible implementation manner, in step 102, verifying the weed detection frames and selecting the weed detection frames that pass the verification includes:
[0058] The image captured by the main camera is converted from the RGB color space to the HSV color space to complete the segmentation of weeds, crops and background; the segmented image is opened and the connected area is marked to obtain the maximum boundary area of several white areas: for the maximum boundary area of each white area, the distance between the center coordinates of the detection frame and the center coordinates of the white area is compared, and the one whose distance meets the set conditions is determined as a weed detection frame that has passed the verification.
[0059] In a possible implementation, in step 103, starting a corresponding auxiliary camera according to each weed detection frame includes:
[0060] The center coordinates of each detection frame in the main camera's field of view are calculated and brought into the field of view of each auxiliary camera, and the auxiliary camera corresponding to the center coordinates of each detection frame is started.
[0061] In a possible implementation, starting the auxiliary camera corresponding to the center coordinates of each detection frame includes:
[0062] When the center coordinates of the detection frame only exist in the field of view of a single auxiliary camera, start the single auxiliary camera; when the center coordinates of the detection frame exist in the fields of view of two auxiliary cameras at the same time, start the auxiliary camera whose field of view center is closer to the center of the detection frame in the current situation.
[0063] In a possible implementation, in step 104, the identifying of weed meristems and generating laser action coordinates includes:
[0064] The weed positioning model is called to identify the meristem in the auxiliary camera image, and the center coordinates of the meristem are obtained; and the center coordinates of the meristem are determined as the laser action coordinates of the laser corresponding to the auxiliary camera.
[0065] In a possible implementation manner, before calling the weed location model to identify the image acquired by the main camera in real time, the method further includes training the weed location model, which specifically includes the following steps:
[0066] A main camera is used to take a number of images containing different types of weeds at a set height, and the area where each type of weed is located and the area where the meristem corresponding to each type of weed is located in each image are marked to complete the classification of each type of weed and the meristem corresponding to each type of weed; the image is randomly rotated and scaled by a data enhancement method to expand the data set, and the detect file of the neural network model is encapsulated as an interface, wherein each type of weed and its corresponding meristem respectively correspond to different categories in the interface; the expanded data set is input into the neural network model for training to obtain a weed positioning model, and a weight file is output.
[0067] The method provided in the embodiment of the present application uses the main and auxiliary cameras to realize the positioning of plant meristems. The main camera can recognize a larger area, which is used for rough identification of weeds (frame selection of the area where the weeds are located) and auxiliary navigation; the auxiliary camera recognizes a smaller area, but can flexibly change the field of view with the help of the galvanometer system, and determine the accurate weed position based on the weed area identified by the main camera.
[0068] After the main camera selects the area where the weeds are located, the auxiliary camera corresponding to the selected area acquires the image and obtains the laser action coordinates, converting the weed identification problem in a large identification area into laser action tasks in several small areas and solving them at one time, thereby improving the weeding efficiency. In addition, the stems of weeds are easily bent due to the influence of weather (wind) or the movement of the robot, resulting in unrecognizable conditions. Identifying the root and stem position after selecting the weeds can better understand the shape and characteristics of the target, helping the system to adapt to these changes more quickly and prevent omissions.
[0069] The following is combined with Figure 2 The method provided in the embodiment of the present application is described in detail. The weed positioning method is implemented by using n main cameras and m auxiliary cameras, where each auxiliary camera corresponds to a laser separately, and the specific steps are as follows:
[0070] Phase 1: Training the YOLOv5 neural network model to distinguish weeds from crops;
[0071] 1.1 The main camera takes a series of images containing different types of weeds at a fixed height, and labels the area where each type of weed is located and the area where the meristem of each type of weed is located in each image, so as to complete the classification of each type of weed and the meristem of each type of weed;
[0072] 1.2 The Mosaic data enhancement method is used to randomly rotate and scale the image, expand the data set, and encapsulate the YOLOv5 detect file as an interface. Each type of weed and its corresponding meristem corresponds to a different category in the interface;
[0073] 1.3 Input the expanded data set into the YOLOv5 neural network model for training, obtain a model with mAP ≥ 95% and inference speed ≥ 16 frames, and output the weight file;
[0074] Phase 2: During the laser weeding process, the main camera acquires images containing weeds and crops, and uses the trained YOLOv5 model weights to call the detect file interface to obtain the weights of the weed categories, complete the distinction between weeds and crops in the weeding area, and obtain the coordinates of the weed detection frame. , calculate the center coordinates of the detection box ;
[0075] The third stage: Verify the recognition results and remove the wrong selection results;
[0076] 3.1 Convert the image captured by the main camera from RGB color space to HSV color space to complete the segmentation of weeds, crops and background;
[0077] RGB color is represented as ;
[0078]
[0079]
[0080] brightness
[0081] Saturation
[0082] when When, color ,otherwise
[0083]
[0084] In the H component grayscale image, calculate the inter-class variance when each pixel value is used as the segmentation threshold:
[0085]
[0086] Where t is the threshold value, is the pixel probability of the two categories after segmentation, and is the average grayscale of the two categories;
[0087] The optimal threshold T is the value that maximizes the variance between classes;
[0088] Perform threshold processing on each pixel in the HSV image:
[0089]
[0090] in is the coordinate of the H component in the grayscale image The pixel value at makes the green area of the original acquired image appear white. The pixel coordinate set of this area is P i , non-green areas are displayed in black; T is the optimal threshold;
[0091] 3.2 After completing the opening operation of the binary image (the binary image is first eroded and then expanded), the connected area is marked; the maximum boundary area of different white areas is calculated:
[0092] Calculate the boundary of each identified white area, that is, the white area is represented as:
[0093] ,in
[0094] 3.3 Compare the center distance of the detection box to remove the weeds that are incorrectly identified by the YOLOv5 model;
[0095] Compare the center coordinates of the detection frame obtained by YOLOv5 The center point of the white area of the current detection frame The difference between When , it proves that the detection frame is correctly identified, otherwise the weeds are incorrectly identified and the detection frame is removed;
[0096] Stage 4: The field of view of the robot’s n main cameras is , the m auxiliary camera fields of view within the field of view are expressed as , where the m auxiliary camera fields of view can completely cover any main camera field of view, that is , the correct detection frame center coordinates in the main camera field of view Bring in the field of view of each auxiliary camera and determine the auxiliary camera that should be activated with the coordinate point as the center;
[0097] 4.1 When there are multiple weeds within the field of view of an auxiliary camera: Since the robot is constantly moving forward during the weeding process, the y-axis coordinate of the back side of the field of view, that is, the center of the detection frame The larger it is, the higher the priority for weed treatment;
[0098] 4.2 Since the field of view of two adjacent auxiliary cameras overlaps, for a single weed:
[0099] 4.2.1 When the center coordinates of the detection frame When it only exists in the field of view of a single auxiliary camera, start the auxiliary camera;
[0100] 4.2.2 When the center coordinates of the detection frame When there are two auxiliary cameras in the field of view at the same time, the auxiliary camera whose field of view center is closer to the detection frame center in the current situation is activated;
[0101] The fifth stage: acquiring auxiliary camera images, identifying weed meristems, and generating laser action coordinates;
[0102] 5.1 Since the weed mortality rate is higher when the laser weeding strikes the meristem, the trained YOLOv5 model is used to identify the meristem; The trained YOLOv5 model is used to identify the meristem, and the encapsulated interface file detect is called to obtain the center coordinates of the meristem to complete real-time information processing;
[0103] 5.2 When no meristem is identified in the auxiliary camera field of view, return to step 2 and re-detect the weed area;
[0104] 5.3 The center position of the detection frame is the laser action coordinate.
[0105] Preferably, the auxiliary camera is a camera connected to a galvanometer system; and the n main cameras are arranged on the same horizontal plane.
[0106] The main and auxiliary cameras are used to locate the plant meristem. The main camera can identify a larger area, which is used for rough identification of weeds (selection of the area where the weeds are located) and auxiliary navigation. The auxiliary camera can identify a smaller area, but it can flexibly change the field of view with the help of the galvanometer system to determine the exact weed location based on the weed area identified by the main camera.
[0107] In summary, the embodiment of the present application provides a weed positioning method, which is applied to a weed positioning device. The device includes several main cameras and several auxiliary cameras. Each auxiliary camera is provided with a laser. The weed positioning model is called to identify the image acquired by the main camera in real time to obtain the coordinates of the weed detection frame; the weed detection frame is verified to screen out the weed detection frame that has passed the verification; the corresponding auxiliary camera is started according to each weed detection frame; the auxiliary camera image is acquired through the auxiliary camera, and the weed meristem is identified to generate the laser action coordinates. After the main camera selects the area where the weeds are located, the auxiliary camera corresponding to the selected area acquires the image to obtain the laser action coordinates, converting the weed identification problem in a large identification area into the laser action tasks in several small areas to be solved at one time, thereby improving the weeding efficiency; in addition, the stems of weeds are easily bent due to the influence of weather (wind) or the movement of the robot, resulting in the situation that they cannot be identified. After the selection, the root and stem position can be identified to better understand the shape and characteristics of the target, helping the system to adapt to these changes more quickly and prevent omission.
[0108] Based on the same technical concept, the embodiment of the present application also provides a weed positioning system, such as Figure 3 As shown, it is applied to a weed positioning device, the device includes a plurality of main cameras and a plurality of auxiliary cameras, each auxiliary camera is provided with a laser, and the system includes:
[0109] The detection frame recognition module 301 is used to call the weed positioning model to recognize the image acquired by the main camera in real time and obtain the coordinates of the weed detection frame;
[0110] A detection frame verification module 302 is used to verify the weed detection frames and select the weed detection frames that pass the verification;
[0111] Auxiliary camera activation module 303, used to activate the corresponding auxiliary camera according to each weed detection frame;
[0112] The laser action coordinate module 304 is used to obtain the auxiliary camera image through the auxiliary camera, identify the weed meristem, and generate the laser action coordinate.
[0113] The present application also provides an electronic device corresponding to the method provided in the above embodiment. Figure 4, which shows a schematic diagram of an electronic device provided by some embodiments of the present application. The electronic device 20 may include: a processor 200, a memory 201, a bus 202 and a communication interface 203, wherein the processor 200, the communication interface 203 and the memory 201 are connected via the bus 202; the memory 201 stores a computer program that can be run on the processor 200, and the processor 200 executes the method provided by any of the aforementioned embodiments of the present application when running the computer program.
[0114] The memory 201 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one physical port (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0115] The bus 202 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory 201 is used to store programs, and the processor 200 executes the programs after receiving execution instructions. The method disclosed in any implementation of the aforementioned embodiment of the present application may be applied to the processor 200, or implemented by the processor 200.
[0116] The processor 200 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 200. The above processor 200 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a readily available programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 201, and the processor 200 reads the information in the memory 201 and completes the steps of the above method in combination with its hardware.
[0117] The electronic device provided in the embodiment of the present application and the method provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the method adopted, operated or implemented by them.
[0118] The present application also provides a computer-readable storage medium corresponding to the method provided in the above embodiment. Figure 5 The computer-readable storage medium shown is a CD 30 on which a computer program (ie, a program product) is stored. When the computer program is run by a processor, the method provided in any of the aforementioned embodiments is executed.
[0119] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical or magnetic storage media, which are not listed here one by one.
[0120] The computer-readable storage medium provided in the above-mentioned embodiments of the present application and the method provided in the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the method adopted, run or implemented by the application program stored therein.
[0121] It should be noted that:
[0122] The algorithm and display provided herein are not inherently related to any particular computer, virtual device or other equipment. Various general purpose devices can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for this type of device. In addition, the application is not directed to any specific programming language. It should be understood that the content of the application described herein can be realized using various programming languages, and the description of the specific language above is to disclose the best mode of implementation of the application.
[0123] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0124] Similarly, it should be understood that in order to streamline the present application and help understand one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present application, the various features of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be interpreted as reflecting the following intention: the claimed application requires more features than the features clearly stated in each claim. More specifically, as reflected in the claims below, the inventive aspects are less than all the features of the single embodiment disclosed above. Therefore, the claims following the specific embodiment are hereby expressly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the present application.
[0125] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0126] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present application and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0127] The various component embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components in the creation device of the virtual machine according to the embodiment of the present application. The present application can also be implemented as a device or device program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0128] It should be noted that the above embodiments illustrate the present application rather than limit the present application, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets should not be constructed as a limitation to the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The present application may be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names.
[0129] The above is only a preferred specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
[0130] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the concept of the present invention, or directly / indirectly applied in other related technical fields are included in the patent protection scope of the present invention.
Claims
1. A weed location method, characterized in that: Applied to a weed locating device, the device comprises a plurality of main cameras and a plurality of auxiliary cameras, each auxiliary camera is provided with a laser, and the method comprises: The weed positioning model is called to identify the image acquired by the main camera in real time to obtain the coordinates of the weed detection frame; Verifying the weed detection frames, and selecting weed detection frames that pass the verification; Start the corresponding auxiliary camera according to each weed detection frame; The auxiliary camera image is acquired through the auxiliary camera, and the weed meristem is identified to generate the laser action coordinates; The calling of the weed positioning model to identify the image acquired in real time by the main camera to obtain the coordinates of the weed detection frame includes: Call the weight file of the weed positioning model to obtain the weight of the weed category to distinguish weeds from crops in the weed removal area, obtain the coordinates of the weed detection frame, and calculate the center coordinates of the detection frame based on the coordinates of the weed detection frame; The corresponding auxiliary camera is started according to each weed detection frame, including: The center coordinates of each detection frame in the main camera's field of view are calculated and brought into the field of view of each auxiliary camera, and the auxiliary camera corresponding to the center coordinates of each detection frame is started; The starting of the auxiliary camera corresponding to the center coordinates of each detection frame includes: When the center coordinates of the detection frame only exist in the field of view of a single auxiliary camera, start the single auxiliary camera; When the coordinates of the center of the detection frame exist in the fields of view of two auxiliary cameras at the same time, the auxiliary camera whose field of view center is closer to the center of the detection frame is started; The method of identifying weed meristems and generating laser action coordinates includes: Calling the weed positioning model to identify the meristem in the auxiliary camera image, and obtaining the center coordinates of the meristem; The center coordinates of the meristem are determined as the laser action coordinates of the laser corresponding to the auxiliary camera; Before calling the weed location model to identify the image acquired by the main camera in real time, the method further includes training the weed location model, which specifically includes the following steps: A main camera is used to take a number of images containing weeds of different categories at a set height, and the area where each type of weed is located and the area where the meristem corresponding to each type of weed is located in each image are marked, so as to complete the classification of each type of weed and the meristem corresponding to each type of weed; The data enhancement method is used to randomly rotate and scale the image to expand the data set, and the detect file of the neural network model is encapsulated as an interface, in which each type of weed and its corresponding meristem correspond to different categories in the interface; The expanded data set is input into the neural network model for training to obtain a weed location model, and a weight file is output.
2. The method according to claim 1, characterized in that Verifying the weed detection frame and selecting the weed detection frame that has passed the verification includes: The image captured by the main camera is converted from RGB color space to HSV color space to complete the segmentation of weeds, crops and background; Perform opening operation and connected area marking on the segmented image to obtain the maximum boundary area of several white areas: For the maximum boundary area of each white area, the distance between the center coordinates of the detection frame and the center coordinates of the white area is compared, and the weed detection frame whose distance meets the set conditions is determined as a weed detection frame that has passed the verification.
3. A weed locating system, characterized in that: The method of one of claims 1-2 is implemented in a weed locating device, the device comprising a plurality of main cameras and a plurality of auxiliary cameras, each auxiliary camera being provided with a laser, and the system comprising: A detection frame recognition module is used to call the weed positioning model to recognize the image acquired by the main camera in real time and obtain the coordinates of the weed detection frame; A detection frame verification module, used to verify the weed detection frame and select the weed detection frame that has passed the verification; Auxiliary camera start module, used to start the corresponding auxiliary camera according to each weed detection frame; The laser action coordinate module is used to obtain the auxiliary camera image through the auxiliary camera, identify the weed meristem, and generate the laser action coordinate.
4. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method according to any one of claims 1 to 2.
5. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and the computer-readable instructions can be executed by a processor to implement the method according to any one of claims 1-2.
