A Grading Method for Appearance Quality of Water Chestnut Based on Multi-Feature Serial Fusion
By collecting multi-angle images of water chestnuts and extracting and fusing various features, the problem of low accuracy in visual classification of water chestnut appearance was solved, and efficient grading of water chestnut quality was achieved.
Patent Information
- Application Number
- CN202210897509.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-28
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2042-07-28
AI Technical Summary
Existing visual classification methods for water chestnut species fail to comprehensively consider various quality characteristics of crops, resulting in poor classification results. Furthermore, collecting only a single image cannot fully represent the characteristics of water chestnut species, leading to low classification accuracy.
A multi-feature serial fusion-based method for grading the appearance quality of water chestnut seeds is adopted. Image information of water chestnut seeds from three angles is acquired by an industrial camera. After preprocessing, geometric features, distortion features, and texture features are extracted and fused. Finally, a support vector machine classifier is used to determine the quality grade of water chestnut seeds.
This improves the accuracy of water chestnut appearance quality grading, enabling a more comprehensive reflection of the actual shape characteristics of water chestnuts and enhancing the accuracy of intelligent water chestnut grading.
Smart Images

Figure CN115240045B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a visual classification method for the appearance of water chestnuts, and more particularly to a method for grading the appearance quality of water chestnuts based on multi-feature serial fusion. Background Technology
[0002] Water chestnut is an annual aquatic herbaceous plant rich in nutrients. Its stems and leaves can be used as feed, and its fruit, rich in starch, is edible. It also helps purify water and improve the environment. Water chestnut varieties are highly susceptible to degeneration, exhibiting characteristics such as longer horns, thicker shells, poorer taste, and reduced yield. To ensure continuous optimization of water chestnut varieties, selection must be carried out after harvesting. Traditional selection and grading are mainly done manually. Manual selection is labor-intensive, inefficient, and costly, and its reliance on experience and subjectivity leads to a high error rate.
[0003] Existing research on water chestnuts can be broadly categorized into two areas: harvesting and post-processing. Regarding harvesting, in 2018, Changsha Ninghu Machinery Equipment Co., Ltd. invented a handheld water chestnut harvester (authorization announcement number: CN 109429693B), which facilitates the harvesting of water chestnuts that are difficult to reach manually, increasing the harvesting range and efficiency. Also in 2018, Liu Zhipeng et al. of Jiangsu Jicui Intelligent Manufacturing Technology Research Institute Co., Ltd. invented a water chestnut harvesting robot (application announcement number: CN 108124585 A), which allows for gentle harvesting of water chestnuts without damaging the vines, adjusting the gap of the rotating wheels according to the size of the mature fruit. In 2021, Cheng Jianghua et al. of the Agricultural Products Processing Research Institute of Anhui Academy of Agricultural Sciences invented a non-destructive automatic grading and harvesting device for water chestnuts (application announcement number: CN 113950944). A) The invention has a trapezoidal ring-shaped mesh conveyor belt installed on the outside of the harvesting vessel, with conveyor rollers attached to the bottom and top, which can harvest and sort the harvested fruits, reduce damage to the plants, and improve harvesting efficiency.
[0004] Regarding the post-processing of water chestnuts, in 2019, Zhang Guozhong et al. from Huazhong Agricultural University invented an automatic shelling machine for fresh water chestnuts (authorization announcement number: CN 109645506 B). This invention includes a cutting device, a shelling device, and a separation device, which can complete the shelling and separation work in one go, thereby improving the production efficiency of water chestnut shelling. As can be seen from the above literature, most existing research on water chestnuts is based on mechanical mechanisms, using suitable mechanical mechanisms to achieve the harvesting and shelling of water chestnuts. However, mechanical mechanisms inevitably cause mechanical damage to water chestnuts during processing. At the same time, there is currently a lack of literature on the appearance inspection of water chestnuts. Therefore, this invention adopts a non-destructive inspection method based on machine vision to inspect and grade the appearance of water chestnuts.
[0005] Existing machine vision-based methods for crop grading and selection have the following problems:
[0006] (1) The various quality characteristics of crops were not comprehensively considered, resulting in poor visual classification of crop appearance.
[0007] (2) Collecting only a single image of a crop cannot fully express its characteristics, resulting in low accuracy in classification and grading.
[0008] The aforementioned problems hinder the development of intelligent crop grading and classification, preventing it from completely replacing manual seed selection and grading with high accuracy. This patent first searched for patents and papers on the appearance of water chestnuts. Due to a lack of literature on visual detection of water chestnuts, literature on visual detection of the appearance of similar crops was also searched.
[0009] In 2013, Tan Yuzhi et al. from China Agricultural University proposed a machine vision-based method for detecting and grading green potatoes (authorization announcement number: CN 103394472 A). This invention uses image segmentation and contour removal to calculate the H value point-by-point in the scanned potato target area to determine whether the potato is a normal potato. Its drawback is that this method only uses the color features of the potato image to classify the quality grade of the potato, which has limitations and cannot guarantee the accuracy of potato grading.
[0010] In 2017, Zhao Jing et al. from Shandong University of Technology proposed a machine vision-based online damage detection and classification method for corn seeds (application publication number: CN 108020556 A). This invention identifies damaged corn kernels through online damage detection and classification, extracting 16 feature values of corn kernels, including 7 Hu invariant moments, and establishing a corn kernel damage identification model that can accurately and efficiently identify damaged corn kernels. Its drawback is that although this invention combines multiple features of corn kernels, it can only classify corn into two categories: damaged and intact, and cannot meet the requirements for grading multiple quality levels, thus having certain limitations.
[0011] To address the problems existing in the aforementioned patents, in 2019, Shen Tao et al. from Jinan University proposed a machine vision-based apple grading method and system (application publication number: CN 110276386 A). This invention extracts color features, fruit shape features, fruit diameter features, and surface defect features from the images of the samples to be tested, and uses a genetic algorithm and a BP neural network to establish a classification model of sample features and grades, classifying the apples to be tested into premium, first-grade, and second-grade categories. Its drawback is that this invention only takes one image of each apple, obtaining only a portion of the apple's shape features, which cannot represent the apple's comprehensive feature information, leading to a decrease in the final classification accuracy.
[0012] In conclusion, to improve the accuracy of visual classification of water chestnuts and other crops, it is necessary to establish a suitable feature extraction algorithm based on the actual shape characteristics of water chestnuts and to adopt a suitable classifier. Summary of the Invention
[0013] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method for grading the appearance quality of water chestnuts based on multi-feature serial fusion, which can effectively utilize the appearance information of water chestnuts to achieve quality grading and classification.
[0014] The objective of this invention is achieved as follows: a method for grading the appearance quality of rhombus seeds based on multi-feature serial fusion, characterized by comprising the following steps:
[0015] Step 1) Acquire images of the water chestnut seed by using an industrial camera to capture image information of the water chestnut seed from three angles;
[0016] Step 2) Image preprocessing of the rhombus seed;
[0017] Step 3) Extract the three features of the rhombus species, including geometric feature data extraction, distortion feature data extraction, and texture feature extraction;
[0018] Step 4: Feature fusion and classification recognition;
[0019] As a further limitation of the present invention, step 1) specifically includes: taking the center of gravity of the water chestnut as the origin, three cameras are respectively located on the x-axis, y-axis and z-axis of the spatial rectangular coordinate system, with the lens at the same distance from the water chestnut, wherein side A is the lateral ridge surface of the water chestnut, side B is the ventral surface of the water chestnut, and side C is the long horn end of the water chestnut; each horn is used to collect images from sides A, B and C respectively.
[0020] As a further limitation of the present invention, the geometric feature data extraction in step 3) includes: applying opening operation to the three angle images of the acquired rhombus seed, first performing erosion operation, then performing dilation operation to eliminate image noise and eliminate the influence of sharp corners on subsequent rectangle fitting; and using the Sobel edge detection algorithm to extract smooth and continuous rhombus seed body edges from the above-mentioned denoised binary image.
[0021] Using OpenCV open-source image processing functions, the above contours were fitted with a minimum rectangle. For each rhombus, three bounding rectangles of the main contours were obtained, where the length of the bounding rectangle on side A is L. A Width W A The length of the circumscribed rectangle on side B is L. B Width W B The length of the circumscribed rectangle on side C is L C Width W C Approximately consider L A =L B W A =LC W B =W C Therefore, the minimum circumscribed cuboid volume V of the rhombus is:
[0022] V = L A ×L C ×W B (1)
[0023] As a further limitation of the present invention, the distortion feature data extraction in step 3) includes: extracting the boundary contour of the rhombus image from the A-side and B-side projection images of the rhombus, determining the centroid of the image, and drawing a straight line L perpendicular to the major axis of the rhombus through the centroid, thus dividing the rhombus image contour into left and right sides. Similarly, in the C-side projection image of the rhombus, drawing a straight line perpendicular to the minor axis of the rhombus through the centroid, also dividing the C-side projection image into left and right sides. A straight line l perpendicular to the line L is drawn at each pixel point between the upper and lower boundaries of the image. i These straight lines intersect each of the two sides of the rhombus projection image outline, with coordinates (x, y, y) respectively. i ,h i ) and (y i ,h i ), and the pixel corresponding to line L is (o i ,h i If the A-side distorted variable r is... A The calculation formula is:
[0024]
[0025] Where n is the number of pixels of line L between the upper and lower bounds of the image;
[0026] The distorted variable r on sides B and C of the rhombus B and r C Similarly, the value of the distortion r of the rhombus can be obtained from equation (2) on the corresponding projected image. The formula for calculating the distortion r of the rhombus is:
[0027]
[0028] Where, r A For the A-side anomaly variable of the rhombus species, r B For the B-side deformity variable of the rhombus species, r C For the C-side anomaly variable of the rhombus species.
[0029] As a further limitation of the present invention, the texture feature data extraction in step 3) includes: extracting the gray-level co-occurrence matrix in the rhombus image, and realizing the description of texture features by calculating its energy, contrast, entropy and inverse variance;
[0030] 1) Energy: Calculated by summing the squares of the elements in the gray-level co-occurrence matrix, it represents the uniformity of the gray-level distribution and the fineness of the texture in the image. The calculation formula is:
[0031]
[0032] Where P(i,j) refers to the normalized gray-level co-occurrence matrix, and i and j are the values of the i-th row and j-th column elements of the co-occurrence matrix, respectively;
[0033] 2) Contrast: Reflects the distribution of values in the matrix and the degree of local variation, indicating the image's sharpness and texture depth. The calculation formula is:
[0034]
[0035] Where P(i,j) refers to the normalized gray-level co-occurrence matrix, and i and j are the values of the i-th row and j-th column elements of the co-occurrence matrix, respectively;
[0036] 3) Entropy: A measure of the randomness of information in an image, representing the complexity of gray levels in the image space. The calculation formula is:
[0037]
[0038] Where P(i,j) refers to the normalized gray-level co-occurrence matrix, and i and j are the values of the i-th row and j-th column elements of the co-occurrence matrix, respectively;
[0039] 4) Inverse variance: Reflects the clarity and regularity of the texture; the calculation formula is:
[0040]
[0041] Where P(i,j) refers to the normalized gray-level co-occurrence matrix, and i and j are the values of the i-th row and j-th column elements of the co-occurrence matrix, respectively; by calculating the above parameter values, the extraction of rhombus texture feature data is realized.
[0042] As a further limitation of the present invention, step 4) specifically includes:
[0043] The values of three types of features—geometric features, distortion features, and texture features—are normalized using deviation standardization to map the original data to the [0,1] interval.
[0044] The normalization formula is as follows:
[0045]
[0046] Where maxM is the maximum value of the elements in the feature vector, minM is the minimum value of the elements in the feature vector, m is an element in the feature vector, and m′ is a normalized element. The normalized feature vector is then represented as M′.
[0047] The geometric features, distortion features and texture features of the rhombus are normalized by Equation (8), and then the features are fused by serial fusion. The rhombus feature vector after serial fusion is represented as F=[V′,R′,W′], where V′ is the normalized geometric feature vector, R′ is the normalized distortion feature vector, and W′ is the normalized texture feature vector.
[0048] The classification and recognition process consists of four parts: First, the water chestnut varieties in the training samples are divided into four quality grades: first-grade, second-grade, third-grade, and fourth-grade, and the corresponding water chestnut varieties are labeled. Second, geometric features, distortion features, and texture features are extracted from the preprocessed water chestnut varieties images, and after normalization, the three features are serially fused into the required classification features. Then, the fused classification features and corresponding labels are used as the training set and input into the SVM classifier, and multi-class classification is used for training. Finally, the trained classification model is obtained. The training set, after preprocessing, feature extraction, and feature fusion, is input into the trained classification model to output the corresponding water chestnut variety quality grade labels, thus completing the multi-quality grading output of water chestnut varieties.
[0049] Compared with existing technologies, the present invention adopts the above technical solution and has the following beneficial effects: On the one hand, the shape and structure of water chestnuts are irregular, and the shape features are different from different angles. The present invention uses three cameras to collect image information of water chestnuts from three angles respectively, and analyzes and classifies the multi-angle and all-round feature information of water chestnuts, which can better reflect the actual shape features of water chestnuts and is more convincing. On the other hand, the grading and classification of water chestnuts is based on multiple evaluation criteria. The present invention starts from the geometric features, distortion features and texture features of water chestnuts, extracts three feature information and fuses them in series to comprehensively determine their quality and grade, effectively improving the accuracy of intelligent grading of water chestnuts. Attached Figure Description
[0050] Figure 1 A flowchart of the present invention.
[0051] Figure 2 A schematic diagram of the image acquisition of the rhombus seed of the present invention.
[0052] Figure 3 A schematic diagram of distortion calculation in this invention. Detailed Implementation
[0053] like Figure 1The method for grading the appearance quality of water chestnut seed based on multi-feature serial fusion shown uses water chestnut seed appearance images captured by an industrial camera as its data processing object, and includes the following steps:
[0054] Step 1) Acquire images of the water chestnut seed by using an industrial camera to capture image information of the water chestnut seed from three angles;
[0055] like Figure 2 As shown, with the center of gravity of the water chestnut as the origin, three cameras are located on the x-axis, y-axis, and z-axis of a spatial rectangular coordinate system, respectively, with the lenses at the same distance from the water chestnut. Side A represents the lateral ridge surface of the water chestnut, side B represents the ventral surface, and side C represents the long horn end of the water chestnut. Images of each water chestnut are captured from sides A, B, and C.
[0056] Step 2) Image preprocessing of the rhombus seed;
[0057] First, the collected images of water chestnut seeds are processed by weighted averaging to convert the three color pixels of the image (red, green, and blue) into grayscale pixels.
[0058] Secondly, the obtained grayscale image is subjected to gamma correction, and the pixel values are adjusted through nonlinear transformation to make the image easier to extract texture features in the later stage.
[0059] Then, the Otsu thresholding method is used to segment the image, converting the grayscale image into a binary image;
[0060] Finally, preprocessing methods such as median filtering were used to smooth the image, resulting in a three-view projection binary image of the rhombus.
[0061] Step 3) Extract the three features of the rhombus species, including geometric feature data extraction, distortion feature data extraction, and texture feature extraction;
[0062] Step 3-1) Geometric feature data extraction;
[0063] The three-angle images of the obtained rhombus seeds were subjected to opening operations, followed by erosion and dilation operations to eliminate image noise and the influence of sharp corners on subsequent rectangle fitting. The Sobel edge detection algorithm was used to extract smooth and continuous edges of the main body of the rhombus seed from the denoised binary image.
[0064] Using OpenCV open-source image processing functions, the above contours were fitted with a minimum rectangle. For each rhombus, three bounding rectangles of the main contours were obtained, where the length of the bounding rectangle on side A is L. A Width W A The length of the circumscribed rectangle on side B is L. B Width W B The length of the circumscribed rectangle on side C is L C Width W C Approximately consider LA =L B W A =L C W B =W C Therefore, the minimum circumscribed cuboid volume V of the rhombus is:
[0065] V = L A ×L C ×W B (1)
[0066] When grading and selecting water chestnuts, size and plumpness are important criteria. The volume V of the circumscribed cuboid reflects the size and plumpness of the main body of the water chestnut seed, thus extracting its geometric characteristics.
[0067] Step 3-2) Extraction of distortion feature data;
[0068] High-quality water chestnuts are generally nearly symmetrical except for the abdomen. However, water chestnuts with significant morphological deformities will inevitably lead to deformities in offspring and varietal degeneration during subsequent planting. Therefore, the degree of morphological deformity of water chestnuts is one of the important criteria for grading and selecting varieties.
[0069] like Figure 3 The diagram shows a schematic of distortion calculation on side A of a certain rhombus. In the projected images of side A and side B of the rhombus, the boundary contour of the rhombus image is extracted, the centroid of the image is determined, and a line is drawn through the centroid intersecting the major axis of the rhombus (the major axis is shown in the diagram). Figure 2 A straight line L perpendicular to the center (marked) divides the outline of the rhombus image into left and right sides. Similarly, in the C-side projection image of the rhombus, a line passing through the centroid and perpendicular to the minor axis of the rhombus (the minor axis is indicated by the center) is drawn. Figure 2 Similarly, a straight line perpendicular to the line L is drawn to divide the C-side projection image into left and right sides. A straight line l is then drawn perpendicular to the line L at each pixel between the upper and lower boundaries of the image. i These straight lines intersect each of the two sides of the rhombus projection image outline, with coordinates (x, y, y) respectively. i ,h i ) and (y i ,h i ), and the pixel corresponding to line L is (o i ,h i If the A-side distorted variable r is... A The calculation formula is:
[0070]
[0071] Where n is the number of pixels of line L between the upper and lower bounds of the image.
[0072] The distorted variable r on sides B and C of the rhombus B and r CSimilarly, the value of the distortion r of the rhombus can be obtained from equation (2) on the corresponding projected image. The formula for calculating the distortion r of the rhombus is:
[0073]
[0074] Where, r A For the A-side anomaly variable of the rhombus species, r B For the B-side deformity variable of the rhombus species, r C The above parameter values represent the C-side distortion variable of the rhombus species. The distortion characteristic data of the rhombus species were extracted by calculating these parameters.
[0075] Step 3-3) Texture feature data extraction;
[0076] High-quality water chestnut seeds have sharp and clear surface textures, while moldy water chestnut seeds have blurred surface textures, and damaged water chestnut seeds have holes on their surface, with the textures appearing discontinuous or disappearing. Therefore, the surface texture characteristics of water chestnut seeds are also one of the important bases for grading and selecting seeds.
[0077] The gray-level co-occurrence matrix (GLCM) is extracted from the rhombus seed image, and its energy, contrast, entropy, and inverse variance are calculated to describe the texture features.
[0078] 1) Energy: Calculated by summing the squares of the elements in the gray-level co-occurrence matrix, it represents the uniformity of the image's gray-level distribution and the fineness of the texture. A higher energy value indicates that the current texture changes regularly and is relatively stable. The calculation formula is:
[0079]
[0080] Where P(i,j) refers to the normalized gray-level co-occurrence matrix, and i and j are the values of the i-th row and j-th column elements of the co-occurrence matrix, respectively;
[0081] 2) Contrast Ratio: Primarily reflects the distribution of values and the degree of local variation within the matrix, indicating the image's clarity and texture depth. Higher contrast ratios indicate deeper and clearer textures. The calculation formula is:
[0082]
[0083] 3) Entropy: Primarily reflects the degree of randomness of information in an image, representing the complexity of gray levels in the image space. The higher the entropy, the more complex the image and the more disordered the gray level distribution. The calculation formula is:
[0084]
[0085] 4) Inverse variance: This mainly reflects the clarity and regularity of the texture. Textures that are clear, regular, and easy to describe have larger inverse variance values. The calculation formula is:
[0086]
[0087] By calculating the above parameter values, the texture feature data of rhombuses was extracted.
[0088] Step 4: Feature fusion and classification recognition;
[0089] Due to the diversity of appearance characteristics of water chestnuts, classifying and selecting water chestnuts based on a single characteristic has limitations and is prone to misjudgment, resulting in low classification accuracy. Therefore, the water chestnut characteristic information collected in the above steps is fused.
[0090] Since the three features of rhombus geometry, distortion, and texture have different physical meanings, direct fusion may result in data discrepancies. Therefore, it is necessary to normalize the values of these three features. Dependency standardization is used for normalization, mapping the original data to the [0,1] interval. The normalization formula is as follows:
[0091]
[0092] Where maxM is the maximum value of the elements in the feature vector, minM is the minimum value of the elements in the feature vector, m is an element in the feature vector, and m′ is a normalized element. The normalized feature vector is then represented as M′.
[0093] If the texture feature vector is W = [w1, w2, w3, w4], the normalization formula is as follows:
[0094]
[0095] Where maxW is the maximum value of the texture feature vector elements, minW is the minimum value of the texture feature vector elements, w is an element in the texture feature vector, and w′ is a normalized element. The normalized texture feature vector is then represented as W′.
[0096] The geometric features, distortion features, and texture features of the rhombus are fused in a serial manner. The resulting rhombus feature vector is represented as F = [V′, R′, W′], where V′ is the normalized geometric feature vector, R′ is the normalized distortion feature vector, and W′ is the normalized texture feature vector.
[0097] The classification and recognition process consists of four parts: First, the water chestnut varieties in the training samples are divided into four quality grades: first-grade, second-grade, third-grade, and fourth-grade, and the corresponding water chestnut varieties are labeled. Second, geometric features, distortion features, and texture features are extracted from the preprocessed water chestnut varieties images, and after normalization, the three features are serially fused into the required classification features. Then, the fused classification features and corresponding labels are used as the training set and input into the SVM classifier, and multi-class classification is used for training. Finally, the trained classification model is obtained. The training set, after preprocessing, feature extraction, and feature fusion, is input into the trained classification model to output the corresponding water chestnut variety quality grade labels, thus completing the multi-quality grading output of water chestnut varieties.
[0098] This invention proposes a method for grading the appearance quality of water chestnuts based on multi-feature serial fusion. By acquiring three-angle images of water chestnuts, preprocessing the acquired images, and extracting the geometric features, distortion features, and texture features of the water chestnuts, the three features are serially fused and classified for identification, which further ensures the comprehensiveness of feature description and the accuracy of water chestnut grading.
[0099] This invention is not limited to the above embodiments. Based on the technical solutions disclosed in this invention, those skilled in the art can make some substitutions and modifications to some of the technical features without creative effort, and all such substitutions and modifications are within the protection scope of this invention.
Claims
1. A method for grading the appearance quality of rhombus seeds based on multi-feature serial fusion, characterized in that, Includes the following steps: Step 1) Acquire images of the water chestnut seed by using an industrial camera to capture image information of the water chestnut seed from three angles; Step 1) Specifically includes: with the center of gravity of the water chestnut as the origin, three cameras are located on the x-axis, y-axis and z-axis of the spatial rectangular coordinate system, respectively, with the lenses at the same distance from the water chestnut. Side A is the lateral ridge surface of the water chestnut, side B is the ventral surface of the water chestnut, and side C is the long horn end of the water chestnut; images of each water chestnut are collected from sides A, B and C respectively. Step 2) Image preprocessing of the rhombus seed; Step 3) Extract the three features of the rhombus species, including geometric feature data extraction, distortion feature data extraction, and texture feature extraction; Step 3) involves extracting the distortion feature data, which includes: extracting the boundary contour of the diamond image from the A-side and B-side projection images, determining the centroid of the image, and drawing a straight line L perpendicular to the major axis of the diamond through the centroid, thus dividing the diamond image contour into left and right sides. Similarly, in the C-side projection image of the diamond, drawing a straight line perpendicular to the minor axis of the diamond through the centroid, also dividing the C-side projection image into left and right sides, and drawing a straight line l perpendicular to L at each pixel point between the upper and lower boundaries of the image. i These straight lines intersect the left and right sides of the rhombus projection image outline, respectively, with coordinates (x, y, y). i ,h i ) and (y i ,h i ), and the pixel corresponding to line L is (o i ,h i If the A-side distorted variable r is... A The calculation formula is: Where n is the number of pixels between the upper and lower bounds of the line L in the image; The distorted variable r on sides B and C of the rhombus B and r C Similarly, the value of the distortion r of the rhombus can be obtained from equation (2) on the corresponding projected image. The formula for calculating the distortion r of the rhombus is: Where, r A For the A-side anomaly variable of the rhombus species, r B For the B-side deformity variable of the rhombus species, r C For the C-side anomaly variable of the rhombus species; Step 4: Feature fusion and classification recognition.
2. The method for grading the appearance quality of rhombus species based on multi-feature serial fusion according to claim 1, characterized in that the geometric feature data extraction in step 3) includes: Opening operations were applied to the three-angle images of the diamond seed, followed by erosion and dilation operations to eliminate noise and the influence of sharp corners on the subsequent rectangle fitting. The Sobel edge detection algorithm was used to extract smooth and continuous edges of the diamond seed body from the denoised binary image. Using OpenCV open-source image processing functions, minimum rectangle fitting was performed on the contours. For each rhombus, three bounding rectangles of the main contours were obtained, where the length of the bounding rectangle on side A is L. A Width W A The length of the circumscribed rectangle on side B is L. B Width W B The length of the circumscribed rectangle on side C is L C Width W C Approximately consider L A =L B W A =L C W B =W C Therefore, the minimum circumscribed cuboid volume V of the rhombus is: V=L A ×L C ×W B (1)。 3. The method for grading the appearance quality of rhombus seeds based on multi-feature serial fusion according to claim 1, characterized in that the texture feature extraction in step 3) includes: The gray-level co-occurrence matrix is extracted from the rhombus seed image, and its energy, contrast, entropy, and inverse variance are calculated to describe the texture features. 1) Energy: Calculated by summing the squares of the elements in the gray-level co-occurrence matrix, it represents the uniformity of the gray-level distribution and the fineness of the texture in the image. The calculation formula is: Where P(i,j) refers to the normalized gray-level co-occurrence matrix, and i and j are the values of the i-th row and j-th column elements of the co-occurrence matrix, respectively; 2) Contrast: Reflects the distribution of values in the matrix and the degree of local variation, indicating the image's sharpness and texture depth. The calculation formula is: Where P(i,j) refers to the normalized gray-level co-occurrence matrix, and i and j are the values of the i-th row and j-th column elements of the co-occurrence matrix, respectively; 3) Entropy: A measure of the randomness of information in an image, representing the complexity of gray levels in the image space. The formula is: Where P(i,j) refers to the normalized gray-level co-occurrence matrix, and i and j are the values of the i-th row and j-th column elements of the co-occurrence matrix, respectively; 4) Inverse variance: Reflects the clarity and regularity of the texture; the calculation formula is: Where P(i,j) refers to the normalized gray-level co-occurrence matrix, and i and j are the values of the i-th row and j-th column elements of the co-occurrence matrix, respectively; by calculating the above parameter values, the extraction of rhombus texture feature data is realized.
4. The method for grading the appearance quality of rhombus seeds based on multi-feature serial fusion according to claim 1, characterized in that step 4) specifically includes: The values of three types of features—geometric features, distortion features, and texture features—are normalized using deviation standardization to map the original data to the [0,1] interval. The normalization formula is as follows: Where maxM is the maximum value of the elements in the feature vector, minM is the minimum value of the elements in the feature vector, m is an element in the feature vector, and m′ is a normalized element. The normalized feature vector is then represented as M′. The geometric features, distortion features and texture features of the rhombus are normalized by Equation (8), and then the features are fused by serial fusion. The rhombus feature vector after serial fusion is represented as F=[V′,R′,W′], where V′ is the normalized geometric feature vector, R′ is the normalized distortion feature vector, and W′ is the normalized texture feature vector. The classification and recognition process consists of four parts: First, the water chestnut varieties in the training samples are divided into four quality grades: first-grade, second-grade, third-grade, and fourth-grade, and the corresponding water chestnut varieties are labeled. Second, geometric features, distortion features, and texture features are extracted from the preprocessed water chestnut varieties images, and after normalization, the three features are serially fused into the required classification features. Then, the fused classification features and corresponding labels are used as the training set and input into the SVM classifier, and multi-class classification is used for training. Finally, the trained classification model is obtained. The training set, after preprocessing, feature extraction, and feature fusion, is input into the trained classification model to output the corresponding water chestnut variety quality grade labels, thus completing the multi-quality grading output of water chestnut varieties.
Citation Information
Patent Citations
Method for detecting and grading greening potatoes based on machine vision
CN103394472A
Online damage detection and classification method for corn seeds based on machine vision
CN108020556A
Water chestnut picking robot
CN108124585A
A handheld water chestnut picker
CN109429693B
An automatic shelling machine for fresh water chestnuts
CN109645506B