Machine Vision-Based Method for Detecting the Ripening of Amorphophallus bulbils

By performing pixel-level registration and gradient field reconstruction on cross-sectional images of bulbils and konjac, the problems of human subjectivity and destructiveness in existing detection methods are solved, realizing automated, quantitative, and non-destructive detection of the ripening degree of bulbils and konjac, and improving the accuracy and precision of detection.

CN123118477APending Publication Date: 2026-11-17KUNMING UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611219590.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-12
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing methods for detecting the ripening of bulbils and konjac rely on manual judgment, which is highly subjective. Chemical detection is destructive and cannot achieve continuous online monitoring. Traditional machine vision detection ignores the time-dimensional image evolution information during the ripening process, resulting in a deviation between the quantitative characterization results and the actual ripening degree, making it difficult to achieve high-precision ripening progress grading.

Method used

By performing pixel-level registration and gradient field reconstruction on continuous time-series images, combined with local region marking and spatial interpolation calibration of gradient direction deviation, ripening characterization parameters are extracted, a calibration gradient direction field is generated, and the normal change trajectory of the iso-grayscale contour line is tracked, thereby realizing automated, quantitative, and non-destructive detection of the ripening degree of bulbils-konjac cross-sections.

Benefits of technology

It improves the accuracy and spatial resolution of maturation progress determination, can accurately identify the tissue evolution characteristics during the maturation process, and provides objective quantitative evidence to support automated processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123118477A_ABST
    Figure CN123118477A_ABST
Patent Text Reader

Abstract

This invention discloses a machine vision-based method for detecting the ripening of konjac bulbils, belonging to the field of machine vision detection technology. The method includes: performing temporal alignment on a sequence of continuously acquired konjac bulbil cross-section images to generate an initial pixel sampling window; reconstructing the gradient field of the multi-band response value of each pixel within the window to obtain an original gradient direction field; marking pixel clusters to be calibrated based on the directional deviation angle between the gradient vector and a preset ripening reference direction; performing spatial neighborhood interpolation on the directional deviation angle within the pixel clusters to be calibrated, replacing the original gradient direction to generate a calibration gradient direction field; tracing the normal change trajectory of the iso-grayscale contour lines in the calibration gradient direction field, and extracting ripening characterization parameters based on the cumulative curvature; and mapping the ripening characterization parameters to a ripening progress coordinate system to output a ripening progress index.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision inspection technology, specifically to a machine vision-based method for detecting the ripening of bulbils and konjac. Background Technology

[0002] During the ripening process of konjac bulbils, the microstructure of its internal tissues undergoes continuous changes, resulting in a dynamic evolution of the texture features and optical response characteristics of the cross-section image. Current ripening degree detection methods largely rely on manual visual judgment or sampling of chemical indicators at a single time point. Manual judgment suffers from strong subjectivity and poor consistency, while chemical testing is destructive and cannot achieve continuous online monitoring. Traditional machine vision-based agricultural product quality inspection methods typically employ color histogram statistics or texture feature extraction techniques from static images. These methods treat single-frame images as the analysis object, ignoring the evolutionary information contained between consecutive frames over time during ripening, making it difficult to capture the dynamic characteristics of the ripening process. Existing visual inspection schemes have significant shortcomings when handling the ripening detection of heterogeneous materials. Firstly, conventional gradient analysis methods directly calculate the gradient field from the original image, lacking the ability to identify gradient direction perturbations caused by local tissue differences such as fiber bundle distribution and vascular structure within the konjac bulbil cross-section, and failing to distinguish between the systematic gradient orientation changes caused by ripening and the random directional noise of the tissue structure itself. Secondly, in regions of uneven ripening, local gradient directions may exhibit anomalous jumps deviating from the overall trend. Existing methods typically perform global smoothing or direct removal of such regions, leading to the loss of detailed information in the ripening front area and reducing the spatial resolution accuracy of ripening progress determination. This results in a significant discrepancy between the quantitative characterization of ripening status and the actual ripening degree when dealing with materials with complex tissue compositions, such as konjac bulbils, making it difficult to achieve high-precision ripening progress grading.

[0003] This invention addresses two main issues: First, how to identify and locate pixel regions with abnormal gradient directions caused by uneven ripening during gradient field construction, distinguishing them from normal tissue regions to avoid interference from abnormal pixels in the overall gradient field orientation judgment under global processing. Second, how to reconstruct the orientation information of the identified abnormal regions in accordance with physical laws, ensuring that the gradient direction of the region maintains spatial continuity with the surrounding ripened tissue, thereby obtaining complete and accurate geometric change features of the iso-grayscale contour lines in subsequent texture tracing. Summary of the Invention

[0004] The purpose of this invention is to provide a machine vision-based method for detecting the ripening degree of konjac bulbils, enabling automated, quantitative, and non-destructive detection of the ripening degree of konjac bulbils cross-sections. By performing pixel-level registration and gradient field reconstruction on continuous time-series images, combined with local region marking of gradient direction deviation and spatial interpolation calibration, ripening characterization parameters are extracted from the curvature changes of the normal trajectory of the iso-grayscale contour lines. These parameters are then mapped to a ripening progress coordinate system to determine the ripening level. This method can effectively identify tissue evolution characteristics during the ripening process, improving the accuracy and spatial resolution of ripening progress determination.

[0005] To achieve the above objectives, the present invention provides the following technical solution: The present invention discloses a machine vision-based method for detecting the ripening of Amorphophallus bulbifera (konjac). This method achieves accurate quantification of the ripening degree of Amorphophallus bulbifera cross-sections by correcting and tracking pixel gradient directions in time-series images. The method includes: performing a time-series alignment operation on a sequence of continuously acquired Amorphophallus bulbifera cross-section images to generate an initial pixel sampling window, thereby eliminating the influence of cross-section position offset during acquisition on the detection results and ensuring the stability of subsequent analysis. Within the initial pixel sampling window, gradient field reconstruction is performed on the multi-band response values ​​of each pixel to obtain the original gradient direction field. A single-channel grayscale field reflecting the changes in cross-section texture is extracted from the multi-band information, laying the foundation for directional feature assignment. Based on the directional deviation angle between the gradient vector in the original gradient direction field and the preset ripening reference direction, the pixel clusters to be calibrated in the initial pixel sampling window are marked. Pixel regions with significant directional differences are identified as regions to be calibrated, thereby distinguishing between normal ripening textures and local abnormal textures. Spatial neighborhood interpolation is performed on the directional deviation angle within the pixel cluster to be calibrated to replace the original gradient direction in the pixel cluster, generating a calibration gradient direction field. The directional information of reliable neighboring pixels is used to repair the directional values ​​in abnormal regions, ensuring the gradient direction field remains continuous and consistent overall, thus enhancing the integrity of the ripening feature representation. The normal change trajectory of the iso-grayscale contour lines is tracked in the calibration gradient direction field. Based on the cumulative curvature of the normal change trajectory, ripening characterization parameters of the bulbils-konjac cross-section are extracted. By tracking the curvature change of the contour lines, the microscopic morphological evolution of the internal tissue during the ripening process is captured, and quantifiable ripening indicators are extracted from the geometric morphology dimension. The ripening characterization parameters are mapped to a pre-constructed ripening progress coordinate system, outputting ripening progress indicators, completing the mapping from image features to ripening levels, and providing intuitive progress indicators for production decision-making.

[0006] As a preferred embodiment of the present invention, the temporal alignment operation includes: acquiring a sequence of images of Amorphophallus bulbifera cross-sections continuously captured by an image acquisition device within a preset time interval; selecting a frame image corresponding to the intermediate time point from the image sequence as a reference frame image, and establishing a polar coordinate system with the geometric center point of the Amorphophallus bulbifera cross-section in the reference frame image as the origin; performing pixel-level registration of other frame images with the reference frame image, calculating the affine transformation matrix between edge contour point sets, and performing an inverse transformation on each frame image according to the affine transformation matrix to obtain a spatially aligned image sequence; and extracting a circular pixel region in the spatially aligned image sequence with the geometric center point as the window center and the minimum circumcircle radius of the cross-section as the window radius, as the initial pixel sampling window. This reliably fixes the region of interest and suppresses pixel misalignment caused by cross-section contraction, expansion, or slight rotation.

[0007] As a further improvement of the present invention, the gradient field reconstruction process includes: reading the original response values ​​of each pixel in the red, green, and blue bands within the initial pixel sampling window, and combining them into a three-channel response vector; performing principal component analysis on the three-channel response vector to extract the first principal component, and using this component value as the single-channel gray value of each pixel; using the Sobel operator to calculate the first-order partial derivatives of the gray value of each pixel in the horizontal and vertical directions to obtain the horizontal gradient component and the vertical gradient component, forming a two-dimensional gradient vector; using the direction angle of the two-dimensional gradient vector as the original gradient direction of the pixel, traversing all pixels within the window to obtain the original gradient direction field. Obtaining a single-channel image with the maximum inter-class difference through principal component transformation can compress redundant information, highlight the contrast of the cross-sectional texture, and make the gradient direction field more focused on the tissue changes caused by aging.

[0008] As a preferred embodiment of the present invention, the step of marking the pixel clusters to be calibrated specifically includes: reading a preset ripening reference direction vector from a pre-stored Amorphophallus bulbifera ripening standard library; calculating the angle between the two-dimensional gradient vector of each pixel in the original gradient direction field and the preset ripening reference direction vector, as the direction deviation angle; dividing the pixels into first, second, and third categories of pixels according to a first angle threshold and a second angle threshold; using the third category of pixels as seed points, performing region growth within the initial pixel sampling window, merging adjacent pixels whose spatial distance from the seed point is less than a preset distance threshold and whose direction deviation angle difference is less than a preset difference threshold into the same pixel cluster to obtain candidate pixel clusters; and marking candidate pixel clusters with a number of pixels greater than a preset number threshold as pixel clusters to be calibrated. This process performs region screening based on the degree of direction deviation and spatial clustering, which can accurately lock abnormal texture areas caused by local defects or uneven ripening, avoiding incorrect estimation of overall texture features.

[0009] As another technical solution of the present invention, the spatial neighborhood interpolation replacement of the pixel cluster to be calibrated specifically includes: determining the minimum bounding rectangle region of the pixel cluster to be calibrated and establishing a uniformly distributed spatial interpolation grid; extracting a set of reference pixels that do not belong to the cluster from the outer neighborhood of the pixel cluster to be calibrated, and obtaining their original gradient direction angles; using each grid point as the interpolation target point, calculating the replacement gradient direction angle based on the spatial distribution of the reference pixel set; smoothing the replacement gradient direction angle using a radial basis function to generate a smooth direction angle for each grid point; replacing the original gradient direction angle of each pixel in the pixel cluster to be calibrated with the smooth direction angle at the nearest grid point to obtain the calibration gradient direction field. Using the direction information of the normal texture in the neighborhood to smoothly fill the abnormal region can eliminate the adverse effects of interference directions on subsequent contour tracking while preserving the overall texture direction, thus improving the robustness of the extraction of ripening characterization parameters.

[0010] As a specific implementation method, the radial basis function smoothing process is as follows: Using each grid point as the center, reference pixels with a spatial distance less than a preset radial distance threshold are selected to form a local reference subset; the radial basis weights of the grid point and each reference pixel in the local reference subset are calculated using the Gaussian radial basis function, with the spatial distance as the independent variable; the initial weighted direction angle is obtained by weighted summation based on the original gradient direction angle of each reference pixel in the local reference subset and its corresponding radial basis weight; the initial weighted direction angle is then normalized to the range of 0 to 360 degrees to obtain the smoothed direction angle. This method ensures that the filling direction angle changes continuously in space, avoiding new abrupt changes in direction.

[0011] As a preferred embodiment of the present invention, the process of extracting maturation characterization parameters includes: selecting multiple initial seed points extending radially outward from the geometric center point of the initial pixel sampling window in the calibration gradient direction field; starting from each initial seed point, performing step tracking along a direction perpendicular to the gradient direction of that point, sequentially connecting the passed pixels to generate multiple equal grayscale contour lines; accumulating the change in orientation angle between adjacent pixels on each equal grayscale contour line to obtain the cumulative orientation deflection, dividing it by the number of tracking steps for that contour line to obtain the average curvature value; statistically analyzing the average curvature values ​​of all equal grayscale contour lines, extracting the maximum, minimum, and arithmetic mean, and combining them as maturation characterization parameters. Through the statistical analysis of the curvature characteristics of multiple contour lines, the uniformity and overall shrinkage or expansion trend of the cross-sectional tissue during the maturation process can be comprehensively reflected from different radial positions, improving the comprehensiveness of the characterization.

[0012] Furthermore, the specific steps for tracking the equal grayscale contour line are as follows: For any starting seed point, read the gradient direction angle in the calibrated gradient direction field and rotate it 90 degrees as the initial tracking direction; starting from the starting seed point, move one pixel step along the initial tracking direction to reach the current tracking position; at the current tracking position, read the gradient direction angle in the calibrated gradient direction field and rotate it 90 degrees to obtain the updated tracking direction, continue moving one pixel step, and repeat until the tracking position point exceeds the boundary of the initial sampling window; connect the pixels passed sequentially during the tracking process in order to generate an equal grayscale contour line. Stepping along the gradient perpendicular direction can accurately fit the equal grayscale contour line and avoid contour drift caused by the accumulation of gradient direction errors.

[0013] As a further improvement of this invention, the step of outputting the ripening progress index includes: reading the standard curvature parameter ranges corresponding to multiple standard ripening progress levels from a pre-constructed ripening progress coordinate system, where the average curvature value is on the horizontal axis and the curvature distribution variance is on the vertical axis; calculating the variance of the average curvature value of all iso-grayscale contour lines in the ripening characterization parameters to obtain the curvature distribution variance value; generating the current detection point in the coordinate system using the arithmetic mean of the average curvature and the curvature distribution variance value; calculating the weighted distance between the current detection point and the regional boundaries of each standard region, and selecting the level corresponding to the standard region with the smallest weighted distance as the initial ripening level; reading the time-series correction offset corresponding to the current acquisition time from a pre-stored time-series ripening correction table, and superimposing it on the initial ripening level to obtain the final ripening progress index. Combined with time-series correction, it can compensate for the ripening state deviation caused by differences in acquisition time points, improving the comparability and accuracy of test results from different batches. This method allows for rapid and non-destructive standardized determination of the ripening degree of bulbils-konjac cut surfaces, providing an objective quantitative basis for automated processing.

[0014] The technical effects and advantages provided by the present invention in the above technical solution are as follows:

[0015] By introducing a multi-level threshold classification and region growth labeling strategy for orientation deviation angles, third-class pixels with significant deviations from the preset ripening reference direction in the original gradient orientation field are used as seed points. Region growth is performed using dual constraints of spatial distance and orientation deviation difference, accurately defining gradient aberration pixel clusters caused by local tissue ripening lag or excessive speed. Compared to global threshold segmentation or fixed window filtering, this region growth labeling method based on gradient orientation consistency constraints can adaptively form closed boundaries of pixel clusters to be calibrated according to the shape and size of the aberration region, avoiding the erroneous inclusion of normally ripened transition regions in the correction range. This ensures that subsequent orientation interpolation operations only apply to the tissue regions that truly need correction, preserving the original accuracy and texture details of the gradient orientation field in normally ripened regions. During the orientation information reconstruction process of the pixel clusters to be calibrated, a spatial interpolation replacement strategy based on peripheral neighboring reference pixels is adopted, and the generated alternative gradient orientation angles are spatially smoothed using radial basis functions. This method uses the true gradient directions of non-abnormal pixels in the immediate vicinity of the pixel cluster to be calibrated as the interpolation constraint source. Through the distance-weighted interpolation mechanism of the Gaussian radial basis function, the generated orientation angles maintain a smooth and continuous transition within the anomalous region and naturally connect with the gradient orientation field of the surrounding normal region at the boundary. Compared with directly using neighborhood mean filling or bilinear interpolation methods, radial basis function interpolation can maintain the high-order continuity of the orientation field within the reconstructed region, effectively suppressing artificially introduced spurious abrupt changes in orientation gradients during the interpolation process. This allows the calibrated gradient orientation field to generate contour trajectories that conform to the continuous variation characteristics of actual tissue texture during subsequent iso-grayscale contour normal tracing, improving the stability of curvature accumulation calculation and the sensitivity of curvature characterization parameters to the degree of curvature. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0017] Figure 1 This is a flowchart of a machine vision-based method for detecting the ripening of bulbils and konjac.

[0018] Figure 2 This is a schematic diagram illustrating the spatial alignment of a cross-sectional image of Amorphophallus bulbifera and the establishment of a circular sampling window;

[0019] Figure 3 This is a flowchart of the pixel cluster extraction process based on gradient direction deviation;

[0020] Figure 4 This is a flowchart of gradient direction field calibration;

[0021] Figure 5 This is a flowchart for detecting the ripening progress of bulbils and konjac based on equal grayscale contour curvature analysis. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0023] See Figure 1 This invention provides a machine vision-based method for detecting the ripening of Amorphophallus bulbifera, comprising: performing a temporal alignment operation on a sequence of continuously acquired Amorphophallus bulbifera cross-section images to generate an initial pixel sampling window; reconstructing the gradient field of the multi-band response value of each pixel within the initial pixel sampling window to obtain an original gradient direction field; marking the pixel cluster to be calibrated in the initial pixel sampling window according to the directional deviation angle between the gradient vector in the original gradient direction field and a preset ripening reference direction; performing spatial neighborhood interpolation on the directional deviation angle within the pixel cluster to be calibrated to replace the original gradient direction in the pixel cluster to be calibrated, generating a calibration gradient direction field; tracing the normal change trajectory of the iso-grayscale contour line in the calibration gradient direction field, and extracting ripening characterization parameters of the Amorphophallus bulbifera cross-section based on the curvature accumulation of the normal change trajectory; mapping the ripening characterization parameters to a pre-constructed ripening progress coordinate system, and outputting a ripening progress index.

[0024] Example 1:

[0025] In specific implementation, please refer to Figure 2 The image acquisition device continuously captures a sequence of images of the cross-section of bulbuloids within a preset time interval. The image acquisition device can be a color industrial camera equipped with a fixed-focus lens. The preset time interval is set to a fixed value, such as 0.5 seconds, based on the ripening reaction rate of the bulbuloids. Each frame in the image sequence contains a pixel matrix of the bulbuloid cross-section, and each pixel in the pixel matrix stores the response intensity values ​​of the three color channels: red, green, and blue.

[0026] The frame image corresponding to the middle time point in the image sequence is selected as the reference frame image. The middle time point is determined as follows: the timestamps of each frame in the image sequence are arranged in the order of shooting, and the frame image corresponding to the timestamp at the exact middle position after sorting is selected as the reference frame image. A polar coordinate system is established with the geometric center point of the Amorphophallus bulbifera cross-section in the reference frame image as the origin. The geometric center point is obtained as follows: the reference frame image is segmented into foreground to separate the foreground pixel set of the Amorphophallus bulbifera cross-section region, the average x-coordinate and average y-coordinate of all pixels in the foreground pixel set are calculated, and the point corresponding to the average x-coordinate and average y-coordinate is selected as the geometric center point.

[0027] Each frame in the image sequence, excluding the reference frame, is registered pixel-level with the reference frame. During registration, the edge contour point set of the Amorphophallus bulbifera cross-section is extracted from the reference frame, and simultaneously, the edge contour point set of the Amorphophallus bulbifera cross-section is extracted from each of the remaining frames. The edge contour point set is obtained by applying the Cannibalism edge detection operator to the binarized cross-section region obtained from foreground segmentation, resulting in a coordinate sequence of several edge pixels. The affine transformation matrix between the edge contour point set of the Amorphophallus bulbifera cross-section in each of the remaining frames and the edge contour point set of the Amorphophallus bulbifera cross-section in the reference frame is calculated. The affine transformation matrix describes the mapping relationship from the pixel coordinates in the remaining frames to the pixel coordinates in the reference frame, expressed as:

[0028]

[0029] in, and These represent the x and y coordinates of the edge contour points in the remaining frames of the image, respectively. and Representing the reference frame image and and The x and y coordinates of the matched edge contour points with the same name; , , , For the matrix elements of the rotation and scaling components, and These are the vector elements representing the translation components. The matrix elements that minimize the sum of squared mapping errors for all matching point pairs are obtained through an iterative nearest-point algorithm or least-squares estimation. , , , Translation elements , These elements are combined to form an affine transformation matrix.

[0030] The pixel coordinates of the remaining frames in each frame are inversely transformed using the affine transformation matrix. During the inverse transformation, for each pixel position in the remaining frames, the corresponding floating-point coordinates mapped to the coordinate system of the reference frame image are calculated using the inverse matrix of the affine transformation matrix. The pixel value at the floating-point coordinates is then obtained by interpolating from the original pixel values ​​of the remaining frames using bilinear interpolation. The interpolated pixel value is then assigned to the mapped integer coordinate position, completing the mapping of the pixel spatial positions of the remaining frames to the pixel spatial positions of the reference frame image. All the mapped remaining frames and the reference frame image together constitute a spatially aligned image sequence.

[0031] In spatially aligned image sequences, a circular pixel region is selected as the initial pixel sampling window, with the geometric center point as the window center and the minimum circumscribed circle radius of the Amorphophallus bulbifera cross-section as the window radius. The minimum circumscribed circle radius of the Amorphophallus bulbifera cross-section is determined as follows: the Euclidean distance between each edge contour point in the edge contour point set of the Amorphophallus bulbifera cross-section in the reference frame image and the geometric center point is calculated, and the maximum distance value among all Euclidean distances is taken as the minimum circumscribed circle radius. The window center is the geometric center point, and the window radius is the minimum circumscribed circle radius. All pixels falling within the circular region centered at the window center and with the window radius as the radius constitute the pixel set within the initial pixel sampling window.

[0032] Example 2:

[0033] In practice, the raw response values ​​of each pixel within the initial pixel sampling window are read in the red, green, and blue bands. These raw response values ​​are the digital signal intensity values ​​output by the photoelectric sensor of the image acquisition device in the three spectral channels of red, green, and blue. The raw response value of each channel is stored as an integer, and its range depends on the bit depth of the analog-to-digital converter in the image acquisition device. The raw response values ​​of the red, green, and blue bands are combined to form a three-channel response vector for each pixel. This three-channel response vector is a column vector containing three elements: the first element is the raw response value of the red band, the second element is the raw response value of the green band, and the third element is the raw response value of the blue band.

[0034] Principal component analysis (PCA) is performed on the three-channel response vectors to extract the first principal component (PPC) component, and the value of the PPC component is used as the single-channel grayscale value of each pixel. The PCA process involves combining the three-channel response vectors of all pixels within the initial pixel sampling window into a response data matrix. The number of rows in the response data matrix equals the total number of pixels within the initial pixel sampling window, and the number of columns is three. The first PPC component is the first one in the response data matrix. Line 1 The elements of the column represent the first pixel within the initial pixel sampling window. The first pixel The original response values ​​of each color channel, where A value of 1 corresponds to the red band. A value of 2 corresponds to the green band. A value of 3 corresponds to the blue band.

[0035] Centering is performed on each column of the response data matrix so that the mean of the values ​​in each column is zero, resulting in a centered response data matrix. The centering operation is as follows: calculate the arithmetic mean of all rows in a given column of the response data matrix, subtract the arithmetic mean of that column from each element in the response data matrix, and perform this operation on all three columns of the response data matrix to obtain the centered response data matrix.

[0036] Calculate the covariance matrix of the centered response data matrix. The covariance matrix is ​​a 3x3 square matrix. The first row of columns in the covariance matrix is ​​the first row of columns. Line 1 The element value of the column is the centered response data matrix. Column vector and the first The covariance of the column vectors, where The value range is from 1 to 3. The value of is between 1 and 3. The covariance is calculated by summing the products of corresponding elements of the two column vectors and dividing by the total number of pixels minus one. Eigenvalue decomposition is performed on the covariance matrix to obtain three eigenvalues ​​and their corresponding eigenvectors. Eigenvalue decomposition represents the covariance matrix as the product of the eigenvector matrix and the diagonal matrix of eigenvalues, with the three eigenvalues ​​arranged in descending order.

[0037] The largest eigenvalue is selected from the three eigenvalues, and the eigenvector corresponding to the largest eigenvalue is taken as the first principal component direction vector. The first principal component direction vector is a three-dimensional column vector, and its three components correspond to the red band projection weight, green band projection weight, and blue band projection weight, respectively. The three-channel response vector of each pixel in the centered response data matrix is ​​projected onto the first principal component direction vector. The projection operation calculates the dot product between the three-channel response vector and the first principal component direction vector, and the dot product result is taken as the projection scalar value. The mathematical expression for the projection scalar value is:

[0038]

[0039] in, Indicates the first pixel within the initial pixel sampling window The projection scalar value of each pixel. This is the pixel index, with values ​​ranging from 1 to the total number of pixels within the initial pixel sampling window; This represents the red band projection weight in the direction vector of the first principal component. This represents the green band projection weight in the direction vector of the first principal component. This represents the blue band projection weight in the direction vector of the first principal component. , and All are determined by the three components of the eigenvector corresponding to the largest eigenvalue obtained from eigenvalue decomposition; Represents the centralized response data matrix. The red band centered response value corresponding to each pixel. Represents the centralized response data matrix. The green band centered response value corresponding to each pixel. Represents the centralized response data matrix. The blue band centered response value corresponding to each pixel. Project the scalar value. As the first The single-channel grayscale value of each pixel is obtained by iterating through all pixels within the initial pixel sampling window.

[0040] The Sobel operator is used to calculate the first-order partial derivatives of grayscale for each pixel within the initial pixel sampling window in both the horizontal and vertical directions. The horizontal partial derivatives are calculated by convolving the horizontal Sobel kernel with a 3×3 neighborhood grayscale matrix centered on the target pixel. The first row of the horizontal Sobel kernel is [-1, 0, 1], the second row is [-2, 0, 2], and the third row is [-1, 0, 1]. The vertical partial derivatives are calculated by convolving the vertical Sobel kernel with a 3×3 neighborhood grayscale matrix centered on the target pixel. The first row of the vertical Sobel kernel is [-1, -2, -1], the second row is [0, 0, 0], and the third row is [1, 2, 1]. The convolution results of the horizontal and vertical partial derivatives are used as the horizontal gradient components, and the convolution results of the vertical partial derivatives are used as the vertical gradient components.

[0041] The horizontal and vertical gradient components are used to construct a two-dimensional gradient vector for each pixel. This two-dimensional gradient vector is a vector containing two elements: the first element is the horizontal gradient component, and the second element is the vertical gradient component. The direction angle of this two-dimensional gradient vector is used as the original gradient direction of the pixel. The direction angle is calculated by calculating the arctangent of the ratio of the vertical gradient component to the horizontal gradient component, and then converting the arctangent from radians to degrees, with the angle ranging from 0 to 360 degrees. This process is repeated for all pixels within the initial pixel sampling window, and the original gradient direction of each pixel is calculated accordingly. The original gradient directions of all pixels together constitute the original gradient direction field.

[0042] Example 3

[0043] In specific implementation, please refer to Figure 3 The pre-stored Amorphophallus bulbifera ripening standard library retrieves the preset ripening reference direction vector corresponding to the current test batch. The Amorphophallus bulbifera ripening standard library is a pre-established data storage structure containing multiple records. Each record contains two fields: a batch identifier and a preset ripening reference direction vector. The batch identifier distinguishes batches of Amorphophallus bulbifera samples from different varieties, growing environments, or harvesting cycles. The preset ripening reference direction vector represents the principal gradient direction of the Amorphophallus bulbifera cross-section tissue in the image during the ideal ripening process obtained through calibration experiments under the above conditions. The preset ripening reference direction vector is represented as a two-dimensional vector, denoted as [vector name missing]. ,in, This represents the horizontal component of the preset ripening reference direction vector. This represents the vertical component of the preset ripening reference direction vector. and All values ​​are floating-point numbers. During actual reading, based on the batch identifier of the currently detected bulbul konjac, a matching record is retrieved from the bulbul konjac ripening standard library, and the preset ripening reference direction vector in the matching record is extracted.

[0044] Calculate the angle between the two-dimensional gradient vector of each pixel in the original gradient orientation field and the preset ripening reference orientation vector, and use this angle as the orientation deviation angle for each pixel. The two-dimensional gradient vector of each pixel in the original gradient orientation field consists of a horizontal gradient component and a vertical gradient component. Let pixel [i] be a [pixel name missing]. The two-dimensional gradient vector is ,in, This is the index number of the pixel within the initial pixel sampling window. Represents pixels The horizontal gradient component of the two-dimensional gradient vector. Represents pixels The perpendicular gradient component of the two-dimensional gradient vector. The formula for calculating the direction deviation angle is:

[0045]

[0046] in, Represents pixels The directional deviation angle, in degrees; Represents the inverse cosine function; This represents the dot product of a two-dimensional gradient vector and a preset ripening reference direction vector; Represents the magnitude of a two-dimensional gradient vector; The magnitude of the preset ripening reference direction vector; This represents pi. For each pixel within the initial pixel sampling window, the corresponding orientation deviation angle is calculated using the formula described above.

[0047] Pixels with a directional deviation angle less than a first angle threshold are labeled as Class I pixels; pixels with a directional deviation angle greater than or equal to the first angle threshold but less than a second angle threshold are labeled as Class II pixels; and pixels with a directional deviation angle greater than or equal to the second angle threshold are labeled as Class III pixels. The first angle threshold is set to 30 degrees, based on the fact that during the normal ripening process of Amorphophallus bulbifera, the gradient direction of the cut surface texture is highly consistent with the ideal ripening direction, and pixels with a directional deviation within 30 degrees are considered to be in areas with consistent ripening direction. The second angle threshold is set to 60 degrees, based on the fact that pixels with a directional deviation exceeding 60 degrees indicate a significant deviation of their local texture direction from the ideal ripening direction, and these pixels may correspond to unripe tissue or areas of abnormal tissue. Class I pixels correspond to areas with highly consistent direction, Class II pixels correspond to areas with transitional direction, and Class III pixels correspond to areas with significant directional deviation.

[0048] Using third-class pixels as seed points, a region growing algorithm is executed within the initial pixel sampling window. The region growing algorithm is executed as follows: An access marker array of the same size as the initial pixel sampling window is established, and all elements are initialized to an unvisited state; all third-class pixels are traversed, and for each third-class pixel used as a seed point, if the seed point is in an unvisited state in the access marker array, a new empty pixel cluster is created, and the seed point is added to the pixel cluster, while the corresponding position in the access marker array is marked as visited; with the seed point as the center, each neighboring pixel within its eight-neighborhood is checked. For each neighboring pixel, if the neighboring pixel is in an unvisited state in the access marker array, the relationship between the neighboring pixel and the seed point is calculated. The spatial distance and directional deviation angle difference between points are considered. The spatial distance uses Euclidean distance, and the directional deviation angle difference is the absolute value of the difference between the directional deviation angle of adjacent pixels and the directional deviation angle of the seed point. If the spatial distance is less than a preset distance threshold and the directional deviation angle difference is less than a preset difference threshold, the adjacent pixels are merged into the current pixel cluster, and the corresponding positions of the adjacent pixels in the access marker array are marked as visited. Then, using the newly merged adjacent pixels as growth points, the system continues to check unvisited pixels within their eight neighborhoods, repeating the spatial distance and directional deviation angle difference checks until the current pixel cluster can no longer accommodate new pixels. The preset distance threshold is set to 5 pixels, based on the following: at the image acquisition resolution, the average diameter of the smallest texture unit in the konjac bulb cross-section tissue structure is 5 pixels, and pixels within a cluster should belong to the same continuous texture region. The preset difference threshold is set to 15 degrees, based on the following: gradient direction changes are gradual within the same texture region, and directional fluctuations within 15 degrees are considered natural continuous changes in the same local texture. After completing one round of region growing, the resulting pixel cluster is saved as a candidate pixel cluster, and the search continues to find the next unvisited third-class pixel as a new seed point. The region growing process is repeated until all third-class pixels have been visited, resulting in multiple candidate pixel clusters.

[0049] The number of pixels contained in each candidate pixel cluster is calculated. When the number of pixels exceeds a preset threshold, the candidate pixel cluster is marked as a cluster to be calibrated. The preset threshold is set to 20, based on the following: candidate pixel clusters with 20 or fewer pixels are usually formed by image noise or isolated edge points and do not represent the tissue texture region, so they are filtered out; candidate pixel clusters with more than 20 pixels correspond to tissue texture abnormal regions with sufficient spatial scale and are marked as clusters to be calibrated. The final output is all marked clusters to be calibrated.

[0050] Example 4:

[0051] In specific implementation, please refer to Figure 4For each marked pixel cluster to be calibrated, perform the following operations: First, determine the minimum bounding rectangle region of the pixel cluster to be calibrated. This is done by iterating through the x-coordinate and y-coordinate values ​​of all pixels within the cluster, recording the minimum, maximum, minimum, and maximum x-coordinate values. The minimum x-coordinate and minimum y-coordinate values ​​are used as the top-left vertex of the rectangle region, and the maximum x-coordinate and maximum y-coordinate values ​​are used as the bottom-right vertex. The resulting rectangle is the minimum bounding rectangle region. Second, establish a uniformly distributed spatial interpolation grid within the minimum bounding rectangle region. This is done by setting a grid step size of 2 pixels. This step size is based on the fact that the continuous spatial scale of the texture direction of the Amorphophallus bulbifera cross-section at the image acquisition resolution is approximately 2 pixels. This step size allows for control of the number of grid points while ensuring interpolation accuracy. Starting from the top-left vertex of the minimum bounding rectangle region, grid points are generated at equal intervals in the horizontal and vertical directions, with each grid point serving as an interpolation target point. All grid points constitute the spatial interpolation grid.

[0052] Pixels not belonging to the pixel cluster to be calibrated are extracted from the outer neighborhood of the pixel cluster to be calibrated and used as a reference pixel set. The outer neighborhood is defined as follows: the neighborhood expansion width is extended outward from the minimum bounding rectangle region, with a width of 10 pixels. This width is based on the fact that the continuous influence range of the texture of the Amorphophallus bulbifera cross-section in the image is approximately 10 pixels. Pixels that do not belong to the pixel cluster to be calibrated and are located within the initial pixel sampling window are extracted from all pixels in the expanded region to form the reference pixel set. The original gradient direction angle of each reference pixel in the reference pixel set is obtained. The original gradient direction angle is read from the corresponding pixel position in the original gradient direction field. The original gradient direction angle of each pixel in the original gradient direction field is the direction of the two-dimensional gradient vector expressed as an angle value.

[0053] Using each grid point in the spatial interpolation grid as the interpolation target point, and based on the distribution of the reference pixel set around the interpolation target point, the alternative gradient direction angle at each interpolation target point is calculated. The alternative gradient direction angle is calculated using a weighted smoothing method based on radial basis functions. This method performs smoothing processing simultaneously during the calculation of the alternative gradient direction angle, generating a smoothed direction angle for each grid point within the minimum bounding rectangle region. The specific generation process of the smoothed direction angle is as follows.

[0054] Centered on each grid point in the spatial interpolation grid, reference pixels within the reference pixel set whose spatial distance from the grid point is less than a preset radial distance threshold are selected to form a local reference subset of the grid points. The spatial distance is the Euclidean distance between the grid point coordinates and the coordinates of the reference pixel. The preset radial distance threshold is 10 pixels, set based on the premise that the effective texture information surrounding the pixel cluster to be calibrated has a real impact on the interpolation target point within a 10-pixel range; reference pixels outside this range have insufficient correlation between their gradient directions and the true gradient direction at the interpolation target point. For grid points, all reference pixels in the reference pixel set whose spatial distance is less than 10 pixels are included in the local reference subset.

[0055] The radial basis function (RBF) is used to calculate the radial basis weights between grid points and each reference pixel in the local reference subset. The Gaussian RBF expression is that the weight is equal to the natural constant e raised to the power of the base, with the exponent being the square of the negative spatial distance divided by the square of twice the radial basis width parameter. The radial basis width parameter is set to 3 pixels. This setting is based on the fact that, under the Gaussian function form, the weight decays to near zero when the distance exceeds 3 times the radial basis width parameter. Choosing 3 pixels limits the effective range of the weights to a local region with a radius of approximately 3 pixels centered on the grid point, ensuring that the interpolation results are sensitive to changes in local texture direction. For a grid point, the spatial distance between the grid point and the s-th reference pixel in the local reference subset is denoted as... Then the radial basis weight value between the grid point and the s-th reference pixel point The above calculations are based on the Gaussian radial basis functions.

[0056] Based on the original gradient direction angle and corresponding radial basis weight value of each reference pixel in the local reference subset, a weighted summation operation is performed to obtain the initial weighted direction angle of the grid points. The expression for the weighted summation operation is:

[0057]

[0058] in, The first point in the spatial interpolation grid is represented by the second point. The initial weighted orientation angles of each grid point, in degrees; This is the grid point index, with values ​​ranging from 1 to the total number of grid points in the grid. Indicates the first The total number of reference pixels in the local reference subset corresponding to each grid point; This refers to the index number of the reference pixel in the local reference subset, with values ​​ranging from 1 to... ; Indicates the first The grid point and the local reference subset of the _th grid point The radial basis weights between each reference pixel are calculated using the Gaussian radial basis function described above. Indicates the first in the local reference subset The original gradient direction angles of the reference pixels are expressed in degrees. The original gradient direction angles are obtained from the original gradient direction angle data of the reference pixel set.

[0059] The initial weighted direction angle is normalized to a range of 0 to 360 degrees, resulting in a smoothed direction angle. The normalization process involves calculating the remainder when the initial weighted direction angle is divided by 360. If the remainder is negative, 360 is added to it. The final result is the smoothed direction angle normalized to the 0-360 degree range. This process is repeated for each grid point within the smallest bounding rectangle region, generating the smoothed direction angle for each grid point.

[0060] After generating the smoothing direction angle, the original gradient direction angle of each pixel in the pixel cluster to be calibrated is replaced with the smoothing direction angle of the nearest spatial interpolation grid point. The nearest spatial interpolation grid point is determined as follows: calculate the Euclidean distance between the pixel in the pixel cluster to be calibrated and each grid point in the spatial interpolation grid, select the grid point with the smallest Euclidean distance as the nearest grid point, read the calculated smoothing direction angle at the nearest grid point, and assign the smoothing direction angle to the pixel in the pixel cluster to be calibrated, overwriting the original gradient direction angle of the pixel. Traverse all pixel clusters to be calibrated within the initial pixel sampling window, and perform all the above steps from determining the smallest bounding rectangle region to replacing the original gradient direction angle for each pixel cluster. The gradient direction field obtained after all replacements are completed is the calibrated gradient direction field.

[0061] Example 5:

[0062] In specific implementation, please refer to Figure 5In the calibration gradient direction field, multiple initial seed points are selected, extending radially outward from the geometric center point of the initial pixel sampling window. The geometric center point is the origin of the polar coordinate system established during the temporal alignment operation. The radial outward extension selection method is as follows: Starting from the geometric center point, a ray is emitted every 30 degrees within the range of 0 to 360 degrees. The 30-degree interval is based on the fact that the angular resolution of the radial texture of the Amorphophallus bulbifera cross-section is no less than 30 degrees, and the 30-degree interval can cover all texture directions of the circular cross-section, emitting a total of 12 rays. On each ray, starting from a position 3 pixels away from the geometric center point, points are selected sequentially with a step distance of 5 pixels until the ray reaches the boundary of the initial pixel sampling window. The 3-pixel distance from the geometric center point is based on the fact that the area near the geometric center point has large noise interference, and avoiding the area within a 3-pixel radius of the geometric center point can improve the stability of subsequent contour tracking. The 5-pixel step distance is based on the fact that the average ridge spacing of the Amorphophallus bulbifera cross-section texture is about 5 pixels. All points selected on each ray are used as starting seed points, and the starting seed points on all rays together constitute the starting seed point set.

[0063] For any starting seed point in the set of starting seed points, read the gradient direction angle of the starting seed point in the calibration gradient direction field. The gradient direction angle is the angle between the gradient vector at that position in the calibration gradient direction field and the horizontal direction of the image, in degrees, with a range of 0 to 360 degrees. Rotate the read gradient direction angle by 90 degrees to obtain the initial tracking direction of the starting seed point. The rotation operation is as follows: add 90 degrees to the gradient direction angle value; if the sum is greater than or equal to 360 degrees, subtract 360 degrees from the sum. The resulting angle value is the initial tracking direction. Starting from the starting seed point, move along the initial tracking direction by one pixel step. The pixel step is defined as the center distance between the current pixel and its neighboring pixels, with a value of 1 pixel unit. After moving, reach the current tracking position point.

[0064] At the current tracking position, read the gradient direction angle of the current tracking position in the calibration gradient direction field. Rotate the gradient direction angle of the current tracking position by 90 degrees to obtain the updated tracking direction of the current tracking position. The rotation method is the same as the initial tracking direction rotation method. Starting from the current tracking position, continue moving one pixel step along the updated tracking direction to reach the next tracking position. Repeat the tracking direction update and step movement operation. After reaching a new tracking position, read the gradient direction angle of that position and rotate it by 90 degrees to obtain the direction along the next step movement, until the tracking position exceeds the boundary of the initial pixel sampling window, at which point the tracking of the contour line stops.

[0065] Connect all pixels traversed sequentially during the tracking process in the order they were tracked to generate a uniform grayscale contour line. This contour line consists of a series of ordered pixel coordinates, starting from the initial seed point and connecting each tracking position point sequentially until the end point. The above tracking operation is performed on each initial seed point in the set, generating multiple uniform grayscale contour lines equal in number to the initial seed point. If the tracking direction cannot be determined for a given initial seed point due to an undefined gradient direction angle, that initial seed point is skipped, and no corresponding uniform grayscale contour line is generated.

[0066] After generating all equal grayscale contours, the changes in orientation angles between adjacent pixels on each contour are accumulated to obtain the cumulative orientation deflection of each contour. The change in orientation angle between adjacent pixels is defined as follows: for two sequentially arranged adjacent pixels on the equal grayscale contour, the gradient orientation angles in the calibration gradient direction field are read, and the absolute value of the difference between the two gradient orientation angles is calculated. If the absolute value is greater than 180 degrees, it is subtracted from 360 degrees, and the result is the change in orientation angle. The changes in orientation angles of all adjacent pixel pairs on the equal grayscale contour are added sequentially, and the accumulated result is the cumulative orientation deflection of the equal grayscale contour, in degrees.

[0067] Divide the cumulative directional deflection by the number of tracking steps for the iso-grayscale contour to obtain the average curvature value of the iso-grayscale contour. The number of tracking steps is the total number of pixels contained in the iso-grayscale contour minus one. The average curvature value represents the average rate of change of direction of the iso-grayscale contour along the tracking path, in degrees per pixel step.

[0068] Statistical analysis is performed on the average curvature values ​​of all iso-grayscale contours to extract the maximum, minimum, and arithmetic mean of the average curvature values. The arithmetic mean is calculated by summing the average curvature values ​​of all iso-grayscale contours and then dividing by the number of iso-grayscale contours. The maximum, minimum, and arithmetic mean of the average curvature values ​​are combined to form a aging characterization parameter, which is stored in triplet form.

[0069] Subsequently, the ripening characterization parameters are mapped to a pre-constructed ripening progress coordinate system. This pre-constructed coordinate system uses the average curvature value as the horizontal axis and the curvature distribution variance as the vertical axis. The coordinate system stores the standard curvature parameter ranges corresponding to multiple standard ripening progress levels, with each standard ripening progress level corresponding to a standard region in the coordinate system. The standard region is a rectangular area defined by the lower limit, upper limit, lower limit, and upper limit of the horizontal and vertical axes. The boundary values ​​of the standard region are obtained as follows: multiple samples of bulbils with known ripening progress are collected; for each sample, the arithmetic mean of the average curvature and the variance of the curvature distribution in the ripening characterization parameters are calculated using the same method; the samples are classified into levels based on their ripening progress; the range of the arithmetic mean of the average curvature of all samples within each level is used as the lower and upper limits of the horizontal axis; and the range of the variance of the curvature distribution is used as the lower and upper limits of the vertical axis.

[0070] The variance of the average curvature value of all equal grayscale contour lines in the ripening characterization parameters is calculated to obtain the curvature distribution variance value. The curvature distribution variance value is calculated as follows: calculate the arithmetic mean of the average curvature values ​​of all equal grayscale contour lines, then calculate the square of the difference between each average curvature value and the arithmetic mean, add all the squared values ​​together and divide by the number of equal grayscale contour lines minus one. The result is the curvature distribution variance value.

[0071] The arithmetic mean of the average curvature from the curvature characterization parameters is used as the x-axis value, and the variance of the curvature distribution is used as the y-axis value to generate the current detection point in the curvature progress coordinate system. The current detection point is a two-dimensional point, with the arithmetic mean of the average curvature as the x-axis value and the variance of the curvature distribution as the y-axis value, and the units are consistent with the units of the x-axis and y-axis of the curvature progress coordinate system.

[0072] Calculate the weighted distance between the current inspection point and the boundary of each standard area in the ripening progress coordinate system. The formula for calculating the weighted distance is:

[0073]

[0074] in, Indicates the current detection point and the first The weighted distance between the boundaries of each standard region This is the index number of the standard area, with a value ranging from 1 to the total number of standard maturity progress levels; This indicates the x-coordinate value of the current detection point and the... The shortest horizontal distance along the horizontal axis of the boundary of each standard region, expressed in units of average curvature. If the current detection point falls within the boundary of the first standard region... Within each standard area, The value is 0; This indicates the relationship between the ordinate value of the current detection point and the first... The shortest vertical distance along the longitudinal axis of the boundary of each standard region, expressed in units of curvature distribution variance. If the current detection point falls within the first... Within each standard area, The value is 0; Indicates the first The standard deviation of the abscissa values ​​of all calibration sample points within a standard region is calculated using the arithmetic mean of the mean curvature of the calibration sample points corresponding to that standard region. Reflects the first The degree of dispersion of the horizontal axis features at each level; Indicates the first The standard deviation of the ordinate values ​​of all calibrated sample points within a standard region is calculated using the variance data of the curvature distribution of the calibrated sample points corresponding to that standard region. Reflects the first The degree of dispersion of the vertical axis features at each level. The inverse square of the standard deviation is used as the weight. In essence, the difference between the horizontal axis and the vertical axis is divided by the square of the standard deviation of their respective dimensions. This is to eliminate the influence of the different dimensions of the horizontal and vertical axes and the difference in dispersion, so that the weighted distance becomes a dimensionless standardized distance.

[0075] Select weighted distance The standard maturity progress level corresponding to the smallest standard area is used as the initial maturity level. The initial maturity level is represented by a level identifier, such as the value 1, 2, 3, etc., and each value corresponds to a maturity progress level.

[0076] The timing correction offset corresponding to the current acquisition time is read from the pre-stored timing ripening correction table. The pre-stored timing ripening correction table is a two-dimensional data table. The first column stores the timestamp in seconds, recording the time value from the exposure of the konjac bulb cut surface. The second column stores the timing correction offset in ripening progress levels, indicating the correction value to be added at that timestamp. The timing correction offset is a signed floating-point value; a positive number indicates an offset to a higher ripening level, and a negative number indicates an offset to a lower ripening level. The timing ripening correction table is established by detecting standard ripening samples at different time points, recording the difference between the initial ripening level obtained by the method of this invention and the manually calibrated true ripening level, and averaging the differences at the same time points to obtain the timing correction offset corresponding to that timestamp. In use, the timestamp of the reference frame image in the image sequence is read, and the closest timestamp record is found in the timing ripening correction table to extract the corresponding timing correction offset.

[0077] The timing correction offset is superimposed on the initial maturation level. The superposition operation is to add the value of the initial maturation level to the timing correction offset to obtain the final maturation progress index. The maturation progress index is output as a maturation level value with decimal places.

[0078] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A machine vision-based method for detecting the ripening of bulbils and konjac, characterized in that, The method includes: A temporal alignment operation is performed on the continuously acquired sequence of cross-sectional images of bulbils and konjac to generate an initial pixel sampling window; Within the initial pixel sampling window, the gradient field is reconstructed for the multi-band response value of each pixel to obtain the original gradient direction field. Based on the directional deviation angle between the gradient vector in the original gradient direction field and the preset ripening reference direction, the pixel cluster to be calibrated in the initial pixel sampling window is marked; Spatial neighborhood interpolation is performed on the orientation deviation angle inside the pixel cluster to be calibrated to replace the original gradient direction in the pixel cluster to be calibrated, thereby generating a calibration gradient direction field; In the calibration gradient direction field, the normal change trajectory of the iso-grayscale contour line is traced, and the ripening characterization parameters of the bulbil konjac cross-section are extracted based on the curvature accumulation of the normal change trajectory. The maturation characterization parameters are mapped to a pre-constructed maturation progress coordinate system to output maturation progress indicators.

2. The machine vision-based method for detecting the ripening of bulbils and konjac as described in claim 1, characterized in that, The step of performing a time-series alignment operation on the continuously acquired konjac bulb cross-section image sequence to generate an initial pixel sampling window includes: A sequence of images of konjac bulbils cut surfaces captured continuously by an image acquisition device within a preset time interval is obtained, wherein each frame in the image sequence contains a pixel matrix of the konjac bulbils cut surface; The frame image corresponding to the intermediate moment in the image sequence is selected as the reference frame image, and a polar coordinate system is established with the geometric center point of the bulbil konjac cross-section in the reference frame image as the origin. The remaining frames in the image sequence, excluding the reference frame image, are each registered pixel-level with the reference frame image. The registration process is as follows: Calculate the affine transformation matrix between the edge contour point set of the Amorphophallus bulbifera cross-section in each frame image and the edge contour point set of the Amorphophallus bulbifera cross-section in the reference frame image; The pixel coordinates of each frame image are inversely transformed according to the affine transformation matrix, so that the pixel spatial positions of the remaining frames image are mapped to the pixel spatial positions of the reference frame image, thus obtaining a spatially aligned image sequence. In the spatially aligned image sequence, a circular pixel region is extracted using the geometric center point as the window center and the minimum circumscribed circle radius of the bulbil-konjac cross-section as the window radius, serving as the initial pixel sampling window.

3. The machine vision-based method for detecting the ripening of bulbils and konjac as described in claim 2, characterized in that, Within the initial pixel sampling window, the multi-band response value of each pixel is reconstructed using a gradient field to obtain the original gradient direction field, including: Read the original response values ​​of each pixel in the red, green and blue bands within the initial pixel sampling window, and combine the original response values ​​in the red, green and blue bands into a three-channel response vector for each pixel; Principal component analysis is performed on the three-channel response vector to extract the first principal component component, and the value of the first principal component component is used as the single-channel gray value of each pixel. The Sobel operator is used to calculate the first-order partial derivatives of gray level for each pixel in the horizontal and vertical directions within the initial pixel sampling window, respectively, to obtain the horizontal gradient component and the vertical gradient component. The horizontal gradient component and the vertical gradient component are combined to form a two-dimensional gradient vector for each pixel. The direction angle of the two-dimensional gradient vector is used as the original gradient direction of the pixel. By traversing all pixels within the initial pixel sampling window, the original gradient direction field is obtained.

4. The machine vision-based method for detecting the ripening of bulbils and konjac as described in claim 3, characterized in that, Based on the directional deviation angle between the gradient vector in the original gradient direction field and the preset ripening reference direction, the pixel clusters to be calibrated in the initial pixel sampling window are marked, including: Read the preset ripening reference direction vector corresponding to the current test batch from the pre-stored bulb konjac ripening standard library; Calculate the angle between the two-dimensional gradient vector of each pixel in the original gradient direction field and the preset ripening reference direction vector, and use the angle as the direction deviation angle of each pixel. Pixels with a directional deviation angle less than the first angle threshold are marked as first-class pixels; pixels with a directional deviation angle greater than or equal to the first angle threshold and less than the second angle threshold are marked as second-class pixels; and pixels with a directional deviation angle greater than or equal to the second angle threshold are marked as third-class pixels. Using the third type of pixel as seed point, a region growing algorithm is executed within the initial pixel sampling window to merge adjacent pixel points whose spatial distance from the seed point is less than a preset distance threshold and whose directional deviation angle difference is less than a preset difference threshold into the same pixel cluster, thereby obtaining multiple candidate pixel clusters. Calculate the number of pixels contained in each candidate pixel cluster. When the number of pixels is greater than a preset threshold, mark the candidate pixel cluster as the pixel cluster to be calibrated.

5. The machine vision-based method for detecting the ripening of bulbils in konjac according to claim 4, characterized in that, Spatial neighborhood interpolation is performed on the orientation deviation angle within the pixel cluster to be calibrated to replace the original gradient direction in the pixel cluster, generating a calibration gradient direction field, including: Determine the minimum bounding rectangle region of the pixel cluster to be calibrated, and establish a uniformly distributed spatial interpolation grid within the minimum bounding rectangle region; Extract pixels that do not belong to the pixel cluster to be calibrated from the outer neighborhood of the pixel cluster to be calibrated as a reference pixel set, and obtain the original gradient direction angle of each reference pixel in the reference pixel set; Using each grid point in the spatial interpolation grid as the interpolation target point, and based on the distribution position of the reference pixel set around the interpolation target point, the alternative gradient direction angle of each interpolation target point is calculated; The alternative gradient direction angle is smoothed using radial basis functions to generate a smoothed direction angle for each grid point within the minimum bounding rectangle region; The original gradient direction angle of each pixel in the pixel cluster to be calibrated is replaced with the smooth direction angle at the nearest spatial interpolation grid point. All pixel clusters to be calibrated within the initial pixel sampling window are traversed to obtain the calibration gradient direction field.

6. The machine vision-based method for detecting the ripening of bulbils and konjac as described in claim 5, characterized in that, Tracing the normal variation trajectory of the iso-grayscale contour line in the calibration gradient direction field, and extracting the ripening characterization parameters of the bulbil konjac cross-section based on the cumulative curvature of the normal variation trajectory, including: In the calibration gradient direction field, multiple starting seed points are selected that extend radially outward from the geometric center of the initial pixel sampling window; Starting from each initial seed point, step tracking is performed along the direction perpendicular to the gradient direction of that point in the calibration gradient direction field. The pixels passed during the tracking process are connected sequentially to generate multiple equal grayscale contour lines. The change in orientation angle between adjacent pixels on each equal grayscale contour line is accumulated to obtain the cumulative orientation deflection of each equal grayscale contour line; Divide the cumulative directional deflection by the number of tracking steps for the equal grayscale contour line to obtain the average curvature value of each equal grayscale contour line; Statistical analysis is performed on the average curvature values ​​of all equal grayscale contours, and the maximum, minimum and arithmetic mean of the average curvature values ​​are extracted. The maximum, minimum and arithmetic mean of the average curvature values ​​are then combined into the ripening characterization parameters.

7. The machine vision-based method for detecting the ripening of bulbils and konjac as described in claim 6, characterized in that, The maturation characterization parameters are mapped to a pre-constructed maturation progress coordinate system, and maturation progress indicators are output, including: Read the standard curvature parameter range corresponding to multiple standard curvature progress levels from the pre-constructed curvature progress coordinate system. The curvature progress coordinate system has the average curvature value as the horizontal axis and the curvature distribution variance as the vertical axis. Each standard curvature progress level corresponds to a standard region in the curvature progress coordinate system. Calculate the variance of the average curvature value of all equal grayscale contours in the ripening characterization parameters to obtain the curvature distribution variance value; The average curvature arithmetic mean of the curvature characterization parameters is used as the abscissa value, and the curvature distribution variance value is used as the ordinate value to generate the current detection point in the curvature progress coordinate system. Calculate the weighted distance between the current detection point and the boundary of each standard region in the maturation progress coordinate system, and select the standard maturation progress level corresponding to the standard region with the smallest weighted distance as the initial maturation level. Read the timing correction offset corresponding to the current acquisition time from the pre-stored timing ripening correction table, and add the timing correction offset to the initial ripening level to obtain the final ripening progress index.

8. The machine vision-based method for detecting the ripening of bulbils and konjac as described in claim 3, characterized in that, Principal component analysis is performed on the three-channel response vector to extract the first principal component, and the value of the first principal component is used as the single-channel grayscale value of each pixel, including: The three-channel response vectors of all pixels within the initial pixel sampling window are combined into a response data matrix. The number of rows in the response data matrix is ​​the total number of pixels within the initial pixel sampling window, and the number of columns is three. Each column in the response data matrix is ​​centered so that the mean value of each column is zero, resulting in a centered response data matrix. Calculate the covariance matrix of the centralized response data matrix, and perform eigenvalue decomposition on the covariance matrix to obtain three eigenvalues ​​and the eigenvector corresponding to each eigenvalue; Select the largest eigenvalue from the three eigenvalues, and use the eigenvector corresponding to the largest eigenvalue as the first principal component direction vector; The three-channel response vector of each pixel in the centralized response data matrix is ​​projected onto the first principal component direction vector to obtain the projection scalar value of each pixel, and the projection scalar value is used as the single-channel gray value.

9. The machine vision-based method for detecting the ripening of bulbils in konjac according to claim 5, characterized in that, The step of smoothing the alternative gradient direction angle using radial basis functions to generate a smoothed direction angle for each grid point within the minimum bounding rectangle region includes: Taking each grid point in the spatial interpolation grid as the center, reference pixels with a spatial distance less than a preset radial distance threshold are selected from the set of reference pixels to form a local reference subset of the grid point; The radial basis weights between the grid point and each reference pixel in the local reference subset are calculated using the Gaussian radial basis function, where the independent variable of the Gaussian radial basis function is the spatial distance between the grid point and the reference pixel. Based on the original gradient direction angle and the corresponding radial basis weight value of each reference pixel in the local reference subset, a weighted summation operation is performed to obtain the initial weighted direction angle of the grid point. The initial weighted direction angle is normalized to a range of 0 to 360 degrees to obtain the smoothed direction angle. Iterate through all grid points within the minimum bounding rectangle region and generate a smooth direction angle for each grid point.

10. The machine vision-based method for detecting the ripening of bulbils and konjac as described in claim 6, characterized in that, Starting from each initial seed point, step tracking is performed along a direction perpendicular to the gradient direction of that point in the calibration gradient direction field. The pixels traversed during the tracking process are connected sequentially to generate multiple equal-grayscale contour lines, including: For any starting seed point, read the gradient direction angle of the starting seed point in the calibration gradient direction field, and rotate the gradient direction angle by 90 degrees to obtain the initial tracking direction of the starting seed point. Starting from the initial seed point, move one pixel step along the initial tracking direction to reach the current tracking position point; At the current tracking position, the gradient direction angle of that position in the calibration gradient direction field is read, and the gradient direction angle is rotated by 90 degrees to obtain the updated tracking direction of that position. Starting from the current tracking position, continue moving one pixel step along the updated tracking direction to reach the next tracking position. Repeat the tracking direction update and step movement operations until the tracking position exceeds the boundary of the initial pixel sampling window. Connect all the pixels that are passed in sequence during the tracking process to generate a grayscale contour line; Iterate through all starting seed points to generate multiple equal grayscale contour lines, with the same number of starting seed points.