Farmland plot image segmentation method, device and storage medium

Through potential boundary selection and full-domain multi-angle linear scanning technology, multi-layer fission linear segmentation of farmland plot images is solved, and the problems of low accuracy, low efficiency and poor adaptability in the prior art are achieved, and high efficiency, high accuracy and high adaptability of farmland plot images are achieved.

CN119379717BActive Publication Date: 2025-04-25BEIJING AKENONG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411942165.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-25
Estimated Expiration
2044-12-27

AI Technical Summary

Technical Problem

The existing farmland plot image segmentation methods have problems such as low accuracy, low efficiency and poor adaptability, especially in different crop periods and multiple plot scenarios.

Method used

The potential boundary selection and full-domain multi-angle linear scanning technology are used to perform multi-layer fission linear segmentation on the farmland plot images to generate the target image. This method does not require manual annotation and RGB threshold setting, and adapts to plot images under multiple phenological periods.

Benefits of technology

It realizes high efficiency, high accuracy and high adaptability of farmland plot image segmentation, improves segmentation efficiency and accuracy, and is suitable for multi-palladium and multi-phenological scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119379717B_ABST
    Figure CN119379717B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and storage medium for segmenting farmland plot images, and relates to the technical field of image segmentation. The method comprises: obtaining a farmland plot image to be segmented; performing potential boundary selection on the farmland plot image to obtain a potential boundary image matrix; introducing a scanning line equation, performing a full-domain multi-angle linear scan on the potential boundary image matrix to obtain a scanning result, and the scanning result includes the absolute number of coverage and the absolute number of non-coverage corresponding to each scanning line; based on a plurality of preset segmentation levels and the segmentation conditions of each layer, performing multi-layer fission linear segmentation on the farmland plot image according to the scanning result to obtain a plurality of segmentation matrices; and using all the segmentation matrices to generate a target image. The present invention can adapt to images of farmland plots of various image sizes and plots in multiple phenological periods, and perform automatic, label-free, efficient and accurate plot segmentation, and has good algorithm plasticity and scalability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image segmentation, and in particular to a method, device and storage medium for segmenting farmland plot images. Background Art

[0002] Farmland plot image segmentation refers to the process of automatically identifying and segmenting farmland plot images using computer vision and image processing technology. Farmland plot image segmentation has broad application prospects in the agricultural field, such as farmland planning, crop planting, yield prediction, pest and disease monitoring, etc. At present, the main methods for farmland plot segmentation are: RGB threshold method, Mask R-CNN (Mask Region-based Convolutional Neural Network) learning method and manual labeling method. Among them, the RGB threshold method refers to: setting the RGB range of farmland plots under characteristic crops, separating the plots from the image, and adjusting the RGB threshold accordingly. It can be targeted at different characteristic crops and adapt to the extraction effect under different backgrounds. The Mask R-CNN learning method refers to: collecting a large number of plot images, manually labeling the farmland plots to be extracted, that is, manually circling the farmland plots to be identified, and the neural network model learns according to the label features. As the number of labels increases, the recognition ability of the neural network model becomes stronger. The manual labeling method means: using plot drawing software, such as ArcGIS Destop 10.2, to manually circle the plots that need to be circled one by one.

[0003] However, the RGB threshold method is limited by the uniformity of the plots. It is difficult to set an ideal RGB threshold with accurate extraction effect. The plots are usually accompanied by problems such as high extraction fragmentation and poor boundary continuity, which makes the plot extraction accuracy average. In addition, the characteristics of farmland plots in different crop periods will affect the setting of RGB thresholds, which makes certain requirements for the image shooting period. Before using the Mask R-CNN learning method, about 5%-10% of the plot images of local farmland plots need to be manually labeled. Because the image characteristics of farmland plots are highly regional, the method is not easy to promote and is only suitable for use in learned (labeled) regions. It also has certain requirements for the image shooting period. The manual labeling method is time-consuming and labor-intensive, and cannot effectively extract large areas and multiple plots, so it is inefficient.

[0004] Based on this, how to provide a convenient, efficient, highly accurate and highly adaptable farmland image segmentation method has become a technical problem that needs to be solved urgently. Summary of the invention

[0005] In view of this, in order to solve the above technical problems, the present invention provides a method, device and storage medium for farmland plot image segmentation.

[0006] The present invention adopts the following technical solution:

[0007] In a first aspect, the present invention provides a method for segmenting a farmland plot image, comprising:

[0008] Acquire the farmland plot image to be segmented;

[0009] Determining potential boundaries of the farmland plot image to obtain a potential boundary image matrix;

[0010] A scanning line equation is introduced to perform a full-domain multi-angle linear scan on the potential boundary image matrix to obtain a scanning result, wherein the scanning result includes an absolute number of coverage and an absolute number of non-coverage corresponding to each scanning line, wherein the absolute number of coverage is the number of potential boundary points in the potential boundary image matrix that overlap with the corresponding scanning line, and the absolute number of non-coverage is the number of non-potential boundary points in the potential boundary image matrix that overlap with the corresponding scanning line;

[0011] Based on the preset multiple segmentation levels and the segmentation conditions of each layer, and according to the scanning results, the farmland plot image is subjected to multi-layer fission linear segmentation to obtain multiple segmentation matrices;

[0012] Using all the segmentation matrices, a target image is generated.

[0013] Optionally, performing potential boundary selection on the farmland plot image to obtain a potential boundary image matrix specifically includes:

[0014] Obtaining an image grayscale value matrix of the farmland plot image;

[0015] Using a boundary selection operator to traverse the image gray value matrix, in the traversal process, calculating the difference between the variation characteristics of the surrounding pixels of the boundary selection operator and the mean value of the boundary selection operator itself, and when the difference is greater than a preset difference threshold, reassigning the corresponding position in the image gray value matrix to a first value, otherwise, reassigning the corresponding position in the image gray value matrix to a second value;

[0016] The re-assigned image grayscale value matrix is ​​determined to be the potential boundary image matrix.

[0017] Optionally, the scanning line equation is:

[0018]

[0019] in, ; ;

[0020] in, is the tangent value of the corresponding scanning line in the corresponding coordinate system, and its angle is the angle with the line , the angle range is between, Reason The column matrix composed of is a column matrix consisting of the Euclidean distances from the origin of the coordinate system to the scanning line, The value range is from 1 to between, and are the width and length of the potential boundary image matrix respectively.

[0021] Optional, The value step length is ;

[0022] The value step size is 1.

[0023] Optionally, based on a plurality of preset segmentation levels and segmentation conditions of each layer, and according to the scanning result, multi-layer fission linear segmentation is performed on the farmland plot image, specifically including:

[0024] Starting from the first segmentation level, the following segmentation process is performed for each segmentation level in turn until the last segmentation level is reached:

[0025] According to the scanning result, among the scanning lines that are not currently filtered out, a target line that meets the segmentation condition of the current segmentation level is filtered out;

[0026] Performing neighborhood deduplication on the target straight line to obtain a target scanning straight line;

[0027] The target scanning line is used to segment the current image matrix. When the current segmentation level is the first segmentation level, the current image matrix is ​​the potential boundary image matrix. When the current segmentation level is not the first segmentation level, the current image matrix is ​​the image matrix obtained after segmentation at the previous segmentation level.

[0028] In a second aspect, the present invention provides a farmland plot image segmentation device, comprising:

[0029] An acquisition module, used for acquiring images of farmland plots to be segmented;

[0030] A determination module is used to determine potential boundaries of the farmland plot image to obtain a potential boundary image matrix;

[0031] A scanning module, used for introducing a scanning line equation, performing a full-domain multi-angle linear scan on the potential boundary image matrix, and obtaining a scanning result, wherein the scanning result includes an absolute number of coverage and an absolute number of non-coverage corresponding to each scanning line, wherein the absolute number of coverage is the number of potential boundary points in the potential boundary image matrix that overlap with the corresponding scanning line, and the absolute number of non-coverage is the number of non-potential boundary points in the potential boundary image matrix that overlap with the corresponding scanning line;

[0032] A segmentation module, configured to perform multi-layer fission linear segmentation on the farmland plot image based on a plurality of preset segmentation levels and segmentation conditions of each layer and according to the scanning result to obtain a plurality of segmentation matrices;

[0033] A generating module is used to generate a target image using all the segmentation matrices.

[0034] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the various steps in the farmland plot image segmentation method as described above are implemented.

[0035] The present invention adopts the above technical scheme, a method for segmenting a farmland plot image, including: obtaining a farmland plot image to be segmented; selecting potential boundaries of the farmland plot image to obtain a potential boundary image matrix; introducing a scanning line equation, performing a full-domain multi-angle linear scan on the potential boundary image matrix to obtain a scanning result, the scanning result includes an absolute number of coverage and an absolute number of uncovering corresponding to each scanning line, the absolute number of coverage is the number of potential boundary points in the potential boundary image matrix that coincide with the corresponding scanning line, and the absolute number of uncovering is the number of non-potential boundary points in the potential boundary image matrix that coincide with the corresponding scanning line; based on multiple preset segmentation levels and the segmentation conditions of each layer, according to the scanning results, multi-layer fission linear segmentation is performed on the farmland plot image to obtain multiple segmentation matrices; using all segmentation matrices to generate a target image.

[0036] Based on this, by introducing the scanning straight line equation, the potential boundary image matrix is ​​subjected to a full-domain multi-angle straight line scan. Compared with searching for straight lines inside the image, the method of the present invention can greatly increase the operating efficiency, improve the image segmentation efficiency, and achieve zero fragmentation of the plot segmentation results, thereby improving the accuracy of the image segmentation results; and, by setting multiple segmentation levels and the segmentation conditions of each layer, and performing multi-layer fission linear segmentation on the farmland plot image based on them, the number of segmentation levels can be increased or decreased according to actual conditions, so that the present invention has good plasticity and scalability. In addition, the present invention does not need to manually annotate model training samples, is not constrained by RGB thresholds, and does not need to be pre-trained for the current area each time, so that the present invention can adapt to the images of plots under multiple phenological periods, and improves the convenience and accuracy of plot division. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0038] Figure 1 It is a flowchart of a method for segmenting farmland plot images provided by an embodiment of the present invention;

[0039] Figure 2 It is a schematic diagram of a three-layer fission split structure provided by an embodiment of the present invention;

[0040] Figure 3 It is a structural schematic diagram of a farmland plot image segmentation device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0041] 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.

[0042] Farmland plot image segmentation refers to the process of automatically identifying and segmenting farmland plot images using computer vision and image processing technology. Farmland plot image segmentation has broad application prospects in the agricultural field, such as farmland planning, crop planting, yield prediction, pest and disease monitoring, etc. At present, the main segmentation methods for farmland plots are: RGB threshold method, Mask R-CNN learning method and manual labeling method. Among them, the RGB threshold method refers to: setting the RGB range of farmland plots under characteristic crops, separating the plots from the image, and adjusting the RGB threshold accordingly. It can be targeted at different characteristic crops and adapted to the extraction effect under different backgrounds. The Mask R-CNN learning method refers to: collecting a large number of plot images, manually labeling the farmland plots to be extracted, that is, manually circling the farmland plots to be identified, and the neural network model learns according to the label features. As the number of labels increases, the recognition ability of the neural network model becomes stronger. The manual labeling method refers to: manually circling the plots that need to be circled one by one through the plot circle drawing software, such as ArcGIS Destop 10.2.

[0043] However, the RGB threshold method is limited by the uniformity of the plots. It is difficult to set an ideal RGB threshold with accurate extraction effect. The plots are usually accompanied by problems such as high extraction fragmentation and poor boundary continuity, which makes the plot extraction accuracy average. In addition, the characteristics of farmland plots in different crop periods will affect the setting of RGB thresholds, which makes certain requirements for the image shooting period. Before using the Mask R-CNN learning method, about 5%-10% of the plot images of local farmland plots need to be manually labeled. Because the image characteristics of farmland plots are highly regional, the method is not easy to promote and is only suitable for use in learned (labeled) regions. It also has certain requirements for the image shooting period. The manual labeling method is time-consuming and labor-intensive, and cannot effectively extract large areas and multiple plots, so it is inefficient.

[0044] Based on this, the present invention provides a method, device and storage medium for image segmentation of farmland plots. The scheme of the present invention has the advantages of convenience, high efficiency, high accuracy and high adaptability. It should be noted that the scheme of the present invention is suitable for farmland with a high degree of linearity of plots, such as farmland in northern my country. There are many large farms in northern my country, for example: Xinjiang, Gansu and Heilongjiang and other typical large farms in the north, the plot boundary features are basically polygonal, there are few curved boundaries, and the plot linearity is high.

[0045] Figure 1 FIG. 1 is a flow chart of a method for segmenting farmland images provided by an embodiment of the present invention. Figure 1 As shown, this process includes:

[0046] Step 101: Acquire an image of a farmland plot to be segmented.

[0047] Specifically, images of farmland plots taken by satellites or drones may be obtained, and the images of farmland plots should not be obstructed by clouds.

[0048] Step 102: Determine potential boundaries of the farmland image to obtain a potential boundary image matrix.

[0049] In the embodiment of the present invention, potential boundaries are selected for the farmland plot image to obtain a potential boundary image matrix, which may specifically include:

[0050] (1021) Get the image gray value matrix of the farmland plot image .

[0051] (1022) Use a boundary selection operator to traverse the image gray value matrix. During the traversal process, calculate the difference between the variation characteristics of the surrounding pixels of the boundary selection operator and the mean value of the boundary selection operator itself. When the difference is greater than a preset difference threshold, reassign the first value to the corresponding position in the image gray value matrix; otherwise, reassign the second value to the corresponding position in the image gray value matrix.

[0052] Specifically, the preset difference threshold may be equal to 35, the first value may be equal to 255, and the second value may be equal to 0.

[0053] Boundary selection operator Can be:

[0054] ...... (1)

[0055] Select the operator at the boundary Then, based on the following two formulas, the boundary selection operator is used to traverse the image gray value matrix. During the traversal process, the difference between the variation characteristics of the surrounding pixels of the boundary selection operator and the mean of the boundary selection operator itself is calculated. :

[0056] ...... (2)

[0057] ...... (3)

[0058] in, Select the operator for the boundary A matrix with the same length and width, which is the image gray value matrix , and sort by row ( )List( ) sorted in traverse in. Find the matrix The mean For the matrix Subtract the mean The final result is the same as above.

[0059] Taking the preset difference threshold value as 35, the first value as 255, and the second value as 0 as an example, When the difference is greater than the preset difference threshold, the corresponding position in the image gray value matrix is ​​reassigned to the first value; otherwise, the corresponding position in the image gray value matrix is ​​reassigned to the second value, that is:

[0060] ...... (4)

[0061] (1023) Determine the gray value matrix of the reassigned image is the potential boundary image matrix.

[0062] Step 103: Introduce the scanning line equation, perform a full-domain multi-angle linear scan on the potential boundary image matrix, and obtain the scanning result. The scanning result includes the absolute number of coverage and the absolute number of uncovered corresponding to each scanning line. The absolute number of coverage is the number of potential boundary points in the potential boundary image matrix that coincide with the corresponding scanning line, and the absolute number of uncovered is the number of non-potential boundary points in the potential boundary image matrix that coincide with the corresponding scanning line.

[0063] In the embodiment of the present invention, the scanning line equation is:

[0064] ...... (5)

[0065] in, ...... (6)

[0066] ...... (7)

[0067] in, is the tangent value of the corresponding scanning line in the corresponding coordinate system, and its angle is the angle with the line , the angle range is between, Reason The column matrix composed of is the intercept of the corresponding scanning line, is a column matrix consisting of the Euclidean distances from the origin of the coordinate system to the corresponding scanning line, The value range is from 1 to between, and are the width and length of the potential boundary image matrix, respectively.

[0068] Optional, The value step size can be ; The value step length of can be 1. That is:

[0069] ...... (8)

[0070] ...... (9)

[0071] Combining formulas (5)-(9), we can Perform linear scanning with full coverage and high angle density. During the scanning process, there are:

[0072] ...... (10)

[0073] in, The image width (i.e. ) is an increasing column matrix with the maximum value.

[0074] ...... (11)

[0075] Formula (11) is a mapping relationship set up, specifically, equal At the point The value of for At the point The value of .

[0076] ...... (12)

[0077] Formula (12) uses the above mapping relationship, so for Points on the current scan line If the value is equal to the first value, it means that the point is a potential boundary, otherwise, it indicates that the point It is not a potential boundary. Taking the first value equal to 255 and the second value equal to 0 as an example, we have:

[0078] ...... (13)

[0079] in, To cover the absolute number, is the absolute number of uncovered items, for and combination.

[0080] It can be seen from formula (10) and formula (13) that the present invention introduces the length and width of the image into the parameters, which enables the present invention to adapt to images of different sizes.

[0081] Will After substituting into formula (5), and Drive the scanning line to perform multi-angle transformation (scanning), and use formula (11)-formula (13) to calculate the value of each scanning line and , get the scan results.

[0082] The embodiment of the present invention uses the multi-angle and multi-intercept straight line scanning based on the matrix coordinate origin. Compared with searching for straight lines inside the image, the present invention can greatly increase the operating efficiency while ensuring accuracy and ensuring zero fragmentation of the plot segmentation results.

[0083] Step 104: Based on the preset multiple segmentation levels and the segmentation conditions of each layer, and according to the scanning results, multi-layer fission linear segmentation is performed on the farmland plot image to obtain multiple segmentation matrices.

[0084] The present invention establishes multiple segmentation levels and segmentation conditions for each level, so that the present invention can segment plots of different sizes into corresponding threshold locking layers, thereby improving the adaptation range of the segmented plot size.

[0085] In the embodiment of the present invention, based on the preset multiple segmentation levels and the segmentation conditions of each layer, the multi-layer fission linear segmentation of the farmland plot image is performed according to the scanning results, which may specifically include:

[0086] Starting from the first segmentation level, the following segmentation process is performed for each segmentation level in turn until the last segmentation level is reached:

[0087] (1) According to the scanning results, among the scanned lines that have not been filtered out, select the target lines that meet the segmentation conditions of the current segmentation level.

[0088] (2) Perform neighborhood deduplication on the target line to obtain the target scanning line.

[0089] (3) Use the target scanning line to segment the current image matrix. When the current segmentation level is the first segmentation level, the current image matrix is ​​the potential boundary image matrix. When the current segmentation level is not the first segmentation level, the current image matrix is ​​the image matrix obtained after segmentation at the previous segmentation level.

[0090] In a specific example, suppose there are 5 segmentation levels and the segmentation conditions of the 5 segmentation levels are They are:

[0091] ...... (14)

[0092] ...... (15)

[0093] ...... (16)

[0094] ...... (17)

[0095] ...... (18)

[0096] It can be seen that the segmentation condition The value range of is gradually decreasing. And the segmentation condition is based on coverage (i.e. ) and the absolute number of Set for condition variables.

[0097] In the segmentation process, first, segmentation is performed on the first segmentation level. The specific segmentation process is as follows:

[0098] (a1) According to the corresponding scanning result, the first straight line satisfying the segmentation condition of the first segmentation level (ie, Formula 14) is selected from all the scanned straight lines.

[0099] (b1) Use the following formula to remove duplicates in the neighborhood of the first straight line and obtain the first scanning straight line:

[0100] ...... (19)

[0101] ...... (20)

[0102] ......(twenty one)

[0103] ......(twenty two)

[0104] in, They are respectively the specific values ​​in the scanning line before the corresponding layer fission and under the segmentation conditions of the corresponding segmentation level. and ; and Correction and The intermediate parameters of and The column matrix is: and , substitute and update the corresponding straight line equation set to obtain the corresponding scanning line (here is the first scanning line).

[0105] It should be noted that since the potential boundary has a certain width, such as 3 pixels or 5 pixels, this will cause the corresponding adjacent equation parameters to meet the conditions, but it is actually just a line when viewed to the naked eye, so domain deduplication is required.

[0106] (c1) Based on the following formula, use the first scanning line to split , and get the first partition matrix:

[0107] ......(twenty three)

[0108] ......(twenty four)

[0109] in, is the input matrix (here, for ). It should be noted that in the multi-layer fission structure, the matrix of the first layer input is (That is, when the current segmentation level is the first segmentation level, the current image matrix is ​​the potential boundary image matrix ), in addition, when the current segmentation level is not the first segmentation level, the current image matrix is ​​the image matrix obtained after segmentation at the previous segmentation level.

[0110] Indicates the use of the corresponding scanning line (Here is the first scan line) Split the input matrix , and get the corresponding partition matrix The number of rows and columns of the matrix before and after segmentation remains unchanged. After segmentation, the element value of the target retention area of ​​the matrix is ​​equal to the element value at the corresponding position of the previous layer matrix, and the element value of the non-target retention area is 0, thus forming a connected domain.

[0111] is the segmentation matrix of the corresponding layer under the corresponding segmentation condition (here, the corresponding segmentation condition is the segmentation condition of the first segmentation level), and the last layer is the final result.

[0112] Then, segmentation is performed on the second segmentation level. The specific segmentation process is as follows:

[0113] (a2) From among all the scan lines except the first lines, select the second lines that meet the segmentation condition of the second segmentation level (ie, Formula 15).

[0114] (b2) Using formula (19) to formula (22), perform neighborhood deduplication on the second straight line to obtain a second scanning straight line.

[0115] (c2) Based on formula (23) and formula (24), the second scanning line is used to segment the corresponding first segmentation matrix to obtain a third segmentation matrix.

[0116] Next, the same or similar segmentation method as above is used to segment the third segmentation level, the fourth segmentation level and the fifth segmentation level respectively. The specific implementation process can refer to the above related content and will not be described again here.

[0117] In another specific example, Figure 2 FIG. 1 is a schematic diagram of a three-layer fission split structure provided by an embodiment of the present invention. Figure 2 As shown, after the first layer fission segmentation is performed, two first segmented images of the second layer are obtained. Then, the second layer fission segmentation is performed on each first segmented image, and each first segmented image is further segmented into four second segmented images to obtain the third layer image.

[0118] Step 105: Generate a target image using all segmentation matrices.

[0119] Specifically, first, the connected domains of all segmentation matrices are summarized, then the plots with sizes smaller than a preset size threshold are filtered out, and finally, they are spliced ​​into a target image.

[0120] The embodiment of the present invention establishes a multi-layer linear segmentation algorithm, so that the present invention can adapt to images of farmland plots of various image sizes and plots in multiple phenological periods, and perform automatic, label-free, efficient and accurate plot segmentation. In addition, the present invention can set segmentation thresholds of different layers and corresponding layers, so that the present invention has good algorithm plasticity and scalability. In addition, the embodiment of the present invention further improves the accuracy of image segmentation results through deduplication processing in the straight line field.

[0121] Based on a general inventive concept, the present invention also provides a device for segmenting farmland plot images. Figure 3 FIG. 1 is a schematic diagram of a structure of a farmland plot image segmentation device provided by an embodiment of the present invention. Figure 3 As shown, the device comprises:

[0122] The acquisition module 31 is used to acquire the farmland plot image to be segmented.

[0123] The selection module 32 is used to select potential boundaries of the farmland plot image to obtain a potential boundary image matrix.

[0124] The scanning module 33 is used to introduce the scanning line equation, perform a full-domain multi-angle linear scan on the potential boundary image matrix, and obtain a scanning result. The scanning result includes the absolute number of coverage and the absolute number of uncovered points corresponding to each scanning line. The absolute number of coverage is the number of potential boundary points in the potential boundary image matrix that overlap with the corresponding scanning line, and the absolute number of uncovered points is the number of non-potential boundary points in the potential boundary image matrix that overlap with the corresponding scanning line.

[0125] The segmentation module 34 is used to perform multi-layer fission linear segmentation on the farmland plot image based on a plurality of preset segmentation levels and segmentation conditions of each layer according to the scanning results to obtain a plurality of segmentation matrices.

[0126] The generating module 35 is used to generate a target image using all segmentation matrices.

[0127] Based on a general inventive concept, the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, each step in the above-mentioned farmland plot image segmentation method is implemented.

[0128] 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.

[0129] 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.

[0130] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising 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 reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.

[0131] 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, multiple 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.

[0132] 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.

[0133] 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.

[0134] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0135] 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.

[0136] 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 segmenting farmland images, characterized in that: include: Acquire the farmland plot image to be segmented; Determining potential boundaries of the farmland plot image to obtain a potential boundary image matrix; A scanning line equation is introduced to perform a full-domain multi-angle linear scan on the potential boundary image matrix to obtain a scanning result, wherein the scanning result includes an absolute number of coverage and an absolute number of non-coverage corresponding to each scanning line, wherein the absolute number of coverage is the number of potential boundary points in the potential boundary image matrix that overlap with the corresponding scanning line, and the absolute number of non-coverage is the number of non-potential boundary points in the potential boundary image matrix that overlap with the corresponding scanning line; Based on the preset multiple segmentation levels and the segmentation conditions of each layer, according to the scanning results, the farmland plot image is subjected to multi-layer fission linear segmentation to obtain multiple segmentation matrices; the segmentation conditions are set based on the coverage and the absolute number of coverage as conditional variables, and the coverage is equal to the ratio of the absolute number of coverage divided by the sum of the absolute number of coverage and the absolute number of uncovered areas; Using all the segmentation matrices, generating a target image; The potential boundary of the farmland plot image is selected to obtain a potential boundary image matrix, which specifically includes: Obtaining an image grayscale value matrix of the farmland plot image; The image gray value matrix is ​​traversed using a boundary selection operator. During the traversal process, the difference between the variation characteristics of the surrounding pixels of the boundary selection operator and the mean value of the boundary selection operator itself is calculated. When the difference is greater than a preset difference threshold, the corresponding position in the image gray value matrix is ​​reassigned to a first value. Otherwise, the corresponding position in the image gray value matrix is ​​reassigned to a second value. The boundary selection operator for: Determine the re-assigned image gray value matrix as the potential boundary image matrix; The scanning line equation is: in, ; ; in, is the tangent value of the corresponding scanning line in the corresponding coordinate system, and its angle is the angle with the line , the angle range is between, Reason The column matrix composed of is a column matrix consisting of the Euclidean distances from the origin of the coordinate system to the scanning line, The value range is from 1 to between, and are the width and length of the potential boundary image matrix respectively; Based on the preset multiple segmentation levels and the segmentation conditions of each layer, the farmland plot image is subjected to multi-layer fission linear segmentation according to the scanning result, specifically including: Starting from the first segmentation level, the following segmentation process is performed for each segmentation level in turn until the last segmentation level is reached: According to the scanning result, among the scanning lines that are not currently filtered out, a target line that meets the segmentation condition of the current segmentation level is filtered out; Performing neighborhood deduplication on the target straight line to obtain a target scanning straight line; The target scanning line is used to segment the current image matrix. When the current segmentation level is the first segmentation level, the current image matrix is ​​the potential boundary image matrix. When the current segmentation level is not the first segmentation level, the current image matrix is ​​the image matrix obtained after segmentation at the previous segmentation level.

2. The farmland plot image segmentation method according to claim 1, characterized in that: The value step length is ; The value step size is 1.

3. A farmland plot image segmentation device, characterized in that: include: An acquisition module, used for acquiring images of farmland plots to be segmented; A selection module is used to select potential boundaries of the farmland plot image to obtain a potential boundary image matrix; A scanning module, used for introducing a scanning line equation, performing a full-domain multi-angle linear scan on the potential boundary image matrix, and obtaining a scanning result, wherein the scanning result includes an absolute number of coverage and an absolute number of non-coverage corresponding to each scanning line, wherein the absolute number of coverage is the number of potential boundary points in the potential boundary image matrix that overlap with the corresponding scanning line, and the absolute number of non-coverage is the number of non-potential boundary points in the potential boundary image matrix that overlap with the corresponding scanning line; A segmentation module, for performing multi-layer fission linear segmentation on the farmland plot image according to the scanning result based on a plurality of preset segmentation levels and segmentation conditions of each layer, so as to obtain a plurality of segmentation matrices; the segmentation conditions are set based on the coverage and the absolute number of coverage as conditional variables, and the coverage is equal to the ratio of the absolute number of coverage divided by the sum of the absolute number of coverage and the absolute number of uncovered areas; A generating module, used for generating a target image using all the segmentation matrices; Wherein, the selected module is specifically used for: Obtaining an image grayscale value matrix of the farmland plot image; The image gray value matrix is ​​traversed using a boundary selection operator. During the traversal process, the difference between the variation characteristics of the surrounding pixels of the boundary selection operator and the mean value of the boundary selection operator itself is calculated. When the difference is greater than a preset difference threshold, the corresponding position in the image gray value matrix is ​​reassigned to a first value. Otherwise, the corresponding position in the image gray value matrix is ​​reassigned to a second value. The boundary selection operator for: Determine the re-assigned image gray value matrix as the potential boundary image matrix; The scanning straight line equation specifically introduced by the scanning module is as follows: in, ; ; in, is the tangent value of the corresponding scanning line in the corresponding coordinate system, and its angle is the angle with the line , the angle range is between, Reason The column matrix composed of is a column matrix consisting of the Euclidean distances from the origin of the coordinate system to the scanning line, The value range is from 1 to between, and are the width and length of the potential boundary image matrix respectively; The segmentation module is specifically used for: Starting from the first segmentation level, the following segmentation process is performed for each segmentation level in turn until the last segmentation level is reached: According to the scanning result, among the scanning lines that are not currently filtered out, a target line that meets the segmentation condition of the current segmentation level is filtered out; Performing neighborhood deduplication on the target straight line to obtain a target scanning straight line; The target scanning line is used to segment the current image matrix. When the current segmentation level is the first segmentation level, the current image matrix is ​​the potential boundary image matrix. When the current segmentation level is not the first segmentation level, the current image matrix is ​​the image matrix obtained after segmentation at the previous segmentation level.

4. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the method for segmenting a farmland plot image as described in any one of claims 1 to 2 is implemented.

Citation Information

Patent Citations

  • Farmland boundary identification method and system

    CN113221740A

  • Unmanned aerial vehicle image sub-field boundary extraction method and device

    CN114240980A