A machine vision-based flower branch thorn analysis method

By using a machine vision-based automated analysis method for flower thorns, the problems of cumbersome manual operation and insufficient accuracy in flower thorn analysis have been solved. This method enables efficient and accurate automated analysis of flower thorn parameters, thereby improving the automation level of the flower industry and the application efficiency of scientific research.

CN121259797BActive Publication Date: 2026-06-16云南省花卉技术培训推广中心 +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
云南省花卉技术培训推广中心
Filing Date
2025-11-14
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

Existing methods for analyzing flower branches and thorns suffer from problems such as cumbersome manual operation, low image acquisition quality, difficulty in accurately separating thorns from flower branches, and insufficient accuracy in extracting and classifying thorn morphological features. These methods are insufficient to meet the needs of the modern floriculture industry for large-scale, automated variety identification.

Method used

An automated analysis method for flower thorns based on machine vision is adopted. Through image acquisition equipment and computer vision algorithms, high-quality image acquisition, accurate region detection, rich morphological feature quantification, and efficient intelligent classification are achieved. The SVM classification method is used to identify the thorn morphology. Combined with the target detection algorithm with adaptive feature fusion and spatial consistency constraints, the most suitable single thorn region is selected, and the color, outline and geometric feature information of the thorn are extracted.

🎯Benefits of technology

It improves the automation level and application efficiency of flower branch thorn analysis, lowers the technical threshold of professional knowledge, and realizes the scientificity and reliability of flower breeding, quality control and market value assessment. It is highly adaptable and can cope with flower branch thorn analysis of different varieties and growth stages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121259797B_ABST
    Figure CN121259797B_ABST
Patent Text Reader

Abstract

The application discloses a kind of flower branch thorn analysis methods based on machine vision, belong to image processing technical field.The method is first by image acquisition equipment to obtain the image of flower branch with thorn, using adaptive feature fusion and spatial consistency constraint target detection algorithm, realize the position detection of flower branch and thorn in image.Succeedingly, the single thorn most suitable for analysis is screened, obtains thorn area information, and carries out area contour segmentation, extracts color and morphological feature.Based on the extracted information, the morphology of thorn is automatically distinguished using support vector machine (SVM) classifier, and the thorn type recognition is realized.The method of the application can consider overall structure and detail feature extraction, improve detection accuracy through multi-scale fusion and spatial constraint mechanism, improve the automatic identification and analysis efficiency of flower branch thorn.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing technology, and more specifically relates to a method for analyzing flower branches and thorns based on machine vision. Background Technology

[0002] Roses, including those in the genus *Rosa* of the Rosaceae family, are important economic crops, and the thorns on their branches are a crucial varietal identification feature. Thorns are structures on the flowering branches that develop from epidermal cells and serve a biological function of protecting plants from herbivores. Thorn morphology is systematically classified into four basic types: straight thorns, oblique straight thorns, curved thorns, and hooked thorns. Different varieties exhibit variations in thorn morphology, and these variations demonstrate high genetic stability, making them ideal indicators for variety identification. Parameter analysis of thorns is particularly important. Manual identification suffers from limitations such as high subjectivity, low efficiency, and the need for specialized knowledge, making it difficult to meet the demands of the modern floriculture industry for large-scale, automated variety identification.

[0003] This invention addresses this technological gap by innovatively proposing an automated analysis method for flower branch and thorn parameters based on machine vision. Through image acquisition equipment and computer vision algorithms, relevant parameters of flower branches and thorns can be quickly analyzed, lowering the technical barrier of specialized knowledge, improving work efficiency, and possessing significant application value for flower breeding, quality control, and market value assessment. Summary of the Invention

[0004] This invention aims to solve the technical problems existing in current flower branch thorn analysis methods, such as cumbersome manual operation, low image acquisition quality, difficulty in accurately separating thorns from flower branches, and insufficient accuracy in thorn morphological feature extraction and classification. It provides an automated flower branch thorn analysis method based on machine vision, which realizes high-quality image acquisition, accurate region detection, rich morphological feature quantification, and efficient intelligent classification of flower branch thorns, so as to improve the automation level of flower branch thorn phenotypic analysis and the efficiency and reliability of its application in scientific research, agricultural breeding and other fields.

[0005] To achieve the above objectives, the present invention employs the following technical solution: the method comprises:

[0006] The image acquisition device captures an image of a flower branch with thorns;

[0007] A target detection algorithm based on adaptive feature fusion and spatial consistency constraints is used to detect the location of flower branches and thorns in images.

[0008] Based on the detected flower branch and thorn location information, the most suitable single thorn for analysis is selected to obtain the thorn area information;

[0009] Based on the thorn region information, the thorn region outline is segmented, and the color information of the region and the thorn region outline information are analyzed.

[0010] Based on the outline information of the thorn region, the thorn feature information is extracted, and the thorn morphology is judged by SVM classification method to determine the type of thorn.

[0011] In one approach, the location of flower branches and thorns in the detected image specifically includes:

[0012] Input image I first obtains feature representation through shallow convolution, and then through a multi-layer convolutional network to gradually extract semantic information from a wider receptive field, extracting feature maps containing overall floral structure information and local detail information. ;

[0013] Subsequently, through the designed weight adaptive module, the feature maps of different layers are fused into a unified fused feature representation, which is used to dynamically adjust the contribution of different feature layers;

[0014] After completing the multi-scale fusion, a spatial consistency constraint mechanism is introduced to perform spatial smoothing and redundancy suppression on the pixel-level representation in the fused feature map.

[0015] Specifically, by taking each pixel p, in its neighborhood... A spatial consistency loss term is introduced, which penalizes feature differences only when adjacent pixels belong to the same category;

[0016] Finally, based on the deep fusion and spatial constraint feature representation obtained above, the positions of the flower branch region and each thorn are predicted in parallel using a customized binary position decoding head.

[0017] In one scheme, the spiked area information includes:

[0018] Based on the detected flower branch and thorn locations, the most suitable single thorn for analysis is selected to obtain the thorn region information, specifically:

[0019] Based on the detected location information of the flower branches, the image of the flower branch region is cropped to obtain an image containing only the flower branches. Based on the cropped flower branch image, the background image color is removed, and only the flower branch region is retained. The outline of the flower branch region is extracted to obtain the outline point set of the flower branch region. Based on the location information of all thorns, which includes the coordinates of the upper left and lower right points of the rectangle of the thorn region, the distance of the base of all thorns from the edge of the flower branch is calculated.

[0020] In one embodiment, the color information and the outline information of the spiked area include:

[0021] S401. Based on the image, the image is converted from RGB space to CIELAB space. When converting from RGB space to CIELAB space, the image is first converted from RGB color space to XYZ intermediate standard space, and then converted from XYZ intermediate standard space to CIELAB space to obtain the image in CIELAB color space.

[0022] S402. Based on the image, calculate the metric value of the target color.

[0023] In one approach, determining the type of thorn includes:

[0024] S501. Based on the outline information of the spike region, the skeleton information of the spike is extracted using the hit-or-miss transformation to obtain its skeleton curve c(t).

[0025] S502. Based on the skeleton line c(t) of the thorn, calculate the curvature and attachment angle of the thorn;

[0026] S503. Based on the thorn contour information, calculate the contour features of the contour, wherein the contour features include Fourier descriptors and Hu invariant moments.

[0027] S504. Based on the curvature k of the thorn, the attachment angle θ of the thorn, and the Fourier descriptor F... FD Hu invariant moment parameters Construct a comprehensive feature vector F;

[0028] Based on the established comprehensive feature vector F, a batch of data is collected to construct a dataset, the comprehensive feature vector F of the dataset is calculated, and an SVM classifier is used to classify the morphology of the spines.

[0029] In one approach, the integrated feature vector is constructed by fusing the geometric features, statistical moment features, Fourier descriptors, and boundary complexity information of the spikes into a set of high-dimensional feature vectors. This vector is calculated independently for each sample spike and then input into an SVM classifier to improve the accuracy of automatic identification and classification of different types of spike structures.

[0030] Beneficial effects of this invention:

[0031] By employing machine vision and intelligent algorithms, automatic detection, feature extraction, and classification of flower branches and thorns can be achieved, replacing traditional methods of manual observation and statistics. This significantly improves the efficiency and stability of data analysis and reduces subjective errors.

[0032] By utilizing a frosted white background, multi-source uniform illumination, and advanced contour and morphological feature fusion methods, background noise and reflective interference are effectively suppressed, significantly enhancing the detection and segmentation accuracy of flower thorns against complex backgrounds.

[0033] By integrating various geometric and statistical features such as curvature, attachment angle, Fourier descriptor, and Hu invariant moment, a highly discriminative mathematical characterization of thorns of different types and complex morphologies is achieved, providing a more scientific and comprehensive feature basis for thorn classification and germplasm screening.

[0034] This method is applicable to thorns of different varieties, forms, and growth stages, and can cope with challenges such as dense thorn distribution and diverse morphological changes, demonstrating strong adaptability and robustness.

[0035] This invention provides efficient and reliable data support and technical platform for high-throughput screening of flower branch phenotypes, variety improvement, resistance analysis, and related agricultural or biological research, and has broad promotional value and application prospects. Attached Figure Description

[0036] Figure 1 Flowchart of the method of this invention;

[0037] Figure 2 Schematic diagram of the spike structure. Detailed Implementation

[0038] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Typical embodiments of the invention are shown in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.

[0039] Unless otherwise defined, all technical and scientific terms used in this invention have the same meaning as understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. To facilitate understanding, the invention will now be described more fully with reference to the accompanying drawings. Typical embodiments of the invention are shown in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to make the disclosure of the invention more thorough and complete.

[0040] like Figure 1 The aforementioned method for analyzing flower thorns based on machine vision includes the following steps:

[0041] S1. The image acquisition device acquires an image of a flower branch with thorns;

[0042] An image of a thorny flower branch was captured by an image acquisition device. Specifically:

[0043] The thorny flower branch to be analyzed is placed on a white background board with a frosted surface to reduce glare. An image is then captured by a camera, scanner, or other image acquisition method.

[0044] In stage S1, to obtain high-quality images of thorny flower branches, the experimental environment must first be properly arranged. The flower branch samples to be analyzed are gently placed on a dedicated white background board. The surface of the white background board is frosted to minimize reflections from ambient light sources and the board itself, avoiding interference from light spots and reflections in subsequent image processing and analysis. The background board must be clean and free of obvious stains and debris to ensure a pure and uniform image background, facilitating subsequent segmentation and feature extraction. The flower branches are arranged so that their main stems and thorns are as clearly visible as possible, avoiding overlap or occlusion. Next, a suitable image acquisition device is selected based on actual needs, such as a high-resolution digital camera, flatbed scanner, or other acquisition devices with image input capabilities. During acquisition, the imaging sensor of the device is pointed directly at the flower branch being analyzed, and the light source and device parameters are adjusted according to lighting conditions to ensure appropriate exposure, rich detail, and no overexposure or underexposure. After image acquisition, the acquired raw images can be simply formatted and numbered, with standardized file naming for easy subsequent image management and batch processing. The entire process requires stable ambient light. It is recommended to operate in a closed light source box or an experimental environment with uniform lighting to obtain flower branch images with high signal-to-noise ratio and minimal external interference, thus providing a reliable data foundation for subsequent analysis algorithms.

[0045] S2. Detect the positions of flower branches and thorns in the acquired image.

[0046] In stage S2, to achieve high-precision detection of the flower branches and their thorns in the acquired flower branch images, a target detection algorithm based on adaptive feature fusion and spatial consistency constraints is designed. The core idea of ​​this algorithm is to fully extract the multi-scale structural information of the flower branches and thorns in the image by designing convolutional kernels of different sizes to act on feature maps in the network layers. Through multi-level feature extraction and fusion, feature capture of different receptive fields is achieved. Specifically, the input image I first obtains high-resolution, detail-preserving feature representations through shallow convolutions, and then, through a multi-layer convolutional network, gradually extracts semantic information under larger receptive fields, extracting feature maps containing both overall flower branch structural information and local detail information. That is,

[0047]

[0048] in, This represents convolution operations at different scales (size and shape). Subsequently, a designed weight adaptive module fuses the feature maps from different layers into a unified fused feature representation. :

[0049]

[0050] in, For the feature channel weights of the network adaptive learning, satisfying It is used to dynamically adjust the contribution of different feature layers.

[0051] After completing multi-scale fusion, a spatial consistency constraint mechanism is introduced to perform spatial smoothing and redundancy suppression on the pixel-level representations in the fused feature map. Specifically, for each pixel p, in its neighborhood... Introducing a spatial consistency loss term

[0052]

[0053] in, As an indicator function, feature differences are penalized only when adjacent pixels belong to the same category (flower branches or thorns) to improve the detection coherence of small target (thorn) regions.

[0054] Finally, based on the deep fusion and spatially constrained feature representations obtained above, a customized binary location decoding head is used to predict the positions of the flower branch region and each thorn in parallel. The decoding process utilizes high- and low-level feature fusion to represent the global flower branch region position using a two-dimensional Gaussian heatmap. This indicates that a sparse set of candidate locations is generated for each target individually. Low-confidence thorns are filtered out based on the confidence level of candidate points. The joint loss function for flower branch and thorn locations is defined as follows:

[0055]

[0056] in, and These represent the confidence regression losses for the heatmap of the flower branch backbone and the candidate thorn apex, respectively. , These are the weighting coefficients.

[0057] Using the algorithm described above, after automatic feature learning, spatial consistency optimization, and joint decoding, the input image I outputs the precise main stem region of the flower branch. and the spatial location information of all the spikes included. This provides an input foundation that is both accurate and spatially consistent for subsequent analysis and screening steps.

[0058] S3. Based on the detected flower branch position and thorn position information, the most suitable single thorn for analysis is selected to obtain the thorn area information.

[0059] Based on the detected flower branch location (spray_site) and thorn location (thorn_site}), the most suitable single thorn for analysis is selected, and the thorn region information (thorn_info) is obtained, specifically:

[0060] Because thorns grow in a three-dimensional spatial distribution on the surface of flower branches, in actual image acquisition scenarios, the flower branches need to be placed on a specific background to fix the subject before the camera can capture the image. During this process, the camera's imaging principle forcibly projects the flower branch and its surrounding three-dimensionally distributed thorns onto a two-dimensional image plane. This projection process inevitably causes the loss of three-dimensional spatial information of the thorns (such as the spatial angle between the thorn and the flower branch axis, and the radial distribution depth of the thorns on the flower branch, which cannot be retained in the two-dimensional image). It may also cause distortion of the two-dimensional imaging morphology of the thorns (for example, thorns growing at an angle may appear as shortened or stretched irregular outlines after projection). To ensure the accuracy and reliability of subsequent thorn feature analysis (such as size, shape, and texture), it is necessary to select the thorn with the least spatial information loss and the least imaging morphology distortion from all detected thorn targets in the image as the optimal target for subsequent analysis, in order to obtain precise thorn region information.

[0061] Based on the detected flower branch location information `spray_site`, the flower branch region image is cropped to obtain an image `image_cut` containing only the flower branch. Based on the cropped flower branch image `image_cut`, the background image color is removed, retaining only the flower branch region. The contour of the flower branch region is extracted to obtain the contour point set `{contours_spray}`. Based on the location information of all thorns `{thorn_site}`, which includes the coordinates of the upper left and lower right points of the rectangle containing the thorn, the distance `{d}` between the base of all thorns and the edge of the flower branch is calculated as follows:

[0062] Taking one of the thorns as an example, such as Figure 2 As shown, the offset distance of the thorn base from the edge of the flower branch is calculated. The coordinates of the upper left point of the rectangle containing the thorn area are A, and the coordinates of the lower right point are B. The coordinates of the two intersection points of the rectangle containing the thorn and the edge of the flower branch are C and D. Since the lower right point B of the rectangle containing the thorn is located within the flower branch area, the direction of the offset vector of the thorn base from the edge of the flower branch is from B to A. Therefore, the formula for calculating the offset distance di of the thorn base from the edge of the flower branch can be expressed as:

[0063]

[0064] Based on the formula shown above, all thorn information is traversed sequentially, and the offset distance di between the base of each thorn and the edge of the flower branch is calculated to obtain the distance {d} between the base of all thorns and the edge of the flower branch. The thorn with the minimum value in the set {d} is the most suitable thorn for analysis, and the thorn region information thorn_info is obtained.

[0065] S4. Based on the thorn region information, segment the thorn region outline, and analyze the color information of the region and the thorn region outline information.

[0066] Based on the thorn region information thorn_info, the thorn region outline contours_thorn are segmented, and the color information of the region is analyzed, specifically:

[0067] Based on the thorn region information thorn_info, and the offset vector of the thorn from its base. (Including offset distance and direction) Crop out an image containing only the thorn area (excluding the flower branch area).

[0068] Based on the forestry industry standard LY / T 1868-2025, "Guidelines for Testing the Distinctiveness, Uniformity, and Stability of New Rosa Varieties," the color of thorns is classified into four types: green, yellow, red, and purple. The color determination method proposed in this invention classifies the thorn color into one of these types. The specific method is as follows:

[0069] S401. Based on the image_cut, convert the image_cut from RGB space to CIELAB space. When converting from RGB space to CIELAB space, first convert the image from RGB color space to XYZ intermediate standard space, and then convert from XYZ intermediate standard space to CIELAB space to obtain the image_lab in CIELAB color space.

[0070] The specific method for converting from RGB space to the intermediate standard space XYZ is as follows:

[0071]

[0072] in: To linearize R, the specific processing method is as follows; the same applies to G and B.

[0073]

[0074] Matrix M is the color transformation matrix, denoted as:

[0075]

[0076] The specific method for converting from XYZ space to CIELAB space is as follows:

[0077]

[0078] in:

[0079]

[0080] f(t) is a nonlinear transformation function, specifically:

[0081]

[0082] S402. Based on the image image_lab, calculate the metric value dis relative to the target color. The specific calculation method is as follows:

[0083]

[0084] Where: L i A i B i The target colors are specified in the standard color pixel values ​​for green, yellow, red, and purple, as detailed in the table below:

[0085] <![CDATA[L i ]]> <![CDATA[A i ]]> <![CDATA[B i ]]> green 50 -60 40 yellow 85 -10 90 red 45 75 60 Purple 40 60 -40

[0086] The color of the thorn can then be divided into min{dis 绿色 dis 黄色 dis 红色 dis 紫色}

[0087] S5. Based on the outline information of the thorn region, extract the thorn feature information, and use the SVM classification method to identify the thorn morphology and determine the type of thorn.

[0088] Based on the contour information of the thorn region (contours_thorn), the thorn feature information is extracted, and the thorn morphology is determined using the SVM classification method to identify the thorn type. Specifically:

[0089] S501. Based on the contour information of the thorn region, contours_thorn, the skeleton information of the thorn is extracted using the hit-or-miss transformation to obtain its skeleton curve c(t). The transformation iteration formula is as follows:

[0090]

[0091] Where S is a set of structuring element pairs used for endpoint detection and intersection detection. The action of hitting or missing is defined as:

[0092]

[0093] in, This involves performing an erosion operation on the image. B and C are complementary element pairs used to match the foreground and background.

[0094] S502. Based on the skeleton line c(t) of the thorn, calculate the curvature and attachment angle of the thorn.

[0095] Curvature calculation:

[0096] Based on the skeleton line c(t) of the thorn, the curvature k(t) at each point on the skeleton line c(t)=(x(t),y(t)) is calculated using the following formula:

[0097]

[0098] Based on the curvature k(t) at each point on the skeleton line c(t) of the thorn, the degree of bending k of the thorn is taken as the average value of the curvature k(t) at each point.

[0099] angle of birth calculate:

[0100] Let the base of the thorn be... The tip is The tangent direction of the flower branch is Then the direction vector of the thorn is Then, from the perspective of life The calculation formula is as follows:

[0101]

[0102] in, This represents the dot product.

[0103] S503. Based on the thorn contour information contours_thorn, calculate the contour features of the contour, wherein the contour features include Fourier descriptors and Hu invariant moments.

[0104] Fourier descriptor F FD Calculation:

[0105] Based on the thorn contour information contours_thorn, the thorn contour point sequence is... , represented as a complex number Its Discrete Fourier Transform (DFT) is:

[0106]

[0107] Take the first L low-frequency coefficients As an eigenvector, F can be obtained FD :

[0108]

[0109] Hu invariant moment parameters The specific calculation method is as follows:

[0110] Based on the thorn contour information contours_thorn, a binary image I of the thorn is obtained. binary ,

[0111] Its (p+q)th moment is:

[0112]

[0113] Its central moment is:

[0114]

[0115] in, The center of mass.

[0116] Its normalized central moments are:

[0117]

[0118] use It is possible to construct 7 translation, rotation, and scaling invariant values. .

[0119]

[0120] S504. Based on the curvature k of the thorn, the attachment angle θ of the thorn, and the Fourier descriptor F... FD Hu invariant moment parameters A comprehensive feature vector F can be constructed:

[0121]

[0122] Based on the established comprehensive feature vector F used to describe the characteristics of the spines, a batch of data is collected to construct a dataset. The comprehensive feature vector F of the dataset is calculated, and an SVM classifier is used to classify the morphology of the spines.

[0123] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0124] It should be understood that the above detailed description of the technical solutions of the present invention with reference to preferred embodiments is illustrative and not restrictive. Those skilled in the art can modify the technical solutions described in the embodiments or make equivalent substitutions for some of the technical features based on reading this specification; however, these modifications or substitutions do not cause the essence of the corresponding technical solutions to depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for analyzing flower branches and thorns based on machine vision, characterized in that: The method includes: The image acquisition device captures an image of a flower branch with thorns; A target detection algorithm based on adaptive feature fusion and spatial consistency constraints is used to detect the location of flower branches and thorns in images. Based on the detected flower branch and thorn locations, the most suitable single thorn for analysis was selected to obtain thorn area information; Based on the information of the thorn region, the outline of the thorn region is segmented, and the color information of the region and the outline information of the thorn region are analyzed. Based on the outline information of the thorn region, thorn feature information is extracted, and SVM classification is used to identify the thorn morphology and determine the type of thorn; The locations of flower branches and thorns in the detected image specifically include: Input image I first obtains feature representation through shallow convolution, and then through a multi-layer convolutional network to gradually extract semantic information from a wider receptive field, extracting feature maps containing overall floral structure information and local detail information. ; Subsequently, through the designed weight adaptive module, the feature maps of different layers are fused into a unified fused feature representation, which is used to dynamically adjust the contribution of different feature layers; After completing the multi-scale fusion, a spatial consistency constraint mechanism is introduced to perform spatial smoothing and redundancy suppression on the pixel-level representation in the fused feature map. Specifically, by taking each pixel p, in its neighborhood... A spatial consistency loss term is introduced, which penalizes feature differences only when adjacent pixels belong to the same category; Finally, based on the deep fusion and spatial constraint feature representation obtained above, the positions of the flower branch region and each thorn are predicted in parallel using a customized binary position decoding head. The information on the spiked area includes: Based on the detected flower branch and thorn locations, the most suitable single thorn for analysis was selected, yielding thorn region information, specifically: Based on the detected location information of the flower branches, the image of the flower branch region is cropped to obtain an image containing only the flower branches. Based on the cropped flower branch image, the background image color is removed, and only the flower branch region is retained. The outline of the flower branch region is extracted to obtain the outline point set of the flower branch region. Based on the location information of all thorns, which includes the coordinates of the upper left and lower right points of the rectangle of the region where the thorn is located, the distance of the base of all thorns from the edge of the flower branch is calculated. Determining the type of thorn includes: S501. Based on the spike region contour information, and using the hit-or-miss transformation, the skeleton information of the spike is extracted to obtain its skeleton curve c(t). S502. Based on the skeleton line c(t) of the thorn, calculate the curvature and attachment angle of the thorn; S503. Based on the spike contour information, calculate the contour features of the contour, wherein the contour features include Fourier descriptors and Hu invariant moments. S504. Based on the curvature k of the thorn, the attachment angle θ of the thorn, and the Fourier descriptor F... FD Hu invariant moment parameters Construct a comprehensive feature vector F; The aforementioned thorn region information: Based on the established comprehensive feature vector F, a batch of data is collected to construct a dataset, the comprehensive feature vector F of the dataset is calculated, and an SVM classifier is used to classify the morphology of the thorns. Calculate the offset distance of the thorn base from the edge of the flower branch. Let the coordinates of the upper left point of the rectangle containing the thorn area be A, and the coordinates of the lower right point be B. The coordinates of the two intersection points of the rectangle containing the thorn and the edge of the flower branch are C and D. Since the lower right point B of the rectangle containing the thorn is located within the flower branch area, the direction of the offset vector of the thorn base from the edge of the flower branch is from B to A. Therefore, the formula for calculating the offset distance di of the thorn base from the edge of the flower branch is as follows: ; Based on the formula shown above, all thorn information is traversed sequentially, and the offset distance di between the base of each thorn and the edge of the flower branch is calculated to obtain the distance {d} between the base of all thorns and the edge of the flower branch. The thorn with the minimum value in the set {d} is the most suitable thorn for analysis, and the thorn region information thorn_info is obtained.

2. The method for analyzing flower branches and thorns based on machine vision according to claim 1, characterized in that: The color information and the outline information of the thorn area include: S401. Based on the image, the image is converted from RGB space to CIELAB space. When converting from RGB space to CIELAB space, the image is first converted from RGB color space to XYZ intermediate standard space, and then converted from XYZ intermediate standard space to CIELAB space to obtain the image in CIELAB color space. S402. Based on the image, calculate the metric value of the target color.

3. The method for analyzing flower branches and thorns based on machine vision according to claim 1, characterized in that: The comprehensive feature vector is constructed by fusing the geometric features, statistical moment features, Fourier descriptors, and boundary complexity information of the thorn into a set of high-dimensional feature vectors. This vector is calculated independently for each sample thorn and finally input into the SVM classifier to improve the accuracy of automatic identification and classification of different types of thorn structures.