Efficient grape quality assessment method based on machine vision
By performing machine vision processing on the grape subject images, screening and fitting the edges of grape particles, evaluating their fullness and bad points, and combining these indicators to calculate the quality coefficient of grapes, the problem of inaccurate grape quality detection in the prior art is solved, and the accuracy and credibility of the detection are improved.
Patent Information
- Application Number
- CN202410627615.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-05-21
AI Technical Summary
In the existing grape quality detection methods, the edges of grape particles may be divided into multiple edges, resulting in inaccurate quality judgment.
Using a machine vision-based grape quality evaluation method, the circle fitting of the suspected sub-edges of grapes in the grape body image is performed, and the real edges are screened out to form a cluster of grape edges, and the center and radius of the grain are calculated to evaluate the fullness. At the same time, the gradient of the internal edge of the grape grain is analyzed to evaluate the bad point degree, and finally the mass coefficient is calculated based on the fullness and bad point degree.
It improves the accuracy of grape quality inspection, solves the quality judgment problem caused by inaccurate edge inspection, and enhances the credibility of the inspection results.
Smart Images

Figure CN118537357B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image data processing, and in particular to an efficient grape quality evaluation method based on machine vision. Background Art
[0002] During the growth process of grapes, due to reasons such as light environment or insect pests, some grapes are not full after maturity, resulting in some grapes failing to meet quality inspection standards and affecting the overall quality of the product. Therefore, it is necessary to conduct quality inspection on the grapes after picking.
[0003] Since the quality of grapes is mainly reflected in the fullness of the grape granules, the edges of full grape granules are nearly round. Currently, when inspecting the quality of grapes, the quality of the grape granules is judged only by the nearly roundness of the edge lines in the edge detection results. However, in the edge detection results, the edge of a grape granule may be divided into multiple edges. The existence of multiple edges will affect the judgment of the grape quality and lead to inaccurate grape quality inspection results. Summary of the invention
[0004] The present invention provides an efficient grape quality assessment method based on machine vision to solve the existing problems.
[0005] The present invention's efficient grape quality assessment method based on machine vision adopts the following technical solutions:
[0006] An embodiment of the present invention provides an efficient grape quality assessment method based on machine vision, the method comprising the following steps:
[0007] Acquire a grape main image and a number of grape suspected sub-edges in the grape main image;
[0008] Performing circle fitting on each suspected grape sub-edge respectively to obtain the fitting circle center, fitting radius and fitting residual of each suspected grape sub-edge; obtaining the reference suspected grape sub-edge of each suspected grape sub-edge according to the distribution of the fitting circle center and fitting radius of the suspected grape sub-edge; performing circle fitting on any suspected grape sub-edge and the reference suspected grape sub-edge of the suspected grape sub-edge respectively to obtain the characteristic residual of the suspected grape sub-edge; obtaining the true edge probability of each suspected grape sub-edge according to the fitting residual and all characteristic residuals; screening and obtaining a number of suspected grape sub-edges from all suspected grape sub-edges according to the true edge probability of each suspected grape sub-edge; obtaining a number of grape grain edge clusters according to the distribution of grape sub-edges;
[0009] All the grape seed edges in each grape seed edge cluster are fitted with circles to obtain the grain center and grain radius of each grape seed edge cluster; the fullness of the grape is obtained based on the similarity between the grain center and grain radius of all grape seed edge clusters and the fitted circle center of the grape seed edge;
[0010] According to the distribution of the grape grain edge clusters, several grape grain internal edges are obtained; according to the gradient of the pixel points on the internal edges of all grape grains, the bad pixel degree of the grape is obtained;
[0011] According to the fullness and bad spot degree of the grapes, the quality coefficient of the grapes is obtained; according to the quality coefficient of the grapes, the quality assessment result of the grapes is obtained.
[0012] Furthermore, the reference grape suspected sub-edge of each grape suspected sub-edge is obtained according to the distribution of the fitting circle center and the fitting radius of the grape suspected sub-edge, and the specific steps include the following:
[0013] Any suspected grape sub-edge is recorded as the target suspected grape sub-edge; the Euclidean distance between the fitting circle centers of any two suspected grape sub-edges is recorded as the circle center distance of the two suspected grape sub-edges; the absolute value of the difference between the fitting radius of any two suspected grape sub-edges is recorded as the radius difference of the two suspected grape sub-edges; any suspected grape sub-edge whose circle center distance with the target suspected grape sub-edge is less than σ and whose radius difference is less than ω is recorded as the reference suspected grape sub-edge of the target suspected grape sub-edge; wherein σ is a preset circle center threshold and ω is a preset radius threshold.
[0014] Furthermore, the actual edge probability of each suspected grape sub-edge is obtained according to the fitting residual and all feature residuals of each suspected grape sub-edge, including the following specific steps:
[0015] Calculate the mean of the characteristic residuals of the target grape suspected sub-edge and all its reference grape suspected sub-edges, then calculate the product of the mean and the fitting residual of the target grape suspected sub-edge, and record the inverse proportional normalized value of the product as the true edge probability of the target grape suspected sub-edge.
[0016] Furthermore, the step of obtaining a plurality of grape seed edge clusters according to the distribution of grape seed edges includes the following specific steps:
[0017] Record any grape seed edge as the target grape seed edge; record the circle whose center distance from the target grape seed edge is less than σ
[0018] The grape sub-edge set consisting of all grape sub-edges with a radius difference less than ω and the target grape sub-edge is recorded as a grape grain edge cluster; where σ is the preset circle center threshold and ω is the preset radius threshold.
[0019] Furthermore, the method of obtaining the fullness of the grapes according to the similarity between the grain center of all grape grain edge clusters, the grain radius and the fitted center of the grape seed edge includes the following specific steps:
[0020] According to the position distribution of the center of each grape edge cluster, the distance between each grape edge cluster is obtained; the fullness of the grape is calculated as follows:
[0021]
[0022] Where BM is the fullness of grapes; LS is the mean distance between all grape edge clusters; n is the number of grape edge clusters; m x is the number of grape seed edges in the xth grape seed edge cluster; d x,c,e is the Euclidean distance between the centers of the fitted circles of the cth grape seed edge and the eth grape seed edge in the xth grape seed edge cluster; r x is the particle radius of the x-th grape particle edge cluster; sigmoid{} is the sigmoid function; (m x -1)! is m x -1 factorial.
[0023] Furthermore, the step of obtaining the particle distance of each grape edge cluster according to the position distribution of the particle circle center of each grape edge cluster includes the following specific steps:
[0024] Any grape grain edge cluster is recorded as the target grape grain edge cluster, and the Euclidean distance between the particle center of the grape grain edge cluster closest to the particle center of the target grape grain edge cluster is recorded as the particle distance of the target grape grain edge cluster.
[0025] Furthermore, the method of obtaining a plurality of inner edges of grape grains according to the distribution of the edge clusters of grape grains includes the following specific steps:
[0026] The least square method is used to fit a circle to each grape grain edge cluster, and a fitting circle of each grape grain edge cluster is obtained. Each suspected sub-edge of the grape within the fitting circle of each grape grain edge cluster is recorded as an internal edge of the grape grain.
[0027] Furthermore, the step of obtaining the bad pixel degree of grapes according to the gradient of the pixel points on the inner edges of all grapes includes the following specific steps:
[0028] The normalized value of the mean of the gradient values of all pixels on the inner edges of all grapes in the grape main image is recorded as the bad pixel degree of the grape.
[0029] Furthermore, the quality coefficient of the grapes is obtained according to the fullness and bad spot degree of the grapes, and the specific steps include the following:
[0030] The ratio of the fullness of the grapes to the degree of bad spots is recorded as the quality coefficient of the grapes.
[0031] Furthermore, the method of obtaining the quality assessment result of the grapes according to the quality coefficient of the grapes includes the following specific steps:
[0032] If the quality coefficient of the grapes is greater than or equal to the preset quality threshold W, the quality of the grapes is qualified; if the quality coefficient of the grapes is less than the preset quality threshold W, the quality of the grapes is unqualified.
[0033] The beneficial effects of the technical solution of the present invention are as follows: the present invention obtains grape grain edge clusters by analyzing the near-circularity of the suspected sub-edges of grapes in the main image of grapes and the characteristic residuals between the suspected sub-edges of grapes, realizes the screening of grape grain edges and the distinction of different grape grain edges, and provides a data basis for the subsequent judgment of grape quality; the fullness of grapes is obtained by the particle distance between different grape grain edge clusters, the approximation of the fitting circle center of the grape sub-edge in each grape grain edge cluster, and the particle radius of the grape grain edge cluster, solving the problem that the edge of a grape grain is divided into multiple edges due to grape edge detection, thereby affecting the judgment of fullness; the bad points on the surface of grape grains are evaluated by the gradient of the pixel points on the internal edge of the grape grains to obtain the bad point degree of grapes, and the fullness and bad point degree of grapes are combined to obtain the quality coefficient of grapes, and the quality of grapes is comprehensively evaluated. The present invention evaluates the quality of grapes more accurately through the quality coefficient of grapes, and improves the credibility of the grape quality detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 The present invention is a flowchart of the steps of the method for efficiently evaluating grape quality based on machine vision. DETAILED DESCRIPTION
[0036] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation, structure, features and effects of the grape quality efficient evaluation method based on machine vision proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0037] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0038] The specific scheme of the method for efficiently evaluating grape quality based on machine vision provided by the present invention is described in detail below with reference to the accompanying drawings.
[0039] See also Figure 1 , which shows a flowchart of a method for efficiently evaluating grape quality based on machine vision provided by an embodiment of the present invention, the method comprising the following steps:
[0040] Step S001: obtaining a grape main image and a plurality of grape suspected sub-edges in the grape main image.
[0041] It should be noted that the present invention realizes the quality detection of grapes by analyzing the edge lines in the edge detection result of the grape image, so the grape image needs to be collected first.
[0042] Specifically, a white image acquisition background is arranged in the area to be detected; a fixed camera is arranged above the area to be detected, and the lens of the fixed camera is aimed at the area to be detected; a bunch of grapes to be detected is placed in the area to be detected, and the fixed camera is used to collect the grape RGB image; the grape RGB image is grayed to obtain a grape image; all pixels of the grape image are divided into two categories of pixels by the Otsu threshold segmentation method; an image composed of pixels of a category with the smallest gray value mean is recorded as a grape main image; edge detection is performed on the grape main image by the Canny edge detection algorithm to obtain several suspected grape sub-edges in the grape main image; graying and Canny edge detection are well-known technologies, and the specific methods are not introduced here.
[0043] Step S002: performing circle fitting on each suspected grape sub-edge respectively to obtain the fitting circle center, fitting radius and fitting residual of each suspected grape sub-edge; obtaining the reference suspected grape sub-edge of each suspected grape sub-edge according to the distribution of the fitting circle center and fitting radius of the suspected grape sub-edge; performing circle fitting on any suspected grape sub-edge and the reference suspected grape sub-edge of the suspected grape sub-edge respectively to obtain the characteristic residual of the suspected grape sub-edge; obtaining the true edge probability of each suspected grape sub-edge according to the fitting residual and all characteristic residuals of each suspected grape sub-edge; screening and obtaining a number of suspected grape sub-edges from all suspected grape sub-edges according to the true edge probability of each suspected grape sub-edge; obtaining a number of grape grain edge clusters according to the distribution of the grape sub-edges.
[0044] It should be noted that when using the suspected grape sub-edge to judge the quality of grape particles, since the edge of a grape particle in the edge detection result may be divided into multiple suspected grape sub-edges, it is necessary to obtain an edge cluster composed of several suspected grape sub-edges of the same grape particle, and then analyze the fullness and surface bad points of the grape particle. Since the edge of a complete grape particle is nearly circular, the position and size of the fitting circles of several suspected grape sub-edges of the same grape particle edge are similar, and the fitting effect of the fitting circles is relatively good. Therefore, for the fitting circle of any suspected grape sub-edge, the better the fitting effect of the fitting circle and the fitting circles of other suspected grape sub-edges with similar positions and sizes, the more likely the suspected grape sub-edge belongs to the edge of the grape particle.
[0045] Specifically, the minimum enclosing rectangle of the main image of the grape is obtained, and the pixel point of any corner of the minimum enclosing rectangle is selected as the origin, and the side of any minimum enclosing rectangle connected to the origin is used as the horizontal axis, and the side of another minimum enclosing rectangle connected to the origin is used as the vertical axis to establish a rectangular coordinate system; in the rectangular coordinate system, a circle is fitted to each suspected sub-edge of the grape by the least squares method to obtain the fitting circle center, fitting radius and fitting residual of each suspected sub-edge of the grape; the method of fitting a circle by the least squares method is a well-known technology, and the specific method is not introduced here; any suspected sub-edge of the grape is recorded as the target suspected sub-edge of the grape; the Euclidean distance between the fitting circle centers of any two suspected sub-edges of the grape is recorded as the center distance of the two suspected sub-edges of the grape; the absolute value of the difference between the fitting radius of any two suspected sub-edges of the grape is recorded as the distance between the centers of the two suspected sub-edges of the grape The radius difference of the suspected grape sub-edge is less than σ and the radius difference is less than ω. Any suspected grape sub-edge whose circle center distance with the target suspected grape sub-edge is less than σ and whose radius difference is less than ω is recorded as the reference suspected grape sub-edge of the target suspected grape sub-edge. Wherein, σ is the preset circle center threshold, ω is the preset radius threshold, σ=5, ω=5, and this embodiment is described as an example. The target suspected grape sub-edge is circularly fitted with each of its reference suspected grape sub-edges by the least squares method, and the residual of the fitting result is recorded as the characteristic residual of the target suspected grape sub-edge and each of its reference suspected grape sub-edges. The mean of the characteristic residuals of the target suspected grape sub-edge and all its reference suspected grape sub-edges is calculated, and then the product of the mean and the fitting residual of the target suspected grape sub-edge is calculated, and the inverse proportional normalized value of the product is recorded as the true edge probability of the target suspected grape sub-edge.
[0046] It should be noted that the smaller the fitting residual of the target grape suspected sub-edge, the better the fitting effect of the fitting circle of the target grape suspected sub-edge, and the higher the probability that the target grape suspected sub-edge belongs to the real grape grain edge; the smaller the characteristic residual of the target grape suspected sub-edge and each of its reference grape suspected sub-edges, the higher the possibility that the target grape suspected sub-edge and each of its reference grape suspected sub-edges belong to the same grape grain edge; the higher the probability that the target grape suspected sub-edge belongs to the real grape grain edge, and the higher the possibility that the target grape suspected sub-edge and each of its reference grape suspected sub-edges belong to the same grape grain edge, the higher the probability that the target grape suspected sub-edge and each of its reference grape suspected sub-edges belong to the same grape grain edge, the higher the probability that the target grape suspected sub-edge and each of its reference grape suspected sub-edges belong to the same real grape grain edge.
[0047] According to the above method, the true edge probability of each suspected sub-edge of grape is obtained.
[0048] Specifically, any suspected grape sub-edge whose true edge probability is greater than a preset probability threshold Q is recorded as a grape sub-edge; wherein Q=0.8, and this embodiment is described by taking this as an example; any grape sub-edge is recorded as a target grape sub-edge; the grape sub-edge set consisting of all grape sub-edges whose circle center distance from the target grape sub-edge is less than σ and whose radius difference is less than ω and the target grape sub-edge, and the target grape sub-edge, is recorded as a grape grain edge cluster; wherein σ is a preset circle center threshold, and ω is a preset radius threshold.
[0049] Step S003: performing circle fitting on all grape seed edges in each grape seed edge cluster respectively to obtain the particle center and particle radius of each grape seed edge cluster; according to the similarity between the particle center and particle radius of all grape seed edge clusters and the fitted circle center of the grape seed edge, the fullness of the grape is obtained.
[0050] It should be noted that a grape grain edge cluster is a real edge cluster of a grape grain. When using the grape grain edge cluster to detect the quality of grapes, the quality of grapes is mainly judged based on the fullness of the grape grains and the surface bad spots. When judging the fullness of grape grains, the smaller the distance between grape grains, the higher the density of grape grains, the higher the overall fullness of grapes, and the better the quality of grapes; when the positions of the fitting circles of the grape seed edges in the grape grain edge cluster are closer, and the radius of the fitting circles of all grape seed edges in the grape grain edge cluster is larger, the fullness of grape grains corresponding to the grape grain edge cluster is higher.
[0051] Specifically, all grape grain edges in each grape grain edge cluster are fitted with circles by the least square method to obtain the fitting circle of each grape grain edge cluster, and the center and radius of each fitting circle are recorded as the particle center and particle radius of each grape grain edge cluster respectively; any grape grain edge cluster is recorded as the target grape grain edge cluster, and the Euclidean distance between the particle centers of the grape grain edge cluster closest to the particle center of the target grape grain edge cluster is recorded as the particle distance of the target grape grain edge cluster; the calculation method of the fullness of the grape is:
[0052]
[0053] Where BM is the fullness of grapes; LS is the mean distance between all grape edge clusters; n is the number of grape edge clusters; m x is the number of grape seed edges in the xth grape seed edge cluster; d x,c,e is the Euclidean distance between the centers of the fitted circles of the cth grape seed edge and the eth grape seed edge in the xth grape seed edge cluster; r x is the particle radius of the x-th grape particle edge cluster; sigmoid{} is the sigmoid function; (m x-1)! is m x -1 factorial.
[0054] It should be noted that Indicates the overall density of grape particles. The larger the value, the higher the density of grape particles and the fuller the grapes are overall. It indicates the fullness of the grape grain corresponding to the x-th grape grain edge cluster. The larger the value is, the fuller the grape grain corresponding to the x-th grape grain edge cluster is.
[0055] Step S004: according to the distribution of the grape grain edge clusters, a number of grape grain internal edges are obtained; according to the gradient of the pixel points on the internal edges of all grape grains, the bad pixel degree of the grape is obtained.
[0056] It should be noted that when judging the surface bad points of grape particles, the suspected sub-edges of grapes inside a grape particle may be caused by bad points or uneven color of grape particles. The existence of bad points will lead to a decrease in the overall quality of grapes, while uneven color of grape particles does not affect the overall quality of grapes. Therefore, it is necessary to distinguish the suspected sub-edges of grapes caused by the two factors. In the main image of grapes, the edge gradient of the suspected sub-edges of grapes caused by uneven color of grape particles is smaller, and the edge gradient of the suspected sub-edges of grapes caused by bad points is larger, so this feature is used for distinction.
[0057] Specifically, the gradient of each pixel point on each suspected sub-edge of each grape in the grape main image is obtained through a 3*3 Sobel operator; obtaining the gradient by the Sobel operator is a well-known technology, and the specific method is not introduced here; a circle is fitted for each grape grain edge cluster by the least squares method to obtain a fitting circle for each grape grain edge cluster, and each suspected sub-edge of the grape within the fitting circle of each grape grain edge cluster is recorded as an internal edge of the grape grain; the sigmoid result of the mean of the gradient values of all pixel points on the internal edges of all grape grains in the grape main image is recorded as the bad pixel degree of the grape.
[0058] Step S005: obtaining a grape quality coefficient according to the fullness and bad spot degree of the grapes; and obtaining a grape quality assessment result according to the grape quality coefficient.
[0059] It should be noted that the fuller the grapes are and the lower the degree of rotten spots, the better the quality of the grapes.
[0060] Specifically, the ratio of the fullness of the grapes to the degree of bad spots is recorded as the quality coefficient of the grapes; if the quality coefficient of the grapes is greater than or equal to the preset quality threshold E, the quality of the grapes is qualified; if the quality coefficient of the grapes is less than the preset quality threshold E, the quality of the grapes is unqualified; wherein W=0.8, and this embodiment is described by taking this as an example.
[0061] So far, the present invention is completed.
[0062] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An efficient grape quality assessment method based on machine vision, characterized in that: The method comprises the following steps: Acquire a grape main image and a number of grape suspected sub-edges in the grape main image; Performing circle fitting on each suspected grape sub-edge respectively to obtain the fitting circle center, fitting radius and fitting residual of each suspected grape sub-edge; obtaining the reference suspected grape sub-edge of each suspected grape sub-edge according to the distribution of the fitting circle center and fitting radius of the suspected grape sub-edge; performing circle fitting on any suspected grape sub-edge and the reference suspected grape sub-edge of the suspected grape sub-edge respectively to obtain the characteristic residual of the suspected grape sub-edge; obtaining the true edge probability of each suspected grape sub-edge according to the fitting residual and all characteristic residuals; screening and obtaining a number of suspected grape sub-edges from all suspected grape sub-edges according to the true edge probability of each suspected grape sub-edge; obtaining a number of grape grain edge clusters according to the distribution of grape sub-edges; Perform circle fitting on all the grape seed edges in each grape seed edge cluster to obtain the grain center and grain radius of each grape seed edge cluster; obtain the fullness of the grapes based on the similarity between the grain center and grain radius of all grape seed edge clusters and the fitted circle center of the grape seed edge; According to the distribution of the grape grain edge clusters, several grape grain internal edges are obtained; according to the gradient of the pixel points on the internal edges of all grape grains, the bad pixel degree of the grape is obtained; According to the fullness and bad spot degree of the grapes, the quality coefficient of the grapes is obtained; according to the quality coefficient of the grapes, the quality evaluation result of the grapes is obtained; The specific steps of obtaining the reference grape suspected sub-edge of each grape suspected sub-edge according to the distribution of the fitting circle center and the fitting radius of the grape suspected sub-edge are as follows: Any suspected grape sub-edge is recorded as the target suspected grape sub-edge; the Euclidean distance between the fitting circle centers of any two suspected grape sub-edges is recorded as the circle center distance of the two suspected grape sub-edges; the absolute value of the difference between the fitting radius of any two suspected grape sub-edges is recorded as the radius difference of the two suspected grape sub-edges; any suspected grape sub-edge whose circle center distance with the target suspected grape sub-edge is less than σ and whose radius difference is less than ω is recorded as the reference suspected grape sub-edge of the target suspected grape sub-edge; wherein σ is a preset circle center threshold and ω is a preset radius threshold.
2. The method for efficiently evaluating grape quality based on machine vision according to claim 1 is characterized in that: The specific steps of obtaining the true edge probability of each suspected sub-edge of the grape according to the fitting residual and all feature residuals of each suspected sub-edge of the grape include the following: Calculate the mean of the characteristic residuals of the target grape suspected sub-edge and all its reference grape suspected sub-edges, then calculate the product of the mean and the fitting residual of the target grape suspected sub-edge, and record the inverse proportional normalized value of the product as the true edge probability of the target grape suspected sub-edge.
3. The method for efficiently evaluating grape quality based on machine vision according to claim 1 is characterized in that: The method of obtaining a plurality of grape seed edge clusters according to the distribution of grape seed edges includes the following specific steps: Any grape seed edge is recorded as the target grape seed edge; the grape seed edge set consisting of all grape seed edges whose circle center distance from the target grape seed edge is less than σ and whose radius difference is less than ω and the target grape seed edge is recorded as a grape grain edge cluster; where σ is the preset circle center threshold and ω is the preset radius threshold.
4. The method for efficiently evaluating grape quality based on machine vision according to claim 1 is characterized in that: The method of obtaining the fullness of grapes according to the similarity between the grain center of all grape grain edge clusters, the grain radius and the fitted circle center of the grape seed edge includes the following specific steps: According to the position distribution of the center of each grape edge cluster, the distance between each grape edge cluster is obtained; the fullness of the grape is calculated as follows: Where BM is the fullness of grapes; LS is the mean distance between all grape edge clusters; n is the number of grape edge clusters; m x is the number of grape seed edges in the xth grape seed edge cluster; d x,c,e is the Euclidean distance between the centers of the fitted circles of the cth grape seed edge and the eth grape seed edge in the xth grape seed edge cluster; r x is the particle radius of the x-th grape particle edge cluster; sigmoid{} is the sigmoid function; (m x -1)! is m x -1 factorial.
5. The method for efficiently evaluating grape quality based on machine vision according to claim 4 is characterized in that: The method of obtaining the particle distance of each grape grain edge cluster according to the position distribution of the particle circle center of each grape grain edge cluster includes the following specific steps: Any grape grain edge cluster is recorded as the target grape grain edge cluster, and the Euclidean distance between the particle centers of the grape grain edge cluster closest to the particle center of the target grape grain edge cluster is recorded as the particle distance of the target grape grain edge cluster.
6. The method for efficiently evaluating grape quality based on machine vision according to claim 1 is characterized in that: The method of obtaining a plurality of inner edges of grape grains according to the distribution of the edge clusters of grape grains includes the following specific steps: The least square method is used to fit a circle to each grape grain edge cluster, and a fitting circle of each grape grain edge cluster is obtained. Each suspected sub-edge of the grape within the fitting circle of each grape grain edge cluster is recorded as an internal edge of the grape grain.
7. The method for efficiently evaluating grape quality based on machine vision according to claim 1 is characterized in that: The method of obtaining the bad pixel degree of grapes according to the gradient of the pixel points on the inner edge of all grapes includes the following specific steps: The normalized value of the mean of the gradient values of all pixels on the inner edges of all grapes in the grape main image is recorded as the bad pixel degree of the grape.
8. The method for efficiently evaluating grape quality based on machine vision according to claim 1 is characterized in that: The method of obtaining the quality coefficient of grapes according to the fullness and bad spot degree of grapes includes the following specific steps: The ratio of the fullness of the grapes to the degree of bad spots is recorded as the quality coefficient of the grapes.
9. The method for efficiently evaluating grape quality based on machine vision according to claim 1, characterized in that: The method of obtaining the grape quality assessment result according to the grape quality coefficient includes the following specific steps: If the quality coefficient of the grapes is greater than or equal to the preset quality threshold W, the quality of the grapes is qualified; if the quality coefficient of the grapes is less than the preset quality threshold W, the quality of the grapes is unqualified.
Citation Information
Patent Citations
Light spot edge fitting method
CN110232697A
Object roundness measuring method
CN110349199A