Tomato phenotype parameter measurement method and system based on machine vision
Through machine vision technology, combined with high-precision cameras and dynamic programming algorithms, the problem of blurred edges of tomato annular cracks is solved, accurate measurement of tomato phenotypic parameters is achieved, and the detection accuracy and connectivity of annular cracks are improved.
Patent Information
- Application Number
- CN202411137835.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-11-26
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When the prior art measures the crack width of tomato annular crack fruit, the edges are blurred when the degree of ring crack is large, resulting in interference in edge detection and the inability to completely extract the cracked defect area, affecting the accuracy of the measurement of tomato phenotypic parameters.
Using the tomato phenotypic parameter measurement method based on machine vision, images are collected through high-precision cameras, grayscale and smoothing are performed, edge pixel sequences are obtained using Canny edge detection and 16 chain coding technology, the preferred pixel sequence is screened, and the data segments are calculated. The degree of uniformity and similarity, the dynamic programming algorithm calculates the minimum cumulative distance, forms a connecting domain of the annular crack area, and overcomes the interference of edge detection.
Accurate processing and analysis of defective tomato images is achieved, precise extraction of annular cracks is ensured, and the accuracy and accuracy of measurement are overcome. The problem of blurred edges of annular cracks is improved, and the connectivity and integrity of the crack areas are improved.
Smart Images

Figure CN119027938A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method and system for measuring tomato phenotypic parameters based on machine vision. Background Art
[0002] The quality of tomato skin, including gloss, color, and integrity, can directly reflect the quality of tomatoes. The appearance quality of tomatoes directly affects consumers' purchasing decisions, which in turn affects tomato sales. Therefore, it is necessary to analyze tomato phenotypic parameters before selling tomatoes. Currently, the measurement of tomato phenotypic parameters is often analyzed and measured by machine vision technology to help ensure product quality, meet consumer demand, reduce food waste, and improve product competitiveness.
[0003] Currently, the measurement of tomato phenotypic parameters is often analyzed and measured through machine vision technology. However, when measuring the crack width of tomato ring-cracked fruits, when the degree of ring cracking is large, the edge of the ring crack is blurred due to the interference of exposed flesh on edge detection, resulting in the inability to completely extract the cracked defect area, which is not conducive to the measurement of tomato phenotypic parameters. Summary of the invention
[0004] The present invention provides a tomato phenotypic parameter measurement method and system based on machine vision to solve the existing problems.
[0005] The present invention provides a method and system for measuring tomato phenotypic parameters based on machine vision, which adopts the following technical solutions:
[0006] The present invention proposes a method for measuring tomato phenotypic parameters based on machine vision, which comprises the following steps:
[0007] Collect the image of defective tomatoes and the image after edge detection, and obtain the pixel sequence of each edge in the image after edge detection;
[0008] Based on the length of the pixel sequence, several preferred pixel sequences are obtained by screening, and several data segments in each preferred pixel sequence are obtained by segmentation; based on the difference of adjacent values in the data segments in the preferred pixel sequence, the uniformity of each data segment in each preferred pixel sequence is obtained, and the data segments with uniform data in each preferred pixel sequence are obtained by screening; based on the proportion of the data segments with uniform data in the preferred pixel sequence and the uniformity of all data segments, the probability that each preferred pixel sequence belongs to the annular crack profile is obtained, and the pixel sequence after further optimization is obtained by screening;
[0009] According to each value in each further optimized pixel sequence, a difference matrix between each further optimized pixel sequence and other further optimized pixel sequences is obtained; the minimum cumulative distance of the difference matrix between each further optimized pixel sequence and other further optimized pixel sequences is obtained by a dynamic programming algorithm, and then the similarity between each further optimized pixel sequence and other further optimized pixel sequences is obtained; classification is performed based on the similarity of different further optimized pixel sequences to obtain connected domains of several annular crack areas.
[0010] Furthermore, the step of obtaining a pixel sequence of each edge in the image after edge detection includes the following specific steps:
[0011] The image of defective tomatoes is captured by a high-precision camera and grayed and smoothed to remove noise from the image.
[0012] The image of defective tomatoes is obtained through Canny edge detection. The image after edge detection;
[0013] The pixel sequence of each edge in the image after edge detection is obtained through 16-chain code.
[0014] Furthermore, the method of screening based on the length of the pixel sequence to obtain a plurality of preferred pixel sequences, and segmenting to obtain a plurality of data segments in each segment of the preferred pixel sequence, includes the following specific steps:
[0015] Among all pixel sequences, a pixel sequence whose sequence length is greater than a first threshold is recorded as a preferred pixel sequence;
[0016] Each preferred pixel sequence is evenly divided into a number of segments having a first length, to obtain a number of data segments in each preferred pixel sequence.
[0017] Furthermore, the uniformity of each data segment in each preferred pixel sequence is obtained based on the difference between adjacent values in the data segment in the preferred pixel sequence, and the corresponding specific calculation formula is:
[0018]
[0019] Among them, E i,j Indicates the uniformity of the jth data segment in the i-th preferred pixel sequence; N i,j represents the length of the jth data segment in the i-th preferred pixel sequence; a i,j,n represents the nth value in the jth data segment in the i-th preferred pixel sequence; a i,j,n-1 represents the n-1th value in the jth data segment in the i-th preferred pixel sequence; S i,jrepresents the variance of all non-zero values in the absolute values of all differential values in the differential sequence of the jth data segment in the ith preferred pixel sequence; || represents the absolute value function; norm() represents the normalization function.
[0020] Furthermore, the step of obtaining a data segment with uniform data in each preferred pixel sequence includes the following specific steps:
[0021] The data segments whose uniformity is greater than the second threshold among all the data segments in each preferred pixel sequence are recorded as data segments with uniform data in each preferred pixel sequence.
[0022] Furthermore, based on the proportion of data segments with uniform data in the preferred pixel sequence and the uniformity of all data segments, the probability that each preferred pixel sequence belongs to the annular crack profile is obtained, and the corresponding specific calculation formula is:
[0023]
[0024] Among them, P i represents the probability that the i-th preferred pixel sequence belongs to the annular crack contour; M i ′ represents the number of data segments with uniform data in the i-th preferred pixel sequence; M i The number of data segments representing the i-th preferred pixel sequence; E i,j Indicates the uniformity of the jth data segment in the i-th preferred pixel sequence.
[0025] Furthermore, the step of obtaining the minimum cumulative distance between each further optimized pixel sequence and the difference matrix of other further optimized pixel sequences includes the following specific steps:
[0026] The difference matrix between each further optimized pixel sequence and other further optimized pixel sequences is input into a dynamic programming algorithm to obtain the minimum cumulative distance of the difference matrix between each further optimized pixel sequence and other further optimized pixel sequences.
[0027] Furthermore, the specific calculation formula corresponding to the similarity between each further optimized pixel sequence and other further optimized pixel sequences is:
[0028]
[0029] Among them, D i,v H represents the similarity between the pixel sequence after further optimization of the i-th item and the pixel sequence after further optimization of the v-th item; i,v,min It represents the minimum cumulative distance of the difference matrix of all further optimized pixel sequences; norm() represents the normalization function.
[0030] Furthermore, the classification based on the similarity of different further optimized pixel sequences to obtain connected domains of several annular crack regions includes the following specific steps:
[0031] Extract all further optimized pixel sequences whose similarity with the first further optimized pixel sequence is greater than a fourth threshold, and connect the extracted further optimized pixel sequences and the first optimized pixel sequence, which belong to the same annular crack, end to end according to the nearest principle to form a connected domain of the annular crack region;
[0032] From several unextracted further optimized pixel sequences, and so on, until no further optimized pixel sequences remain, connected domains of several annular crack regions are obtained.
[0033] The present invention also proposes a tomato phenotypic parameter measurement system based on machine vision, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program stored in the memory to implement the steps of the aforementioned tomato phenotypic parameter measurement method based on machine vision.
[0034] The beneficial effects of the technical solution of the present invention are:
[0035] By processing and analyzing defective tomato images, the annular cracks of tomatoes are accurately extracted and measured, and the phenotypic parameters are accurately calculated. Specifically, images are collected by a high-precision camera, grayed and smoothed to remove noise and ensure image quality; then Canny edge detection and 16-chain code technology are used to obtain accurate edge pixel sequences, which improves the accuracy of crack detection; then based on the length of the pixel sequence, the shorter pixel sequences are eliminated, the preferred pixel sequences are retained, and they are evenly divided into several data segments. By analyzing the differences between adjacent values, the uniformity of the data segments is calculated, thereby selecting the preferred pixel sequences with uniform data and improving the measurement accuracy; by calculating the uniformity of the data segments, the probability that the preferred pixel sequence belongs to the annular crack contour is evaluated, and a better pixel sequence is further selected to improve the accuracy of crack contour recognition; the minimum cumulative distance between pixel sequences is calculated by a dynamic programming algorithm to ensure the continuity and integrity of the crack edge; the complete crack area is extracted according to the similarity, and the pixel sequences with similarity greater than the threshold are extracted and connected end to end according to the nearest principle to form a connected domain of the complete annular crack area, thereby enhancing the connectivity of the crack area. By analyzing the characteristics of the annular crack edge and calculating the uniformity and similarity of the pixel sequence, the interference of the exposed flesh and stalk area on edge detection can be overcome, the complete extraction of the crack area can be ensured, and the problem of blurred crack edges can be effectively addressed. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] 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.
[0037] Figure 1 A flowchart of the steps of a method for measuring tomato phenotypic parameters based on machine vision according to the present invention;
[0038] Figure 2 Schematic diagram of defective tomatoes captured for the camera;
[0039] Figure 3 This is a schematic diagram after processing by Canny edge detection. DETAILED DESCRIPTION
[0040] 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 a tomato phenotypic parameter measurement method and system based on machine vision proposed by the present invention, its specific implementation, structure, features and effects, in conjunction 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.
[0041] 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.
[0042] The specific scheme of a tomato phenotypic parameter measurement method and system based on machine vision provided by the present invention is described in detail below with reference to the accompanying drawings.
[0043] See also Figure 1 , which shows a flowchart of a method for measuring tomato phenotypic parameters based on machine vision provided by an embodiment of the present invention, the method comprising the following steps:
[0044] Step S001: collecting an image of a defective tomato and an image after edge detection, and obtaining a pixel sequence of each edge in the image after edge detection.
[0045] The purpose of this embodiment is to measure the tomato phenotype based on the characteristics of the annular crack contour of the tomato in the tomato image. Therefore, it is necessary to use an image acquisition tool to acquire the tomato image and pre-process the acquired image.
[0046] It should be noted that tomato cracks can be roughly divided into three categories, namely radial cracks, strip cracks and ring cracks. Ring cracks refer to cracks or cracks that appear in a ring or concentric circle from the fruit pedicle to the fruit shoulder. When judging the quality of ring cracks, the width of the crack is an important measurement indicator, which directly reflects the quality of tomatoes. Therefore, it is particularly important to accurately measure the width of the ring crack. When the length of the ring crack is short, the crack appears as two approximately parallel straight lines. At this time, the clarity and connectivity are good, and it is easy to measure the crack parameters; when the length of the ring crack is long, the edge is blurred and there are multiple edges, and it is difficult for the machine to define the true edge of the crack. When the ring crack is more serious, the crack appears as a crescent, consisting of two arcs with different radii. Both arcs are relatively smooth, and the radius of the inner circle arc is larger, and the radius of the outer circle arc is slightly smaller than that of the inner circle. The inner circle arc and the outer circle arc chain code are similar.
[0047] Specifically, images of defective tomatoes are collected by a high-precision camera, such as Figure 2 As shown, the image is grayed and smoothed to remove the noise in the image; the image of the defective tomato is obtained through Canny edge detection. Figure 3 As shown, the pixel sequence of each edge in the image after edge detection is obtained by the 16-chain code, and the elements in the pixel sequence are the 16-chain code values corresponding to the pixel points.
[0048] Step S002: Based on the length of the pixel sequence, several preferred pixel sequences are screened and obtained, and several data segments in each preferred pixel sequence are obtained by segmentation; according to the difference of adjacent values in the data segments in the preferred pixel sequence, the uniformity of each data segment in each preferred pixel sequence is obtained, and the data segments with uniform data in each preferred pixel sequence are screened; based on the proportion of the data segments with uniform data in the preferred pixel sequence and the uniformity of all data segments, the probability that each preferred pixel sequence belongs to the annular crack contour is obtained, and the pixel sequence after further optimization is screened.
[0049] It should be noted that for a crack with a large cracking degree, since the white edge of the crack edge has a certain thickness, after Canny edge detection, four or more relatively parallel crescent-shaped cracks are often detected. The white edge shows a certain fluctuation change on the side close to the crack area, and is smooth on the other side far away from the crack area. The edge line with a rougher white edge does not belong to the real crack contour, but an interference area. For a real crack contour, the chain code of its pixel sequence changes more evenly; for some more serious annular crack areas, strip cracks may be caused on the outside, that is, the chain code of the crack pixel sequence allows for uneven local changes, but uniform overall changes. Therefore, for a real crack contour, the chain code change of its pixel sequence must meet the local uniformity characteristics.
[0050] It should be further explained that to determine whether a pixel sequence satisfies the local uniformity characteristic, a chain code can be first divided into several segments, and each data segment can be judged to determine whether it satisfies the uniformity. If there are more data segments that meet the uniformity, it is considered that the entire pixel sequence satisfies the local uniformity characteristic. Since the crack contour belongs to a uniform and smooth arc, the chain code of the arc should be consistent within a small range, without jumping or breaking, and when the arc chain code value changes, the change amplitude is roughly the same. Therefore, the difference between adjacent chain codes is small, and the mean of the absolute value of the first-order differential chain code is small. The smaller the mean, the smaller the average change between the original chain codes, and the more uniform the data segment; and in the absolute value series of the first-order differential chain code, the smaller the numerical difference of the non-zero value, indicating that when the curve chain code changes, the degree of change is similar, and the pixel sequence satisfies the arc characteristic more.
[0051] Specifically, the first threshold value preset in this embodiment is 300 and the first length is 20. This is used as an example for description. Other implementations may be set to other values. Among all pixel sequences, the pixel sequence whose sequence length is greater than the first threshold value is recorded as the preferred pixel sequence. Each preferred pixel sequence is divided into a plurality of segments of the first length, and a plurality of data segments in each preferred pixel sequence are obtained, which are expressed as follows:
[0052] L i,j =[a i,j,1 ,a i,j,2 ,…,a i,j,n ]
[0053] Among them, L i,j represents the jth data segment in the i-th preferred pixel sequence; a i,j,1 represents the first value in the jth data segment in the i-th preferred pixel sequence; a i,j,2 represents the second value in the jth data segment in the i-th preferred pixel sequence; a i,j,n Represents the nth value in the jth data segment in the ith preferred pixel sequence; it is particularly noted that, during the division of the preferred pixel sequence, if the amount of remaining data is less than the first length, the remaining data is directly combined into the last data segment.
[0054] Furthermore, a first-order difference is performed on each data segment in each preferred pixel sequence (the difference is performed by subtracting the previous element from the next element), and a difference sequence of each data segment in each preferred pixel sequence and the absolute value of each difference value are obtained. The variance of the non-zero values is calculated, so as to obtain the uniformity of each data segment in each preferred pixel sequence. The specific calculation formula is:
[0055]
[0056] Among them, E i,j Indicates the uniformity of the jth data segment in the i-th preferred pixel sequence; N i,j represents the length of the jth data segment in the i-th preferred pixel sequence; a i,j,n represents the nth value in the jth data segment in the i-th preferred pixel sequence; a i,j,n-1 represents the n-1th value in the jth data segment in the i-th preferred pixel sequence; S i,j represents the variance of all non-zero values in the absolute values of all differential values in the differential sequence of the jth data segment in the ith preferred pixel sequence; || represents the absolute value function; norm() represents the linear normalization function, and the normalization object is the variance of all data segments in all preferred pixel sequences.
[0057] It should be noted that represents the sum of the absolute values of all differential values in the differential sequence of the jth data segment in the i-th preferred pixel sequence, It represents the reciprocal of the mean. The smaller the mean, the larger the reciprocal, the smaller the average change between the original chain codes, and the higher the uniformity of the data segment. At the same time, the smaller the variance of the non-zero value in the absolute value of the difference value in the difference series, the smaller the discrete change of the difference value, and the greater the uniformity.
[0058] Furthermore, the second threshold value preset in this embodiment is 0.9, which is used as an example for description. In other implementations, it can be set to other values; the data segments whose uniformity is greater than the second threshold value in all data segments in each preferred pixel sequence are recorded as data segments with uniform data in each preferred pixel sequence; then the specific calculation formula for the probability that each preferred pixel sequence belongs to the annular crack profile is:
[0059]
[0060] Among them, P i represents the probability that the i-th preferred pixel sequence belongs to the annular crack contour; M i ′ represents the number of data segments with uniform data in the i-th preferred pixel sequence; M i The number of data segments representing the i-th preferred pixel sequence; E i,j Indicates the uniformity of the jth data segment in the i-th preferred pixel sequence.
[0061] It should be noted that represents the proportion of data segments with uniform data in the i-th preferred pixel sequence. The higher the proportion, the more it satisfies the local uniformity characteristic of the annular crack profile, and the greater the probability that the preferred pixel sequence belongs to the annular crack profile; It represents the average uniformity of the data segments in the i-th preferred pixel sequence. The larger the average uniformity, the greater the probability that the preferred pixel sequence belongs to the annular crack profile.
[0062] Furthermore, the third threshold value preset in this embodiment is 0.8, which is used as an example for description. Other implementation modes may be set to other values; the preferred pixel sequences in all preferred pixel sequences whose probability of belonging to the annular crack contour is greater than the third threshold value are recorded as further preferred pixel sequences.
[0063] Step S003: according to each value in each further optimized pixel sequence, obtain the difference matrix between each further optimized pixel sequence and other further optimized pixel sequences; obtain the minimum cumulative distance of the difference matrix between each further optimized pixel sequence and other further optimized pixel sequences through a dynamic programming algorithm, and then obtain the similarity between each further optimized pixel sequence and other further optimized pixel sequences; classify based on the similarity of different further optimized pixel sequences to obtain connected domains of several annular crack areas.
[0064] It should be noted that since the edges in the edge detection image are fuzzy, the annular crack may be broken into two or more parts. In order to extract the complete annular crack, it is necessary to calculate the similarity between the pixel sequences, connect the further optimized pixel sequences, and then extract the complete crack area. To compare the similarity of the two further optimized pixel sequences, DTW matching can be used to calculate the best matching path of the two sequences. The shorter the path, the greater the similarity of the two pixel sequences.
[0065] Specifically, the absolute value of the difference between each value in each further optimized pixel sequence and each value in other further optimized pixel sequences is calculated to obtain a difference matrix between each further optimized pixel sequence and other further optimized pixel sequences, which is expressed as follows:
[0066]
[0067] Among them, G i,v represents the difference matrix between the pixel sequence after the i-th further optimization and the pixel sequence after the v-th further optimization; Q i,1 represents the first value in the pixel sequence after further optimization of the i-th item; Q v,1 represents the first value in the pixel sequence after the vth item is further optimized; Q i,x represents the xth value in the i-th pixel sequence after further optimization; Q v,y represents the yth value in the pixel sequence after the vth item is further optimized; || represents the absolute value function.
[0068] Furthermore, the difference matrix between each further optimized pixel sequence and other further optimized pixel sequences is input into the dynamic programming algorithm to obtain the minimum cumulative distance of the difference matrix between each further optimized pixel sequence and other further optimized pixel sequences; it should be noted that the dynamic programming algorithm is a common and well-known algorithm, and the specific steps are not repeated here; then the specific calculation formula for the similarity between each further optimized pixel sequence and other further optimized pixel sequences is:
[0069]
[0070] Among them, D i,v H represents the similarity between the pixel sequence after further optimization of the i-th item and the pixel sequence after further optimization of the v-th item; i,v,min represents the minimum cumulative distance of the difference matrix of all further optimized pixel sequences; norm() represents the linear normalization function, and the normalized object is the minimum cumulative distance of all further optimized pixel sequences.
[0071] It should be noted that, the smaller the minimum cumulative distance for matching between two further optimized pixel sequences, the higher the similarity between the two further optimized pixel sequences.
[0072] Specifically, all further optimized pixel sequences are arranged in descending order according to the length from large to small, starting from the first further optimized pixel sequence, and the fourth threshold is preset to 0.9, which is described as an example, and other values can be set in other embodiments; all further optimized pixel sequences whose similarity with the first further optimized pixel sequence is greater than the fourth threshold are extracted, and the extracted several further optimized pixel sequences and the first optimized pixel sequence belong to the same annular crack, and are connected end to end according to the nearest principle to form a connected domain of the annular crack area; from the several further optimized pixel sequences that have not been extracted (the first further optimized pixel sequence is also considered to have been extracted), the above method is used and so on until no further optimized pixel sequences remain, and the connected domains of several annular crack areas are obtained. The area and position of the connected domain of each annular crack area are obtained, and the acquisition of the annular crack area of tomatoes and the measurement of its phenotypic parameters are completed.
[0073] At this point, this embodiment is completed.
[0074] The present invention also provides a tomato phenotypic parameter measurement system based on machine vision, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program stored in the memory to implement the steps of the aforementioned tomato phenotypic parameter measurement method based on machine vision.
[0075] 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. A method for measuring tomato phenotypic parameters based on machine vision, characterized in that: The method comprises the following steps: Collect the image of defective tomatoes and the image after edge detection, and obtain the pixel sequence of each edge in the image after edge detection; Based on the length of the pixel sequence, several preferred pixel sequences are obtained by screening, and several data segments in each preferred pixel sequence are obtained by segmentation; based on the difference of adjacent values in the data segments in the preferred pixel sequence, the uniformity of each data segment in each preferred pixel sequence is obtained, and the data segments with uniform data in each preferred pixel sequence are obtained by screening; based on the proportion of the data segments with uniform data in the preferred pixel sequence and the uniformity of all data segments, the probability that each preferred pixel sequence belongs to the annular crack profile is obtained, and the pixel sequence after further optimization is obtained by screening; According to each value in each further optimized pixel sequence, a difference matrix between each further optimized pixel sequence and other further optimized pixel sequences is obtained; the minimum cumulative distance of the difference matrix between each further optimized pixel sequence and other further optimized pixel sequences is obtained by a dynamic programming algorithm, and then the similarity between each further optimized pixel sequence and other further optimized pixel sequences is obtained; classification is performed based on the similarity of different further optimized pixel sequences to obtain connected domains of several annular crack areas.
2. The method for measuring tomato phenotypic parameters based on machine vision according to claim 1, characterized in that: The step of obtaining the pixel sequence of each edge in the image after edge detection includes the following specific steps: The image of defective tomatoes is captured by a high-precision camera and grayed and smoothed to remove noise from the image. The image of defective tomatoes is obtained through Canny edge detection. The image after edge detection; The pixel sequence of each edge in the image after edge detection is obtained through 16-chain code.
3. The method for measuring tomato phenotypic parameters based on machine vision according to claim 1, characterized in that: The method of screening to obtain a plurality of preferred pixel sequences based on the length of the pixel sequence and segmenting to obtain a plurality of data segments in each segment of the preferred pixel sequence comprises the following specific steps: Among all pixel sequences, a pixel sequence whose sequence length is greater than a first threshold is recorded as a preferred pixel sequence; Each preferred pixel sequence is evenly divided into a number of segments having a first length, to obtain a number of data segments in each preferred pixel sequence.
4. The method for measuring tomato phenotypic parameters based on machine vision according to claim 1, characterized in that: According to the difference between adjacent values in the data segments in the preferred pixel sequence, the uniformity of each data segment in each preferred pixel sequence is obtained, and the corresponding specific calculation formula is: Among them, E i,j Indicates the uniformity of the jth data segment in the i-th preferred pixel sequence; N i,j represents the length of the jth data segment in the i-th preferred pixel sequence; a i,j,n represents the nth value in the jth data segment in the i-th preferred pixel sequence; a i,j,n-1 represents the n-1th value in the jth data segment in the i-th preferred pixel sequence; S i,j represents the variance of all non-zero values in the absolute values of all differential values in the differential sequence of the jth data segment in the ith preferred pixel sequence; || represents the absolute value function; norm() represents the normalization function.
5. The method for measuring tomato phenotypic parameters based on machine vision according to claim 1, characterized in that: The specific steps of obtaining a data segment with uniform data in each preferred pixel sequence are as follows: The data segments whose uniformity is greater than the second threshold among all the data segments in each preferred pixel sequence are recorded as data segments with uniform data in each preferred pixel sequence.
6. The method for measuring tomato phenotypic parameters based on machine vision according to claim 1, characterized in that: The probability of each preferred pixel sequence belonging to the annular crack profile is obtained based on the proportion of data segments with uniform data in the preferred pixel sequence and the uniformity of all data segments. The corresponding specific calculation formula is: Among them, P i represents the probability that the i-th preferred pixel sequence belongs to the annular crack contour; M i ′ represents the number of data segments with uniform data in the i-th preferred pixel sequence; M i The number of data segments representing the i-th preferred pixel sequence; E i,j Indicates the uniformity of the jth data segment in the i-th preferred pixel sequence.
7. The method for measuring tomato phenotypic parameters based on machine vision according to claim 1, characterized in that: The step of obtaining the minimum cumulative distance between each further optimized pixel sequence and the difference matrix of other further optimized pixel sequences includes the following specific steps: The difference matrix between each further optimized pixel sequence and other further optimized pixel sequences is input into a dynamic programming algorithm to obtain the minimum cumulative distance of the difference matrix between each further optimized pixel sequence and other further optimized pixel sequences.
8. The method for measuring tomato phenotypic parameters based on machine vision according to claim 1, characterized in that: The specific calculation formula corresponding to the similarity between each further optimized pixel sequence and other further optimized pixel sequences is: Among them, D i,v H represents the similarity between the pixel sequence after further optimization of the i-th item and the pixel sequence after further optimization of the v-th item; i,v,min It represents the minimum cumulative distance of the difference matrix of all further optimized pixel sequences; norm() represents the normalization function.
9. The method for measuring tomato phenotypic parameters based on machine vision according to claim 1, characterized in that: The method of classifying based on the similarity of different further optimized pixel sequences to obtain connected domains of several annular crack regions includes the following specific steps: Extract all further optimized pixel sequences whose similarity with the first further optimized pixel sequence is greater than a fourth threshold, and connect the extracted further optimized pixel sequences and the first optimized pixel sequence, which belong to the same annular crack, end to end according to the nearest principle to form a connected domain of the annular crack region; From several unextracted further optimized pixel sequences, and so on, until no further optimized pixel sequences remain, connected domains of several annular crack regions are obtained.
10. A tomato phenotypic parameter measurement system based on machine vision, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the computer program is executed by the processor, the steps of the method for measuring tomato phenotypic parameters based on machine vision as described in any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Mechanical part surface defect identification method based on visual image data
CN115631174A
Visual inspection method for cracks of electric control silicone oil fan clutch shell
CN116012767A
Visual detection method for quality of connecting line and connector
CN117455870A
Intelligent detection method for crack defect of reinforcing sheet based on image processing
CN118196097A
Cited By
Workpiece drilling intelligent positioning method based on CNC system
CN119205767A
