Method, device, electronic device and computer-readable storage medium for identifying seedling shortage
By converting the plot image into a binary image and identifying the planned planting area, the automatic identification and replanting of missing seedlings is realized, which solves the problem of high cost and low efficiency of manual inspection, and improves the degree of agricultural automation and farmland yield.
Patent Information
- Application Number
- CN202010537720.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-12
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-06-12
AI Technical Summary
In agriculture, the identification of missing seedlings currently mainly relies on manual inspection, resulting in high labor costs and low efficiency. The degree of automation is low, and it is impossible to effectively identify and replant, affecting farmland yields.
By converting the plot image into a binary image to be processed, the planned planting area is determined based on the target pixels and plant planting rows, the seedling-deficient area is identified, and a recommended operation path is generated for automatic replanting, realizing automated identification and replanting.
It can accurately identify the location of missing seedlings without manual participation, reduce labor costs, improve identification efficiency, and timely replant to avoid farmland yield reduction.
Smart Images

Figure CN111753687B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of agricultural technology, and in particular to a method and device for identifying missing seedlings, an electronic device and a computer-readable storage medium. Background Art
[0002] With the advancement of technology, the agricultural field has gradually entered the era of automation. However, the degree of automation in some sub-sectors of agriculture is still very low. Taking the identification of missing seedlings as an example, manual inspection is currently mainly used to determine the missing seedling area. Although manual inspection can ensure a certain degree of recognition accuracy, when the inspection area is large, the labor cost of manual inspection is quite high, and the operation efficiency is also low. Obviously, realizing automated missing seedling identification has become an important part of promoting the development of agricultural automation. Summary of the invention
[0003] In view of this, an object of the present invention is to provide a method, device, electronic device and computer-readable storage medium for identifying missing seedlings.
[0004] In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:
[0005] In a first aspect, an embodiment provides a method for identifying missing seedlings, the method comprising:
[0006] Converting the plot image to be identified as lacking seedlings into a binary image to be processed; wherein the binary image to be processed includes target pixel points assigned a first specific value, and the target pixel points correspond to pixel points in an image area where plants are presented in the plot image;
[0007] Based on the target pixel point and the first direction representing the planting direction of the plant, a planned planting area is determined in the binary image to be processed;
[0008] According to the distribution of the target pixel points in the planned planting area, the seedling-deficient area in the planned planting area is identified so as to mark the seedling-deficient area in the plot image.
[0009] In a second aspect, an embodiment provides a replanting method, which is applied to an operation device, and the method includes:
[0010] When a seedling-deficient area is identified according to the method provided in the first aspect, a recommended operation path is generated based on the identified seedling-deficient area; and automatic replanting operation is performed according to the recommended operation path.
[0011] In a third aspect, an embodiment provides a method for planning an operation route, the method comprising: planning an operation route on a seedling-deficient area identified by the method provided in the first aspect.
[0012] In a fourth aspect, an embodiment provides a spraying / sowing / harvesting operation method, which is applied to an operation equipment, and the method comprises: using the method provided in the first aspect to identify a seedling-deficient area, and marking the seedling-deficient area; when the operation equipment moves according to a planned operation route, comparing the real-time position with the seedling-deficient area to obtain a comparison result; if the comparison result is that the real-time position belongs to the seedling-deficient area, pausing the operation and continuing to move according to the planned operation route until the real-time position does not belong to the seedling-deficient area, and then restarting the operation.
[0013] In a fifth aspect, an embodiment provides a yield estimation method, the method comprising: identifying a seedling-deficient region using the method provided in the first aspect; determining the area of a seedling-existing region based on the seedling-deficient region; and calculating the yield of the region based on the area of the seedling-existing region.
[0014] In a sixth aspect, an embodiment provides a seedling shortage identification device, the seedling shortage identification device comprising:
[0015] A conversion module, used for converting the plot image to be identified as lacking seedlings into a binary image to be processed; wherein the binary image to be processed includes target pixel points assigned a first specific value, and the target pixel points correspond to the pixel points in the image area where the plants are presented in the plot image;
[0016] A determination module, configured to determine a planned planting area in the binary image to be processed based on the target pixel point and a first direction representing a planting row direction of the plants;
[0017] The recognition module is used to identify the seedling-deficient area in the planned planting area according to the distribution of the target pixel points in the planned planting area, so as to mark the seedling-deficient area in the plot image.
[0018] In a seventh aspect, an embodiment provides an electronic device, comprising a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement any method described in any of the aforementioned embodiments.
[0019] In an eighth aspect, an embodiment provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements a method as described in any one of the aforementioned embodiments.
[0020] Compared with the prior art, the missing seedlings identification method provided in the embodiment of the present invention converts the plot image into a binary image to be processed including target pixels assigned a first specific value, and the target pixels represent the pixels in the image area where the plants are presented in the plot image. Based on the target pixels and the first direction representing the planting direction of the plants, the planned planting area is determined in the binary image to be processed, and the ideal planting area is automatically identified. Finally, the missing seedlings area in the planned planting area is identified based on the target pixels. In this way, the location of the missing seedlings can be accurately determined, and the identification process does not require manual assistance, which reduces labor costs and improves recognition efficiency.
[0021] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 A schematic diagram of an electronic device provided by an embodiment of the present invention is shown.
[0024] Figure 2 One of the step flow charts of the method for identifying missing seedlings provided in an embodiment of the present invention is shown.
[0025] Figure 3 An example diagram of a plot image including a crop-planting area provided by an embodiment of the present invention is shown.
[0026] Figure 4 for Figure 3 The binary image to be processed corresponds to the plot image shown.
[0027] Figure 5 For Figure 4 Example map of planned planting areas identified in .
[0028] Figure 6 This is an example of a plot image with areas where seedlings are missing marked.
[0029] Figure 7 Shows Figure 2 Flowchart of sub-steps of step S101 in FIG.
[0030] Figure 8 Shows Figure 2 Flowchart of sub-steps of step S102 in FIG.
[0031] Fig. 9 An example diagram of the coordinate axes created on the binary image to be processed mentioned in step S102 - 1 is shown.
[0032] Fig.10 The second step flow chart of the method for identifying missing seedlings provided in an embodiment of the present invention is shown.
[0033] Fig.11 An example diagram of a binary image to be processed that meets the conditions after rotation and expansion is shown.
[0034] Fig.12 The third step flow chart of the method for identifying missing seedlings provided in an embodiment of the present invention is shown.
[0035] Fig.13 A schematic diagram of a seedling shortage identification device provided in an embodiment of the present invention is shown.
[0036] Icons: 100 - electronic device; 110 - memory; 120 - processor; 130 - communication module; 400 - seedling shortage identification device; 401 - conversion module; 402 - determination module; 403 - identification module; 404 - judgment module. DETAILED DESCRIPTION
[0037] The following will be combined with the accompanying 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. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0038] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.
[0039] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0040] The yield of crops is affected to a certain extent by the number of crop plants. Generally, the more plants there are in the same farmland, the greater the total yield. However, due to various reasons during the growth of crops, the actual number of surviving plants will decrease. If the location of missing seedlings cannot be discovered and replanted in time, the yield of the farmland will be reduced.
[0041] It is worth noting that before the present application was filed, the commonly used methods in the relevant technology included manual inspection of farmland and drone inspection of farmland. However, manual inspection of farmland has high labor costs and is time-consuming when the area of farmland is too large. In addition, although the areas with missing seedlings can be accurately found, it is also easy to miss some areas with missing seedlings due to negligence. When drones patrol farmland, it is necessary to manually check the farmland pictures fed back by the drones. Obviously, this method still requires human participation, and there will inevitably be human costs.
[0042] The seedling shortage identification method, device, electronic device and computer-readable storage medium provided in the present application can identify the planned planting area for expected planting in the binary image to be processed, and then compare the planned planting area with the area where plants actually exist, so as to obtain the seedling shortage area. Automatic identification of the seedling shortage area is achieved without the need for human participation, saving labor costs and being highly efficient.
[0043] Please refer to Figure 1, a block diagram of an electronic device 100 provided by an embodiment of the present invention is shown. The electronic device 100 described above may be, but is not limited to, a mobile device, a tablet computer, a laptop computer, etc., or any combination thereof. In some embodiments, the mobile device may include a wearable device, a smart mobile device, a virtual reality device, an augmented reality device, etc., or any combination thereof. In some embodiments, the wearable device may include a smart bracelet, a smart shoelace, a smart glass, a smart helmet, a smart watch, a smart clothing, a smart backpack, a smart accessory, etc., or any combination thereof. In some embodiments, the smart mobile device may include a smart phone, a personal digital assistant (PDA), etc., or any combination thereof. In some embodiments, the virtual reality device and / or the augmented reality device may include a virtual reality helmet, a virtual reality glass, a virtual reality patch, an augmented reality helmet, an augmented reality glass, or an augmented reality patch, etc., or any combination thereof. For example, the virtual reality device and / or the augmented reality device may include various virtual reality products, etc.
[0044] The electronic device 100 includes a memory 110, a processor 120, and a communication module 130. The memory 110, the processor 120, and the communication module 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0045] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, a random access memory 110 (RAM), a read only memory 110 (ROM), a programmable read-only memory 110 (PROM), an erasable programmable read-only memory 110 (EPROM), an electrically erasable read-only memory 110 (Electric Erasable Programmable Read-Only Memory 110 (EEPROM), etc.
[0046] The processor 120 is used to read / write data or programs stored in the memory 110 and execute corresponding functions.
[0047] The communication module 130 is used to establish a communication connection between the electronic device 100 and other communication terminals through the network, and to send and receive data through the network.
[0048] It should be understood that Figure 1 The structure shown is only a schematic diagram of the structure of the electronic device 100. The electronic device 100 may also include Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0049] Please refer to Figure 2 , Figure 2 FIG. 2 shows a method for identifying seedling shortage provided by an embodiment of the present invention. Figure 2 As shown, the above-mentioned seedling shortage identification method may include the following steps:
[0050] Step S101, converting the image of the plot to be identified as lacking seedlings into a binary image to be processed.
[0051] The plot image may be image data including a crop planting area. Optionally, the aerial photography data may include a complete crop planting area. Optionally, the aerial photography data may include multiple images, each of which presents a portion of the crop planting area, and the multiple aerial photography data can fully present the crop planting area.
[0052] The above-mentioned plot image can be collected by an image acquisition device, or can be obtained from monitoring video data. For example, the above-mentioned image acquisition device can be a drone, a high-altitude high-definition heavy-load camera, etc.
[0053] The pixels in the binary image to be processed are divided into two categories, one category of pixels is assigned a first specific value, and the other category of pixels is not assigned a first specific value. The pixels assigned the first specific value correspond to the pixels in the image area where the plants are presented in the plot image. It can be understood that there is a corresponding relationship between the binary image to be processed and the pixels with the same image coordinates in the plot image. For example, if the crop planting area is a sugarcane field, the pixels in the binary image to be processed that have the same image coordinates as the multiple pixels showing the sugarcane plants in the plot image are all assigned the first specific value.
[0054] The above-mentioned assigning of the first specific value to the pixel point may be to make the pixel point take the first specific value, or to adjust the grayscale state corresponding to the pixel point to the first specific value. As long as it can be distinguished from the pixel point that is not assigned the first specific value, the specific implementation method of the present invention is not limited.
[0055] Step S102, determining a planned planting area in the binary image to be processed based on the target pixel point and a first direction representing the planting direction of the plant.
[0056] The above-mentioned target pixel point is a pixel point assigned with a first specific value in the binary image to be processed. The above-mentioned plant planting row direction is the direction of the plant planting row. It can be understood that the radiation and lighting conditions in the crop planting area are different from those in the bare land, and the lighting conditions are important factors affecting the growth and development of crops. In order to improve the utilization rate of light energy of crop plants, crop plants are usually planted according to a certain row direction and row spacing so that there is no mutual occlusion between crop plants in different rows (that is, different plant planting rows). Under the trend of refined operations, in order to maximize the land utilization rate and increase production, crop plants will be planted according to the pre-planned ideal planting area, and the ideal planting area includes the area occupied by each planned plant planting row. On the whole, the planting position of the crop plant is within the ideal planting area. In addition, the direction of the plant planting row is also parallel to the central axis of the planned planting area. Therefore, using the first direction of the plant planting row and the target pixel point representing the position of the plant in the binary image to be processed, the planned planting area representing the ideal planting area can be determined in the binary image to be processed. Optionally, each plant planting row corresponds to a planned planting area, and the above-mentioned ideal planting area may correspond to multiple planned planting areas.
[0057] The above-mentioned planned planting area is the actual planting area divided by the user according to the planting habits, that is, the area where the user expects to plant crops. Ideally, the distribution density between the crops planted in the planned planting area must meet the specified requirements.
[0058] Step S103, identifying the seedling-deficient area in the planned planting area according to the distribution of the target pixel points in the planned planting area.
[0059] The ideal planting area is evenly planted with crop plants. At the same time, when creating the binary image to be processed, the target pixel points are used to represent the image area where the crop plants are actually shown in the plot image. Therefore, in theory, the planned planting area in the binary image to be processed is the target pixel point. However, due to missed planting, crop plants not surviving during the actual growth process, etc., there will be vacancies in the planned planting area, that is, the seedling-missing area. Therefore, in the embodiment of the present invention, the distribution of the target pixel points in the planned planting area can be used to reversely deduce the seedling-missing area in the planned planting area.
[0060] Finally, by using the corresponding relationship between the pixels of the plot image and the binary image to be processed, the determined seedling-deficient area is marked in the plot image to prompt relevant personnel to replant.
[0061] It can be seen that the missing seedling identification method provided by the embodiment of the present invention identifies the image area where the plant is located, and then uses the confirmed image area where the plant is located to analyze the ideal planting area, and finally obtains the missing seedling area based on the actual distribution of plants in the ideal planting area. The entire identification process does not require human intervention, saves a lot of manpower costs, and is time-saving. The larger the area of the crop planting area, the more obvious the advantage is compared with the manual inspection or drone inspection combined with manual identification used in the relevant technology.
[0062] In order to facilitate those skilled in the art to use the missing seedling identification method provided in the embodiment of the present invention, the missing seedling identification of a sugarcane field is taken as an example, as follows:
[0063] By using drones to take aerial photos of sugarcane fields, we can get Figure 3 The plot image shown shows a sugarcane field, and the dark pixels in the image are sugarcane plants. Figure 4 The binary image to be processed is shown in Figure 4 The pixel points in the black area are target pixel points. Based on the target pixel points in the binary image to be processed and the first direction representing the planting row direction, the planned planting area is determined. Figure 5 The figure shows the planned planting area corresponding to a plant planting row. Finally, according to the distribution of the target pixel points in the planned planting area, the seedling-deficient area in each planned planting area is determined, so that the seedling-deficient area can be marked in the plot image to remind relevant personnel to replant. The effect of marking the seedling-deficient area in the plot image can be shown as follows: Figure 6 shown.
[0064] The implementation details of the embodiment of the present invention are described below.
[0065] In some embodiments, the purpose of the above step S101 is to mark the location of the plant in the plot image. Figure 7 As shown, the above step S101 may include the following sub-steps:
[0066] Sub-step S101 - 1 , identifying an image area showing plants in a plot image.
[0067] In some embodiments, an image region showing crop plants can be identified from a plot image by using image recognition technology. For example, the image region showing crop plants is determined as a region of interest, and a deep learning model capable of identifying crop plants is used for recognition to obtain an image region showing plants in the plot image.
[0068] In some other embodiments, specific parameters extracted from the plot image can be used to distinguish pixel points in the plot image that belong to the image area showing crop plants. The above specific parameters can be, but are not limited to, color space (such as RGB to HSV), color index, vegetation index, etc. The following uses the super green index as an example to describe how to use the specific parameters extracted from the plot image to distinguish pixel points in the image area showing crop plants in the plot image: First, the super green index calculation formula is used:
[0069] ExG = 2Green-Red-Blue;
[0070] The super green index corresponding to each pixel in the plot image is calculated in sequence. Among them, ExG represents the super green index; Green represents the value corresponding to the green color channel of the pixel, Red represents the value corresponding to the red color channel of the pixel, and Blue represents the value corresponding to the blue color channel of the pixel.
[0071] Then, it is determined that the pixel points whose super green index exceeds the preset value belong to the image area showing the plants, thereby determining the image area showing the plants.
[0072] It can be understood that the implementation of the above sub-step S101-1 using the deep learning network not only has a fast recognition speed, but also has an accurate recognition result. In addition, the above sub-step S101-1 is implemented using specific parameters, which occupies less system resources during the execution process and is simple and fast to implement. Therefore, those skilled in the art can choose a suitable way to implement the above sub-step S101-1 according to actual conditions.
[0073] Sub-step S101 - 2 , assigning a first specific value to the pixel points in the image area showing the plant.
[0074] In some embodiments, the value of the pixel points in the image region showing the plant can be changed to a first specific value. For example, the value of the pixel points in the image region showing the plant is determined to be 1. In other embodiments, the grayscale state of the pixel points in the image region showing the plant can be adjusted to the first specific value. For example, the grayscale state of the pixel points in the image region showing the plant is adjusted to 255.
[0075] Sub-step S101 - 3 , assigning a second specific value to the pixel points in the image area where no plant is shown, so as to generate a binary image to be processed.
[0076] It can be understood that by obtaining an image area where plants are presented, it is possible to obtain an image area where plants are not presented. In order to more conveniently distinguish between an image area where plants are presented and an image area where plants are not presented, the pixels in the image area where plants are not presented can be assigned a second specific value. In some embodiments, the values of the pixels in the image area where plants are presented can be changed to a second specific value. For example, the values of the pixels in the image area where plants are presented are determined to be 0. In other embodiments, the grayscale state of the pixels in the image area where plants are presented can also be adjusted to a second specific value. For example, the grayscale state of the pixels in the image area where plants are presented is adjusted to 0.
[0077] Through the above sub-steps S101 - 2 and S101 - 3, it is possible to generate a corresponding binary image to be processed based on the land plot image.
[0078] In the embodiment of the present invention, the purpose of the above step S102 is to determine the image area corresponding to the ideal planting area (ie, the planned planting area) from the binary image to be processed.
[0079] In some embodiments, Figure 8 As shown, the above step S102 may include the following sub-steps:
[0080] Sub-step S102-1, establishing a coordinate axis perpendicular to the first direction.
[0081] for example, Fig. 9 As shown in , the first direction characterizing the planting direction of the plants is direction a, and therefore, a coordinate axis perpendicular to direction a, coordinate axis b, can be established.
[0082] Sub-step S102-2, counting the number of target pixel points in the pixel point column corresponding to each position point on the coordinate axis.
[0083] The above-mentioned position points may be points on a coordinate axis.
[0084] The above-mentioned pixel point column can be a set composed of multiple pixel points. The arrangement direction of the pixels belonging to the same pixel point column in the binary image to be processed is parallel to the first direction. In addition, all pixels whose arrangement direction is parallel to the first direction between the same pixel point in the binary image to be processed are in the same pixel point column. In order to facilitate the understanding of those skilled in the art, the pixel point column is explained with two examples below: Example 1, when the first direction is the vertical direction, the pixel points located in the same column in the pixel point array corresponding to the binary image to be processed belong to the same pixel point column, that is, all pixels satisfying the image coordinates of (i, 1) belong to the same pixel point column, and the pixel points satisfying the image coordinates of (i, 2) belong to the same pixel point column, and so on. It should be noted that i can be any value between 1 and the maximum row number of the pixel point array. Example 2, the angle between the first direction and the horizontal direction is 45°. Assuming that the pixel array of the binary image to be processed is a 300*300 array, the pixels with image coordinates (1,1), (2,2)…(300,300) belong to the same pixel column, the pixels with image coordinates (2,1), (3,2)…(300,299) belong to the same pixel column, and the pixels with image coordinates (1,2), (2,3)…(299,300) belong to the same pixel column.
[0085] Based on the above, the pixel point column related to the position point may be a pixel point column having a pixel point that coincides with the position point, or a pixel point column in which an extension line of a straight line formed by the included pixel points intersects with the position point.
[0086] In the embodiment of the present invention, the number of target pixels included in the pixel column corresponding to each position point is counted. Optionally, the number of corresponding target pixels can be determined by counting the number of pixels assigned the first specific value in the pixel column.
[0087] Sub-step S102-3, generating a cumulative curve according to the position points on the coordinate axis and the number of corresponding target pixel points.
[0088] Optionally, the abscissa of the obtained cumulative curve is the position point on the above coordinate axis, and the ordinate is the number of target pixel points corresponding to the position point.
[0089] Sub-step S102-4, determining the planned planting area according to the cumulative curve.
[0090] The above-mentioned cumulative curve can characterize the distribution of target pixel points in the first direction, that is, the distribution of plants in the planting row upward in the actual space. At the same time, during the planting process, the crop plants are planted as a whole in the ideal planting area. In general, there are more target pixel points in the planned planting area than in other locations. Therefore, the position of the planned planting area in the binary image to be processed can be determined based on the peaks in the cumulative curve.
[0091] Based on the above principles, in some embodiments, the above sub-step S102-4 can be implemented as follows:
[0092] (1) Obtain the peak vertex and peak width corresponding to at least one peak from the cumulative curve.
[0093] In some embodiments, all the peaks may be identified from the cumulative curve, and the corresponding peak vertices and peak widths may be obtained. Optionally, the above method of identifying the peaks from the cumulative curve may be to determine whether it is a peak based on the angle between the tangent of each point of the cumulative curve and the first direction. For example, if the change trend of the angle between the tangent corresponding to the continuous multiple points in the cumulative curve and the first direction satisfies: first changing from less than 90° to equal to 90°, and then changing from equal to 90° to less than 90°, then it is determined that the continuous multiple points constitute a peak of the cumulative curve.
[0094] In some embodiments, the above-mentioned acquisition of the peak vertex and peak width corresponding to at least one peak can also be implemented by using scipy.signal.find_peaks and other similar methods.
[0095] (2) Determine the central axis corresponding to each crest based on the crest vertices and the first direction corresponding to each crest. Optionally, a straight line passing through the crest fixed point and parallel to the first direction may be determined as the central axis corresponding to the crest.
[0096] (3) Based on the central axis corresponding to the wave crest and the wave crest width, at least one planned planting area is determined.
[0097] In the embodiment of the present invention, the peak width is used as the width of the planned planting area, and the rectangular planned planting area is determined in the binary image to be processed along the central axis. Each peak corresponds to a pair of central axes and peak widths, so the corresponding number of planned planting areas can be obtained according to the identified peaks.
[0098] In some embodiments, in order to reduce the existence of errors, before determining the planned planting area based on the cumulative curve, the above step S102 may also include: smoothing the cumulative curve.
[0099] The purpose of the above-mentioned smoothing process is to realize denoising of the accumulated curve. Based on the above-mentioned purpose, the implementation of the above-mentioned smoothing process of the accumulated curve can be, but is not limited to, denoising after moving average, denoising after Univariate Spline fitting, and denoising after Savitzky_Golay Filter smoothing. The denoising includes but is not limited to correcting the value of negative numbers after Savitzky_GolayFilter smoothing.
[0100] For ease of processing, in some embodiments, Fig.10 As shown, in Figure 2 The method for identifying missing seedlings further comprises the following steps:
[0101] S201, rotating the binary image to be processed until a first direction representing the planting row direction of the plants in the binary image to be processed coincides with the vertical direction.
[0102] S202, expanding the rotated binary image to be processed into a preselected shape to obtain a binary image to be processed that meets the conditions.
[0103] It can be understood that the binary image to be processed that is expanded into the preselected shape is the binary image to be processed that meets the conditions. The pixels in the binary image to be processed that meets the conditions and belongs to the expanded image area are assigned the second specific value. Fig.11 As shown, after the land plot image is binarized, it is rotated and expanded into a square, and the pixels in the expanded image area are assigned a second specific value. It should be noted that Fig.11 In the binary image to be processed that meets the conditions, the black area is the pixel point assigned the second specific value, and the white area is the pixel point assigned the first specific value.
[0104] exist Fig.10 In the missing seedling identification method shown, the bottom edge of the binary image to be processed that meets the conditions is perpendicular to the bottom edge of the binary image to be processed, so the bottom edge of the binary image to be processed can be determined as the coordinate axis established in step S102. In this way, when counting the number of target pixels in the pixel point column corresponding to each position point on the coordinate axis, each column of pixels in the binary image to be processed that meets the conditions can be regarded as a pixel point column, and at this time, the pixel point column corresponding to the position point is a pixel point column containing pixels that coincide with the position point.
[0105] Based on the above description, it can be known that the first direction is critical to obtain an accurate planned planting area. In some embodiments, the first direction can be manually marked in the binary image to be processed.
[0106] In some other embodiments, the first direction can also be automatically identified. Figure 2 The method for identifying missing seedlings further comprises the following steps:
[0107] Step S301, identifying a first direction from a binary image to be processed.
[0108] In some embodiments, Fig.12 As shown, the above step S301 may include the following sub-steps:
[0109] Sub-step S301 - 1 , performing Hough transform processing on the binary image to be processed to obtain a plurality of straight line parameters and corresponding accumulated values.
[0110] In an embodiment of the present invention, the process of the above-mentioned Hough transform processing can be to first convert the binary image to be processed into the Hough space in the polar coordinate system, and then obtain the identified straight line parameters and the accumulated values corresponding to the straight line parameters from the accumulator of the Hough space. The straight line parameters can characterize the straight line formed by the target pixel points in the binary image to be processed. For example, after the binary image to be processed is subjected to Hough transform processing, a straight line list can be obtained, in which each entry in the list has a straight line parameter (for example, the straight line direction angle and radius of the straight line in the polar coordinate system), and each straight line parameter also corresponds to this accumulated value.
[0111] Sub-step S301 - 2 , determining the target straight line direction angle according to the straight line parameters and the accumulated value.
[0112] In some embodiments, the above-mentioned straight line parameters may be composed of a straight line direction angle and a radius. Of course, in other embodiments, they may also be composed of a slope and a radius. The following takes the straight line parameters composed of a straight line direction angle and a radius as an example to illustrate sub-step S301-2. Of course, it can be understood that no matter what form the straight line parameters exist in, the principle of the above-mentioned step S301-2 is the same, and it will not be repeated. The details are as follows:
[0113] In some embodiments, the above sub-step S301-2 includes:
[0114] S301-2-1, when the number of line parameters does not exceed the preset first value, the line direction angle of the line parameter with the largest corresponding cumulative value is determined as the target line direction angle. For example, when the number of items in the obtained line list does not exceed the preset 20, the line direction angle recorded in the item with the largest corresponding cumulative value is determined as the target line direction angle.
[0115] S301-2-2: When the number of straight line parameters exceeds the first value, count the number of occurrences of different straight line direction angles based on all straight line parameters.
[0116] For example, according to the straight line list, straight line parameters (θ1, r1), straight line parameters (θ1, r2), straight line parameters (θ2, r3), and straight line parameters (θ1, r3), the above θ1 and θ2 are different straight line direction angles. Based on the above statistics, the number of occurrences of θ1 in the straight line list is 3, and the number of occurrences of θ2 is 1.
[0117] In the embodiment of the present invention, there is no necessary order between the above S301-2-1 and S301-2-2, and the two are in a parallel relationship. After obtaining the number of occurrences corresponding to different straight line direction angles, the process enters step S301-2-3.
[0118] S301-2-3, determining the straight line direction angle with the highest number of occurrences as the target straight line direction angle.
[0119] In some possible scenarios, when there are multiple straight direction angles with the largest number of occurrences, the target straight direction angle can also be selected by combining the corresponding accumulated values. For example, the accumulated values corresponding to the straight line parameters with the same straight direction angle are superimposed to obtain statistical values, and then the one with the largest corresponding statistical value is selected from the straight direction angles with the largest number of occurrences, and is determined as the target straight direction angle.
[0120] Sub-step S301-3, determining a first direction according to the target straight line direction angle.
[0121] In some embodiments, the direction represented by the target straight line direction angle is used as the first direction.
[0122] In some embodiments, the purpose of the above step S103 is to distinguish between areas with surviving plants and areas without surviving plants in the ideal planting area.
[0123] As a real-time method, the above step S103 may include:
[0124] First, a mask image is created based on the value assigned to the target pixel and the planned planting area determined. The mask image is also a binary image, and the image size is the same as the binary image to be processed. Optionally, the created mask image has an image area corresponding to the planned planting area, and the pixel points in the image area are assigned the value of the target pixel points, that is, the first specific value, and other image areas are assigned the second specific value.
[0125] Secondly, the mask image and the binary image to be processed are XORed.
[0126] In some embodiments, the mask image is XORed with the binary image to be processed to determine the seedling-deficient area in the planned planting area of the binary image to be processed. The seedling-deficient area is then mapped to the plot image and marked to remind relevant personnel to replant according to the identified seedling-deficient area. The whole process is time-consuming and the labor cost required is almost zero. In some scenarios, the seedling-deficient area can also be detected in a timely and autonomous manner, effectively avoiding a reduction in production due to failure to replant in time.
[0127] In order to execute the corresponding steps in the above embodiments and various possible methods, a method for implementing the missing seedling identification device 400 is given below. Optionally, the missing seedling identification device 400 can adopt the above Figure 1 The device structure of the electronic device 100 is shown. Fig.13 , Fig.13A functional module diagram of a seedling shortage identification device 400 provided in an embodiment of the present invention. It should be noted that the basic principle and technical effects of the seedling shortage identification device 400 provided in this embodiment are the same as those of the above-mentioned embodiments. For the sake of brief description, for parts not mentioned in this embodiment, reference can be made to the corresponding contents in the above-mentioned embodiments. The seedling shortage identification device 400 includes: a conversion module 401, a determination module 402, an identification module 403 and a judgment module 404.
[0128] The above-mentioned conversion module 401 is used to convert the plot image with missing seedlings to be identified into a binary image to be processed; wherein the binary image to be processed includes target pixel points assigned a first specific value, and the target pixel points correspond to the pixel points in the image area where plants are presented in the plot image.
[0129] In some embodiments, the above step S101 may be performed by the conversion module 401 .
[0130] The determination module 402 is used to determine the planned planting area in the binary image to be processed based on the target pixel point and the first direction representing the planting row direction of the plant. Specifically, the conversion module 401 is also used to: identify the image area where the plant is presented in the plot image; assign the first specific value to the pixel points belonging to the image area where the plant is presented; assign the second specific value to the pixel points belonging to the image area where the plant is not presented, so as to generate the binary image to be processed.
[0131] In some embodiments, the above step S102 may be performed by the determination module 402. Optionally, the determination module 402 includes: an establishment submodule, a statistics submodule, a generation submodule and a first determination submodule.
[0132] In some embodiments, the establishing submodule is used to establish a coordinate axis perpendicular to the first direction.
[0133] In some embodiments, the statistical submodule is used to count the number of target pixel points in the pixel point column corresponding to each position point on the coordinate axis; wherein the arrangement direction of the pixel points of the same pixel point column in the binary image to be processed is parallel to the first direction.
[0134] In some embodiments, the generating submodule is used to generate a cumulative curve according to the position points on the coordinate axis and the number of corresponding target pixel points.
[0135] In some embodiments, the first determination submodule is used to determine the planned planting area based on the cumulative curve. Optionally, the first determination submodule is used to: obtain the peak vertex and peak width corresponding to at least one peak from the cumulative curve; determine the central axis corresponding to each peak based on the peak vertex and the first direction corresponding to each peak; determine at least one planned planting area based on the central axis and peak width corresponding to the peak.
[0136] The identification module 403 is used to identify the seedling-deficient area in the planned planting area according to the distribution of the target pixel points in the planned planting area, so as to mark the seedling-deficient area in the plot image.
[0137] In some embodiments, the above step S103 may be performed by the identification module 403 .
[0138] The above-mentioned determination module 404 is used to identify the first direction from the binary image to be processed.
[0139] In some embodiments, the above step S301 may be performed by the determination module 404 .
[0140] In some embodiments, the determination module 404 may include a transformation submodule, a selection submodule and a second determination submodule.
[0141] The transformation submodule is used to perform Hough transformation on the binary image to be processed to obtain a plurality of straight line parameters and corresponding accumulated values; wherein the straight line parameters are used to characterize the straight line identified from the binary image to be processed.
[0142] The selection submodule is used to determine the target straight line direction angle according to the straight line parameters and the accumulated value.
[0143] The second determination submodule is used to determine the first direction according to the target straight line direction angle.
[0144] Optionally, the above modules can be stored in the form of software or firmware. Figure 1 The memory 110 shown in the figure may be fixed in the operating system (OS) of the electronic device 100 and may be Figure 1 Meanwhile, the data and program codes required for executing the above modules may be stored in the memory 110.
[0145] In addition, a replanting method is also provided in some other embodiments of the present invention. The above-mentioned replanting method can be applied to operating equipment. Optionally, the above-mentioned replanting method includes: when the existing seedling-deficient area is identified according to the seedling-deficient identification method provided in the above-mentioned embodiment, a recommended operating path is generated based on the identified seedling-deficient area. Automatic replanting operations are performed according to the recommended operating path. In some embodiments, after the user determines to use the above-mentioned recommended operating path, the operating equipment automatically performs the replanting operation according to the above-mentioned recommended operating path.
[0146] Some other embodiments of the present invention also provide a work route planning method, which includes: planning a work route based on the seedling-deficient area identified by the seedling-deficient identification method provided in the aforementioned embodiment, so that the planned work path avoids the seedling-deficient area as much as possible to reduce unnecessary work.
[0147] In some other embodiments of the present invention, a spraying / sowing / harvesting operation method is also provided, which is applied to operation equipment. Optionally, the above method includes: using the seedling shortage identification method provided in the above embodiment to determine the seedling shortage area and mark the seedling shortage area; when the operation equipment moves according to the planned operation route, the real-time position is compared with the seedling shortage area to obtain a comparison result; if the comparison result is that the real-time position belongs to the seedling shortage area, the operation is suspended and continues to move according to the planned operation route until the real-time position does not belong to the seedling shortage area and restarts the operation. It can be understood that the above-mentioned spraying / sowing / harvesting are actually the operation modes of the operation equipment, so the operation mentioned in this embodiment can be any one of spraying / sowing / harvesting. Specifically, as a spraying method, the operation mentioned in this embodiment is a spraying operation, and the above-mentioned spraying method is used to achieve high-efficiency spraying operation to avoid waste; as a sowing method, the operation mentioned in this embodiment is a sowing operation, and the above-mentioned sowing method is used to efficiently utilize the land while avoiding the original crop planting position from being occupied. As a harvesting method, the operation mentioned in this embodiment is a harvesting operation, which improves harvesting efficiency and energy consumption.
[0148] Some other embodiments of the present invention also provide a yield estimation method. Optionally, the above method includes: using the seedling shortage identification method provided in the above embodiment to determine the seedling shortage area; determining the area of the seedling area according to the seedling shortage area; and calculating the regional yield according to the area of the seedling area. For example, the yield values of different seedling areas are calculated based on the area and unit yield of each seedling area, and then the yield values of all areas are superimposed to obtain the final regional yield. It can be understood that the above seedling area is the plot area in the planned planting area except the seedling shortage area.
[0149] In summary, the embodiments of the present invention provide a method, device, electronic device and computer-readable storage medium for identifying missing seedlings. The missing seedlings identification method includes converting a plot image into a binary image to be processed; the binary image to be processed includes target pixels assigned a first specific value, and the target pixels correspond to pixels in an image region where plants are presented in the plot image; based on the target pixels and a first direction representing the planting direction of the plants, a planned planting region is determined in the binary image to be processed; based on the distribution of the target pixels in the planned planting region, the missing seedling region in the planned planting region is identified so as to mark the missing seedling region in the plot image. The embodiments of the present invention realize accurate determination of the location of missing seedlings, and the identification process does not require manual assistance, which reduces labor costs and improves identification efficiency.
[0150] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0151] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0152] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0153] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0154] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention. It should be noted that similar numbers and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0155] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for identifying seedling shortage, characterized in that: The seedling shortage identification method comprises: Converting the plot image to be identified as lacking seedlings into a binary image to be processed; wherein the binary image to be processed includes target pixel points assigned a first specific value, and the target pixel points correspond to pixel points in an image area where plants are presented in the plot image; Establishing a coordinate axis perpendicular to a first direction; the first direction is used to characterize the planting row direction of the plants; Counting the number of the target pixel points in the pixel point column corresponding to each position point on the coordinate axis; wherein the arrangement direction of the pixel points of the same pixel point column in the binary image to be processed is parallel to the first direction; Generate a cumulative curve according to the position points on the coordinate axis and the number of corresponding target pixel points; Obtaining a peak vertex and a peak width corresponding to at least one peak from the cumulative curve; Determine the central axis corresponding to each of the wave crests according to the wave crest vertices corresponding to each of the wave crests and the first direction; Determining at least one planned planting area based on the central axis and the peak width corresponding to the peak; According to the distribution of the target pixel points in the planned planting area, the seedling-deficient area in the planned planting area is identified so as to mark the seedling-deficient area in the plot image.
2. The method for identifying missing seedlings according to claim 1, characterized in that: Before determining the planned planting area according to the accumulated curve, the step of determining the planned planting area in the binary image to be processed based on the target pixel point and the first direction representing the planting direction of the plant includes: The accumulated curve is smoothed.
3. The method for identifying missing seedlings according to claim 1, characterized in that: Before determining the planned planting area in the binary image to be processed based on the target pixel point and the first direction representing the planting row direction of the plants, the missing seedling identification method further includes: Rotating the binary image to be processed until the first direction representing the planting row direction of the plants in the binary image to be processed coincides with the vertical direction; The rotated binary image to be processed is expanded into a preselected shape to obtain a binary image to be processed that meets the conditions; wherein the pixel points belonging to the expanded image area in the binary image to be processed that meets the conditions are assigned a second specific value.
4. The method for identifying missing seedlings according to claim 1, characterized in that: The step of converting the image of the plot of land to be identified as lacking seedlings into a binary image to be processed comprises: identifying an image region in the plot image where the plant is present; Assigning the first specific value to the pixel points belonging to the image area showing the plant; The pixel points in the image area where the plant is not shown are assigned a second specific value to generate the binary image to be processed.
5. The method for identifying missing seedlings according to claim 1, characterized in that: The missing seedling identification method further includes: identifying the first direction from the binary image to be processed; the step of identifying the first direction from the binary image to be processed includes: Performing Hough transform processing on the binary image to be processed to obtain a plurality of straight line parameters and corresponding accumulated values; wherein the straight line parameters include a straight line direction angle; Determining a target straight line direction angle from the straight line direction angles of the straight line parameters according to the straight line parameters and the accumulated value; The first direction is determined according to the target straight line direction angle.
6. The method for identifying missing seedlings according to claim 5, characterized in that: The step of determining the target straight line direction angle from the straight line direction angle of the straight line parameter according to the straight line parameter and the accumulated value comprises: When the number of the straight line parameters does not exceed a preset first value, determining the straight line direction angle of the straight line parameter with the largest corresponding accumulated value as the target straight line direction angle; When the number of the straight line parameters exceeds the first value, counting the number of occurrences of different straight line direction angles based on all the straight line parameters; The straight line direction angle with the highest number of occurrences is determined as the target straight line direction angle.
7. The method for identifying missing seedlings according to claim 1, characterized in that: The step of identifying the seedling-deficient area in the planned planting area according to the distribution of the target pixel points in the planned planting area comprises: Creating a mask map based on the value assigned to the target pixel point and the determined planned planting area; wherein the value assigned to the pixel point in the image area corresponding to the planned planting area in the mask map is the value assigned to the target pixel point; The mask image and the binary image to be processed are subjected to XOR processing to obtain the seedling-deficient area.
8. A method for replanting, characterized in that: Applied to operating equipment, the method comprises: When the seedling-deficient area is identified according to the method according to any one of claims 1 to 7, a recommended operation path is generated based on the identified seedling-deficient area; Automatic replanting operation is performed according to the recommended operation path.
9. A method for planning an operation route, characterized in that: The method comprises: Plan an operation route on the seedling-deficient area identified by the method described in any one of claims 1 to 7.
10. A spraying / scattering / harvesting method, characterized in that: Applied to operating equipment, the method comprises: The method according to any one of claims 1 to 7 is used to identify the seedling-deficient area, and the seedling-deficient area is marked; When the operation equipment moves according to the planned operation route, the real-time position is compared with the seedling-deficient area to obtain a comparison result; If the comparison result is that the real-time position belongs to the seedling-deficient area, the operation is suspended and the movement continues according to the planned operation route until the real-time position does not belong to the seedling-deficient area, and the operation is restarted.
11. A method for calculating production, characterized in that: The method comprises: Identify the seedling-deficient area by the method according to any one of claims 1 to 7; Determine the area of the area with seedlings according to the area lacking seedlings; According to the area of the seedling area, the corresponding regional yield is calculated.
12. A device for identifying missing seedlings, characterized in that: The seedling shortage identification device comprises: A conversion module, used for converting the plot image to be identified as lacking seedlings into a binary image to be processed; wherein the binary image to be processed includes target pixel points assigned a first specific value, and the target pixel points correspond to the pixel points in the image area where the plants are presented in the plot image; An establishment submodule is used to establish a coordinate axis perpendicular to the first direction; A statistical submodule, used for counting the number of target pixel points in a pixel point column corresponding to each position point on the coordinate axis; wherein the arrangement direction of the pixel points of the same pixel point column in the binary image to be processed is parallel to the first direction; A generating submodule, used for generating a cumulative curve according to the position points on the coordinate axis and the number of corresponding target pixel points; A first determination submodule is used to obtain a peak vertex and a peak width corresponding to at least one peak from the cumulative curve; determine a central axis corresponding to each peak according to the peak vertex and the first direction corresponding to each peak; and determine at least one planned planting area based on the central axis and the peak width corresponding to the peak; The recognition module is used to identify the seedling-deficient area in the planned planting area according to the distribution of the target pixel points in the planned planting area, so as to mark the seedling-deficient area in the plot image.
13. The seedling shortage identification device according to claim 12, characterized in that: The conversion module is used for: identifying an image region in the plot image where the plant is present; Assigning the first specific value to the pixel points belonging to the image area showing the plant; The pixel points in the image area where the plant is not shown are assigned a second specific value to generate the binary image to be processed.
14. The seedling shortage identification device according to claim 12, characterized in that: The seedling shortage identification device further includes a judgment module for identifying the first direction from the binary image to be processed; the judgment module includes: A transformation submodule, used for performing Hough transformation on the binary image to be processed to obtain a plurality of straight line parameters and corresponding accumulated values; wherein the straight line parameters are used to characterize the straight line identified from the binary image to be processed; A selection submodule, for determining a target straight line direction angle from the straight line direction angles of the straight line parameters according to the straight line parameters and the accumulated value; The second determination submodule is used to determine the first direction according to the target straight line direction angle.
15. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement any one of the methods of claims 1-11.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.
Citation Information
Patent Citations
A crop seedling situation and seedling situation collecting and analyzing method and device
CN109886094A
