Method and equipment for automatically dividing crop breeding plots
Through technical means such as image splicing and binary processing, crop breeding communities are automatically divided, which solves the problem of time-consuming and labor-intensive division of breeding communities and poor division of segmentation in the existing technology, and achieves efficient and accurate division of breeding communities.
Patent Information
- Application Number
- CN202411166188.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-13
AI Technical Summary
The existing technology cannot automatically divide crop breeding communities, resulting in a lot of time and energy required during the breeding process. The automatic or semi-automatic image processing methods are interfered by factors such as the heterospectral and heterospectral of surrounding land objects, and the segmentation effect is poor.
Using technical means such as image stitching, binary processing, downsampling, window traversal, threshold determination and segmentation line extraction, binary images are generated through image processing, crop, translate and segment breeding cells, and use specific formulas and algorithms to determine the segmentation points and Dividing line to automatically divide breeding communities.
The automated division of crop breeding communities has been realized, the efficiency and accuracy of the breeding process has been improved, the problem of time-consuming and labor-consuming manual division has been solved, and the risk of interference with the segmentation effect has been reduced.
Smart Images

Figure CN119131057A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image processing, and in particular to a method and device for automatically dividing crop breeding plots. Background Art
[0002] Breeding plays a key role in the agricultural sector and is important for increasing crop yields and farmers' incomes. Before introducing new varieties, small-scale breeding yield testing is an essential step. Such testing can assess the adaptability and potential performance of new varieties, providing a solid foundation for their wider planting range.
[0003] Dividing the breeding area into several plots helps to monitor and manage the growth of crops in more detail. By accurately observing each plot, various problems that may affect crop growth can be discovered and solved in a timely manner, thereby maximizing yield and quality. At the same time, this kind of plot division also facilitates the collection and analysis of crop information, providing valuable data support for breeding work.
[0004] In addition to monitoring crop growth, plot division can also provide reliable data basis for monitoring the emergence rate and standardized management of breeding areas. Through refined management, various variables in the breeding process can be more effectively controlled to ensure the steady progress of breeding work.
[0005] At present, the cell division method mainly relies on manual visual interpretation. Although this method has high accuracy, the process requires a lot of time and effort. In addition, some automatic or semi-automatic image processing methods, such as image binarization or multi-scale segmentation, although they have certain potential in theory, are interfered by factors such as the same object with different spectra and the same spectrum with different objects in the surrounding ground objects in actual applications, resulting in unsatisfactory segmentation results and unable to meet actual needs. Summary of the invention
[0006] In view of this, an object of the present invention is to provide a method and device for automatically dividing crop breeding plots, so as to overcome the problem that crop breeding plots cannot be automatically divided at present.
[0007] To achieve the above objectives, the present invention adopts the following technical solutions:
[0008] On the one hand, the present application provides a method for automatically dividing crop breeding plots, comprising:
[0009] Collecting plot images, and stitching the plot images using image stitching software;
[0010] Determining the area to be divided in the spliced land image;
[0011] Binarization is performed on the stitched land image to generate a binary image;
[0012] Cutting out a plot image from the binary image according to the plot boundary, and translating the plot image so that the plot has a rectangular shape;
[0013] Determine segmentation points based on all the plot images;
[0014] A dividing line is determined according to the dividing point, and the breeding plot is divided according to the dividing line.
[0015] Furthermore, in the above method, the step of binarizing the stitched land image to generate a binary image includes:
[0016] The spliced land image is processed according to the formulas ExG=2×GRB and SUM=R+G+B to obtain an im_ExG single-band image and an im_SUM single-band image;
[0017] Obtain the pixel size and target pixel size of the im_ExG single-band image and the im_SUM single-band image;
[0018] Determine the first window size according to the ratio of the pixel size of the im_ExG single-band image to the target pixel size;
[0019] According to the first window size, the im_ExG single-band image is divided into a plurality of small squares with a side length of the first window size, wherein the small square is a pixel after downsampling, the center of the small square is the position of the pixel, and the average value of the pixels in the small square is the pixel value, thereby completing the downsampling of the im_ExG single-band image;
[0020] Determine the second window size according to the ratio of the pixel size of the im_SUM single-band image to the target pixel size;
[0021] According to the second window size, the im_SUM single-band image is divided into a plurality of small squares with a side length of the second window size, wherein the small square is a pixel after downsampling, the center of the small square is the position of the pixel, and the average value of the pixels in the small square is the pixel value, thereby completing the downsampling of the im_SUM single-band image;
[0022] Use a 21×21 window to traverse the downsampled im_ExG single-band image and the im_SUM single-band image respectively, and calculate the difference between the center pixel value and the mean value of all pixels in the 21×21 window as the new center pixel value;
[0023] Determine the threshold of the im_ExG single-band image according to the proportion of green pixels, and determine the candidate green pixels according to the threshold of the im_ExG single-band image;
[0024] Determine the threshold of the im_SUM single-band image according to the proportion of brightness pixels, and determine the bright pixels according to the threshold of the im_SUM single-band image;
[0025] Determine green pixels in the im_ExG single-band image and the im_SUM single-band image according to the candidate green pixels and the bright pixels;
[0026] A binary image is generated according to the im_ExG single-band image and the im_SUM single-band image after determining the green pixels.
[0027] Furthermore, in the above method, the step of cutting out the plot image from the binary image according to the plot boundary and translating the plot image so that the plot has a rectangular shape includes:
[0028] Cutting out the plot image from the binary image according to the plot boundary;
[0029] Determine the translation mode of the land plot image according to the row and column coordinates of the north corner point and the row and column coordinates of the west corner point of the land plot image;
[0030] The land parcel image is translated according to the translation mode so that the land parcel has a rectangular shape.
[0031] Furthermore, in the above method, determining the segmentation points according to all the land plot images includes:
[0032] Using a matrix of size 81×5 to traverse and sum the translated plot image, and determining the green pixels of the plot image after summation according to a preset threshold value T1;
[0033] Dividing the land plot image after determining the green pixels into a preset number of image strips;
[0034] Determine the column coordinates of the gap points in each row of each of the image strips according to the green pixels;
[0035] Determine the distance between two adjacent gap points in each row, and remove and supplement the gap points in each row of the image strip according to the distance between the two adjacent gap points to determine the segmentation point of each image strip;
[0036] According to all the processed image strips, an im_POINT image consisting of segmentation points is obtained.
[0037] Furthermore, the method described above, wherein determining a dividing line according to the dividing point, and dividing the breeding plot according to the dividing line, comprises:
[0038] Perform convolution operation on the im_POINT image using a 3×3 matrix, and extract pixels at the segmentation points;
[0039] Determine effective pixel points according to the pixels at the segmentation points;
[0040] The effective pixel points are translated to obtain an image containing multiple line segments;
[0041] Use the Two-Pass algorithm to number each line segment and extract the segmentation points in each line segment. According to the segmentation points in each line segment, determine the segmentation line of each line segment.
[0042] Performing smoothing on the segmentation line;
[0043] Performing a reverse conversion on the smoothed segmentation lines, and projecting the pixels on each segmentation line onto the plot image to obtain a segmentation line image im_LINE, and removing pixels that are both green pixels and segmentation points from the image im_LINE;
[0044] The discrete pixels on the segmentation line in the image im_LINE are extracted according to the pixel values, and these pixels are arranged and connected in sequence to obtain a segmentation line composed of multiple segmentation points, and the segmentation line of the plot image is obtained to divide the breeding plots.
[0045] Furthermore, the above method further includes:
[0046] Number each segmentation line and generate a vector spline;
[0047] Superimposing the land parcel boundary and the vector spline to generate an intersection area;
[0048] According to the naming rules of the breeding plots and the naming rules of the intersecting plots, the intersecting plots are merged, deleted and renamed to finally obtain the breeding plots.
[0049] On the other hand, the present application provides a device for automatically dividing crop breeding plots, including a processor and a memory, wherein the processor is connected to the memory:
[0050] Wherein, the processor is used to call and execute the program stored in the memory;
[0051] The memory is used to store the program, and the program is at least used to execute any one of the above methods for automatically dividing crop breeding plots.
[0052] The beneficial effects of the present invention are:
[0053] The present application first collects plot images, and stitches the plot images through image stitching software, determines the area to be divided in the stitched plot images, binarizes the stitched plot images to generate a binary image, crops the plot images from the binary image according to the plot boundaries, and translates the plot images to make the shape of the plots rectangular, determines segmentation points based on all plot images, determines segmentation lines based on the segmentation points, and divides breeding plots based on the segmentation lines, thereby completing the automatic division of breeding plots and solving the current problem that crop breeding plots cannot be automatically divided. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] 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 these drawings without paying creative work.
[0055] Figure 1 It is a flow chart provided by an embodiment of a method for automatically dividing crop breeding plots of the present invention;
[0056] Figure 2 It is a structural schematic diagram provided by an embodiment of an automatic crop breeding plot division device of the present invention. DETAILED DESCRIPTION
[0057] To make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described in detail below. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.
[0058] Figure 1 The present invention provides a flowchart of an embodiment of a method for automatically dividing crop breeding plots.
[0059] See also Figure 1 , this embodiment may include the following steps:
[0060] S1. Collect plot images and stitch them together using image stitching software.
[0061] S2. Determine the area to be divided in the stitched land image.
[0062] S3. Binarize the stitched plot images to generate a binary image.
[0063] S4. Cut out the plot image from the binary image according to the plot boundary, and translate the plot image so that the plot has a rectangular shape.
[0064] S5. Determine segmentation points based on all plot images.
[0065] S6. Determine a dividing line according to the dividing point, and divide the breeding plot according to the dividing line.
[0066] It can be understood that the present application first collects plot images, and stitches the plot images through image stitching software, determines the area to be divided in the stitched plot images, binarizes the stitched plot images to generate a binary image, crops the plot images from the binary image according to the plot boundaries, and translates the plot images to make the shape of the plots rectangular, determines the segmentation points based on all the plot images, determines the segmentation lines based on the segmentation points, and divides the breeding plots according to the segmentation lines, thereby completing the automatic division of the breeding plots, solving the current problem of being unable to automatically divide crop breeding plots.
[0067] It should be noted that the plot images were taken by drone when the weather was clear and windless. The image stitching software was used to complete the image stitching work, and markers of different colors were placed at the four corners of the area to be divided to distinguish the orientation and actual number of the farmland and determine the plot numbering rules.
[0068] Preferably, step S3 includes:
[0069] The spliced plot images are processed according to the formulas ExG = 2 × GRB and SUM = R + G + B to obtain the im_ExG single-band image and the im_SUM single-band image;
[0070] Get the pixel size and target pixel size of im_ExG single-band image and im_SUM single-band image;
[0071] Determine the first window size according to the ratio of the pixel size of the im_ExG single-band image to the target pixel size;
[0072] According to the first window size, the im_ExG single-band image is divided into a number of small squares with a side length of the first window size, the small square is a pixel after downsampling, the center of the small square is the position of the pixel, and the mean value of the pixels in the small square is the pixel value, thus completing the downsampling of the im_ExG single-band image;
[0073] Determine the second window size according to the ratio of the pixel size of the im_SUM single-band image to the target pixel size;
[0074] According to the second window size, the im_SUM single-band image is divided into a number of small squares with a side length of the second window size. The small square is a pixel after downsampling. The center of the small square is the position of the pixel. The mean value of the pixels in the small square is the pixel value, and the downsampling of the im_SUM single-band image is completed.
[0075] Use a 21×21 window to traverse the downsampled im_ExG single-band image and im_SUM single-band image respectively, and calculate the difference between the central pixel value and the mean value of all pixels in the 21×21 window as the new central pixel value;
[0076] According to the proportion of green pixels, the threshold of the im_ExG single-band image is determined, and the candidate green pixels are determined according to the threshold of the im_ExG single-band image;
[0077] According to the proportion of brightness pixels, the threshold of the im_SUM single-band image is determined, and the bright pixels are determined according to the threshold of the im_SUM single-band image;
[0078] Determine green pixels in the im_ExG single-band image and the im_SUM single-band image based on candidate green pixels and bright pixels;
[0079] Generate a binary image based on the im_ExG single-band image and the im_SUM single-band image after determining the green pixels.
[0080] It can be understood that the UAV stitching images are processed according to the formula ExG = 2 × GRB and SUM = R + G + B to obtain two single-band images im_ExG and im_SUM. Because the original image has high resolution and large data volume, and the resolution required for cell boundary division does not need to be too high, the im_ExG and im_SUM images will be downsampled to about 0.03 meters. The downsampling method is: first determine the window size window_size according to the ratio of the target pixel size dst_pixel_size to the original pixel size src_pixel_size, and then divide the image into several small squares of window_size × window_size, each small square is a pixel after downsampling, the center of the small square is the position of the pixel, the mean value of the pixels in the small square is the pixel value, and the image resolution after downsampling becomes src_pixel_size × window_size. For example: src_pixel_size = 0.0031 meters, dst_pixel_size = 0.03 meters, then the window size is window_size = dst_pixel_size / src_pixel_size≈10, and the resolution of the downsampled image is src_pixel_size×window_size = 0.031 meters. First, use a 21×21 window to traverse the downsampled im_ExG and im_SUM respectively, and calculate the difference between the center pixel value and the mean of all pixels in the window as the new center pixel value. Then, the threshold of the im_ExG image is determined according to the green_percentage (set to 0.3), which is the (1-green_percentage)×100th quantile of all pixels in im_ExG. Pixels greater than this threshold are recorded as candidate green pixels. The threshold of the im_SUM image is determined according to the bright_percentage (set to 0.4), which is the (1-bright_percentage)×100th quantile of all pixels in im_SUM. Pixels greater than this threshold are recorded as bright pixels. Finally, pixels on candidate green pixels but not bright pixels are recorded as green pixels. This can remove some pixels of dry vegetation and make the segmentation line extraction more accurate.
[0081] Preferably, step S4 comprises:
[0082] Crop the plot image from the binary image according to the plot boundary;
[0083] Determine the translation mode of the plot image according to the row and column coordinates of the north corner point and the row and column coordinates of the west corner point of the plot image;
[0084] Translate the plot image according to the translation method so that the shape of the plot is a rectangle.
[0085] It can be understood that the plot is cropped from the binary image according to the plot boundary, and the shape of the plot is approximately rectangular. According to the row and column number coordinates (north_row = 0, north_col) of the north corner point and the row and column number coordinates (west_row, west_col = 0) of the west corner point of the image, the translation method of the image is determined. If west_row is smaller (a < b), the image is flipped left and right so that the side with a longer projection in the north-south direction is located in the north. First, translate the image pixels row by row so that the west boundary of the plot is in the same column as the north corner point. Then, translate the image pixels so that the north boundary is in the same row as the upper left corner point. Finally, an approximately rectangular image is obtained. If the side with a longer projection of the plot boundary in the north-south direction is in the same direction as the long side of the breeding plot, record this image as the V image; and the transposed image is the H image. Otherwise, vice versa.
[0086] Preferably, step S5 includes:
[0087] Traverse and sum the translated plot image with a matrix of size 81×5, and determine the green pixels of the plot image after summation according to a preset threshold T1;
[0088] Divide the plot image after determining the green pixels into a preset number of image strips;
[0089] Determine the column coordinates of the gap points in each row of each image strip according to the green pixels;
[0090] Determine the distance between two adjacent gap points in each row, and remove and supplement the gap points in each row of the image strip according to the distance between two adjacent gap points to determine the segmentation points of each image strip;
[0091] Obtain the im_POINT image composed of the segmentation points according to all the processed image strips.
[0092] It can be understood that the translated image is traversed and summed using a matrix of size 81×5, and then according to the set threshold T1 (V is 8, H is 6), the pixel value greater than T1 is set to 1, recorded as a green pixel, and the others are set to 0, and finally the distribution of green pixels is obtained. After the above processing, each column of green pixels can be well connected. The processed image is divided into C image strips, and the number of rows in each image strip is m pixels (m=40 for V image; m=30 for H image). The column coordinates of the gap points in each row of the image strip are obtained. The column coordinates of the gap points are obtained as follows: the column coordinates of the central pixel of the set of N consecutive non-green pixels are taken as the column coordinates of the gap points (n=8 for V image; n=12 for H image), and the column coordinates of the gap points in each row of the entire image strip are calculated; the pixels with adjacent column coordinates are grouped together. If the number of pixels in the group is greater than m*t (t=0.2), the center column coordinates of the group are obtained by weighted average, and its pixel value is the number of pixels in the group. The gap points obtained above may be too close or too far away, which will cause errors in the connection of subsequent segmentation lines. To this end, we need to filter out points that are too close and supplement points that are too far away. First, calculate the distance from each gap point to the next gap point, and take the median dis as the standard for judging whether the gap points are uniform. If the distance is less than dis×(2 / 3), the distance is too close and a point needs to be removed. The screening method is: add the distance to the previous distance and the next distance respectively. If the value is closer to the next distance when added to the previous distance, remove the previous endpoint, otherwise remove the next endpoint; if the distance is greater than dis×(4 / 3), the distance is too far and some points need to be added. The adding method is: take the previous endpoint as the reference, add points one by one according to the distance dis, until the distance to the next endpoint is less than dis×(4 / 3), and the pixel values of these added gap points are set to 1. These gap points are recorded as segmentation points. Process each image strip in turn, and finally obtain a number of images im_POINT composed of segmentation points, the number of whose rows is consistent with the number of image strips.
[0093] Preferably, step S6 comprises:
[0094] Use a 3×3 matrix to perform convolution on the im_POINT image and extract the pixels at the segmentation points;
[0095] Determine the effective pixel points according to the pixels at the segmentation points;
[0096] The effective pixel points are translated to obtain an image containing multiple line segments;
[0097] Use the Two-Pass algorithm to number each line segment and extract the segmentation points in each line segment. According to the segmentation points in each line segment, determine the segmentation line of each line segment.
[0098] Smooth the dividing line;
[0099] Perform reverse transformation on the smoothed segmentation lines, and project the pixels on each segmentation line onto the plot image to obtain the segmentation line image im_LINE, and remove the pixels that are both green pixels and segmentation points in the image im_LINE;
[0100] The discrete pixels on the segmentation line in the image im_LINE are extracted according to the pixel values, and these pixels are arranged and connected in sequence to obtain a segmentation line composed of multiple segmentation points, and the segmentation line of the plot image is obtained to divide the breeding plot.
[0101] It can be understood that isolated points are filtered out (only the segmentation point image im_POINT generated by the V image is processed, and the H image is not processed). Use a 3×3 matrix to perform a convolution operation (sum) on the image, and then extract the pixels at the segmentation point. If the pixel value is less than 4, remove the segmentation point, otherwise keep it and set it to 1. The valid pixel points (pixel value is 1) obtained above are translated to the right by 1,…, c pixels, and then translated downward by 1,…, r pixels (c=3, r=8 when processing the V image; c=10, r=20 when processing the H image). Finally, an image containing multiple "line segments" is obtained. The Two-Pass algorithm is used to implement the numbering of each "line segment". The segmentation points in each "line segment" are extracted as the "segmentation lines" belonging to this "line segment". These "segmentation lines" are composed of multiple discrete points. Remove the number of discrete points less than C*T_min (C is the number of image strips, T_min=0.3). Repeat the above two operations once to make the "segmentation line" more accurate. After the above processing, the values of the pixels on each "dividing line" are the same. We found that the pixels on the "dividing line" are not continuous, and some pixels will deviate far from the adjacent pixels. In fact, the dividing line of the breeding plot is relatively straight. To this end, it is necessary to move these relatively discrete pixels to make the "dividing line" smoother. The moving method is: if the column coordinate deviation of the pixel relative to the previous pixel is greater than 5 pixels in length, then move the pixel to the previous pixel by dif_pixel_col / 2 pixels in length. Previously, the image was translated, flipped, transposed, and other operations were performed to obtain the current "dividing line". Now, according to the reverse operation, the pixels on each "dividing line" are projected onto the original image to obtain the dividing line image im_LINE. Compare the green pixel image and the dividing line image, and remove the pixels that are both green pixels and dividing points to ensure that the dividing points are not on vegetation pixels and improve the extraction accuracy of the dividing line. According to the pixel value, the discrete pixels on the segmentation line are extracted (the same pixel value means that these pixels are on the same segmentation line), and these pixels are arranged and connected in order to obtain a segmentation line composed of multiple segmentation points. The above operation is performed on each segmentation line, and finally the segmentation line line_v (line_h) of the V image (H image) is obtained.
[0102] Preferably, it also includes:
[0103] Number each segmentation line and generate a vector spline;
[0104] Superimpose the land parcel boundary and the vector spline to generate the intersection area;
[0105] According to the naming rules of the breeding plots and the naming rules of the intersecting plots, the intersecting plots are merged, deleted and renamed to finally obtain the breeding plots.
[0106] It can be understood that line_v (line_h) is arranged in order, and the first and second segmentation lines after sorting are connected in sequence to obtain spline 1, and the number is set to 1, and the second and third lines after sorting are connected to obtain spline 2, and the number is set to 2, and so on. Finally, bar_v (bar_h) is obtained. The sorting method of the segmentation line is: take a segmentation line, calculate the position of each point on the segmentation line and the similar line segment on another segmentation line (the point is on the left or right side of the line segment), whichever is the most common. According to the above-mentioned judgment method, all other segmentation lines can be traversed, and finally the number of line segments on the left and right sides of the segmentation line can be determined, and then the number of the segmentation line can be inferred. The land boundary, bar_v, and bar_h are superimposed on each other. Each small intersecting area is an intersecting cell, and each cell will have two numbers, which are derived from bar_v and bar_h, for example: H: 1; V: 2. The naming rules of the breeding plots are matched with the naming rules of the intersecting plots, and then the intersecting plots are merged, deleted, and renamed according to the rules to finally obtain the breeding plots.
[0107] The present invention also provides a crop breeding plot automatic division device, which is used to implement the above method embodiment. Figure 2 1 is a schematic diagram of a structure of an automatic crop breeding plot division device according to an embodiment of the present invention. Figure 2 As shown, the crop breeding plot automatic division device of this embodiment includes a processor 21 and a memory 22, and the processor 21 is connected to the memory 22. The processor 21 is used to call and execute the program stored in the memory 22; the memory 22 is used to store the program, and the program is at least used to execute the crop breeding plot automatic division method in the above embodiment.
[0108] The specific implementation scheme of the automatic crop breeding plot division device provided in the embodiments of the present application can refer to the implementation scheme of the automatic crop breeding plot division method in any of the above embodiments, which will not be repeated here.
[0109] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.
[0110] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" refers to at least two.
[0111] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.
[0112] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0113] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0114] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0115] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0116] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0117] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A method for automatically dividing crop breeding plots, characterized in that: include: Collecting plot images, and stitching the plot images using image stitching software; Determining the area to be divided in the spliced land image; Binarization is performed on the stitched land image to generate a binary image; Cutting out a plot image from the binary image according to the plot boundary, and translating the plot image so that the plot has a rectangular shape; Determine segmentation points based on all the plot images; A dividing line is determined according to the dividing point, and the breeding plot is divided according to the dividing line.
2. The method according to claim 1, characterized in that The binarization process is performed on the stitched land image to generate a binary image, including: The spliced land image is processed according to the formulas ExG=2×GRB and SUM=R+G+B to obtain an im_ExG single-band image and an im_SUM single-band image; Obtain the pixel size and target pixel size of the im_ExG single-band image and the im_SUM single-band image; Determine the first window size according to the ratio of the pixel size of the im_ExG single-band image to the target pixel size; According to the first window size, the im_ExG single-band image is divided into a plurality of small squares with a side length of the first window size, wherein the small square is a pixel after downsampling, the center of the small square is the position of the pixel, and the average value of the pixels in the small square is the pixel value, thereby completing the downsampling of the im_ExG single-band image; Determine the second window size according to the ratio of the pixel size of the im_SUM single-band image to the target pixel size; According to the second window size, the im_SUM single-band image is divided into a plurality of small squares with a side length of the second window size, wherein the small square is a pixel after downsampling, the center of the small square is the position of the pixel, and the average value of the pixels in the small square is the pixel value, thereby completing the downsampling of the im_SUM single-band image; Use a 21×21 window to traverse the downsampled im_ExG single-band image and the im_SUM single-band image respectively, and calculate the difference between the center pixel value and the mean value of all pixels in the 21×21 window as the new center pixel value; Determine the threshold of the im_ExG single-band image according to the proportion of green pixels, and determine the candidate green pixels according to the threshold of the im_ExG single-band image; Determine the threshold of the im_SUM single-band image according to the proportion of brightness pixels, and determine the bright pixels according to the threshold of the im_SUM single-band image; Determine green pixels in the im_ExG single-band image and the im_SUM single-band image according to the candidate green pixels and the bright pixels; A binary image is generated according to the im_ExG single-band image and the im_SUM single-band image after determining the green pixels.
3. The method according to claim 2, characterized in that The step of cutting out the plot image from the binary image according to the plot boundary and translating the plot image so that the plot has a rectangular shape includes: Cutting out the plot image from the binary image according to the plot boundary; Determine the translation mode of the land plot image according to the row and column coordinates of the north corner point and the row and column coordinates of the west corner point of the land plot image; The land parcel image is translated according to the translation mode so that the shape of the land parcel is a rectangle.
4. The method according to claim 3, characterized in that The step of determining the segmentation points according to all the land plot images comprises: Using a matrix of size 81×5 to traverse and sum the translated plot image, and determining the green pixels of the plot image after summation according to a preset threshold value T1; Dividing the plot image after determining the green pixels into a preset number of image strips; Determine the column coordinates of the gap points in each row of each of the image strips according to the green pixels; Determine the distance between two adjacent gap points in each row, and remove and supplement the gap points in each row of the image strip according to the distance between the two adjacent gap points to determine the segmentation point of each image strip; According to all the processed image strips, an im_POINT image consisting of segmentation points is obtained.
5. The method according to claim 4, characterized in that Determining a dividing line according to the dividing point, and dividing the breeding plot according to the dividing line, comprises: Perform convolution operation on the im_POINT image using a 3×3 matrix, and extract pixels at the segmentation points; Determine effective pixel points according to the pixels at the segmentation points; The effective pixel points are translated to obtain an image containing multiple line segments; Use the Two-Pass algorithm to number each line segment and extract the segmentation points in each line segment. According to the segmentation points in each line segment, determine the segmentation line of each line segment. Performing smoothing on the segmentation line; Performing a reverse conversion on the smoothed segmentation lines, and projecting the pixels on each segmentation line onto the plot image to obtain a segmentation line image im_LINE, and removing pixels that are both green pixels and segmentation points from the image im_LINE; The discrete pixels on the segmentation line in the image im_LINE are extracted according to the pixel values, and these pixels are arranged and connected in sequence to obtain a segmentation line composed of multiple segmentation points, and the segmentation line of the plot image is obtained to divide the breeding plots.
6. The method according to claim 5, characterized in that Also includes: Number each segmentation line and generate a vector spline; Superimposing the land parcel boundary and the vector spline to generate an intersection area; According to the naming rules of the breeding plots and the naming rules of the intersecting plots, the intersecting plots are merged, deleted and renamed to finally obtain the breeding plots.
7. A crop breeding plot automatic division device, characterized in that: The invention comprises a processor and a memory, wherein the processor is connected to the memory: Wherein, the processor is used to call and execute the program stored in the memory; The memory is used to store the program, and the program is at least used to execute the method for automatic division of crop breeding plots according to any one of claims 1-6.
