Method and system for detecting maturity of waxberries

By performing brightness normalization and color space conversion on bayberry fruit images, identifying and segmenting shadow and highlight areas, extracting their geometric properties and texture features, and constructing feature vectors, the light and shadow confusion problem was solved, and accurate and non-destructive evaluation of bayberry maturity was achieved.

CN120655651AActive Publication Date: 2025-09-16JIANGSU SMART REAL INNOVATION TECHNOLOGY CO LTD

Patent Information

Application Number
CN202511164453.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-20
Publication Date
2025-09-16
Estimated Expiration
2045-08-20

AI Technical Summary

Technical Problem

In existing methods for detecting bayberry maturity, shadows and highlights caused by uneven lighting confuse the fruit color information, resulting in a high misjudgment rate. Existing solutions also increase hardware cost and complexity and fail to effectively utilize light and shadow information.

Method used

By acquiring bayberry fruit images, brightness normalization and color space conversion are performed, shadow and highlight areas are identified and segmented, their geometric properties and texture features are extracted, and feature vectors are constructed to evaluate maturity.

Benefits of technology

Without adding hardware equipment, the accuracy and reliability of bayberry maturity evaluation are significantly improved, and lossless, online maturity evaluation of single-sided images is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120655651A_ABST
    Figure CN120655651A_ABST
Patent Text Reader

Abstract

The invention provides a waxberry maturity detection method and system, and relates to the technical field of waxberry maturity detection. The method comprises the following steps: processing a waxberry fruit image to obtain a target image; according to the brightness distribution characteristics of the three-dimensional structure of the meat column on the surface of the waxberry fruit in the target image under fixed illumination, a shadow area and a highlight area in the target image are identified and segmented; extracting geometric attributes and first texture features; constructing feature vectors of the waxberry fruits by combining the geometric attributes with the first texture features; and determining the maturity grade of the waxberry fruits according to the feature vectors. The method aims at solving the problems of light and shadow confusion and insufficient single-face information in a traditional method, the accuracy and reliability of waxberry maturity evaluation are remarkably improved on the premise that no complex hardware equipment is added, and then accurate overall maturity lossless evaluation of waxberries with only single-face images is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of bayberry maturity detection, and in particular to a bayberry maturity detection method and system. Background Art

[0002] In the automated bayberry sorting production line, the core link of bayberry fruit sorting is the machine vision inspection station. This station usually transports bayberry fruits continuously to a designated area via a conveyor belt, and is equipped with an industrial camera and a fixed light source above it to collect images of the bayberries on the conveyor belt online and continuously. The collected images are then transmitted to the image processing unit, whose core task is to analyze traditional visual features such as color and size in the image to evaluate the maturity of the bayberries. Based on the evaluation results, the system will control subsequent sorting mechanisms, such as pneumatic nozzles or robotic arms, to accurately divert bayberries of different maturity levels to the corresponding collection channels, thereby realizing the automated grading of bayberries.

[0003] However, in the aforementioned industrial sorting scenario, bayberry fruits are not ideal standard spheres. Their surfaces possess a unique and complex three-dimensional morphology, composed of numerous sclerites (individual drupes) that exhibit significant unevenness. As bayberries pass through inspection stations in random positions on a conveyor belt, a fixed overhead light source shines on their irregular surfaces, inevitably creating numerous shadows and highlights. Specifically, the depressions between the sclerites create dark shadows because direct light is difficult to penetrate. Meanwhile, the raised tips of the sclerites, facing the light source, create bright, specular highlights due to specular reflection or strong scattering.

[0004] These shadows and highlights, created by the complex interaction of lighting conditions and the three-dimensional geometry of the fruit's surface, significantly confuse the brightness information with the fruit's inherent color, resulting from varying degrees of pigmentation. Traditional image processing units, when analyzing pixel information, struggle to effectively distinguish whether dark areas in an image are due to the fruit's inherent immaturity (e.g., a dark red or green hue) or simply shadows cast by surface depressions on a mature fruit (e.g., a purple-black hue). Similarly, a bright spot can be mistakenly interpreted as a lighter color from an immature area of ​​the fruit, rather than a specular reflection from the mature surface. This information confusion significantly reduces the accuracy of color-based ripeness assessment algorithms, resulting in unacceptable false positive rates. For example, a fully ripe, deep purple bayberry might be misclassified as less mature simply because of a large area of ​​shadow on its surface. Conversely, a less mature, lighter-colored bayberry might be mistakenly classified as highly mature due to interference from surface highlights.

[0005] To address the issues caused by uneven lighting, an intuitive approach is to modify the lighting system, such as introducing ring-shaped shadowless lamps or integrating sphere-type diffuse light sources, in order to create a uniform, non-directional lighting environment, thereby minimizing shadows and highlights. However, in the pursuit of high-throughput, low-cost industrial online sorting production lines, such complex lighting equipment not only significantly increases hardware procurement costs and installation space requirements, but also its daily maintenance (such as regular cleaning of the inner wall of the lampshade to ensure the diffuse effect) is quite difficult and time-consuming. This runs counter to the core requirements of industrial production for equipment simplicity, reliability, and economy. Furthermore, pre-cleaning and drying the bayberries to eliminate reflective factors such as surface water droplets also adds additional steps, reduces overall production efficiency, and may cause physical damage to the delicate bayberry fruit, affecting its commercial value.

[0006] Furthermore, existing systems typically capture images from the top using only a single, fixed-position camera, thus only capturing two-dimensional image information of the upper half of the fruit's surface. However, the ripening process of bayberry is affected by light, and a "yin-yang side" phenomenon may exist: the sun-facing side is more mature and darker in color, while the shady side is less mature and lighter in color. Because the bayberries are randomly positioned on the conveyor belt, the camera may capture either the more mature side or the less mature side. Judging the ripeness of the entire fruit based solely on single-sided information is insufficiently representative and inherently biased. While multi-sided imaging can be achieved by adding a mechanical flipping device to roll the bayberries on the conveyor belt, this also introduces additional mechanical structures, increasing system complexity and potential failure points. Furthermore, the rolling process can easily damage the bayberry's skin, further impacting its commercial value.

[0007] Therefore, existing methods for evaluating bayberry maturity face a dilemma: on the one hand, simple lighting and imaging systems cannot effectively address the optical artifacts caused by the bayberry's complex surface; on the other hand, complex systems that can effectively eliminate these artifacts are not industrially feasible in terms of cost, efficiency, and fruit protection. A core obstacle to this evaluation method lies in its treatment of the shadows and highlights generated by illumination as "noise" that must be eliminated. However, the distribution pattern, size, and contrast of this "noise" actually contain rich information about the three-dimensional morphology of the bayberry surface. For example, as bayberries mature, their stems become fuller and rounder, and the fruit expands in size. This systematic change in microscopic morphology, under fixed lighting conditions, naturally translates into systematic shifts in shadow and highlight patterns. The stems of mature fruits are more rounded, and the outlines and transitions of their shadows may be smoother and softer; whereas the stems of unripe fruits are relatively thin and compact, and the shadows they create may be sharper and more fragmented. These image texture features, determined by both lighting and geometry, are not useless interference but rather recognizable "fingerprints" intrinsically linked to maturity. Effectively utilizing these "fingerprints" could potentially improve the accuracy of bayberry maturity assessment without adding complex hardware. Summary of the Invention

[0008] The purpose of the present invention is to provide a method and system for detecting the maturity of bayberry, aiming to solve the problems of light and shadow confusion and insufficient single-sided information in traditional methods. This solution successfully transforms the shadows and highlights formed by the inherent complex morphology of the bayberry fruit surface under fixed lighting from "interference" into "information", thereby significantly improving the accuracy and reliability of bayberry maturity evaluation without adding any complex hardware equipment, and further realizing accurate overall maturity non-destructive evaluation of bayberries with only single-sided images.

[0009] In a first aspect, the present invention provides a method for detecting the maturity of bayberry, comprising the following steps: Acquire bayberry fruit images; Brightness normalization and color space conversion are performed on the bayberry fruit image to retain the brightness difference caused by the interaction between light and the fruit surface, and obtain the target image. According to the brightness distribution characteristics of the three-dimensional structure of the flesh column on the surface of the bayberry fruit in the target image under fixed lighting, the shadow area and highlight area in the target image are identified and segmented; Extracting geometric properties reflecting the morphology and spatial distribution of the shadow and highlight regions, and extracting first texture features reflecting the microscopic roughness and detail changes of the shadow and highlight regions from the local region containing the shadow and highlight regions; By combining the geometric attributes and the first texture feature, a feature vector of the bayberry fruit is constructed; Determine the maturity level of bayberry fruit based on the eigenvector.

[0010] The bayberry maturity detection method provided by this invention, under fixed lighting and single-view imaging conditions, no longer treats the shadows and highlights created by the concave and convex topography of the bayberry fruit surface due to the aggregation of fleshy stems as image noise. Instead, it treats them as effective visual fingerprints reflecting the plumpness and denseness of the fleshy stems. By extracting features from the collected bayberry images, quantifying the geometric and textural properties of these light and shadow fingerprints, and mapping these features to the bayberry maturity level, the method accurately assesses the overall maturity of the bayberry without requiring additional complex hardware. The core concept of this technical solution is to interpret the specific shadow and highlight distribution patterns produced by the complex three-dimensional topography of the bayberry fruit surface due to the aggregation of fleshy stems under fixed top light illumination as a "morphological fingerprint" closely related to the bayberry's maturity. By identifying and quantifying the geometric and textural properties of this "morphological fingerprint" and constructing a maturity classification model based on these features, the method achieves accurate, online, and non-destructive assessment of the overall maturity of the bayberry without changing the hardware configuration of existing industrial production lines. This method utilizes the visual manifestation of the morphological changes of the bayberry flesh during the ripening process. Even if only a single-sided image is available, the overall maturity state of the fruit can be inferred through these microscopic morphological features.

[0011] In a second aspect, the present invention provides a waxberry maturity detection system, comprising: An acquisition module is used to acquire the image of bayberry fruit; a processing module for performing brightness normalization and color space conversion on the bayberry fruit image to retain the brightness difference formed by the interaction between light and the fruit surface in the bayberry fruit image, thereby obtaining a target image; A recognition module is used to identify and segment shadow areas and highlight areas in the target image based on the brightness distribution characteristics of the three-dimensional structure of the flesh column on the surface of the bayberry fruit under fixed lighting; An extraction module is used to extract geometric attributes reflecting the morphology and spatial distribution of the shadow area and the highlight area, and to extract first texture features reflecting the microscopic roughness and detail changes of the local area containing the shadow area and the highlight area; A construction module, configured to construct a feature vector of the bayberry fruit by combining the geometric attribute and the first texture feature; The determination module is used to determine the maturity level of the bayberry fruit according to the feature vector.

[0012] From the above, it can be seen that the bayberry maturity detection method provided by the present invention, by deeply exploring the specific light and shadow texture pattern formed by the three-dimensional morphology of the bayberry fruit itself under fixed lighting, takes it as the key feature of maturity evaluation, and effectively solves the problem of light and shadow interference and color information confusion in traditional methods. Specifically, this solution no longer regards shadows and highlights as noise, but regards them as effective visual fingerprints reflecting the fullness and compactness of the bayberry flesh. By extracting and quantifying the geometric properties and texture features of these light and shadow fingerprints, a mapping relationship with the bayberry maturity level is established. In addition, under the limiting conditions of only being able to obtain a single-sided image of the fruit and the existence of the "yin and yang side" phenomenon, this solution realizes an accurate inference of the overall maturity of the bayberry by identifying the microscopic features of the changes in the flesh shape. Ultimately, this solution achieves accurate, online, and non-destructive evaluation of the overall maturity of the bayberry without adding additional hardware costs and system complexity such as complex lighting systems or mechanical flipping devices, significantly improving the efficiency and reliability of the automated sorting production line.

[0013] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the embodiments of the present invention. The purposes and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 A flow chart of a method for detecting the maturity of bayberry provided in an embodiment of the present invention.

[0015] Figure 2 A structural schematic diagram of a bayberry maturity detection system provided in an embodiment of the present invention.

[0016] Description of labels: 100, acquisition module; 200, processing module; 300, identification module; 400, extraction module; 500, construction module; 600, determination module. DETAILED DESCRIPTION

[0017] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.

[0018] Reference Attachment Figure 1 The present invention provides a method for detecting the maturity of bayberry, comprising the following steps: Acquire bayberry fruit images; Brightness normalization and color space conversion are performed on the bayberry fruit image to retain the brightness difference caused by the interaction between light and the fruit surface, and obtain the target image. According to the brightness distribution characteristics of the three-dimensional structure of the flesh column on the surface of the bayberry fruit in the target image under fixed lighting, the shadow area and highlight area in the target image are identified and segmented; Extracting geometric properties reflecting the morphology and spatial distribution of the shadow and highlight regions, and extracting first texture features reflecting the microscopic roughness and detail changes of the shadow and highlight regions from the local region containing the shadow and highlight regions; By combining the geometric attributes and the first texture feature, a feature vector of the bayberry fruit is constructed; Determine the maturity level of bayberry fruit based on the eigenvector.

[0019] Brightness normalization and color space conversion processing refers to adjusting the pixel brightness values ​​of the original bayberry fruit image and converting it to a color space suitable for analyzing lighting differences. It can be achieved by using brightness adjustment methods such as histogram equalization, gamma correction, local brightness enhancement, and converting the image from RGB color space to HSV, Lab or YUV color space. Its main purpose is to ensure that the brightness changes in the image caused by the interaction between light and the three-dimensional structure of the fruit surface (such as shadows and highlights) are effectively retained and enhanced, while reducing the impact of non-structural brightness changes, providing a stable image foundation for subsequent feature extraction. Based on the brightness distribution characteristics of the three-dimensional structure of the bayberry fruit surface flesh under fixed illumination, identifying and segmenting shadow and highlight regions in the target image refers to using the brightness pattern formed by the concave and convex morphology of the bayberry fruit surface flesh under specific lighting conditions to distinguish and separate dark and bright areas in the image. This method can be implemented using threshold-based segmentation methods, region growing algorithms, edge detection combined with region filling, or machine learning-based image segmentation models. It is mainly used to separate the light and shadow information directly related to the three-dimensional structure of the bayberry flesh from the background or other interference, and use these light and shadow regions as information carriers of maturity characteristics. Extracting geometric attributes reflecting their morphology and spatial distribution from the shadow and highlight regions refers to quantifying the macroscopic features such as shape, size, and position of the identified shadow and highlight regions. This can be achieved by calculating the area, perimeter, aspect ratio, circularity, center of gravity coordinates, main axis direction, and the relative positional relationship between regions. It is mainly used to capture the macroscopic morphological changes caused by the changes in the maturity of the bayberry flesh, which directly affect the geometric characteristics of the shadow and highlight regions. Extracting primary texture features reflecting microscopic roughness and detail variations from localized regions encompassing shadow and highlight areas involves quantifying subtle patterns of pixel brightness variations within small image patches encompassing shadow and highlight regions. This can be achieved using gray-level co-occurrence matrix features, local binary patterns, wavelet transform features, Gabor filter responses, or Fourier transform spectrum features. This approach primarily captures subtle variations in the surface microstructure of the bayberry stem (e.g., the stem tip, sides, and joints). These variations, under illumination, form specific texture patterns that reflect surface roughness or detail smoothness due to fruit maturity. Constructing a feature vector for bayberry fruit by combining geometric attributes with primary texture features involves integrating geometric attributes and texture features extracted from shadow and highlight regions into a unified numerical sequence. This can be achieved through feature concatenation, weighted feature fusion, or dimensionality reduction methods such as principal component analysis. This approach integrates complementary feature information from different dimensions into a comprehensive representation, thereby providing a more discriminative representation of bayberry maturity and enhancing the judgment capabilities of subsequent classification models.

[0020] The core concept of this technical solution is to regard the complex three-dimensional morphology formed by the aggregation of the fleshy columns on the surface of the bayberry fruit, and the specific shadow and highlight distribution patterns produced under the illumination of a fixed overhead light source, as a "morphological fingerprint" closely related to the maturity of the bayberry. By identifying and quantifying the geometric properties and texture features of these "morphological fingerprints" and constructing a maturity classification model based on these features, it is possible to achieve accurate, online, and non-destructive evaluation of the overall maturity of the bayberry without changing the hardware configuration of the existing industrial production line. This method utilizes the visual manifestation of the morphological changes of the bayberry fleshy columns during the ripening process. Even if only a single-sided image is available, the overall maturity of the fruit can be inferred through these microscopic morphological features.

[0021] The innovation of this application lies in that the shadow areas and highlight areas formed by the three-dimensional structure of the flesh column on the surface of the bayberry fruit under fixed lighting are used as information carriers, and the geometric properties reflecting its morphology and spatial distribution and the first texture features reflecting its micro-roughness and detail changes are extracted from these areas, thereby constructing a feature vector with the ability to discriminate the maturity of the bayberry, achieving the effect of evaluating the maturity of the bayberry without relying on lighting equipment or additional processing steps.

[0022] Specifically, this method systematically utilizes brightness differences generated by the interaction between the three-dimensional surface structure of bayberry fruit and fixed illumination to determine ripeness through a series of image processing and feature extraction steps. First, a raw bayberry fruit image is acquired as input for subsequent processing. Subsequently, this image undergoes brightness normalization and color space conversion. This process does not eliminate the effects of illumination but rather intentionally preserves and enhances brightness differences resulting from the interaction between illumination and the three-dimensional structure of the fruit's stems, such as shadows between stems and highlights at the stem tips. This yields a target image that contains light and shadow information related to the fruit's morphology. Based on this, shadow and highlight regions within the target image are identified and segmented based on the brightness distribution characteristics of the stems under fixed illumination. This process exploits the brightness patterns created by the stems' concave and convex morphology under illumination to precisely separate these shadow regions from the image, making them the focus of subsequent feature extraction. Next, geometric properties reflecting their morphology and spatial distribution are extracted from these identified shadow and highlight regions. These geometric attributes quantify macroscopic features of the light and shadow regions, such as their size, shape, and relative position. These features directly reflect the plumpness and arrangement of the bayberry stem, which varies with the fruit's maturity. Simultaneously, first-level texture features, reflecting variations in microscopic roughness and detail, are extracted from local image regions encompassing these shadow and highlight regions. These texture features capture subtle brightness variations on the stem surface, such as the smoothness or roughness of light-shadow transitions. These microscopic details are also closely related to the fruit's maturity. The extracted geometric attributes are then combined with the first-level texture features to construct a comprehensive bayberry fruit feature vector. This combination effectively integrates macroscopic morphological and microscopic textural information, forming a multi-dimensional, highly discriminative feature representation that more comprehensively characterizes the surface characteristics of the bayberry fruit as it changes with maturity. Finally, the constructed feature vector is input into a pre-trained classification model, which then determines the maturity grade of the bayberry fruit. The entire process conducts in-depth analysis and feature extraction of the "artifacts" produced by the interaction between light and the three-dimensional structure of the fruit, transforming them from interference into valuable discriminant information, thereby realizing the judgment of the maturity of bayberry.

[0023] As a preferred embodiment, the solution of the present application is implemented as follows: First, an RGB image of a bayberry fruit is acquired using a camera. The acquired RGB image is then converted to the HSV color space, and the V (luminance) channel is subjected to histogram equalization, tailored to image characteristics, to enhance local brightness differences while preserving illumination variations, resulting in a target image. Next, local brightness gradient analysis and a region growing algorithm are used to identify and segment shadow and highlight regions in the target image based on the brightness peaks and valleys and transition patterns formed by the bayberry stem under fixed illumination. For example, a brightness threshold range can be set, with regions below this range initially identified as shadows and regions above this range as highlights. This is then optimized through morphological operations and connected component analysis. Furthermore, for each segmented shadow and highlight region, geometric properties such as area, perimeter, aspect ratio, and centroid coordinates are calculated. Simultaneously, texture features such as contrast, energy, and homogeneity of the gray-level co-occurrence matrix are calculated for the local image blocks containing these shadow and light regions, or a Gabor filter is applied to extract texture responses at different directions and scales. After normalization, these geometric and texture features are concatenated to form a multidimensional feature vector. This feature vector is then fed into a support vector machine classifier or neural network model trained with images of bayberry fruits at different maturity levels and their corresponding feature vectors. The model then outputs the maturity level of the current bayberry fruit, for example, unripe, semi-ripe, and ripe.

[0024] Through the above-mentioned solution, this application effectively solves the problem of bayberry maturity detection, where the interaction between the three-dimensional surface morphology of the bayberry fruit and fixed lighting conditions results in shadows and highlights in the image. The brightness information of these areas is confused with the fruit's inherent color information, thus affecting the maturity assessment ability based on color analysis. This method transforms the shadows and highlights, traditionally considered interference, into information carriers that carry information about the bayberry flesh morphology and texture. This method enables the determination of bayberry maturity, avoids dependence on lighting equipment or cleaning and drying processes, reduces system cost and operational complexity, and simultaneously improves the judgment ability and stability of the detection.

[0025] In some embodiments, the step of performing brightness normalization and color space conversion on the bayberry fruit image to retain brightness differences in the bayberry fruit image caused by the interaction between light and the fruit surface to obtain the target image includes: By analyzing the brightness distribution of bayberry fruit images, the local brightness features reflecting the brightness non-uniformity of the bayberry fruit surface are obtained. Based on the local brightness characteristics, the brightness range of the bayberry fruit image is adaptively adjusted to enhance the local contrast between shadow and highlight areas while preserving the brightness differences formed by the interaction between light and the fruit surface. The bayberry fruit image after brightness adjustment is converted into a color space to obtain the target image.

[0026] Brightness distribution analysis refers to the process of statistically analyzing and identifying patterns in the brightness values ​​of pixels in an image. This can be achieved through histogram analysis, gray-level co-occurrence matrix analysis, or calculation of local statistics (such as local mean and variance). Local brightness features refer to attributes derived from brightness distribution analysis that reflect the patterns of brightness variation in local regions of the image. These features can be represented by local brightness mean, local brightness standard deviation, local brightness gradient, or local brightness peak-valley values. Adaptively adjusting the brightness range of bayberry fruit images involves dynamically adjusting the brightness mapping relationship based on the brightness characteristics of different image regions to optimize visual quality and information retention. This can be achieved through local adaptive histogram equalization (such as the CLAHE algorithm), gamma correction based on local statistics, or local tone mapping algorithms. Color space conversion processing refers to converting an image from one color representation model to another. This can be achieved by converting an RGB image to HSV color space, Lab color space, or YCbCr color space.

[0027] The operating logic of this solution is as follows: first, by performing a detailed brightness distribution analysis on the original bayberry fruit image, the system can deeply understand the brightness non-uniformity caused by the interaction between the image's illumination and the fruit's complex three-dimensional surface topography. This analysis process accurately captures the local brightness features that reflect the bayberry fruit's surface concave-convex structure. For example, it identifies which areas are deep shadows and which are harsh highlights, as well as their respective brightness ranges and variation patterns. It is based on these detailed local brightness features that the solution enters the core adaptive adjustment stage. Second, based on these acquired local brightness features, the system intelligently and non-uniformly adjusts the bayberry fruit image's brightness range. This adjustment is not a simple global stretching, but rather a differentiated processing of different brightness regions within the image. The key is to specifically enhance the local contrast of shadow and highlight areas while fully preserving the bayberry fruit's inherent light-shadow contrast (i.e., the contrast between light and dark created by the concave-convex structure of the flesh column under illumination). This means that the texture and boundary information within areas where details may have been blurred due to being too dark or too bright are effectively enhanced and highlighted, making the microscopic morphological features of the bayberry flesh, such as its fullness and compactness of arrangement, more clearly discernible in the image. Finally, after the brightness range has been finely adaptively adjusted and the key local contrast has been significantly enhanced, the image is subjected to color space conversion to obtain the final target image. This conversion step, such as converting the image from RGB space to Lab or HSV space, can effectively separate brightness information from color information, or convert color information into a representation more suitable for subsequent analysis. Since the previous step has optimized the brightness information, so that the light and shadow details are fully preserved and enhanced, this conversion can more effectively utilize the light and shadow features contained in the image, providing high-quality input for subsequent image recognition and feature extraction. Through the synergistic effect of the above steps, this scheme can overcome the limitations of traditional global processing methods in dealing with the complex light and shadow of bayberry. It not only provides a clearer and more informative image foundation for the subsequent identification and segmentation of shadow and highlight regions, but also enables the geometric attributes and texture features extracted from these regions to more accurately reflect the true morphology and maturity of the bayberry flesh. This high-quality preprocessing significantly improves the robustness and accuracy of the entire bayberry maturity detection method, enabling the effective use of the "morphological fingerprint" of the bayberry fruit surface for accurate judgment even under complex and changing lighting conditions, thereby resolving the problem of reduced maturity assessment accuracy caused by the loss of light and shadow details.

[0028] This approach analyzes the brightness distribution of bayberry fruit images to obtain local brightness features that reflect the non-uniform brightness of the bayberry fruit surface. Based on these features, the brightness range of the image is adaptively adjusted, thereby preserving the brightness differences formed by the interaction between light and the fruit surface while enhancing the local contrast between shadow and highlight areas. This processing effectively addresses the problem of extremely uneven brightness distribution caused by the complex three-dimensional morphology of bayberry fruit under fixed lighting, preventing over-compression or loss of key local light and shadow details (such as texture in deep shadows and transitions at highlight edges). Ultimately, by performing color space conversion on the brightness-adjusted image, the resulting target image can more clearly present the microtexture and detailed information of the bayberry flesh, providing a high-quality image foundation for the subsequent precise extraction of the "morphological fingerprint," thereby improving the accuracy of bayberry maturity assessment.

[0029] In some embodiments, the step of identifying and segmenting shadow areas and highlight areas in the target image based on the brightness distribution characteristics of the three-dimensional structure of the flesh column on the surface of the bayberry fruit in the target image under fixed lighting includes: By analyzing the local brightness characteristics of the target image, the brightness variation pattern reflecting the three-dimensional structure of the flesh column on the surface of the bayberry fruit under fixed lighting is obtained. The brightness variation pattern includes local brightness gradient, brightness peak and valley distribution, and brightness transition area characteristics. According to the brightness change pattern, the candidate regions in the target image are identified and generated; the candidate regions include candidate shadow regions and candidate highlight regions; By analyzing the internal brightness uniformity, boundary clarity, and brightness contrast with the surrounding areas of the candidate area, the correspondence between the candidate area and the bayberry column morphology is evaluated to obtain the evaluation analysis results. According to the evaluation and analysis results, the preset segmentation threshold or region growing criterion is adjusted, and the candidate regions are segmented and optimized to obtain shadow areas and highlight areas.

[0030] Specifically, local brightness feature analysis involves examining the brightness values ​​of pixels within a smaller range within an image, rather than focusing solely on global brightness. This can include calculating the brightness difference between a pixel and its neighbors, compiling a local brightness histogram, or applying various filters to highlight brightness variations. Its goal is to capture the detailed brightness textures formed by the microstructure of the bayberry stem under illumination. The brightness variation pattern is an abstract summary of the results of local brightness feature analysis. It is not just a single brightness value, but rather a regular pattern composed of multiple interrelated brightness features. The local brightness gradient reflects the speed and direction of brightness variations in the image and is typically obtained by calculating the brightness difference between pixels in the horizontal and vertical directions. The distribution of brightness peaks and valleys corresponds to the brightest and darkest areas in the image, and their distribution pattern reflects the convex and concave structures of the stem. Brightness transition region features refer to the smooth or abrupt transition of brightness from one region to another. Candidate regions are the collection of pixels in the image that are likely to be shadows or highlights, identified through preliminary analysis of the brightness variation pattern. These regions are potential targets for further verification and refinement. Internal brightness uniformity measures the consistency of pixel brightness values ​​within a candidate region; boundary sharpness measures the apparent brightness difference between the candidate region and its surrounding pixels; and brightness contrast with surrounding areas measures the difference between the average brightness of the candidate region and the average brightness of its adjacent regions. Evaluating the correspondence between a candidate region and its yangmei stalk morphology involves comprehensively evaluating these characteristics, including internal brightness uniformity, boundary sharpness, and brightness contrast with surrounding areas. The goal is to determine the extent to which a candidate region conforms to the typical light and shadow characteristics of a yangmei stalk under fixed illumination. Adjusting the preset segmentation threshold or region growing criterion dynamically modifies the image segmentation parameters based on the candidate region evaluation results. The segmentation threshold is used to divide pixels into regions based on their brightness values. The region growing criterion is an image segmentation method that, starting from one or more seed points, adds adjacent pixels to the region based on a preset similarity criterion. Segmentation and optimization involves performing precise pixel-level segmentation of the candidate region under the adjusted parameters and post-processing the segmentation results.

[0031] This solution uses a multi-stage, adaptive process to identify and segment the shadow and highlight areas on the surface of bayberry fruit. First, by analyzing the local brightness characteristics of the target image, we can obtain the brightness change pattern that reflects the three-dimensional structure of the flesh column on the surface of the bayberry fruit under fixed lighting. This step is crucial because it goes beyond simple global brightness threshold processing and can capture the subtle and unique brightness change patterns produced by the complex surface of the bayberry flesh column, such as the brightness gradient at the edge of the flesh column, the distribution of brightness peaks and valleys at the top and depression of the flesh column, and the brightness transition characteristics between these areas. These brightness details constitute the "fingerprint" of the flesh column morphology, providing a solid data foundation for subsequent accurate identification.

[0032] Based on this, candidate regions within the target image can be identified and generated based on the acquired brightness variation pattern, including candidate shadow regions and candidate highlight regions. This step uses the aforementioned brightness pattern to preliminarily screen out all areas in the image that may be shadows or highlights, thereby focusing subsequent processing on these potential areas. This avoids blindly searching and segmenting across the entire image, improving processing efficiency.

[0033] Furthermore, by performing feature analysis on the internal brightness uniformity, boundary clarity, and brightness contrast with the surrounding areas of these candidate regions, the correspondence between the candidate regions and the morphology of the bayberry flesh column can be objectively and comprehensively evaluated, and the evaluation and analysis results can be obtained. This evaluation process is the key to fine-tuning the verification of the initially generated candidate regions. Candidate regions generated solely based on the brightness change pattern may contain some interference areas of non-flesh column light and shadow. By comprehensively analyzing these features, the system can determine whether each candidate region truly conforms to the actual light and shadow morphology formed by the bayberry flesh column under fixed lighting, thereby effectively eliminating misidentified areas and providing a highly reliable decision-making basis for subsequent precise segmentation.

[0034] Finally, based on the evaluation and analysis results, the preset segmentation threshold or region growing criterion can be adjusted, and the candidate regions can be segmented and optimized to obtain the final shadow and highlight regions. Traditional fixed segmentation thresholds or region growing criteria are difficult to adapt to the complex and changeable light and shadow conditions and random postures on the surface of bayberry fruit. By utilizing the evaluation and analysis results obtained in the previous step, the system can adaptively adjust the segmentation parameters. For example, if a candidate region is evaluated as highly consistent with the light and shadow characteristics of the flesh column, the segmentation threshold or region growing criterion can be adjusted accordingly to make it more inclined to include the region, or more detailed adjustments can be made at the boundary to ensure its integrity. Conversely, for areas with poor evaluation results, the segmentation conditions can be tightened. This dynamic adjustment and optimization process based on the evaluation results can effectively eliminate interfering areas that do not conform to the flesh column morphology, while ensuring that the shadow and highlight areas that truly reflect the three-dimensional structure of the flesh column are accurately and completely segmented. Through multi-stage analysis and optimization, this method overcomes the difficulty of traditional methods in accurately segmenting light and shadow areas under complex lighting and fruit morphology. It robustly identifies and segments shadow and highlight regions associated with bayberry stem morphology, effectively avoiding missed or misclassified areas due to atypical light and shadow features. This precise segmentation result provides high-quality input for the subsequent extraction of first texture features from shadow and highlight regions, reflecting their morphological and spatial distribution, as well as microscopic roughness and detail variations, significantly improving the accuracy of bayberry maturity assessment.

[0035] In summary, this approach effectively addresses the complexity and non-standardization of light and shadow patterns caused by the morphological diversity of the bayberry fruit stems through multi-stage, adaptive brightness feature analysis, candidate region generation, evaluation, and optimization of the target image. By meticulously capturing local brightness gradients, peak and valley distribution, and brightness transition region features, it comprehensively identifies brightness variation patterns closely related to the three-dimensional structure of the bayberry stems, laying the foundation for subsequent light and shadow region identification. Furthermore, by comprehensively evaluating the internal brightness uniformity, boundary clarity, and brightness contrast of candidate regions with surrounding areas, it effectively distinguishes true stem light and shadow from interference regions, avoiding missed or misclassified areas due to atypical light and shadow features. Finally, segmentation parameters are adaptively adjusted based on the evaluation and analysis results, enabling the segmentation process to robustly adapt to the complex and variable light and shadow conditions on the bayberry fruit surface, accurately segmenting shadow and highlight regions. This significantly improves the accuracy of bayberry maturity assessment in complex scenarios, provides high-quality image regions for subsequent feature extraction, and ultimately enhances the reliability of automated bayberry sorting.

[0036] In some embodiments, the step of evaluating the correspondence between the candidate region and the bayberry stem morphology by performing feature analysis on the candidate region based on internal brightness uniformity, boundary clarity, and brightness contrast with surrounding areas, and obtaining the evaluation analysis result includes: Obtain the brightness distribution of the initial surrounding area of ​​the candidate area; According to the brightness distribution of the initial surrounding area, the sub-area in the initial surrounding area that is interfered by the light and shadow of the adjacent bayberry fruit or flesh column is identified, and the corrected surrounding area is obtained by excluding the sub-area; Based on the corrected surrounding area, the brightness contrast between the candidate area and the corrected surrounding area is calculated; Combined with the internal brightness uniformity, boundary clarity and calculated brightness contrast of the candidate area, the correspondence between the candidate area and the bayberry column morphology was evaluated to obtain the evaluation and analysis results.

[0037] Identifying subregions within the initial surrounding area that are affected by the light and shadow of adjacent bayberry fruits or stems involves analyzing the brightness distribution characteristics of the initial surrounding area, such as sudden brightness changes, unusually bright areas, or unusually dark areas, to identify areas within the initial surrounding area that are not part of the candidate area's own background and are caused by external light and shadow. This can be achieved using a variety of image processing techniques, such as brightness threshold segmentation, connected component analysis, morphological operations, or incorporating machine learning models to identify these interfering areas.

[0038] The operating logic of this solution is to first obtain the brightness distribution of the initial surrounding area of ​​the candidate area to be evaluated, which provides basic data for subsequent refined analysis. In view of the fact that when bayberry fruits are densely arranged or the flesh pillars are closely adjacent, the initial surrounding area may contain light and shadow interference from other flesh pillars or fruits. This solution further intelligently identifies and excludes these interfered sub-areas based on the brightness distribution of the initial surrounding area, thereby obtaining a more pure and more representative corrected surrounding area of ​​the true background of the current candidate area. On this basis, the brightness contrast between the candidate area and the corrected surrounding area is calculated to ensure that the contrast value can accurately reflect the difference between the brightness characteristics of the candidate area itself and the local background, avoiding the misleading of external light and shadow. Finally, this accurately calculated brightness contrast is combined with the inherent internal brightness uniformity and boundary clarity of the candidate area for a comprehensive evaluation. This combination makes the judgment of the correspondence between the candidate area and the bayberry flesh pillar morphology more comprehensive and reliable. Through this optimized brightness contrast analysis, this solution effectively overcomes the inaccurate judgment of surrounding areas by traditional methods in complex lighting environments. This allows the evaluation results to more accurately reflect the true morphological characteristics of the bayberry stem when identifying and segmenting shadow and highlight areas, thus laying a solid foundation for subsequent precise segmentation. This aligns with the goal of the above-mentioned solution to evaluate the correspondence between candidate regions and bayberry stem morphology through feature analysis, significantly improving the accuracy and robustness of this evaluation process, thereby enhancing the reliability of the entire bayberry maturity detection method.

[0039] This solution intelligently identifies and excludes subregions within the initial surrounding area that are affected by the light and shadow of adjacent bayberry fruits or stems before calculating the brightness contrast between the candidate region and the surrounding area. This ensures that the calculated brightness contrast more accurately reflects the difference between the candidate region's own brightness characteristics and the local background. This effectively avoids evaluation bias caused by external light and shadow interference in complex scenes where bayberry fruits are densely arranged or touching each other, significantly improving the accuracy and reliability of evaluating the correspondence between the candidate region and the bayberry stem morphology, thereby enhancing the accuracy of identifying and segmenting shadow and highlight regions.

[0040] In some embodiments, the steps of adjusting a preset segmentation threshold or region growing criterion based on the evaluation and analysis results, segmenting and optimizing the candidate regions, and obtaining shadow regions and highlight regions include: Obtaining spatial location information of each candidate area in the evaluation and analysis results and information on the corresponding relationship between the candidate area and the bayberry column morphology; According to the spatial location information, the spatial adjacency relationship and potential connection paths between adjacent candidate regions are analyzed; Based on the spatial adjacency and potential connection paths, combined with the correspondence between the candidate regions and the bayberry column morphology, the overall coherence characteristics and local detail characteristics of the light and shadow areas on the bayberry fruit surface are identified. According to the overall coherence characteristics and local detail characteristics, the segmentation parameter adjustment criteria are determined; the segmentation parameter adjustment criteria are used to maintain the global coherence of the light and shadow areas and preserve the local details of the microscopic morphology of the meat column; According to the segmentation parameter adjustment criterion, the preset segmentation threshold or region growing criterion is adjusted, and the candidate region is segmented and optimized to obtain the shadow region and the highlight region.

[0041] The spatial location information of each candidate region in the evaluation and analysis results refers to the geometric position data of each candidate region in the image coordinate system, such as its centroid coordinates, boundary pixel set, or minimum bounding rectangle parameters. This can be implemented using pixel coordinate records, region masks, or geometric shape descriptors. The correspondence information between the candidate regions and the bayberry stem morphology refers to a quantitative assessment of the degree of match between each candidate region and the typical light and shadow morphology of the bayberry stem, such as a confidence score or classification label. This can be implemented using feature similarity calculations, machine learning classifier outputs, or expert rule system judgments. Spatial adjacency refers to the spatial proximity or direct contact between two or more candidate regions in an image. This can be implemented using pixel distance determination, connectivity analysis, or topological relationship detection. Potential connection paths refer to the connection channels that can be established through image processing or morphological operations between two candidate regions in an image that are not directly adjacent but may belong to the same light and shadow region. This can be implemented using morphological dilation, bridging algorithms, or graph-theoretic path search. The overall coherence feature of the light and shadow areas on the surface of the bayberry fruit refers to the continuity, integrity or structural unity of the shadows or highlights formed by light on the surface of the bayberry fruit at a macroscopic scale. It can be achieved by using connected component analysis, regional merging rules or optimization based on a global energy function. The local detail feature refers to the fine texture, sharp edges or tiny structures in the light and shadow areas on the surface of the bayberry fruit that reflect the microscopic morphology of the flesh column. It can be achieved by using local gradient information, texture descriptors or wavelet transform coefficients. The segmentation parameter adjustment criterion refers to the rules or strategies set for the subsequent image segmentation process to guide parameter optimization based on the identified overall coherence features and local detail features. It can be achieved by using rule-based conditional judgment, adaptive threshold calculation formula or parameter weights output by the machine learning model.

[0042] This solution, through a series of interrelated steps, aims to address the fragmentation, discontinuity, and loss of detail that often occur in the segmentation of light and shadow regions on the bayberry fruit surface, ensuring that the segmentation results accurately reflect the overall morphology and microscopic features of the bayberry stem. First, the system obtains the spatial location information of each candidate region from the evaluation and analysis results, as well as the correspondence between the candidate region and the bayberry stem morphology. This initial step lays the foundation for subsequent spatial analysis and high-level feature recognition. By obtaining the specific coordinates of each candidate region in the image and its degree of match with the bayberry stem morphology, the system obtains the data input required for global consideration and local refinement, moving beyond the independent assessment of individual regions. Based on this spatial location information, the system analyzes the spatial adjacency and potential connecting paths between adjacent candidate regions. This analysis is crucial for identifying the overall coherence of light and shadow regions. Simply understanding the independent evaluation results for each region is not sufficient; understanding how they relate to each other in image space is also crucial. By analyzing which candidate regions are adjacent or connected in some way, the system can initially construct a macroscopic structure of the light and shadow region, providing a basis for subsequent holistic judgment and avoiding the erroneous segmentation of supposedly coherent light and shadow regions into multiple unrelated fragments. Furthermore, based on the analyzed spatial adjacency relationships and potential connection paths, combined with the correspondence between the candidate regions and the bayberry stem morphology, the system identifies the overall coherence and local detail features of the light and shadow regions on the bayberry fruit surface. This is the core of our approach. It deeply integrates this spatial connectivity information with the quality assessment of each candidate region. This means that even if a candidate region's individual assessment result is suboptimal, if it forms a coherent pattern consistent with the light and shadow characteristics of the bayberry stem with multiple high-quality adjacent regions, it will be considered a valid part, thus maintaining the global coherence of the light and shadow region. Furthermore, this step can identify and retain even small but crucial local light and shadow features that contribute to the stem morphology, taking into account their spatial context, ensuring the precision of the segmentation results. The system then determines the criteria for adjusting the segmentation parameters based on the identified overall coherence and local detail features. This adjustment criterion is used to maintain the global coherence of the light and shadow areas and preserve the local details of the microscopic morphology of the flesh pillars. After identifying the macroscopic coherence and microscopic details of the light and shadow areas, the system no longer simply adjusts based on a single threshold, but instead formulates targeted adjustment criteria based on these higher-level features. For example, for the interior of a large continuous shadow area, even if there are slight brightness fluctuations, the adjustment criterion will tend to relax its internal uniformity requirements to allow for larger brightness fluctuations, thereby ensuring that its global coherence is not destroyed; and for the tiny highlights or shadows reflecting the tips or depressions of the flesh pillars, the adjustment criterion will pay more attention to preserving their fine boundaries and morphology to ensure that local details are not smoothed out.This criterion provides a clear target and basis for adjusting segmentation parameters, better adapting to the complex light and shadow variations on the bayberry fruit surface. Ultimately, the system adjusts the preset segmentation threshold or region growing criterion based on the determined segmentation parameter adjustment criterion, and segment and optimizes the candidate regions to obtain shadow and highlight regions. Based on the previously determined segmentation parameter adjustment criterion, which fully considers global coherence and local details, the system fine-tunes the initial preset segmentation threshold or region growing criterion. This adjustment enables the segmentation process to more intelligently handle regions with blurred boundaries, uneven brightness, or subtle features, resulting in more accurate segmentation and optimization of candidate regions. This solution is closely integrated with previous steps (e.g., identifying and generating candidate regions in the target image and evaluating their correspondence with bayberry stem morphology). These previous steps provide preliminary candidate regions based on local features and their evaluation results, providing the necessary data foundation for this solution. Building on this foundation, this solution integrates and optimizes these local evaluation results at a higher level by incorporating spatial context analysis and global coherence considerations. This combination enables the system to elevate from isolated local judgments to a holistic understanding of the light and shadow patterns of the entire bayberry fruit, overcoming the fragmentation and detail loss that can result from relying solely on local assessments. In this way, the resulting shadow and highlight regions not only conform to the individual fruit column morphology, but also present a coherent and detailed pattern overall. This significantly improves the accuracy and robustness of light and shadow region recognition, provides high-quality input for subsequent feature extraction, and thus enhances the overall accuracy of bayberry maturity detection.

[0043] This scheme obtains the spatial location information of candidate regions and their corresponding relationship to the bayberry stem morphology. Based on this information, it analyzes the spatial adjacency and potential connection paths of adjacent regions to identify the global coherence and local detail characteristics of the light and shadow regions on the bayberry fruit surface. Based on these identified features, the scheme determines targeted segmentation parameter adjustment criteria that maintain the global coherence of the light and shadow regions while preserving the local micromorphological details of the stem. By adjusting the preset segmentation threshold or region growing criterion based on these adjustment criteria, and then segmenting and optimizing the candidate regions, the scheme effectively addresses the complex connections or small gaps between adjacent light and shadow regions caused by the aggregation characteristics of the bayberry stem. This ensures that when the local assessment results are converted into light and shadow region segmentation for the entire bayberry fruit, the adjusted segmentation parameters and optimization process maintain the global coherence of the light and shadow regions across the entire bayberry fruit, avoiding fragmentation or incompleteness of the effective light and shadow regions due to local adjustments. Furthermore, the scheme accurately preserves the local details reflecting the micromorphology of the stem, thereby accurately reflecting the overall morphology and microscopic features of the stem, improving the accuracy and robustness of bayberry maturity assessment.

[0044] In some embodiments, the step of extracting geometric attributes reflecting the morphology and spatial distribution of the shadow region and the highlight region includes: Obtaining the initial geometric properties of each independent region in the shadow area and the highlight area; the initial geometric properties include area, perimeter, shape factor, and main axis direction; Based on the initial geometric properties, the geometric features of each independent area are analyzed. Combined with the typical geometric pattern of the preset light and shadow areas of the bayberry column, the degree of conformity of each independent area with the typical geometric pattern is evaluated. Based on the evaluation results of the degree of conformity, abnormal areas in the shadow and highlight areas that do not conform to the typical geometric pattern are identified and excluded to obtain the effective light and shadow areas; From the effective light and shadow area, geometric attributes reflecting its morphology and spatial distribution are extracted.

[0045] The typical geometric pattern of the bayberry stem's light and shadow areas refers to the expected or standard set of geometric features exhibited by the shadow or highlight areas formed by the stem on the surface of the bayberry fruit under specific lighting conditions. This pattern can be established based on statistical analysis of a large number of bayberry fruit images or expert experience. For example, it can be represented by the distribution of area, perimeter, shape factor, and principal axis orientation within a specific range. It can be implemented using statistical models (such as mean, variance, and distribution range), rule-based threshold sets, or machine learning models (such as cluster centers and classification boundaries). The degree of conformity is a quantitative measure of the similarity or degree of match between the initial geometric attributes of each independent light and shadow area and the preset typical geometric pattern of the bayberry stem's light and shadow areas. This degree of conformity can be expressed as a similarity score (such as Euclidean distance or cosine similarity based on feature vectors), a probability value, or a classification result (such as whether it belongs to the "typical" category). Abnormal areas are areas in the shadow and highlight areas whose geometric features deviate significantly from the preset typical geometric pattern of the bayberry stem's light and shadow areas. These regions are often caused by non-pillar features (such as water droplets, scratches, and impurities) or image noise and should not be used to represent the true morphology of the bayberry stem. Effective light and shadow regions refer to the remaining shadow and highlight regions that accurately reflect the morphology and spatial distribution of the bayberry stem after screening and excluding abnormal areas. These regions form the basis for subsequent geometric attribute extraction and ensure the validity of the extracted features.

[0046] This approach screens and optimizes the initially identified shadow and highlight regions to ensure that the extracted geometric attributes accurately reflect the morphology and spatial distribution of the bayberry stem. First, initial geometric attributes are obtained for each individual region in the shadow and highlight regions. These initial geometric attributes include area, perimeter, shape factor, and principal axis orientation. This step provides quantitative data for subsequent pattern matching and abnormal region identification. Second, based on these initial geometric attributes, the geometric morphological characteristics of each individual region are analyzed. The degree of conformity of each individual region with the pre-defined typical geometric pattern of bayberry stem light and shadow regions is evaluated. This process uses the "typical geometric pattern" as a reference. By comparing the actual detected light and shadow regions with the light and shadow pattern representing the true morphology of the bayberry stem, it is possible to distinguish light and shadow caused by the three-dimensional structure of the bayberry stem from light and shadow caused by other factors. Next, based on the conformity assessment results, abnormal regions in the shadow and highlight regions that do not conform to the typical geometric pattern are identified and excluded, resulting in valid light and shadow regions. This elimination process removes interfering information from the image, ensuring that the subsequently extracted geometric attributes are derived only from light and shadow regions that truly reflect the morphological characteristics of the bayberry stem. Finally, geometric attributes reflecting its morphology and spatial distribution are extracted from the effective light and shadow area. By extracting geometric attributes from the screened and optimized "effective light and shadow area", the obtained geometric attributes are ensured to be of high quality and high relevance, and they can more accurately characterize the morphology and spatial distribution of the bayberry flesh column. In the bayberry maturity detection method, the previous steps have identified and segmented the shadow area and highlight area. This scheme refines these areas on this basis, effectively avoiding the interference of artifacts on feature extraction, making the constructed bayberry fruit feature vector more reliable, thereby improving the accuracy of bayberry maturity evaluation and enhancing the stability of the system under different conditions.

[0047] This solution screens and optimizes the initially identified shadow and highlight regions, ensuring that the resulting geometric attributes accurately reflect the morphology and spatial distribution of the bayberry stem. This effectively prevents artifacts from interfering with feature extraction, thereby improving the accuracy of bayberry maturity assessment and enhancing the system's stability under varying conditions.

[0048] In some embodiments, the step of extracting a first texture feature reflecting microscopic roughness and detail variations from a local area including a shadow area and a highlight area includes: Get the local area including the shadow area and the highlight area; By analyzing the brightness distribution of the local area, local brightness gradient information reflecting the direction of light and shadow changes in the local area is obtained; the local brightness gradient information includes gradient amplitude and gradient direction; Based on the local brightness gradient information, the main direction or multiple significant directions of light and shadow changes in the local area are identified; the main direction or multiple significant directions reflect the arrangement direction of the bayberry flesh or the direction of light interaction; Calculate the second texture features of the local area along the main direction or multiple significant directions; the second texture features reflect the microscopic roughness and detail changes; The second texture features are combined to obtain first texture features reflecting microscopic roughness and detail changes.

[0049] Local brightness gradient information refers to the speed and direction of brightness changes within a local area of ​​an image. It can be calculated using edge detection algorithms such as the Sobel operator, Prewitt operator, or Roberts operator. Gradient amplitude refers to the intensity of brightness changes within the local brightness gradient information and can be calculated using the square root of the sum of the squares of the horizontal and vertical brightness changes of a pixel. Gradient direction refers to the direction of brightness change within the local brightness gradient information and can be calculated using the inverse tangent function of the ratio of the horizontal and vertical brightness changes of a pixel. The main direction or multiple significant directions refer to the directions where light and shadow changes are most obvious or concentrated within a local area. These can be identified using methods such as gradient direction histogram analysis, Fourier transform, or wavelet transform. Secondary texture features refer to texture quantization values ​​calculated along specific directions that reflect changes in microscopic roughness and detail. These can be calculated using statistics such as the energy, contrast, or entropy of the gray-level co-occurrence matrix in a specific direction, or the pattern distribution of local binary patterns in a specific direction. Primary texture features refer to comprehensive texture descriptions obtained by combining multiple secondary texture features. They can be formed using methods such as feature splicing, feature fusion, or feature weighting.

[0050] This proposal details how to efficiently and accurately extract primary texture features reflecting microscopic roughness and detail variations from localized regions containing shadow and highlight information on the surface of bayberry fruit. First, a localized region encompassing shadow and highlight information is acquired. This provides a clear image range for subsequent texture analysis, ensuring that the analysis focuses on the visual manifestation of the interaction between the three-dimensional structure of the bayberry fruit's fleshy stems and illumination. Next, by analyzing the brightness distribution within these localized regions, the system obtains local brightness gradient information, including gradient magnitude and direction, reflecting the directionality of light and shadow variations. This gradient information directly quantifies the microscopic shadow patterns formed by light on the stem surface, laying the foundation for understanding the stem's three-dimensional structure and roughness. Furthermore, based on this local brightness gradient information, the primary direction or multiple significant directions of light and shadow variation within the localized region are identified. These directions reflect the arrangement of the stems or the direction of illumination interaction, allowing the system to focus on the directional texture information most strongly associated with the stem's morphology and maturity, avoiding the potential information confusion caused by non-directional analysis. Secondary texture features are then calculated for the localized region along these identified primary or significant directions. This directional calculation method can more accurately capture the microscopic roughness and detailed changes of the bayberry flesh, such as the plumpness of the flesh, edge sharpness, or surface smoothness. Ultimately, the second texture features calculated along different main directions or significant directions are combined to form the final first texture feature. This combination method ensures that the first texture feature can comprehensively characterize the microscopic roughness and detailed changes of the bayberry fruit surface in different directions, providing rich and discriminative information for subsequent feature vector construction and maturity level determination.

[0051] This scheme is closely integrated with other steps in the bayberry maturity detection method. After the bayberry fruit image undergoes brightness normalization and color space conversion, the system can identify and segment the shadow and highlight regions within the target image. This scheme extracts texture features based on these identified local regions, which contain rich light and shadow information. In this way, the directional texture features extracted by this scheme are directly linked to the three-dimensional structure and illumination interaction patterns of the bayberry fruit's surface flesh, avoiding the information confusion caused by uneven illumination in traditional methods. When these directional texture features are combined with geometric attributes extracted from the shadow and highlight regions, the jointly constructed feature vector can more comprehensively and accurately reflect the maturity status of the bayberry fruit. This combination enables the system to perform a refined assessment of bayberry maturity not only based on macroscopic geometric morphology but also on microscopic textural details, particularly directional characteristics, thereby improving the accuracy of bayberry maturity assessment under complex lighting conditions and fruit postures.

[0052] This approach deeply analyzes the directionality of light and shadow variations within a local area, identifying significant directions associated with bayberry stem arrangement or light interaction. Texture features are then calculated along these specific directions, capturing and quantifying the anisotropic characteristics of light and shadow texture on the bayberry fruit surface. This effectively preserves directional texture information associated with bayberry stem morphology and maturity, improving the discriminability of the extracted features and, in turn, enhancing the accuracy and robustness of bayberry maturity assessment.

[0053] In some embodiments, the step of constructing a feature vector of the bayberry fruit by combining the geometric attribute and the first texture feature includes: Preprocessing the geometric attributes to obtain a first standardized feature subset; Preprocessing the first texture feature to obtain a second standardized feature subset; The first standardized feature subset and the second standardized feature subset are spliced ​​together to construct a feature vector of bayberry fruit.

[0054] Geometric attributes are quantitative descriptions of the morphology and spatial distribution of the shadow and highlight regions of bayberry fruit images, extracted from these regions. These can be characterized using parameters such as area, perimeter, shape factor, principal axis orientation, or eccentricity. Primary texture features are quantitative descriptions of the microscopic roughness and detail variations of the bayberry fruit surface, extracted from local regions encompassing the shadow and highlight regions. These can be characterized using gray-level co-occurrence matrix (GLCM) features, local binary pattern (LBP) features, wavelet transform coefficients, or Fourier descriptors. Preprocessing involves transforming the raw extracted feature data to eliminate or minimize the influence of differences in dimension, value range, or distribution between different features. This can be achieved using methods such as normalization, standardization, logarithmic transformation, or principal component analysis (PCA). The first standardized feature subset is the set of geometric attributes after preprocessing. This can be represented by scaling each geometric attribute value to a specific range (e.g., [0, 1] or [-1, 1]) or by making it conform to a specific statistical distribution (e.g., mean 0 and variance 1). The second standardized feature subset refers to the preprocessed first texture feature set, which can be scaled or distributed in a similar manner to the first standardized feature subset. Splicing refers to connecting two or more independent feature subsets in a specific order to form a longer single vector containing all features, which can be achieved by vector connection or matrix merging. A feature vector refers to an ordered list of multiple numerical features used to quantitatively describe a specific attribute of an object or phenomenon, which can be used as input to a machine learning model or classifier.

[0055] When constructing the feature vector for bayberry fruit, this scheme first preprocesses the geometric attributes extracted from the shadow and highlight regions to obtain a first standardized feature subset. This processing step aims to eliminate any imbalance in weighting between geometric attributes due to differences in scale or numerical range. For example, the area value can be much larger than the shape factor. Without preprocessing, the area feature may dominate the feature vector, overshadowing other equally important geometric features. Preprocessing transforms these geometric attributes to a uniform scale or distribution, ensuring that each geometric feature contributes its true information to the feature vector. Simultaneously, preprocessing is performed on the first texture features extracted from the local region encompassing the shadow and highlight regions to obtain a second standardized feature subset. Similar to geometric attributes, texture features can also have different numerical ranges and distributions. Preprocessing ensures that, when combined with geometric features, texture features do not unduly influence the overall feature vector due to their original numerical range being too large or too small, thereby ensuring that texture information is effectively and fairly utilized. Subsequently, the preprocessed first and second standardized feature subsets are concatenated to construct the feature vector for bayberry fruit. Since both subsets have been standardized, they are comparable on a numerical scale, avoiding the weight imbalance problem that may be caused by the direct splicing of the original features. This processing method ensures that the geometric morphological information and microtexture information can work together to jointly and balancedly characterize the maturity of the bayberry fruit. It is precisely because of this standardized processing and balanced combination of different types of features that the constructed feature vector can more comprehensively and accurately reflect the maturity-related information of the bayberry fruit. On this basis, combined with the subsequent steps of determining the maturity grade of the bayberry fruit based on the feature vector in this method, the accuracy and robustness of the maturity judgment can be significantly improved, and the misjudgment caused by uneven feature weights can be avoided, thereby providing a more reliable basis for the automated grading of bayberry.

[0056] Reference Attachment Figure 2 The present invention provides a waxberry maturity detection system, comprising: An acquisition module 100 is used to acquire an image of a bayberry fruit; The processing module 200 is used to perform brightness normalization and color space conversion on the bayberry fruit image to retain the brightness difference formed by the interaction between the light and the fruit surface in the bayberry fruit image, thereby obtaining a target image; The recognition module 300 is used to identify and segment the shadow area and highlight area in the target image based on the brightness distribution characteristics of the three-dimensional structure of the flesh column on the surface of the bayberry fruit in the target image under fixed lighting; Extraction module 400, for extracting geometric attributes reflecting the morphology and spatial distribution of the shadow area and the highlight area, and extracting first texture features reflecting the microscopic roughness and detail changes of the local area containing the shadow area and the highlight area; A construction module 500 is used to construct a feature vector of the bayberry fruit by combining the geometric attribute and the first texture feature; The determination module 600 is used to determine the maturity level of the bayberry fruit according to the feature vector.

[0057] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any actual relationship or order between these entities or operations.

[0058] The foregoing description is merely an embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Those skilled in the art will readily appreciate that the present invention is susceptible to various modifications and variations. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.

Claims

1. A method for detecting the maturity of bayberry, characterized in that: The following steps are involved: Acquire bayberry fruit images; Brightness normalization and color space conversion are performed on the bayberry fruit image to retain the brightness difference caused by the interaction between light and the fruit surface, and obtain the target image. According to the brightness distribution characteristics of the three-dimensional structure of the flesh column on the surface of the bayberry fruit in the target image under fixed lighting, the shadow area and highlight area in the target image are identified and segmented; Extracting geometric properties reflecting the morphology and spatial distribution of the shadow and highlight regions, and extracting first texture features reflecting the microscopic roughness and detail changes of the shadow and highlight regions from the local region containing the shadow and highlight regions; By combining the geometric attributes and the first texture feature, a feature vector of the bayberry fruit is constructed; Determine the maturity level of bayberry fruit based on the eigenvector.

2. The method for detecting the maturity of bayberry according to claim 1, wherein The bayberry fruit image is subjected to brightness normalization and color space conversion processing to preserve the brightness differences in the bayberry fruit image caused by the interaction between light and the fruit surface. The steps of obtaining the target image include: By analyzing the brightness distribution of bayberry fruit images, the local brightness features reflecting the brightness non-uniformity of the bayberry fruit surface are obtained. Based on the local brightness characteristics, the brightness range of the bayberry fruit image is adaptively adjusted to enhance the local contrast between shadow and highlight areas while preserving the brightness differences formed by the interaction between light and the fruit surface. The bayberry fruit image after brightness adjustment is converted into a color space to obtain the target image.

3. The method for detecting the maturity of bayberry according to claim 1, wherein According to the brightness distribution characteristics of the three-dimensional structure of the flesh column on the surface of the bayberry fruit in the target image under fixed lighting, the steps of identifying and segmenting the shadow area and the highlight area in the target image include: By analyzing the local brightness characteristics of the target image, the brightness change pattern reflecting the three-dimensional structure of the flesh column on the surface of the bayberry fruit under fixed light is obtained. According to the brightness change pattern, the candidate regions in the target image are identified and generated; the candidate regions include candidate shadow regions and candidate highlight regions; By analyzing the internal brightness uniformity, boundary clarity, and brightness contrast with the surrounding areas of the candidate area, the correspondence between the candidate area and the bayberry column morphology is evaluated to obtain the evaluation analysis results. According to the evaluation and analysis results, the preset segmentation threshold or region growing criterion is adjusted, and the candidate regions are segmented and optimized to obtain shadow areas and highlight areas.

4. The method for detecting the maturity of bayberry according to claim 3, wherein The brightness change pattern includes local brightness gradient, brightness peak and valley distribution, and brightness transition area characteristics.

5. The method for detecting the maturity of bayberry according to claim 3, wherein By analyzing the internal brightness uniformity, boundary clarity, and brightness contrast of the candidate area with the surrounding area, the correspondence between the candidate area and the bayberry column morphology is evaluated. The steps of obtaining the evaluation and analysis results include: Obtain the brightness distribution of the initial surrounding area of ​​the candidate area; According to the brightness distribution of the initial surrounding area, the sub-area in the initial surrounding area that is interfered by the light and shadow of the adjacent bayberry fruit or flesh column is identified, and the corrected surrounding area is obtained by excluding the sub-area; Based on the corrected surrounding area, the brightness contrast between the candidate area and the corrected surrounding area is calculated; Combined with the internal brightness uniformity, boundary clarity and calculated brightness contrast of the candidate area, the correspondence between the candidate area and the bayberry column morphology was evaluated to obtain the evaluation and analysis results.

6. The method for detecting the maturity of bayberry according to claim 3, wherein Based on the evaluation and analysis results, the preset segmentation threshold or region growing criterion is adjusted, and the candidate regions are segmented and optimized. The steps of obtaining shadow regions and highlight regions include: Obtaining spatial location information of each candidate area in the evaluation and analysis results and information on the corresponding relationship between the candidate area and the bayberry column morphology; According to the spatial location information, the spatial adjacency relationship and potential connection paths between adjacent candidate regions are analyzed; Based on the spatial adjacency and potential connection paths, combined with the correspondence between the candidate regions and the bayberry column morphology, the overall coherence characteristics and local detail characteristics of the light and shadow areas on the bayberry fruit surface are identified. According to the overall coherence characteristics and local detail characteristics, the segmentation parameter adjustment criteria are determined; the segmentation parameter adjustment criteria are used to maintain the global coherence of the light and shadow areas and preserve the local details of the microscopic morphology of the meat column; According to the segmentation parameter adjustment criterion, the preset segmentation threshold or region growing criterion is adjusted, and the candidate region is segmented and optimized to obtain the shadow region and the highlight region.

7. The method for detecting the maturity of bayberry according to claim 1, wherein The steps of extracting geometric attributes reflecting their morphology and spatial distribution from shadow and highlight areas include: Get the initial geometric properties of each independent area in the shadow area and highlight area; Based on the initial geometric properties, the geometric features of each independent area are analyzed. Combined with the typical geometric pattern of the preset light and shadow areas of the bayberry column, the degree of conformity of each independent area with the typical geometric pattern is evaluated. Based on the evaluation results of the degree of conformity, abnormal areas in the shadow and highlight areas that do not conform to the typical geometric pattern are identified and excluded to obtain the effective light and shadow areas; From the effective light and shadow area, geometric attributes reflecting its morphology and spatial distribution are extracted.

8. The method for detecting the maturity of bayberry according to claim 1, wherein The step of extracting a first texture feature reflecting microscopic roughness and detail changes from a local area including a shadow area and a highlight area includes: Get the local area including the shadow area and the highlight area; By analyzing the brightness distribution of the local area, local brightness gradient information reflecting the direction of light and shadow changes in the local area is obtained; Based on the local brightness gradient information, the main direction or multiple significant directions of light and shadow changes in the local area are identified; the main direction or multiple significant directions reflect the arrangement direction of the bayberry flesh or the direction of light interaction; Calculate the second texture features of the local area along the main direction or multiple significant directions; the second texture features reflect the microscopic roughness and detail changes; The second texture features are combined to obtain first texture features reflecting microscopic roughness and detail changes.

9. The method for detecting the maturity of bayberry according to claim 1, wherein The steps of constructing a feature vector of bayberry fruit by combining the geometric attribute and the first texture feature include: Preprocessing the geometric attributes to obtain a first standardized feature subset; Preprocessing the first texture feature to obtain a second standardized feature subset; The first standardized feature subset and the second standardized feature subset are spliced ​​together to construct a feature vector of bayberry fruit.

10. A waxberry maturity detection system, characterized in that: include: An acquisition module is used to acquire the image of bayberry fruit; a processing module for performing brightness normalization and color space conversion on the bayberry fruit image to retain the brightness difference formed by the interaction between light and the fruit surface in the bayberry fruit image, thereby obtaining a target image; A recognition module is used to identify and segment shadow areas and highlight areas in the target image based on the brightness distribution characteristics of the three-dimensional structure of the flesh column on the surface of the bayberry fruit under fixed lighting; An extraction module is used to extract geometric attributes reflecting the morphology and spatial distribution of the shadow area and the highlight area, and to extract first texture features reflecting the microscopic roughness and detail changes of the local area containing the shadow area and the highlight area; A construction module, configured to construct a feature vector of the bayberry fruit by combining the geometric attribute and the first texture feature; The determination module is used to determine the maturity level of the bayberry fruit according to the feature vector.

Citation Information

Patent Citations

  • Method and system for detecting maturity of waxberries

    CN114549363A

  • Mature fruit self-adaptive identification method and system

    CN114842469A

  • Orchard fruit maturity evaluation and picking planning system based on intelligent image analysis

    CN118628847A

  • Nondestructive testing method and system for comprehensive quality of harvested bananas

    CN119595556A

  • Zanthoxylum schinifolium quality evaluation system and method based on image recognition

    CN120047694A

Cited By

  • Method and device for predicting productivity of fruits in greenhouse, electronic equipment and readable storage medium

    CN121147911A

  • Real-time detection method and system for fruit maturity

    CN121640448A