Sorghum ear number extraction method, device and equipment and storage medium
By integrating the color, depth, and texture features of sorghum images, the sorghum image data is segmented and the number of ears is extracted. This solves the problems of low efficiency and insufficient accuracy in sorghum yield estimation in existing technologies, and achieves stable, accurate, and efficient extraction of sorghum ear count.
Patent Information
- Application Number
- CN202511532656.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-24
- Publication Date
- 2026-02-13
AI Technical Summary
Existing technologies for estimating sorghum yield are inefficient and cumbersome, and the accuracy of sorghum ear number extraction based on UAV platforms is insufficient, especially in terms of poor applicability to different sorghum varieties.
By fusing the color, depth, and texture features of sorghum images, the sorghum image data is segmented and the number of ears is extracted. This includes preprocessing, color segmentation, depth segmentation, and texture segmentation. The intersection operation of color, depth, and texture features, as well as the geometric feature analysis of the image patches after texture segmentation, are used to accurately extract the number of sorghum ears.
It improves the stability and accuracy of sorghum ear number extraction, is applicable to different varieties of sorghum, and does not require manual data calibration. It is low in cost, widely applicable, and achieves efficient and accurate sorghum ear number estimation.
Smart Images

Figure CN121527104A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of sorghum yield estimation, in particular to a sorghum ear number extraction method, device, equipment and storage medium. BACKGROUND
[0002] It is known that sorghum is the fifth largest cereal crop in the world, second only to corn, rice, wheat and barley, and is widely planted in more than 100 countries and regions around the world and is widely used to produce biofuels, feed, food, etc. It is a major source of bioenergy and food for humans. Sorghum is widely planted in various climate zones in China and plays an important role in China's grain, feed, brewing, and bioenergy industries. In order to cultivate high-quality and high-yield excellent sorghum varieties, breeders need to monitor the sorghum phenotype information in large-area breeding plots in real time during the cultivation process, and yield data is the key data for determining whether a sorghum variety has high-yield traits.
[0003] In the traditional implementation, due to the limitation of labor cost, it is not feasible to obtain yield data by harvesting all sorghum ears and weighing them. In general, breeders determine the average number of grains per ear and the average weight of each grain by random sampling, and then obtain the number of sorghum ears per unit area (or per row) (unit area ear density) by manual counting, and estimate the yield based on the calculation method of yield = area * unit area ear density * average number of grains per ear * average weight per grain. In recent years, with the continuous progress of unmanned aerial vehicles and sensor technology, it has become possible to quickly and efficiently collect a large amount of crop phenotype data in the field. Therefore, a large number of breeders have also estimated the yield of sorghum based on crop ear recognition and sorghum ear number on the unmanned aerial vehicle platform. Specifically, RGB sorghum images are obtained by unmanned aerial vehicles, the ear recognition and sorghum ear number extraction task is regarded as a target detection task, a deep learning data set is constructed based on the RGB sorghum images, and the classic target detection network is used to complete the sorghum ear number extraction.
[0004] However, the above-mentioned manual measurement method for estimating the yield of sorghum has the defects of low efficiency, complicated operation and difficulty in application to large-scale field work. The method of estimating the yield of sorghum based on crop ear recognition and sorghum ear number on the unmanned aerial vehicle platform has the following problems: according to the research, there are few open source sorghum data sets at present, and most of them are sorghum planted abroad, which has the characteristics of short stem and tight ear, and lacks high-stem and loose-ear sorghum image data. The traits and ear morphology of different sorghum varieties differ greatly, and the target detection network trained using open source data sets lacks universality for different sorghum varieties, resulting in a decrease in extraction accuracy, and if manual data labeling is performed, it is time-consuming and labor-intensive. SUMMARY
[0005] Based on this, the application provides a sorghum ear number extraction method, device, equipment and storage medium, which fuses the color, depth and texture features of sorghum, performs segmentation and sorghum ear number extraction on the sorghum image data to obtain sorghum ear number data, and achieves the effects of improving the stability and extraction accuracy of sorghum ear number extraction, low use cost and wide applicability to different varieties of sorghum.
[0006] In a first aspect, a sorghum ear number extraction method is provided, which includes: Obtaining sorghum image data, pre-processing the sorghum image data to obtain pre-processed image data; According to the color feature and depth feature of the pre-processed image data, performing color segmentation and depth segmentation on the pre-processed image data respectively to obtain initial segmented image data; According to the texture feature of the initial segmented image data, performing texture segmentation on the initial segmented image data to obtain texture segmented image data; According to the texture segmented image data, extracting the sorghum ear number in the texture segmented image data to obtain sorghum ear number data.
[0007] According to an implementable manner in the embodiments of the application, according to the color feature and depth feature of the pre-processed image data, performing color segmentation and depth segmentation on the pre-processed image data respectively to obtain initial segmented image data includes: According to the color feature of the pre-processed image data, performing color segmentation on the pre-processed image data to obtain color segmented image data; According to the depth feature of the pre-processed image data, performing depth segmentation on the pre-processed image data to obtain depth segmented image data; Performing intersection operation on the color segmented image data and the depth segmented image data to obtain initial segmented image data.
[0008] According to an implementable manner in the embodiments of the application, according to the color feature of the pre-processed image data, performing color segmentation on the pre-processed image data to obtain color segmented image data includes: Performing decorrelation stretch operation on the pre-processed image data to obtain stretched image data; Performing color space projection operation on the stretched image data to obtain projected image data; Performing color threshold segmentation operation on the projected image data to obtain color segmented image data.
[0009] According to an implementable manner in the embodiments of the application, according to the depth feature of the pre-processed image data, performing depth segmentation on the pre-processed image data to obtain depth segmented image data includes: Performing stereo matching operation on the pre-processed image data to obtain image depth data; The local adaptive segmentation operation is performed on the image depth data to obtain depth segmented image data.
[0010] According to an implementable manner in the embodiments of the present application, the initial segmented image data is subjected to texture segmentation according to texture features of the initial segmented image data to obtain texture segmented image data, including: The gray feature values in the initial segmented image data are extracted according to the gray level co-occurrence matrix to obtain gray feature image data; The gray feature image data is input into a classifier model to perform classification operation on the gray feature image data to obtain the texture segmented image data.
[0011] According to an implementable manner in the embodiments of the present application, the number of sorghum spikes in the texture segmented image data is extracted according to the texture segmented image data to obtain the number of sorghum spikes data, including: The initial patch image data is obtained according to the texture segmented image data; The geometric features of the patches in the initial patch image data are calculated to obtain patch geometric feature data; The patch geometric feature data is input into a classifier model to obtain classified patch image data; The number of sorghum spikes in the classified patch image data is extracted to obtain the number of sorghum spikes data.
[0012] According to an implementable manner in the embodiments of the present application, the classified patch image data includes adherent patch image data and non-adherent patch image data, and the number of sorghum spikes in the classified patch image data is extracted to obtain the number of sorghum spikes data, including: The adherent patch image data is subjected to erosion and expansion operation to obtain adherent segmented patch image data; The number of sorghum spikes is extracted from the adherent segmented patch image data and the non-adherent patch image data to obtain the number of sorghum spikes data.
[0013] In a second aspect, a sorghum spike number extraction device is provided, which includes: A preprocessing unit is configured to acquire sorghum image data, and perform preprocessing on the sorghum image data to obtain preprocessed image data; An initial segmentation unit is configured to perform color segmentation and depth segmentation on the preprocessed image data according to color features and depth features of the preprocessed image data, respectively, to obtain initial segmented image data; A final segmentation unit is configured to perform texture segmentation on the initial segmented image data according to texture features of the initial segmented image data to obtain texture segmented image data; The ear number extraction unit is configured to extract the number of sorghum ears in the texture segmented image data according to the texture segmented image data, and obtain sorghum ear number data.
[0014] In a third aspect, a computer device is provided, comprising: at least one processor; and a memory in communication with the at least one processor; wherein The memory stores computer instructions executable by the at least one processor, and the computer instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect.
[0015] In a fourth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores computer instructions, wherein the computer instructions are configured to enable a computer to perform the method described in the first aspect.
[0016] According to the technical content provided in the embodiments of the present application, the sorghum image data is acquired, and the sorghum image data is preprocessed to obtain preprocessed image data. The preprocessed image data is color segmented and depth segmented according to the color feature and the depth feature of the preprocessed image data, respectively, to obtain initial segmented image data. The initial segmented image data is texture segmented according to the texture feature of the initial segmented image data, to obtain texture segmented image data. The number of sorghum ears in the texture segmented image data is extracted according to the texture segmented image data, to obtain sorghum ear number data. The foregoing operations segment the sorghum image data and extract the number of sorghum ears by fusing the color, depth and texture features of the sorghum, so as to obtain the sorghum ear number data, and achieve the effects of stability and extraction accuracy of the number of sorghum ears in different appearances, different varieties and different shooting environments, lossless, high efficiency, accuracy, no need for manual data calibration, low use cost and wider applicability to different varieties of sorghum. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 An application environment diagram of a sorghum ear number extraction method in an embodiment; Figure 2 A flowchart of a sorghum ear number extraction method in an embodiment; Figure 3 A decorrelation stretch result diagram of a sorghum ear number extraction method in an embodiment; Figure 4 A color feature ear segmentation result diagram of a sorghum ear number extraction method in an embodiment; Figure 5 A depth feature ear segmentation result diagram of a sorghum ear number extraction method in an embodiment; Figure 6A segmentation result schematic diagram of a color feature and a depth feature fusion of a sorghum ear number extraction method in an embodiment; Figure 7 A texture feature secondary detection result schematic diagram of a sorghum ear number extraction method in an embodiment; Figure 8 A sorghum ear number extraction result schematic diagram of a sorghum ear number extraction method in an embodiment; Figure 9 A sorghum ear number real value and sorghum ear number detection value correlation schematic diagram of a sorghum ear number extraction method in an embodiment; Figure 10 A preferred process schematic diagram of a sorghum ear number extraction method in an embodiment; Figure 11 A structure block diagram of a sorghum ear number extraction device in an embodiment; Figure 12 A schematic structure diagram of a computer device in an embodiment. DETAILED DESCRIPTION
[0018] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0019] The sorghum ear number extraction method provided by the present application can be applied in an application environment as shown in Figure 1 . Specifically, the server 103 obtains the sorghum image data sent by the terminal 101, pre-processes the sorghum image data to obtain pre-processed image data, performs color segmentation and depth segmentation on the pre-processed image data according to the color feature and the depth feature of the pre-processed image data, respectively, to obtain initial segmented image data, performs texture segmentation on the initial segmented image data according to the texture feature of the initial segmented image data, to obtain texture segmented image data, and extracts the sorghum ear number in the texture segmented image data according to the texture segmented image data, to obtain sorghum ear number data. The terminal 101 can be, but is not limited to, a UAV, and the server 103 can be implemented by an independent server or a server cluster composed of multiple servers.
[0020] Figure 2 A flowchart of a sorghum ear number extraction method provided by an embodiment of the present application, which can be executed by the server 103 in an application environment as shown in Figure 1 . As shown in Figure 2 , the method can include the following steps: Step 201: Obtain sorghum image data, and pre-process the sorghum image data to obtain pre-processed image data.
[0021] Here, during the heading and flowering stage of the sorghum, the sorghum RGB image data is collected by using a UAV equipped with a visible light camera on a sunny day. The UAV can fly along a preset arch-shaped route and complete data collection. The camera vertically downwardly photographs, and the exposure compensation is adjusted according to the lighting conditions to avoid motion blur and overexposure. After the sorghum image data is obtained, the sorghum image data can be pre-processed, wherein the pre-processing operation includes but is not limited to distortion correction, dark corner enhancement, and light enhancement.
[0022] Specifically, based on the EXIF metadata in the sorghum image data, the sorghum image data is dark corner enhanced by using software such as Lightroom, Photoshop or Snapseed; the sorghum image after dark corner enhancement is subjected to camera parameter calculation, and distortion correction is completed by using Photoscan software; the image after distortion correction is converted to CIE L*a*b* color space, and histogram equalization is performed on the L* channel, that is, the cumulative distribution function CDF and the conversion function T can be used to calculate the gray value of the L* channel after conversion, and the image after histogram equalization is converted back to the RGB color space to complete the light enhancement. It should be noted that the steps of pre-processing the sorghum image data are all prior art, and therefore, will not be described in detail here.
[0023] Step 203: According to the color features and depth features of the pre-processed image data, the pre-processed image data is subjected to color segmentation and depth segmentation respectively to obtain initial segmented image data.
[0024] The color features refer to the color difference between the sorghum ear part and soil, leaves, weeds and other sundries; the depth features refer to the spatial structure of the sorghum ear located at the top of the sorghum.
[0025] Here, the staff analyzes the obtained historical sorghum image data and finds that there is a certain color difference between the sorghum ear part and soil, leaves, weeds and other sundries, so the pre-processed image data can be subjected to color segmentation based on this difference; at the same time, since the sorghum plant has obvious spatial structure characteristics, from top to bottom, it can be roughly divided into ear part, high layer leaves, bottom layer leaves and root part, in addition, the height of other weeds in the sorghum field is also relatively low, therefore, in the sorghum field, the sorghum ear part has the maximum height value, so the pre-processed image data can be subjected to depth segmentation based on this spatial structure feature, and then the initial segmented image data can be obtained.
[0026] Step 205: performing texture segmentation on the initial segmentation image data according to a texture feature of the initial segmentation image data, to obtain texture segmentation image data.
[0027] The texture feature refers to a texture difference between the ear and the leaf.
[0028] Here, after obtaining the initial segmentation image data, since the initial segmentation image data fused with the color feature and the depth feature contains part of the incorrectly segmented leaves, the initial segmentation result can be detected again by using the texture feature of the sorghum ear, so as to remove the incorrectly segmented leaves. Specifically, since there is an obvious texture difference between the sorghum ear and the sorghum leaf, the sorghum ear is composed of a plurality of grains, the overall texture is more rough and complex, and there is no obvious directionality, while the texture of the leaf is more uniform and smooth, and there is obvious directionality, and then the initial segmentation image data can be subjected to texture segmentation to obtain texture segmentation image data.
[0029] Step 207: extracting the number of sorghum ears in the texture segmentation image data according to the texture segmentation image data, to obtain sorghum ear number data.
[0030] Here, after obtaining the texture segmentation image data, the ear region of the sorghum is segmented out to form a plurality of independent image patches. The plurality of image patches are sequentially traversed to determine the number of sorghum ears contained in each image patch, so as to complete the extraction of the number of sorghum ears and obtain the sorghum ear number data. Then, accurate sorghum ear number phenotype data is provided for sorghum breeding, which assists breeders in estimating the yield of sorghum and breeding excellent sorghum varieties. Meanwhile, it is also conducive to the continuous monitoring of the growth of sorghum and the estimation of subsequent yield.
[0031] It can be seen that, in the embodiments of the present application, the sorghum image data is obtained, and the sorghum image data is preprocessed to obtain preprocessed image data. The preprocessed image data is subjected to color segmentation and depth segmentation according to the color feature and the depth feature of the preprocessed image data, respectively, to obtain initial segmentation image data. The initial segmentation image data is subjected to texture segmentation according to a texture feature of the initial segmentation image data, to obtain texture segmentation image data. The number of sorghum ears in the texture segmentation image data is extracted according to the texture segmentation image data, to obtain sorghum ear number data. The foregoing operations fuse the color, depth and texture features of the sorghum, segment the sorghum image data and extract the number of sorghum ears, to obtain the sorghum ear number data, so as to achieve the stability and extraction accuracy of the extraction of the number of sorghum ears with different appearances, different varieties and different shooting environments, and the effects of lossless, efficient, accurate, no need for manual data calibration, low use cost and wider applicability to different varieties of sorghum.
[0032] The different steps in the above method flow are described in detail below. First, the step 203, i.e., "performing color segmentation and depth segmentation on the preprocessed image data according to the color features and depth features of the preprocessed image data to obtain initial segmented image data", is described in detail in combination with an embodiment.
[0033] According to the color features of the preprocessed image data, the preprocessed image data is color segmented to obtain color segmented image data; according to the depth features of the preprocessed image data, the preprocessed image data is depth segmented to obtain depth segmented image data; and the color segmented image data and the depth segmented image data are intersected to obtain initial segmented image data.
[0034] In an implementable manner, according to the color features of the preprocessed image data, the preprocessed image data is color segmented to obtain color segmented image data, including: performing a decorrelation stretch operation on the preprocessed image data to obtain stretched image data; performing a color space projection operation on the stretched image data to obtain projected image data; and performing a color threshold segmentation operation on the projected image data to obtain color segmented image data.
[0035] Here, referring to FIG. 1, the preprocessed image data is decorrelation stretched to obtain stretched image data, that is, by reducing the correlation between different bands of the preprocessed image data and performing contrast stretching to enhance color saturation and color difference, the overall visual effect of the preprocessed image data is improved to enhance the image color contrast and enlarge the color features of the ear. Figure 3 Specifically, as shown in FIG. 2(a), assuming that the preprocessed image data is represented by R, G and B, where R, G and B represent the red, green and blue color channels respectively, and the pixel number is represented by N, and the channel number is represented by C, the mean value of each channel of the preprocessed image data is calculated as follows: Figure 3 wherein, is the mean value of each channel of the preprocessed image data, and the covariance matrix between channels is calculated as follows: × matrix, wherein N represents the pixel number, and C represents the channel number. The channel information of the preprocessed image data is counted. Since the preprocessed image data is an RGB image, it usually contains 3 basic color channels, respectively corresponding to red (Red), green (Green) and blue (Blue) three primary colors, and through the combination of different intensities, most of the color images that can be perceived by the human eye can be presented. The mean value of each channel of the preprocessed image data is calculated as follows: , i.e., the mean value of the aforementioned 3 basic color channels, and the covariance matrix between channels is calculated as follows: , which can be specifically expressed as follows: ; wherein N represents the pixel number, and C represents the channel number. , and the channel mean value is represented by .
[0036] Principal component analysis was performed on the channels, and the covariance matrix was analyzed. Eigenvalue decomposition can be expressed as follows: ; Where V represents The feature vector is . × An orthogonal matrix, with column vectors representing characteristic directions; A represents... A diagonal matrix, i.e., a matrix whose diagonal elements are eigenvalues.
[0037] Projecting preprocessed image data onto the principal component space can be used... The specific expression is as follows: ; Where V represents eigenvectors; This indicates preprocessed image data; Indicates the channel mean; express Transpose of a matrix.
[0038] Principal component space The principal component space is obtained by stretching, and can then be used... The specific expression can be represented as follows: ; Where A represents A diagonal matrix; V represents eigenvectors; This indicates preprocessed image data; Indicates the channel mean; express Transpose of a matrix.
[0039] Inverse projection of the stretched principal component variables yields stretched image data, which can be used... The specific expression can be represented as follows: ; Where A represents A diagonal matrix; V represents eigenvectors; This indicates preprocessed image data; Indicates the channel mean; express The matrix is transposed. After the stretching operation, the correlation of the RGB three channels decreases significantly, resulting in richer colors and more distinct layers in the preprocessed image data, thus yielding stretched image data, such as...Figure 3 (b) is shown to facilitate the detection of the later ear of sorghum.
[0040] The color space projection operation is performed on the stretched image data to obtain projected image data. That is, the stretched image data is projected into the CIE L*a*b* color space to obtain the projected image data. In the CIE L*a*b* color space, the L* channel is the luminance, the a* channel reflects the color from green to red, and the b* channel reflects the color from blue to yellow. Compared with the RGB color space, it is more convenient to set the color threshold in the later stage.
[0041] Here, the color threshold segmentation operation is performed on the projected image data to obtain color segmented image data, as shown in Figure 4 Here, based on the experience of the staff, the following experience threshold can be set in advance in the "color segmenter" based on matlab software: ; Among them, by setting L*≥50, the bottom layer of the leaf soil and the shadow area are removed; by setting a*≥-40, the blue vein area of the leaf is removed, and by setting a*≤40, the soil area of the magenta is removed; by setting b*≥50, the green leaf and weed area is removed. That is, the projected image data is input into the color segmenter, and the color segmented image data can be obtained.
[0042] The above operation enhances the color features of the sorghum ear by decorrelation stretching, and through color segmentation of the preprocessed image data, the soil, leaves and weeds and other sundries can be segmented by color, which further guarantees the accurate extraction of the number of sorghum ears in the subsequent stage.
[0043] In another implementable manner, according to the depth features of the preprocessed image data, the preprocessed image data is depth segmented to obtain depth segmented image data, including: performing a stereo matching operation on the preprocessed image data to obtain image depth data; performing a local adaptive segmentation operation on the image depth data to obtain depth segmented image data.
[0044] Referring to Figure 5 As shown in Figure 5 (a), the stereo matching operation is performed on the preprocessed image data to obtain the image depth data, as shown in
[0045] The image depth data is locally adaptively segmented to obtain depth segmented image data, as shown in FIG. 2B. Figure 5 (b). Here, since the sorghum ear is located at the top of the plant and has a protruding shape, its depth value in the image depth data is smaller than that of the leaves, soil, weeds and the like. By using this depth feature, the region with a smaller local depth is segmented from the image depth data based on a locally adaptive threshold, thereby realizing the segmentation of the sorghum ear from the preprocessed image data. Specifically, the image depth data is segmented for the sorghum ear by using a locally adaptive threshold segmentation method. The principle of this method is as follows: each pixel in the image depth data is sequentially traversed, the distribution information of the pixel values in a given size field is counted, and the local threshold is calculated to determine the foreground or background. The specific expression can be represented as follows: ; wherein, represents the locally adaptive threshold in the field centered on the pixel ; represents the mean value of the pixel values in the field centered on the pixel ; represents a manually set offset. Here, assuming that the depth value of a certain pixel in the image depth data is D(x, y), when D(x, y)< (x, y), it is foreground, i.e., the sorghum ear; when D(x, y)>= (x, y), it is background, thereby obtaining the depth segmented image data.
[0046] After obtaining the color segmented image data and the depth segmented image data, the color segmented image data and the depth segmented image data are intersected, i.e., the intersection is taken, to obtain the initial segmented image data, as shown in FIG. 2C. Figure 6
[0047] The above operation generates a depth map by stereo vision and performs locally adaptive threshold segmentation based on the depth feature of the sorghum ear, thereby eliminating the regions of weeds and soil that are incorrectly detected in color feature segmentation. By performing depth segmentation on the preprocessed image data, the soil, leaves and weeds and other sundries can be segmented out in another dimension, i.e., the depth, thereby providing further guarantee for the accurate extraction of the number of sorghum ears in the subsequent step.
[0048] The above step 205, i.e., “performing texture segmentation on the initial segmented image data according to the texture feature of the initial segmented image data to obtain texture segmented image data”, will be described in detail below in combination with an embodiment.
[0049] According to the gray level co-occurrence matrix, the gray level characteristic value in the initial segmentation image data is extracted to obtain the gray level characteristic image data; the gray level characteristic image data is input into the classifier model to classify the gray level characteristic image data to obtain the texture segmentation image data.
[0050] Here, since the ear segmentation result of the hybrid of the color feature and the depth feature, i.e., the initial segmentation image data, contains part of the wrongly segmented leaves, the ear texture feature can be used for secondary detection of the segmentation result to eliminate the wrongly segmented leaves.
[0051] Referring to Figure 7 , according to the gray level co-occurrence matrix, the gray level characteristic value in the initial segmentation image data is extracted to obtain the gray level characteristic image data. Since the eigenvalue of the gray level co-occurrence matrix reflects much information of the texture, the periodicity, regularity and directionality of the sorghum texture and other features can be extracted by using the gray level co-occurrence matrix to count the gray level value relationship of the pixel pairs in different directions in the initial segmentation image data. Specifically, each segmentation blob in the initial segmentation image data is traversed, and the 1-distance 4-direction (0°, 45°, 90° and 135°) gray level co-occurrence matrix is calculated based on the G channel. Here, taking the 45° direction as an example, the specific expression of the gray level co-occurrence matrix can be represented as follows: ; wherein, represents the gray level value of the pixel at position in the initial segmentation image data; a represents the gray level value of the reference pixel; b represents the gray level value of the adjacent pixel paired with the reference pixel; is a discriminant function, and the function value is 1 when , otherwise the function value is 0.
[0052] The average value of the eigenvalues of the contrast, homogeneity, entropy, energy and correlation of the four-direction gray level co-occurrence matrix is calculated. The contrast reflects the intensity of the local gray level change in the initial segmentation image data, and is calculated by the difference between the gray level values of the pixels. The specific contrast can be represented by , and the specific expression can be represented as follows: ; wherein, represents the total gray level of the initial segmentation image data; a represents the gray level value of the reference pixel; b represents the gray level value of the adjacent pixel paired with the reference pixel; represents the gray level co-occurrence matrix.
[0053] The homogeneity reflects the smoothness of the local gray level change in the initial segmentation image data. The specific homogeneity can be represented by , and the specific expression can be represented as follows: ; wherein, represents the total gray level of the initial segmented image data; a represents the gray value of the reference pixel; and b represents the gray value of the adjacent pixel paired with the reference pixel; represents the gray level co-occurrence matrix.
[0054] The entropy reflects the complexity and randomness of the texture in the initial segmented image data. The specific entropy can be represented as , and the specific expression can be represented as follows: ; wherein, represents the total gray level of the initial segmented image data; a represents the gray value of the reference pixel; and b represents the gray value of the adjacent pixel paired with the reference pixel; represents the gray level co-occurrence matrix.
[0055] The energy reflects the uniformity of the gray distribution and the regularity of the texture in the initial segmented image data. The specific energy can be represented as , and the specific expression can be represented as follows: ; wherein, represents the total gray level of the initial segmented image data; a represents the gray value of the reference pixel; and b represents the gray value of the adjacent pixel paired with the reference pixel; represents the gray level co-occurrence matrix.
[0056] The correlation reflects the correlation degree of the gray values of the pixels and the adjacent pixels in the initial segmented image data. The correlation value is [-1, 1], -1 represents negative correlation, and 1 represents positive correlation. The specific correlation can be represented as , and the specific expression can be represented as follows: ; wherein, represents the total gray level of the initial segmented image data; a represents the gray value of the reference pixel; and b represents the gray value of the adjacent pixel paired with the reference pixel; represents the gray level co-occurrence matrix; and respectively represent the row mean and the column mean of the matrix; respectively represent the row standard deviation and the column standard deviation of the matrix, which measure the dispersion degree of the gray level. Through the above operations, the contrast, homogeneity, entropy, energy, and correlation of the four-direction gray level co-occurrence matrix can be obtained, and then the average values of the characteristic values, i.e., the gray feature image data, can be obtained.
[0057] The gray feature image data is input into the classifier model to perform a classification operation on the gray feature image data, to obtain texture segmentation image data, as shown in Figure 7 (a). Here, before modeling, the staff can manually collect the feature values of a plurality of ear patches and leaf patches to constitute training data, and train a support vector machine classifier based on the "classification learner" of the Matlab software, which can determine whether a patch is an ear patch or a leaf patch according to the input patch texture feature value. Specifically, the gray feature image data is input into the classifier model, and since the classifier can determine whether a patch is an ear patch or a leaf patch based on the feature value, a binary classification operation can be performed on the gray feature image data to obtain texture segmentation image data, so as to remove the patches classified as leaves. As shown in Figure 7 (b) and Figure 7 (c), which are local enlarged views of the texture segmentation image data; wherein the area with a red frame is a sorghum ear, and the area with a blue frame is a sorghum leaf.
[0058] The above operation obtains the corresponding feature value through the gray level co-occurrence matrix, and then the feature value can be input into the classifier model to determine whether the segmented patch is an ear or a leaf, so as to remove the incorrectly detected patches, and further provide further guarantee for accurate extraction of the number of sorghum ears. The leaf area incorrectly detected in the detection result is removed through the gray level co-occurrence matrix feature value classification, which significantly improves the accuracy and stability of the segmentation, and solves the problems of false detection and missed detection caused by single feature in the traditional method.
[0059] Finally, the above step 207, i.e., "extracting the number of sorghum ears from the texture segmentation image data to obtain sorghum ear number data", is described in detail in combination with the embodiments.
[0060] According to the texture segmentation image data, initial patch image data is obtained; the geometric features of the patches in the initial patch image data are calculated to obtain patch geometric feature data; the patch geometric feature data is input into the classifier model to obtain classified patch image data; and the number of sorghum ears in the classified patch image data is extracted to obtain sorghum ear number data.
[0061] The geometric features of the patches include but are not limited to the area, perimeter, solidity, range, and circularity of the patches, etc.
[0062] Here, the initial patch image data is obtained according to the texture segmentation image data. Specifically, after the sorghum ear segmentation based on multiple features, the ear region in the sorghum image is segmented out to obtain texture segmentation image data, and a plurality of independent patches are formed in the texture segmentation image data, and then the initial patch image data can be obtained.
[0063] The geometric features of the patches in the initial patch image data are calculated to obtain patch geometric feature data. Here, due to the phenomenon of sorghum ear adhesion, the number of sorghum ears corresponding to part of the patches is greater than 1, and the segmented patches need to be adhesion segmented to obtain the actual number of sorghum ears in the patch, so the geometric features of the patches in the initial patch image data can be calculated to obtain patch geometric feature data.
[0064] Specifically, the patch area can be represented as , which is the total number of pixels in the patch. Assuming that the two side lengths of the circumscribed rectangle of the patch are L and S, and the pixel coordinates are , then The specific expression of ; where L can be regarded as the pixel length of the circumscribed rectangle of the patch in the c coordinate axis direction; S can be regarded as the pixel length of the circumscribed rectangle of the patch in the d coordinate axis direction, that is, the expression of the patch area can realize the traversal of each pixel in the circumscribed rectangle of the patch.
[0065] The patch perimeter can be represented as , which is the number of pixels of the patch boundary, then The specific expression of ; where , , , and all represent the number of adjacent pixels.
[0066] The patch solidity can be represented as , which is an index for measuring the "compactness" or "fullness" of the patch shape, obtained by the patch area and the minimum convex polygon area of the patch represented by . The minimum convex polygon area of the patch is the smallest convex polygon of all points in the patch. The specific expression can be represented as follows: ; The patch circularity can be represented as , which is an index for describing the degree of similarity between the region shape and the circle, and can reflect the similarity between the region and the circle by comparing the area of the region with the area of its minimum circumscribed circle. Assuming that the radius of the minimum circumscribed circle of the patch is r, the specific expression of the patch circularity can be represented as follows: ; where represents the patch area; represents the patch perimeter.
[0067] By calculating the geometric features of the patch as described above, we can obtain the geometric feature data of the patch.
[0068] The geometric feature data of the image patches are input into the classifier model to obtain categorized image patch data. Here, the classifier model is constructed by selecting several non-adherent and adherent image patches, calculating their geometric features, and then using these features to create adhesion recognition training data. A support vector machine classifier, i.e., the classifier model, is trained using the "classification learner" function in Matlab software. After obtaining the classifier model, the geometric feature data of all image patches can be input into it, i.e., image patch classification is performed based on the classifier model to obtain categorized image patch data.
[0069] The number of sorghum ears in the classified patch image data is extracted to obtain sorghum ear count data. In one feasible method, extracting the number of sorghum ears from the classified patch image data includes: performing an erosion and dilation operation on the adhered patch image data to obtain adhered segmented patch image data; and performing sorghum ear count extraction operations on both the adhered segmented patch image data and the non-adhesive patch image data to obtain sorghum ear count data.
[0070] The categorized image data includes both adherent and non-adherent image data.
[0071] Reference Figure 8 As shown, for the image data of adhesion patches, such as Figure 8 As shown in (a), an erosion and expansion operation is performed to obtain image data of adhered and segmented patches, as follows. Figure 8 As shown in (b). Here, for the adhered patches in the adhered patch image data, the adhered segmented ears are processed based on morphological erosion and dilation to obtain the actual number of sorghum ears in the patch. Specifically, the erosion operation can define a specific shape, such as a circle or rectangle, and the erosion kernel of size can be represented by Q. The erosion kernel is used to traverse each pixel of the adhered patch image data, which can be represented by P, where x, y represent the pixel with coordinates (x, y). If the erosion kernel Q is completely inside P, the pixel is marked as 1; otherwise, it is marked as 0. After the traversal, all pixels marked as 0 in the adhered patch image data are removed. The specific expression can be expressed as follows: ; The dilation operation can be defined by a dilation kernel K. The kernel iterates through each pixel in the cohesive patch image data, where each pixel can be represented by a pixel J. Here, x and y represent the pixel at coordinates (x, y). If the kernel K intersects with J, the pixel is marked as 1; otherwise, it is marked as 0. After the iteration is complete, all pixels marked as 1 are added to the cohesive patch image data. The specific expression can be represented as follows: ; Through the above corrosion and expansion operation, the image data of the adhesion segmentation patches can be obtained.
[0072] Here, the sorghum ear count is extracted from both the contiguous and non-contiguous patch image data to obtain sorghum ear count data, such as... Figure 8 As shown in (c). Specifically, the patches in the contiguous segmented patch image data and the non-contiguous patch image data are traversed and accumulated, i.e., the sorghum ear number extraction operation is performed to obtain the sorghum ear number data.
[0073] The above operations obtain initial patch image data based on texture segmentation image data; adhesion recognition based on geometric features of the initial patch image data and adhesion segmentation based on morphological erosion and dilation solve the problem of missed detection caused by sorghum ear adhesion, thereby improving the accuracy of sorghum ear number extraction.
[0074] It should also be noted that, based on actual UAV RGB sorghum images of sorghum fields, the actual number of sorghum ears in each image is obtained through manual observation and counting. The method of this application is then used to obtain the detected value of the number of sorghum ears in the UAV RGB sorghum images. The detected value is compared with the actual value to demonstrate the high accuracy and reliability of the method of this invention. The specific process is as follows: 1. Acquisition of sorghum image data Using a DJI Mavic 3 Multispectral drone, equipped with one visible light lens and four multispectral lenses (green, red, red-edge, and near-infrared), image data of sorghum was collected between 10:00 AM and 2:00 PM. The drone flew along a pre-defined bow-shaped flight path to complete data collection, with a flight altitude of 12m and a forward / lateral overlap rate of 80%. The shooting mode was set to shutter priority (Speed mode), the shutter speed to 1 / 1000 second, the camera shooting vertically downwards, and the exposure compensation (EV) adjusted according to lighting conditions to avoid motion blur and overexposure.
[0075] 2. Preprocessing and cropping of sorghum image data Based on the EXIF metadata of the sorghum image data, the sorghum image data is dark corner enhanced, the camera parameter calculation is carried out using Photoscan software, and the distortion correction is carried out, based on the histogram equalization technology, the image after distortion correction is converted to CIE L*a*b* color space, and the L* channel gray value is limited to contrast adaptive histogram equalization, and finally the equalized histogram image is converted back to RGB color space. And the preprocessed image is cut according to the sorghum field block, and finally 54 pieces of preprocessed and cut preprocessed image data are obtained.
[0076] 3. Sorghum ear segmentation based on multiple features 3.1 Sorghum ear segmentation based on color features The matlab software is used to first stretch the preprocessed image data for decorrelation, such as Figure 3 Figures (a) and (b) are the preprocessed image data and the stretched image data, respectively. It can be seen that the input image color is single, the G channel and the B channel have strong correlation, and after decorrelation stretching, the image color is more rich, and the RGB three channels have reduced correlation. The color of the ear part is more obvious than the leaves, soil and weeds, and the color feature of the ear part is enhanced.
[0077] The stretched image data is converted to CIE L*a*b* color space to obtain projection image data; the color threshold is determined based on the "color segmenter" of matlab software, and the color threshold segmentation operation is performed on the projection image data. After threshold segmentation, the color segmented image data can be obtained, as shown in Figure 4 . It basically contains all the sorghum ear parts, but there are also some false detection of soil, weeds and leaf areas. Here, the color threshold can be selected as follows: ; And after obtaining the color segmented image data, erosion and expansion operations can be performed to process the foreground area of the color segmented image data.
[0078] 3.2 Sorghum ear segmentation based on depth features The Photoscan software is used to perform stereo matching on the preprocessed image data to generate a depth map, and image depth data is obtained. All preprocessed image data collected by single-strip unmanned aerial vehicle is imported into Photoscan software, and "align photos" and "create dense point cloud" operations are performed in turn to obtain depth segmentation image data. The depth map is segmented into foreground with lower depth and background with deeper depth, and the foreground is the ear segmentation result. As shown in Figure 5The image shown is a segmentation result of the ear based on depth features. The ear and upper leaves are segmented, achieving the removal of deeper soil, lower leaves, and weeds. The initial segmented image data is obtained by intersecting the color segmentation image data and the depth segmentation image data, as shown below. Figure 6 As shown, weeds and soil areas that were incorrectly detected by color features were successfully removed, but the results still included some upper-level leaves.
[0079] 3.3 Secondary detection of sorghum ears based on texture features Based on the initial segmented image data, 25 leaf patches and 75 ear patches were selected. The G channel was extracted, and the gray-level co-occurrence matrix (GLCM) along with its corresponding contrast, homogeneity, entropy, energy, and correlation were calculated. The eigenvalues were the average of the four directions. Using the "classification learner" in MATLAB software, the data was split into training, validation, and test sets in an 8:1:1 ratio, and a support vector machine classifier was trained to obtain the classifier model. Based on the classifier model, all gray-level feature image data were classified, and leaf patches were labeled and removed. For example... Figure 7 As shown, this is the result of secondary detection based on texture features. The blue area represents the detected leaf area, and the incorrectly detected leaf area was successfully removed.
[0080] 4. Extract the number of sorghum ears based on the segmentation results. like Figure 8 As shown, based on texture segmentation image data, 50 adhered patches and 50 non-adhered patches were selected, and the area, perimeter, solidity, range, and roundness of the sorghum patches were calculated. The data was divided into training set, validation set, and test set in a ratio of 8:1:1, and a support vector machine classifier was trained to obtain the classifier model. All sorghum patches were classified, and adhered patches were labeled.
[0081] Continue to refer to Figure 8 Based on the morphological erosion-dilation method, adhesive patches in the image data of adhesive patches are processed. First, the adhesive regions are segmented by erosion, and then the patches are restored by dilation. The number of sorghum ears corresponding to the adhesive patches is determined by the number of patches after erosion-dilation.
[0082] 5. Verify feasibility As shown above, the accuracy of the proposed method was verified based on measured UAV RGB images of 54 sorghum fields. However, due to the poor image quality of fields 48 and 51, 52 UAV images (i.e., sorghum image data) were ultimately selected as the method input. The actual number of sorghum ears in the images was obtained by manual counting, while the detected number of sorghum ears was determined by the method of this application, as shown in Table 1 below. The average accuracy reached 0.93, and the correlation between the detected number of sorghum ears and the actual number is as follows: Figure 9 As shown, R 2The correlation reaches 0.9378, proving the feasibility and accuracy of the method.
[0083] Table 1. Measured results of the method In combination with the implementation modes in the above embodiments, the following describes the method in combination with Figure 10 A preferred method process provided by the embodiment is described by example. As shown in the figure, the method can include the following steps: Figure 10 Step S301, acquiring sorghum image data, pre-processing the sorghum image data to obtain pre-processed image data.
[0084] Step S302, performing a de-correlation stretching operation on the pre-processed image data to obtain stretched image data.
[0085] Step S303, performing a color space projection operation on the stretched image data to obtain projected image data.
[0086] Step S304, performing a color threshold segmentation operation on the projected image data to obtain color segmented image data.
[0087] Step S305, performing a stereo matching operation on the pre-processed image data to obtain image depth data.
[0088] Step S306, performing a local adaptive segmentation operation on the image depth data to obtain depth segmented image data.
[0089] Step S307, performing an intersection operation on the color segmented image data and the depth segmented image data to obtain initial segmented image data.
[0090] Step S308, extracting gray level feature values in the initial segmented image data according to a gray level co-occurrence matrix to obtain gray level feature image data.
[0091] Step S309, inputting the gray level feature image data into a classifier model to classify the gray level feature image data to obtain texture segmented image data.
[0092] Step S310, obtaining initial patch image data according to the texture segmented image data.
[0093] Step S311, calculating geometric features of patches in the initial patch image data to obtain patch geometric feature data.
[0094] Step S312, inputting the patch geometric feature data into a classifier model to obtain classified patch image data, the classified patch image data including adherent patch image data and non-adherent patch image data.
[0095] Step S313, erosion and expansion operation is performed on the adhesion map image data to obtain adhesion segmentation map image data.
[0096] Step S314, high stalk number extraction operation is performed on the adhesion segmentation map image data and the non-adhesion map image data to obtain high stalk number data.
[0097] It should be understood that, although Figure 2 , Figure 10 The steps in the flowchart are displayed in sequence according to the direction of the arrow, but these steps are not necessarily executed in the order indicated by the arrow. Unless otherwise specified in this application, the execution of these steps has no strict order restriction, and these steps can be executed in other orders. Moreover, Figure 2 , Figure 10 At least part of the steps in ,
[0098] Figure 11 A structural schematic diagram of a high stalk number extraction device provided by an embodiment of the present application. The device can be arranged in the server in the application environment shown in Figure 1 to execute the method processes shown in Figure 2 , Figure 10 As shown in Figure 11 The device can include a preprocessing unit 401, an initial segmentation unit 403, a final segmentation unit 405, and a stalk number extraction unit 407. The main functions of each component module are as follows: The preprocessing unit 401 is configured to obtain sorghum image data, preprocess the sorghum image data, and obtain preprocessed image data. The initial segmentation unit 403 is configured to perform color segmentation and depth segmentation on the preprocessed image data according to the color features and depth features of the preprocessed image data, and obtain initial segmentation image data. The final segmentation unit 405 is configured to perform texture segmentation on the initial segmentation image data according to the texture features of the initial segmentation image data, and obtain texture segmentation image data. The stalk number extraction unit 407 is configured to extract the number of sorghum stalks in the texture segmentation image data according to the texture segmentation image data, and obtain high stalk number data.
[0099] In one embodiment, the initial segmentation unit 403 is further configured to: According to the color feature of the preprocessed image data, the preprocessed image data is color segmented to obtain color segmented image data; According to the depth feature of the preprocessed image data, the preprocessed image data is depth segmented to obtain depth segmented image data; The color segmented image data and the depth segmented image data are intersected to obtain initial segmented image data.
[0100] In one embodiment, the initial segmentation unit 403 is further configured to: perform a decorrelation stretch operation on the preprocessed image data to obtain stretched image data; perform a color space projection operation on the stretched image data to obtain projected image data; perform a color threshold segmentation operation on the projected image data to obtain color segmented image data.
[0101] In one embodiment, the initial segmentation unit 403 is further configured to: perform a stereo matching operation on the preprocessed image data to obtain image depth data; perform a local adaptive segmentation operation on the image depth data to obtain depth segmented image data.
[0102] In one embodiment, the final segmentation unit 405 is further configured to: perform an extraction operation on the gray scale feature values in the initial segmented image data according to a gray scale co-occurrence matrix to obtain gray scale feature image data; input the gray scale feature image data into a classifier model to perform a classification operation on the gray scale feature image data to obtain texture segmented image data.
[0103] In one embodiment, the ear number extraction unit 407 is further configured to: obtain initial patch image data according to the texture segmented image data; perform a calculation on the geometric features of the patches in the initial patch image data to obtain patch geometric feature data; input the patch geometric feature data into a classifier model to obtain classified patch image data; perform an extraction operation on the number of sorghum ears in the classified patch image data to obtain sorghum ear number data.
[0104] In one embodiment, the classified patch image data includes adherent patch image data and non-adherent patch image data, and the ear number extraction unit 407 is further configured to: perform an erosion and expansion operation on the adherent patch image data to obtain adherent segmented patch image data; perform a sorghum ear number extraction operation on the adherent segmented patch image data and the non-adherent patch image data to obtain sorghum ear number data.
[0105] The same or similar parts among the above various embodiments can be mutually referred to, and each embodiment focuses on the difference from other embodiments. Especially, for the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiments.
[0106] It should be noted that the embodiments of the present application can involve the use of user data. In actual application, user-specific personal data can be used in the schemes described in the present application within the scope allowed by applicable laws and regulations, as long as the applicable laws and regulations are met (for example, the user explicitly agrees, the user is explicitly notified, the user explicitly authorizes, etc.).
[0107] According to the embodiments of the present application, the present application also provides a computer device and a computer readable storage medium.
[0108] As shown in Figure 12 , it is a block diagram of a computer device according to an embodiment of the present application. The computer device is intended to represent various forms of digital computers or mobile devices. Among them, the digital computer can include a desktop computer, a portable computer, a workstation, a personal digital assistant, a server, a mainframe computer and other suitable computers. The mobile device can include a tablet computer, a smart phone, a wearable device, etc.
[0109] As shown in Figure 12 , the computer device 500 includes a computing unit 501, a ROM 502, a RAM 503, a bus 504 and an input / output (I / O) interface 505, the computing unit 501, the ROM 502 and the RAM 503 are connected to each other through the bus 504. The input / output (I / O) interface 505 is also connected to the bus 504.
[0110] The computing unit 501 can perform various processes in the method embodiments of the present application according to computer instructions stored in the read-only memory (ROM) 502 or loaded from the storage unit 508 to the random access memory (RAM) 503. The computing unit 501 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. The computing unit 501 can include but is not limited to a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. In some embodiments, the method provided by the embodiments of the present application can be implemented as a computer software program, which is tangibly contained in a computer readable storage medium, such as the storage unit 508.
[0111] The RAM 503 can also store various programs and data required for the operation of the computer device 500. Part or all of the computer programs can be loaded and / or installed onto the computer device 500 via the ROM 502 and / or the communication unit 509.
[0112] The input unit 506, the output unit 507, the storage unit 508, and the communication unit 509 in the computer device 500 can be connected to the I / O interface 505. Among them, the input unit 506 can be, for example, a keyboard, a mouse, a touch screen, a microphone, etc.; the output unit 507 can be, for example, a display, a speaker, an indicator light, etc. The computer device 500 can exchange information, data, etc. with other devices through the communication unit 509.
[0113] It should be noted that the device can also include other components necessary for normal operation. It can also only include components necessary for implementing the solutions of the present application, and does not necessarily include all components shown in the figure.
[0114] Various embodiments of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof.
[0115] Computer instructions for implementing the methods of the present application can be written in any combination of one or more programming languages. These computer instructions can be provided to the computing unit 501, such that when the computer instructions are executed by the computing unit 501, such as a processor, the steps involved in the embodiments of the methods of the present application are performed.
[0116] The computer readable storage medium provided by the present application can be a tangible medium, which can contain or store computer instructions for performing the steps involved in the embodiments of the methods of the present application. The computer readable storage medium can include, but is not limited to, storage media in electronic, magnetic, optical, electromagnetic, etc. forms.
[0117] The above detailed description does not constitute a limitation on the scope of protection of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for extracting the number of sorghum ears, characterized in that, The method includes: Acquire sorghum image data, and preprocess the sorghum image data to obtain preprocessed image data; Based on the color and depth features of the preprocessed image data, color segmentation and depth segmentation are performed on the preprocessed image data respectively to obtain initial segmented image data; Based on the texture features of the initial segmented image data, texture segmentation is performed on the initial segmented image data to obtain texture segmented image data; Based on the texture segmentation image data, the number of sorghum ears in the texture segmentation image data is extracted to obtain sorghum ear count data.
2. The method according to claim 1, characterized in that, The step involves performing color segmentation and depth segmentation on the preprocessed image data based on its color and depth features, respectively, to obtain initial segmented image data, including: Based on the color features of the preprocessed image data, color segmentation is performed on the preprocessed image data to obtain color segmented image data; Based on the depth features of the preprocessed image data, depth segmentation is performed on the preprocessed image data to obtain depth segmented image data; The initial segmented image data is obtained by performing an intersection operation on the color segmented image data and the depth segmented image data.
3. The method according to claim 2, characterized in that, The step of performing color segmentation on the preprocessed image data based on the color features of the preprocessed image data to obtain color-segmented image data includes: The preprocessed image data is subjected to decorrelation stretching to obtain stretched image data; Perform a color space projection operation on the stretched image data to obtain projected image data; The projected image data is subjected to color thresholding to obtain color segmented image data.
4. The method according to claim 2, characterized in that, The step of performing depth segmentation on the preprocessed image data based on the depth features of the preprocessed image data to obtain depth-segmented image data includes: Perform stereo matching on the preprocessed image data to obtain image depth data; Local adaptive segmentation is performed on the image depth data to obtain depth-segmented image data.
5. The method according to claim 2, characterized in that, The step of performing texture segmentation on the initial segmented image data based on the texture features of the initial segmented image data to obtain texture segmented image data includes: Based on the gray-level co-occurrence matrix, gray-level feature values are extracted from the initial segmented image data to obtain gray-level feature image data. The grayscale feature image data is input into a classifier model to perform a classification operation on the grayscale feature image data, thereby obtaining texture segmentation image data.
6. The method according to claim 5, characterized in that, The step of extracting the number of sorghum ears from the texture segmentation image data to obtain sorghum ear count data includes: Based on the texture segmentation image data, initial patch image data is obtained; The geometric features of the patches in the initial patch image data are calculated to obtain patch geometric feature data; The geometric feature data of the image patches are input into the classifier model to obtain classified image patch data; The number of sorghum ears in the classified image data is extracted to obtain sorghum ear count data.
7. The method according to claim 6, characterized in that, The classified patch image data includes adhered patch image data and non-adhered patch image data. The step of extracting the number of sorghum ears from the classified patch image data to obtain sorghum ear count data includes: The adhesion patch image data is subjected to erosion and dilation operations to obtain adhesion segmentation patch image data; The number of sorghum ears was extracted from both the adhering segmented patch image data and the non-adhering patch image data to obtain the number of sorghum ears data.
8. A sorghum ear count extraction device, characterized in that, The device includes: The preprocessing unit is used to acquire sorghum image data and preprocess the sorghum image data to obtain preprocessed image data. The initial segmentation unit is used to perform color segmentation and depth segmentation on the preprocessed image data according to the color features and depth features of the preprocessed image data, respectively, to obtain the initial segmented image data. The final segmentation unit is used to perform texture segmentation on the initial segmented image data based on the texture features of the initial segmented image data to obtain texture segmented image data; The ear number extraction unit is used to extract the number of sorghum ears from the texture segmentation image data based on the texture segmentation image data, so as to obtain sorghum ear number data.
9. A computer device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores computer instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method of any one of claims 1-7.
10. A computer-readable storage medium storing computer instructions thereon, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 7.