A method and system for detecting the maturity of a waxberry
By performing brightness normalization and color space transformation on images of bayberry fruits, shadow and highlight areas are identified and segmented, their geometric attributes and texture features are extracted, and feature vectors are constructed. This solves the problem of misjudgment of maturity detection caused by uneven lighting, realizes non-destructive online maturity evaluation, and improves detection accuracy and efficiency.
Patent Information
- Application Number
- CN202511164453.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-20
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-08-20
AI Technical Summary
In existing methods for detecting the maturity of bayberries, uneven lighting causes shadows and highlights that can be confused with fruit color information, leading to a high misjudgment rate. Furthermore, existing solutions increase hardware costs and complexity, affecting production efficiency and fruit protection.
By performing brightness normalization and color space transformation on images of bayberry fruits, shadow and highlight areas are identified and segmented, their geometric attributes and texture features are extracted, and feature vectors are constructed to evaluate maturity, avoiding additional hardware equipment and processing steps.
Without adding hardware, the accuracy and reliability of bayberry maturity evaluation have been improved, enabling non-destructive, online overall maturity judgment and enhancing the efficiency and reliability of automated sorting lines.
Smart Images

Figure CN120655651B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of waxberry maturity detection technology, and more specifically, to a method and system for waxberry maturity detection. Background Technology
[0002] In an automated bayberry sorting production line, the core step in bayberry fruit sorting is the machine vision inspection station. This station typically uses a conveyor belt to continuously transport bayberries to a designated area, with an industrial camera and fixed light source positioned above them to continuously capture images of the bayberries on the conveyor belt. The acquired images are then transmitted to an image processing unit, whose core task is to analyze traditional visual features such as color and size to evaluate the ripeness of the bayberries. Based on the evaluation results, the system controls subsequent sorting mechanisms, such as pneumatic nozzles or robotic arms, to precisely separate bayberries of different ripeness levels into their corresponding collection channels, thus achieving automated grading of the bayberries.
[0003] However, in the aforementioned industrial sorting scenario, the bayberry fruit is not an ideal standard sphere. Its surface has a unique and complex three-dimensional morphology, composed of numerous fleshy pillars (i.e., individual small drupes), exhibiting a significant unevenness. When the bayberries pass through the inspection station on the conveyor belt in a random posture, the fixed top light source illuminates their irregular surface, inevitably producing numerous shadows and highlights. Specifically, the depressions between the fleshy pillars form dark shadows because light cannot penetrate directly; while the raised tips of the pillars facing the light source form bright spots of light due to specular reflection or strong scattering.
[0004] The shadows and highlights created by the complex interaction between lighting conditions and the three-dimensional geometry of the fruit surface cause significant confusion between their brightness information and the inherent color information of the fruit itself, which is determined by varying degrees of pigment deposition. Traditional image processing units, when analyzing pixel information, struggle to effectively distinguish whether a dark area in an image originates from the fruit's immaturity (e.g., a dark reddish or bluish hue) or is merely a shadow cast by depressions on the surface of a ripe fruit (e.g., a purplish-black color). Similarly, a bright spot might be misinterpreted as a light color from an immature area rather than a specular reflection from the surface of an immature fruit. This information confusion directly leads to a significant decrease in the accuracy of color-analysis-based maturity assessment algorithms, resulting in an unacceptable misjudgment rate. For example, a fully ripe, deep purple bayberry might be misjudged as a less mature fruit simply because of a large area of shadow on its surface; conversely, an underripe, light-colored bayberry might be incorrectly classified as highly mature due to interference from bright areas on its surface.
[0005] To address the problem of uneven lighting, an intuitive approach is to modify the lighting system, such as introducing ring-shaped shadowless lamps or integrating sphere diffused light sources, to create a uniform, non-directional lighting environment, thereby minimizing shadows and highlights. However, in industrial online sorting production lines that prioritize high throughput and low cost, such complex lighting equipment not only significantly increases hardware procurement costs and installation space requirements, but its daily maintenance (such as regularly cleaning the inner walls of the lampshade to ensure diffused light) is also quite difficult and time-consuming. This contradicts the core requirements of industrial production for equipment simplicity, reliability, and economy. Simultaneously, pre-processing the bayberries by washing and drying them to eliminate surface water droplets and other reflective factors also adds extra steps, reduces overall production efficiency, and may cause physical damage to the delicate bayberry fruit, affecting its commercial value.
[0006] Furthermore, existing systems typically use only a single, fixed-position camera to capture images from above, thus only obtaining two-dimensional image information of the upper surface of the bayberry fruit. However, the ripening process of bayberries is affected by sunlight, potentially exhibiting a "sunny-side" phenomenon—the sun-facing side is more mature and darker in color, while the shaded side is less mature and lighter in color. Since the arrangement of bayberries on the conveyor belt is random, the camera may capture either a more mature side or a less mature side. Judging the ripeness of the entire fruit based on information from only one side is insufficiently representative and inherently biased. While adding a mechanical flipping device to roll the bayberries on the conveyor belt can achieve multi-faceted imaging, this also introduces additional mechanical structures, increasing system complexity and potential failure points. Moreover, the rolling process can easily damage the bayberry skin, further affecting its commercial value.
[0007] Therefore, existing methods for evaluating the maturity of bayberries face a dilemma: on the one hand, simple lighting and imaging systems cannot effectively address the optical artifacts caused by the complex surface of bayberries; on the other hand, complex systems capable of effectively eliminating these artifacts lack industrial practicality in terms of cost, efficiency, and fruit protection. The core obstacle of this evaluation method lies in its treatment of shadows and highlights generated by lighting as "noise" that must be eliminated. However, the distribution patterns, size, and contrast of these "noises" actually contain rich information about the three-dimensional morphology of the bayberry surface. For example, as bayberries ripen, their fleshy pillars become fuller and rounder, and the fruit volume increases accordingly. This systematic change in micromorphology, under fixed lighting conditions, naturally translates into a systematic change in shadow and highlight patterns. The fleshy pillars of mature fruits are larger and rounder, and the outlines and transitions of their shadow areas may be smoother and softer; while the fleshy pillars of unripe fruits are relatively thinner and firmer, and the shadows they create may be sharper and more fragmented. These image texture features, determined by both lighting and geometric shape, are not useless interference, but rather identifiable "fingerprints" intrinsically linked to maturity. If these "fingerprints" can be effectively utilized, it is hoped that the accuracy of waxberry maturity assessment can be improved without increasing the complexity of hardware. Summary of the Invention
[0008] The purpose of this invention is to provide a method and system for detecting the maturity of bayberries, aiming to solve the problems of light and shadow confusion and insufficient information from one side 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 into "information" instead of "interference". This significantly improves the accuracy and reliability of bayberry maturity evaluation without adding any complex hardware equipment, and enables accurate and non-destructive evaluation of the overall maturity of bayberries with only one side image.
[0009] In a first aspect, the present invention provides a method for detecting the maturity of bayberry, comprising the following steps:
[0010] Obtain an image of a bayberry fruit;
[0011] Brightness normalization and color space conversion were performed on the image of the bayberry fruit to preserve the brightness difference caused by the interaction between light and the fruit surface, thus obtaining the target image.
[0012] Based on the brightness distribution characteristics formed by the three-dimensional structure of the fleshy columnar structure on the surface of the bayberry fruit in the target image under fixed illumination, the shadow area and highlight area in the target image are identified and segmented.
[0013] Geometric properties reflecting the shape and spatial distribution of the shadow and highlight areas are extracted, and first texture features reflecting the micro-roughness and detail variations are extracted from the local areas containing the shadow and highlight areas.
[0014] By combining geometric properties and first texture features, a feature vector of bayberry fruit is constructed;
[0015] The maturity level of bayberry fruit is determined based on the feature vector.
[0016] The waxberry maturity detection method provided by this invention, under fixed lighting and single-view imaging conditions, no longer considers the shadows and highlights generated by the uneven morphology of the waxberry fruit surface due to the aggregation of fleshy columns as image noise, but rather as an effective visual fingerprint reflecting the fullness and tightness of the fleshy columns. By extracting features from the acquired waxberry images, quantifying the geometric attributes and texture features of these light and shadow fingerprints, and establishing a mapping relationship between these features and the waxberry maturity level, an accurate evaluation of the overall maturity of the waxberry can be achieved without the need for additional complex hardware equipment. The core concept of this technical solution is to regard the specific shadow and highlight distribution patterns generated by the complex three-dimensional morphology of the waxberry fruit surface due to the aggregation of fleshy columns under fixed top light source illumination as a "morphological fingerprint" closely related to the waxberry maturity. By identifying and quantifying the geometric attributes and texture features of these "morphological fingerprints," and constructing a maturity classification model based on these features, an accurate, online, and non-destructive evaluation of the overall maturity of the waxberry can be achieved without changing the existing industrial production line hardware configuration. This method utilizes the visual representation of morphological changes in the fleshy column of the bayberry during the ripening process. Even with only a single-sided image, the overall ripening status of the fruit can be inferred from these microscopic morphological features.
[0017] Secondly, the present invention provides a waxberry maturity detection system, comprising:
[0018] The acquisition module is used to acquire images of bayberry fruits;
[0019] The processing module is used to perform brightness normalization and color space conversion on the bayberry fruit image to preserve the brightness differences in the bayberry fruit image caused by the interaction between light and the fruit surface, so as to obtain the target image.
[0020] The recognition module is used to identify and segment the shadow and highlight areas in the target image based on the brightness distribution characteristics formed by the three-dimensional structure of the fleshy columnar structure on the surface of the bayberry fruit under fixed illumination.
[0021] The extraction module is used to extract geometric properties reflecting the shape and spatial distribution of shadow and highlight areas, and to extract first texture features reflecting the micro-roughness and detail variations of local areas containing shadow and highlight areas.
[0022] A building block is used to construct the feature vector of a bayberry fruit by combining geometric properties and first texture features;
[0023] The determination module is used to determine the maturity level of bayberry fruits based on feature vectors.
[0024] As can be seen from the above, the bayberry maturity detection method provided by this invention effectively solves the problems of light and shadow interference and color information confusion in traditional methods by deeply exploring the specific light and shadow texture patterns formed by the three-dimensional morphology of the bayberry fruit under fixed illumination and using them as key features for maturity evaluation. Specifically, this scheme no longer regards shadows and highlights as noise, but rather as effective visual fingerprints reflecting the fullness and compactness of the bayberry flesh columns. By extracting and quantifying the geometric attributes and texture features of these light and shadow fingerprints, a mapping relationship with the bayberry maturity level is established. In addition, under the limitation of only being able to acquire single-sided images of the fruit and the existence of "yin-yang" phenomena, this scheme achieves accurate inference of the overall maturity of the bayberry by identifying the microscopic features of flesh column morphology changes. Finally, this scheme achieves accurate, online, and non-destructive evaluation of the overall maturity of bayberries without increasing the additional hardware costs and system complexity of complex lighting systems or mechanical flipping devices, significantly improving the efficiency and reliability of automated sorting lines.
[0025] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing embodiments of the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings. Attached Figure Description
[0026] Figure 1 This is a flowchart of a method for detecting the maturity of bayberry provided in an embodiment of the present invention.
[0027] Figure 2 This is a schematic diagram of a waxberry maturity detection system provided in an embodiment of the present invention.
[0028] Label Explanation:
[0029] 100. Acquisition Module; 200. Processing Module; 300. Recognition Module; 400. Extraction Module; 500. Construction Module; 600. Determination Module. Detailed Implementation
[0030] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0031] Reference Appendix Figure 1 This invention provides a method for detecting the maturity of bayberries, comprising the following steps:
[0032] Obtain an image of a bayberry fruit;
[0033] Brightness normalization and color space conversion were performed on the image of the bayberry fruit to preserve the brightness difference caused by the interaction between light and the fruit surface, thus obtaining the target image.
[0034] Based on the brightness distribution characteristics formed by the three-dimensional structure of the fleshy columnar structure on the surface of the bayberry fruit in the target image under fixed illumination, the shadow area and highlight area in the target image are identified and segmented.
[0035] Geometric properties reflecting the shape and spatial distribution of the shadow and highlight areas are extracted, and first texture features reflecting the micro-roughness and detail variations are extracted from the local areas containing the shadow and highlight areas.
[0036] By combining geometric properties and first texture features, a feature vector of bayberry fruit is constructed;
[0037] The maturity level of bayberry fruit is determined based on the feature vector.
[0038] 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 illumination differences. This can be achieved by using brightness adjustment methods such as histogram equalization, gamma correction, and local brightness enhancement, as well as converting the image from RGB color space to HSV, Lab, or YUV color spaces. The main purpose is to ensure that brightness changes (such as shadows and highlights) caused by the interaction between illumination and the three-dimensional structure of the fruit surface are effectively preserved and enhanced, while reducing the impact of non-structural brightness changes, thus providing a stable image foundation for subsequent feature extraction. Based on the brightness distribution characteristics of the three-dimensional structure of the fleshy columnar structure on the surface of the bayberry fruit in the target image under fixed illumination, identifying and segmenting the shadow and highlight regions in the target image refers to using the brightness patterns formed by the concave and convex shapes of the fleshy columnar structure under specific illumination conditions to distinguish and separate dark and bright areas in the image. This can be achieved using threshold-based segmentation methods, region growing algorithms, edge detection combined with region filling, or machine learning-based image segmentation models. Its main purpose is to separate the light and shadow information directly related to the three-dimensional structure of the bayberry fleshy columnar structure from the background or other interference, using these light and shadow regions as information carriers of maturity characteristics. Extracting geometric attributes reflecting the morphology and spatial distribution from the shadow and highlight regions involves quantifying the shape, size, position, and other macroscopic features of the identified shadow and highlight regions. This can be achieved by calculating the area, perimeter, aspect ratio, roundness, centroid coordinates, principal axis direction, and relative positional relationships between regions. This is mainly used to capture the macroscopic morphological changes of the bayberry fleshy columnar structure caused by maturity changes, which directly affect the geometric features of the shadow and highlight regions. Extracting the first texture feature, reflecting the micro-roughness and detail variations, from a local region containing both shadow and highlight areas refers to quantifying the fine patterns of pixel brightness variations within a small image patch containing shadow and highlight areas. This can be achieved using gray-level co-occurrence matrix features, local binary patterns, wavelet transform features, Gabor filter responses, or Fourier transform spectral features. It is primarily used to capture the fine variations in the microstructure of the bayberry's fleshy surface (such as the top, sides, and joints of the fleshy column). These variations form specific texture patterns under illumination, reflecting the surface roughness or detail smoothness caused by fruit ripening. Constructing the bayberry fruit's feature vector by combining geometric attributes and the first texture feature involves integrating the geometric attributes and texture features extracted from the shadow and highlight areas into a unified numerical sequence. This can be achieved using feature splicing, feature weighted fusion, or feature fusion through dimensionality reduction methods such as principal component analysis. It is mainly used to integrate complementary feature information from different dimensions into a comprehensive representation, thereby providing a more discriminative representation of bayberry ripening and enhancing the judgment ability of subsequent classification models.
[0039] The core concept of this technical solution lies in treating the complex three-dimensional morphology formed by the aggregation of fleshy columns on the surface of the bayberry fruit, and the specific shadow and highlight distribution patterns produced under a fixed top light source, as a "morphological fingerprint" closely related to the ripeness of the bayberry. By identifying and quantifying the geometric attributes and texture features of these "morphological fingerprints," and constructing a ripeness classification model based on these features, an accurate, online, and non-destructive evaluation of the overall ripeness of bayberries can be achieved without changing the existing hardware configuration of industrial production lines. This method utilizes the visual manifestation of morphological changes in the bayberry fleshy columns during ripening; even with only a single-sided image, the overall ripeness status of the fruit can be inferred from these microscopic morphological features.
[0040] The innovation of this application lies in using the shadow and highlight areas formed by the three-dimensional structure of the fleshy column on the surface of the bayberry fruit under fixed lighting as information carriers, and extracting geometric attributes reflecting its morphology and spatial distribution, as well as first texture features reflecting its micro-roughness and detail changes from these areas, thereby constructing a feature vector that can discriminate the maturity of bayberries, achieving the effect of evaluating the maturity of bayberries without relying on lighting equipment or additional processing procedures.
[0041] Specifically, this method systematically utilizes the brightness differences generated by the interaction between the three-dimensional structure of the bayberry fruit surface and fixed illumination to determine its ripeness through a series of image processing and feature extraction steps. First, the original image of the bayberry fruit is acquired as input for subsequent processing. Then, the image undergoes brightness normalization and color space transformation. This processing is not intended to eliminate the influence of illumination, but rather to purposefully preserve and enhance the brightness differences formed by the interaction between illumination and the three-dimensional structure of the fruit's surface pillars, such as shadows between the pillars and highlights at the top of the pillars, thus obtaining a target image containing light and shadow information related to the fruit's morphology. Based on this, according to the brightness distribution characteristics formed by the pillars on the bayberry fruit surface under fixed illumination in the target image, shadow and highlight regions in the image are identified and segmented. This process utilizes the brightness patterns formed by the concave and convex shapes of the pillars under illumination to accurately separate these light and shadow regions from the image, making them the focus of subsequent feature extraction. Next, geometric attributes reflecting the morphology and spatial distribution of these identified shadow and highlight regions are extracted. These geometric attributes quantify the macroscopic features of the light and shadow areas, such as their size, shape, and relative position. These features directly reflect the fullness and arrangement of the bayberry flesh, and these macroscopic morphologies change with the ripeness of the bayberry. Simultaneously, first texture features reflecting microscopic roughness and detail changes are extracted from local image regions containing these shadow and highlight areas. These texture features capture subtle brightness variation patterns on the surface of the flesh, such as the smoothness or roughness of light and shadow transitions; these microscopic details are also closely related to the ripeness of the bayberry. Subsequently, the extracted geometric attributes and first texture features are combined to construct a comprehensive bayberry fruit feature vector. This combination effectively integrates macroscopic morphological information with microscopic texture information, forming a multi-dimensional, highly discriminative feature representation that can more comprehensively depict the surface features of the bayberry fruit caused by changes in ripeness. Finally, the constructed feature vector is input into a pre-trained classification model to determine the ripeness level of the bayberry fruit based on this feature vector. The entire process involves in-depth analysis and feature extraction of the "artifacts" generated by the interaction between light and the three-dimensional structure of the fruit, transforming them from interference into valuable discriminative information, thereby enabling the determination of the ripeness of the bayberry.
[0042] As a preferred embodiment, the specific implementation of this application is as follows: First, an RGB image of the bayberry fruit is acquired using a camera. Then, the acquired RGB image is converted to the HSV color space, and the V (luminance) channel is subjected to histogram equalization processing adjusted according to image characteristics to enhance local brightness differences and preserve illumination differences, thus obtaining the target image. Next, using local brightness gradient analysis and region growing algorithms, shadow and highlight regions in the target image are identified and segmented based on the brightness peaks and valleys and transition patterns formed by the bayberry flesh columns 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 initially identified as highlights, and optimized through morphological operations and connected component analysis. Further, for each segmented shadow and highlight region, its area, perimeter, aspect ratio, and centroid coordinates, etc., are calculated. Simultaneously, on local image blocks containing these shadow and light regions, texture features such as contrast, energy, and homogeneity of the gray-level co-occurrence matrix are calculated, or Gabor filters are applied to extract texture responses of different directions and scales. These geometric attributes and texture features are standardized and then concatenated to form a multi-dimensional feature vector. Finally, this feature vector is input into a support vector machine classifier or neural network model, which has been trained using images of bayberries at different maturity levels and their corresponding feature vectors, to output the current maturity level of the bayberry, for example, divided into three levels: unripe, semi-ripe, and ripe.
[0043] By employing the aforementioned solution, this application effectively addresses the problem in waxberry maturity detection where the interaction between the three-dimensional morphology of the waxberry fruit surface and fixed lighting conditions leads to shadow and highlight areas in the image. The brightness information of these areas is confused with the fruit's inherent color information, thus affecting the maturity assessment capability based on color analysis. This method transforms the shadow and highlight areas, traditionally considered interference, into information carriers containing the morphology and texture information of the waxberry flesh, thereby enabling the determination of waxberry maturity. This avoids reliance on lighting equipment or washing and drying processes, reduces system costs and operational complexity, and simultaneously improves the detection's judgment capability and stability.
[0044] In some embodiments, the steps of performing brightness normalization and color space conversion on the bayberry fruit image to preserve the brightness differences in the bayberry fruit image caused by the interaction between light and the fruit surface, and obtaining the target image, include:
[0045] By analyzing the brightness distribution of images of bayberry fruits, local brightness features reflecting the non-uniformity of brightness on the surface of bayberry fruits were obtained.
[0046] Based on local brightness characteristics, the brightness range of the bayberry fruit image is adaptively adjusted to enhance the local contrast of shadow and highlight areas while preserving the brightness differences formed by the interaction between light and the fruit surface.
[0047] The color space of the brightened bayberry fruit image was converted to obtain the target image.
[0048] Brightness distribution analysis refers to the process of statistically analyzing and recognizing patterns in the brightness values of pixels in an image. This can be achieved using histogram analysis, gray-level co-occurrence matrix analysis, or local statistical calculations (such as local mean and variance). Local brightness features are attributes obtained from brightness distribution analysis that reflect the brightness variation patterns in local areas of an image. They 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 a bayberry fruit image refers to dynamically adjusting its brightness mapping relationship based on the brightness characteristics of different regions of the image to optimize visual effects and information preservation. This can be achieved using 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 the HSV color space, Lab color space, or YCbCr color space.
[0049] The operational logic of this solution lies in the following: First, by performing a detailed brightness distribution analysis on the original bayberry fruit image, the system can deeply understand the brightness non-uniformity formed by the interaction between light and the complex three-dimensional morphology of the fruit surface. This analysis process can accurately acquire local brightness features reflecting the uneven structure of the bayberry fruit surface, such as identifying which areas are deep shadows, which are glaring highlights, and their respective brightness ranges and variation patterns. It is based on these refined local brightness features that this solution can enter its core adaptive adjustment stage. Second, based on these acquired local brightness features, the system can intelligently and non-uniformly adjust the brightness range of the bayberry fruit image. This adjustment is not a simple global stretching, but rather a differentiated processing of different brightness areas in the image. Its core is to selectively enhance the local contrast of shadow and highlight areas while ensuring that the inherent light and shadow differences of the bayberry fruit (i.e., the light and dark contrast formed by the uneven structure of the flesh pillars under light) are fully preserved. This means that areas that might otherwise appear blurry due to excessive darkness or brightness have their internal texture and boundary information effectively enhanced and highlighted. This makes the microscopic morphological features of the bayberry flesh, such as its fullness and density, more clearly discernible in the image. Finally, after finely adaptively adjusting the brightness range and significantly enhancing the contrast of key local areas, the image undergoes 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, effectively separates brightness and color information, or converts color information into a representation more suitable for subsequent analysis. Because the brightness information has been optimized in the preceding steps, the light and shadow details are fully preserved and enhanced. Therefore, 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 handling the complex light and shadow of bayberries. This not only provides a clearer and more informative image foundation for the subsequent identification and segmentation of shadow and highlight areas, but also enables the geometric attributes and texture features extracted from these areas to more accurately reflect the true morphology and maturity information of the bayberry flesh. This high-quality preprocessing significantly improves the robustness and accuracy of the entire bayberry maturity detection method, allowing for accurate judgment even under complex and variable lighting conditions by effectively utilizing the "morphological fingerprint" of the bayberry fruit surface, thus solving the problem of decreased accuracy in maturity evaluation caused by the loss of light and shadow details.
[0050] This method analyzes the brightness distribution of bayberry fruit images to obtain local brightness features reflecting the non-uniformity of brightness on the fruit surface. Based on these features, the brightness range of the image is adaptively adjusted, thereby enhancing the local contrast of shadow and highlight areas while preserving the brightness differences caused by the interaction between light and the fruit surface. This processing effectively solves the problem of extremely uneven brightness distribution caused by the complex three-dimensional morphology of bayberry fruit under fixed lighting, avoiding the over-compression or loss of key local light and shadow details (such as textures in deep shadows and transitions at highlight edges). Finally, by performing color space conversion on the brightness-adjusted image, the resulting target image can more clearly present the microscopic texture and details of the bayberry flesh, providing a high-quality image foundation for subsequent accurate extraction of "morphological fingerprints," thus improving the accuracy of bayberry maturity evaluation.
[0051] In some embodiments, the step of identifying and segmenting shadow and highlight regions in a target image based on the brightness distribution characteristics formed by the three-dimensional structure of the fleshy columns on the surface of the bayberry fruit under fixed illumination includes:
[0052] By performing local brightness feature analysis on the target image, the brightness change pattern reflecting the three-dimensional structure of the fleshy columnar structure on the surface of the bayberry fruit under fixed illumination was obtained; the brightness change pattern includes local brightness gradient, distribution of brightness peaks and valleys, and characteristics of brightness transition regions.
[0053] Based on the brightness variation pattern, candidate regions in the target image are identified and generated; candidate regions include candidate shadow regions and candidate highlight regions.
[0054] By performing feature analysis on the candidate region's internal brightness uniformity, boundary clarity, and brightness contrast with the surrounding region, the correspondence between the candidate region and the morphology of the bayberry flesh column is evaluated, and the evaluation analysis results are obtained.
[0055] Based on the evaluation and analysis results, the preset segmentation threshold or region growth criteria are adjusted, and the candidate regions are segmented and optimized to obtain shadow regions and highlight regions.
[0056] Specifically, local brightness feature analysis refers to examining the brightness values of pixels within a small area of an image, rather than focusing solely on global brightness. This can include calculating the brightness difference between a pixel and its neighboring pixels, statistically plotting the brightness histogram of a local region, or applying various filters to highlight brightness variations. The aim is to capture the detailed brightness texture formed by the microstructure of the bayberry flesh pillars under illumination. The brightness variation pattern is an abstract generalization of the results of local brightness feature analysis; it is not merely a single brightness value, but a regular representation composed of multiple interrelated brightness features. Among these, the local brightness gradient reflects the speed and direction of brightness changes in the image, 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 patterns reflect the convex and concave structure of the flesh pillars; brightness transition region features refer to the characteristic of brightness transitioning smoothly or steeply from one region to another. Candidate regions refer to the set of pixels in the image that may belong to shadows or highlights after 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 degree of brightness difference between the candidate region and its surrounding pixels; brightness contrast with surrounding regions measures the difference between the average brightness of the candidate region and the average brightness of its neighboring regions. Evaluating the correspondence between the candidate region and the morphology of a bayberry-like column is a process of comprehensively judging the aforementioned features such as internal brightness uniformity, boundary sharpness, and brightness contrast with surrounding regions. Its purpose is to determine the extent to which a candidate region conforms to the typical light and shadow characteristics formed by a bayberry-like column under fixed lighting conditions. Adjusting the preset segmentation threshold or region growth criterion refers to dynamically modifying the parameters used for image segmentation based on the evaluation results of the candidate region. The segmentation threshold is used to divide pixels into different regions based on their brightness values. The region growth criterion is an image segmentation method that starts from one or more seed points and adds neighboring pixels to the region according to a preset similarity criterion. Segmentation and optimization refer to performing precise pixel-level segmentation of the candidate region under the adjusted parameters and post-processing the segmentation results.
[0057] This scheme employs a multi-stage, adaptive process to identify and segment the shadow and highlight regions on the surface of bayberry fruits. First, by performing local brightness feature analysis on the target image, the brightness variation patterns reflecting the three-dimensional structure of the bayberry fruit's flesh pillars under fixed illumination can be obtained. This step is crucial because it goes beyond simple global brightness thresholding, capturing the subtle and unique brightness variation patterns produced by the complex surface of the bayberry flesh pillars. Examples include the brightness gradient at the pillar edges, the distribution of brightness peaks and valleys at the pillar tips and depressions, and the brightness transition characteristics between these regions. This detailed brightness information constitutes the "fingerprint" of the flesh pillar morphology, providing a solid data foundation for subsequent accurate identification.
[0058] Based on this, candidate regions in the target image can be identified and generated according to the acquired brightness change patterns, including candidate shadow regions and candidate highlight regions. This step utilizes the aforementioned brightness patterns to initially filter out all regions in the image that may belong to shadows or highlights, thereby focusing subsequent processing on these potential regions, avoiding blind searching and segmentation across the entire image, and improving processing efficiency.
[0059] Furthermore, by analyzing the internal brightness uniformity, boundary sharpness, and brightness contrast with 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 evaluation results can be obtained. This evaluation process is crucial for the refined verification of the initially generated candidate regions. Candidate regions generated solely based on brightness variation patterns may contain some interference areas that are not part of the flesh column's light and shadow. By comprehensively analyzing these features, the system can determine whether each candidate region truly matches the actual light and shadow morphology formed by the bayberry flesh column under fixed illumination, thereby effectively eliminating misidentified regions and providing a highly reliable decision-making basis for subsequent accurate segmentation.
[0060] Finally, based on the evaluation and analysis results, the preset segmentation threshold or region growth criteria 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 growth criteria are difficult to adapt to the complex and variable light and shadow conditions and random postures on the surface of bayberry fruits. 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 a flesh column, the segmentation threshold or region growth criteria can be adjusted accordingly to make it more likely to include the region, or more detailed adjustments can be made at the boundaries to ensure its integrity. Conversely, for regions with poor evaluation results, the segmentation conditions can be tightened. This dynamic adjustment and optimization process based on evaluation results can effectively eliminate interference regions that do not conform to the flesh column morphology, while ensuring that the shadow and highlight regions that truly reflect the three-dimensional structure of the flesh column are accurately and completely segmented. This method, through multi-stage analysis and optimization, overcomes the problem of traditional methods struggling to accurately segment light and shadow regions under complex lighting and fruit morphology. It robustly identifies and segments the shadow and highlight regions related to the morphology of the bayberry flesh, effectively avoiding omissions or missegments due to atypical light and shadow features. This precise segmentation provides high-quality input for subsequent extraction of geometric attributes reflecting the morphology and spatial distribution, as well as the first texture features of micro-roughness and detail variations, from the shadow and highlight regions, thus significantly improving the accuracy of bayberry maturity evaluation.
[0061] In summary, this scheme effectively addresses the complexity and non-standardization of light and shadow patterns caused by the diverse morphology of the bayberry fruit's surface phallic columns through multi-stage, adaptive brightness feature analysis, candidate region generation, evaluation, and optimization. By meticulously capturing local brightness gradients, peak and valley distributions, and brightness transition region features, it comprehensively identifies brightness variation patterns closely related to the three-dimensional structure of the bayberry phallic columns, laying the foundation for subsequent light and shadow region recognition. Furthermore, by comprehensively evaluating the internal brightness uniformity, boundary clarity, and brightness contrast with surrounding areas of candidate regions, it effectively distinguishes between genuine phallic column light and shadow and interference areas, avoiding missed or incorrect classifications due to atypical light and shadow features. Finally, based on the evaluation and analysis results, the segmentation parameters are adaptively adjusted, enabling the segmentation process to robustly adapt to the complex and variable light and shadow conditions on the bayberry fruit surface, thereby accurately segmenting shadow and highlight regions. This significantly improves the accuracy of bayberry maturity evaluation in complex scenarios, provides high-quality image regions for subsequent feature extraction, and ultimately enhances the reliability of automated bayberry sorting.
[0062] In some embodiments, the steps of evaluating the correspondence between the candidate region and the morphology of the bayberry flesh column by performing feature analysis on the candidate region's internal brightness uniformity, boundary sharpness, and brightness contrast with the surrounding region, and obtaining the evaluation analysis results, include:
[0063] Obtain the initial brightness distribution of the surrounding area of the candidate region;
[0064] Based on the brightness distribution of the initial surrounding area, identify the sub-regions in the initial surrounding area that are affected by the light and shadow of adjacent bayberry fruits or fleshy pillars, and obtain the corrected surrounding area by excluding the sub-regions.
[0065] Based on the corrected surrounding area, calculate the brightness contrast between the candidate area and the corrected surrounding area;
[0066] By combining the internal brightness uniformity, boundary clarity, and calculated brightness contrast of the candidate regions, the correspondence between the candidate regions and the morphology of the bayberry flesh column is evaluated, and the evaluation analysis results are obtained.
[0067] Identifying sub-regions within the initial surrounding area that are disturbed by the light and shadow of adjacent bayberry fruits or fleshy pillars involves analyzing the brightness distribution characteristics of the initial surrounding area, such as abrupt brightness changes, abnormal highlights, or abnormal dark areas, to determine regions that are not part of the background of the current candidate region and are caused by external light and shadow. This can be achieved using various image processing techniques, such as brightness thresholding, connected component analysis, morphological operations, or by combining these techniques with machine learning models.
[0068] The operational logic of this scheme is as follows: First, the brightness distribution of the initial surrounding area of the candidate region to be evaluated is obtained, providing basic data for subsequent refined analysis. Given that the initial surrounding area may contain light and shadow interference from other fleshy columns or fruits when the bayberry fruits are densely arranged or their fleshy columns are closely adjacent, this scheme further intelligently identifies and excludes these disturbed sub-regions based on the brightness distribution of the initial surrounding area, thus obtaining a purer, more representative, and corrected surrounding area. On this basis, the brightness contrast between the candidate region and this corrected surrounding area is calculated, ensuring that the contrast value accurately reflects the brightness characteristics of the candidate region itself and the differences in the local background, avoiding the misleading influence of external light and shadow. Finally, this precisely calculated brightness contrast is combined with the inherent internal brightness uniformity and boundary clarity of the candidate region for comprehensive evaluation. This combination method makes the judgment of the correspondence between the candidate region and the morphology of the bayberry fleshy columns more comprehensive and reliable. By employing this optimized brightness and contrast analysis, this approach effectively overcomes the inaccurate judgment of surrounding areas by traditional methods in complex lighting conditions. This allows the evaluation results to more accurately reflect the true morphological characteristics of the bayberry flesh column when identifying and segmenting shadow and highlight areas, thus laying a solid foundation for subsequent precise segmentation. This aligns with the goal of the upper-level approach, which assesses the correspondence between candidate regions and bayberry flesh column morphology through feature analysis, significantly improving the accuracy and robustness of this evaluation step and ultimately enhancing the reliability of the entire bayberry maturity detection method.
[0069] This scheme intelligently identifies and excludes sub-regions in the initial surrounding area that are interfered with by the light and shadow of adjacent bayberry fruits or fleshy pillars before calculating the brightness contrast between the candidate region and the surrounding area. This ensures that the calculated brightness contrast more accurately reflects the brightness characteristics of the candidate region itself and the difference between 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 in contact with each other, thus significantly improving the accuracy and reliability of evaluating the correspondence between the candidate region and the morphology of the bayberry fleshy pillars, and further improving the accuracy of shadow and highlight area identification and segmentation.
[0070] In some embodiments, the steps of adjusting a preset segmentation threshold or region growth criterion based on the evaluation and analysis results, and segmenting and optimizing the candidate regions to obtain shadow regions and highlight regions include:
[0071] Obtain spatial location information of each candidate region and correspondence information between the candidate regions and the morphology of the bayberry flesh column in the evaluation and analysis results;
[0072] Based on spatial location information, analyze the spatial adjacency relationships and potential connection paths between adjacent candidate regions;
[0073] Based on spatial adjacency relationships and potential connection paths, and combined with the correspondence information between candidate regions and the morphology of bayberry flesh columns, the overall coherence characteristics and local detail characteristics of the light and shadow areas on the surface of bayberry fruit are identified.
[0074] Based on 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 area and preserve the local details of the micro-morphology of the flesh column.
[0075] Based on the segmentation parameter adjustment criteria, the preset segmentation threshold or region growth criteria are adjusted, and the candidate regions are segmented and optimized to obtain shadow regions and highlight regions.
[0076] The spatial location information of each candidate region in the evaluation analysis results refers to the geometric location data of each candidate region in the image coordinate system, such as its centroid coordinates, boundary pixel set, or minimum bounding rectangle parameter. This can be achieved using pixel coordinate records, region masks, or geometric shape descriptors. The correspondence information between candidate regions and the morphology of the bayberry column refers to the quantitative evaluation of the degree of matching between each candidate region and the typical light and shadow morphology of the bayberry column, such as a confidence score or classification label. This can be achieved using feature similarity calculation, machine learning classifier output, or expert rule system judgment. Spatial adjacency refers to the state where two or more candidate regions in the image are close to or directly in contact with each other in space. This can be achieved using pixel distance judgment, connectivity analysis, or topological relationship detection. Potential connection paths refer to the connection channels that can be established between two non-directly adjacent candidate regions in the image that may belong to the same light and shadow region through image processing or morphological operations. This can be achieved using morphological dilation, bridging algorithms, or graph-based path search. The overall coherence of the light and shadow regions on the surface of the bayberry fruit refers to the continuity, integrity, or structural uniformity of the shadow or highlight areas formed by light on the fruit surface at a macroscopic scale. This can be achieved using connected component analysis, region merging rules, or optimization based on global energy functions. Local detail features refer to the fine textures, sharp edges, or microstructures reflecting the microscopic morphology of the fleshy column in the light and shadow regions of the bayberry fruit surface. These can be achieved using local gradient information, texture descriptors, or wavelet transform coefficients. Segmentation parameter adjustment criteria refer to the rules or strategies set to guide parameter optimization in the subsequent image segmentation process based on the identified overall coherence and local detail features. These can be achieved using rule-based conditional judgments, adaptive threshold calculation formulas, or parameter weights output by machine learning models.
[0077] This solution addresses the fragmentation, discontinuity, and loss of detail in the segmentation of light and shadow regions on the surface of bayberry fruits through a series of interconnected steps, ensuring that the segmentation results accurately reflect the overall morphology and microscopic features of the bayberry flesh column. First, the system acquires the spatial location information of each candidate region and its correspondence with the morphology of the bayberry flesh column from the evaluation analysis results. This initial step lays the foundation for subsequent spatial analysis and advanced feature recognition. By obtaining the specific coordinates of each candidate region in the image and its matching degree with the morphology of the bayberry flesh column, the system obtains the data input required for global consideration and local refinement, allowing the segmentation process to move beyond independent judgment of individual regions. Based on this, the system analyzes the spatial adjacency relationships and potential connection paths between adjacent candidate regions according to the spatial location information. This analysis is a crucial step in identifying the overall coherence of the light and shadow regions. Simply understanding the independent evaluation results of each region is insufficient; it is also necessary to understand how they are interconnected in image space. By analyzing which candidate regions are adjacent to each other or can be connected in some way, the system can initially construct the macroscopic structure of the light and shadow region, providing a basis for subsequent overall judgment and thus avoiding the erroneous segmentation of a coherent light and shadow region into multiple unrelated fragments. Further, based on the analyzed spatial adjacency relationships and potential connection paths, combined with the correspondence between candidate regions and the morphology of the bayberry flesh column, the system identifies the overall coherence characteristics and local detail features of the light and shadow region on the surface of the bayberry fruit. This is the core of this scheme. It deeply integrates the aforementioned spatial connection information with the quality assessment of each candidate region itself. This means that even if the evaluation result of a single candidate region is not optimal, if it forms a coherent pattern with multiple high-quality adjacent regions that conforms to the light and shadow characteristics of the bayberry flesh column, then it will be considered a valid part, thus maintaining the global coherence of the light and shadow region. Simultaneously, this step can also identify and preserve those local light and shadow features, although small, that are crucial to the morphology of the flesh column, based on their spatial context, ensuring the precision of the segmentation results. Subsequently, the system determines the segmentation parameter adjustment criteria based on the identified overall coherence characteristics and local detail features. This adjustment criterion is used to maintain the global coherence of the light and shadow area while preserving the local details of the flesh pillar's micro-morphology. After identifying the macro-coherence and micro-details of the light and shadow area, the system no longer simply adjusts based on a single threshold, but instead formulates targeted adjustment criteria based on these higher-level characteristics. For example, for the interior of an area identified as a large, continuous shadow, even with slight brightness fluctuations, the adjustment criterion tends to relax its internal uniformity requirements to allow for greater brightness fluctuations, thereby ensuring that its global coherence is not compromised; while for the tiny highlights or shadows reflecting the tips or recesses of the flesh pillar, the adjustment criterion focuses more on preserving their fine boundaries and shapes to ensure that local details are not smoothed out.The formulation of this criterion provides a clear objective and basis for adjusting segmentation parameters, enabling better adaptation to the complex light and shadow variations on the surface of the bayberry fruit. Ultimately, based on the determined segmentation parameter adjustment criteria, the system adjusts the preset segmentation threshold or region growth criteria, and segments and optimizes candidate regions to obtain shadow and highlight regions. Based on the previously determined segmentation parameter adjustment criteria that fully consider global coherence and local details, the system fine-tunes the initial preset segmentation threshold or region growth criteria. This adjustment allows the segmentation process to more intelligently handle regions with blurred boundaries, uneven brightness, or subtle features, thereby achieving more accurate segmentation and optimization of candidate regions. This scheme is closely integrated with preceding steps (e.g., identifying and generating candidate regions in the target image, and evaluating the correspondence between candidate regions and the morphology of bayberry flesh columns). The preceding steps provide preliminary, local feature-based candidate regions and their evaluation results, providing the necessary data foundation for this scheme. Building upon this, this scheme, by introducing spatial context analysis and global coherence considerations, integrates and optimizes the local evaluation results of the preceding steps at a higher level. This combination enables the system to move from isolated local judgments to a holistic understanding of the light and shadow patterns of the entire bayberry fruit, thus overcoming the fragmentation and loss of detail that can result from relying solely on local evaluations. In this way, the resulting shadow and highlight areas not only conform to the morphology of the fleshy column on an individual basis but also exhibit a coherent and detailed pattern overall. This significantly improves the accuracy and robustness of light and shadow region recognition, providing high-quality input for subsequent feature extraction and ultimately enhancing the overall accuracy of bayberry maturity detection.
[0078] This scheme acquires the spatial location information of candidate regions and their correspondence with the morphology of the bayberry flesh column. Based on this, it analyzes the spatial adjacency relationships and potential connection paths of adjacent regions, enabling the identification of the overall coherence and local details of the light and shadow regions on the surface of the bayberry fruit. Based on these identified features, the scheme can determine targeted segmentation parameter adjustment criteria. These criteria are used to maintain the global coherence of the light and shadow regions while preserving the microscopic morphological details of the flesh column. By adjusting the preset segmentation threshold or region growth criteria according to these adjustment criteria, and segmenting and optimizing the candidate regions, this scheme can effectively solve the problem of complex connections or tiny gaps between adjacent light and shadow regions caused by the aggregation characteristics of the bayberry flesh column. This ensures that when converting local evaluation results into the segmentation of the entire bayberry fruit's light and shadow regions, the adjusted segmentation parameters and optimization process can maintain the global coherence of the entire bayberry fruit's light and shadow regions, avoiding fragmentation or incompleteness of the effective light and shadow regions due to local adjustments. Simultaneously, this scheme can accurately preserve the local details reflecting the microscopic morphology of the flesh column, thereby accurately reflecting the overall morphology and microscopic characteristics of the flesh column, improving the accuracy and robustness of bayberry maturity evaluation.
[0079] In some embodiments, the step of extracting geometric properties reflecting the shape and spatial distribution of shadow and highlight regions includes:
[0080] Obtain the initial geometric properties of each individual region in the shadow and highlight regions; the initial geometric properties include area, perimeter, shape factor, and principal axis direction;
[0081] Based on the initial geometric properties, analyze the geometric morphological characteristics of each independent region, and combine them with the typical geometric pattern of the pre-set bayberry flesh column light and shadow region to evaluate the degree of conformity between each independent region and the typical geometric pattern.
[0082] 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;
[0083] Extract geometric attributes that reflect the shape and spatial distribution of the effective light and shadow area.
[0084] The typical geometric pattern of the shadow and light region of the bayberry flesh pillar refers to the expected or standard set of geometric features exhibited by the shadow or highlight regions formed by the flesh pillars 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, principal axis direction, etc., within a specific range. It can be achieved using statistical models (such as mean, variance, distribution range), rule-based threshold sets, or machine learning models (such as cluster centers, classification boundaries). The degree of conformity refers to the quantitative measure of the similarity or matching degree between the initial geometric attributes of each independent shadow and light region and the preset typical geometric pattern of the bayberry flesh pillar shadow and light region. This degree of conformity can be achieved using similarity scores (e.g., Euclidean distance based on feature vectors, cosine similarity), probability values, or classification results (e.g., whether it belongs to the "typical" category). Anomaly regions refer to areas in the shadow and highlight regions whose geometric morphological features deviate significantly from the preset typical geometric pattern of the bayberry flesh pillar shadow and light region. These areas are typically caused by non-plumage features (such as water droplets, scratches, and impurities) or image noise and should not be used to represent the true morphology of the bayberry plum. The effective light and shadow areas refer to the remaining shadow and highlight areas that accurately reflect the morphology and spatial distribution of the bayberry plum after screening and excluding abnormal areas. These areas form the basis for subsequent extraction of geometric attributes, ensuring the effectiveness of the extracted features.
[0085] This scheme ensures that the extracted geometric attributes accurately reflect the morphology and spatial distribution of the bayberry pulp column by screening and optimizing the initially identified shadow and highlight areas. First, the initial geometric attributes of each independent region within the shadow and highlight areas are obtained, including area, perimeter, shape factor, and principal axis direction. This step provides quantitative data for subsequent pattern matching and anomaly region identification. Second, based on the initial geometric attributes, the geometric morphological characteristics of each independent region are analyzed, and the degree of conformity between each independent region and the preset typical geometric pattern of the bayberry pulp column's light and shadow area is evaluated. This process introduces a "typical geometric pattern" as a reference; by comparing the actually detected light and shadow areas with the light and shadow pattern representing the true morphology of the bayberry pulp column, it is possible to distinguish between light and shadow formed by the three-dimensional structure of the bayberry pulp column and light and shadow caused by other factors. Next, based on the evaluation results of the degree of conformity, anomaly regions in the shadow and highlight areas that do not conform to the typical geometric pattern are identified and eliminated, resulting in valid light and shadow areas. This elimination process removes interference information from the image, ensuring that the subsequently extracted geometric attributes only come from light and shadow areas that truly reflect the morphological characteristics of the bayberry pulp column. Finally, geometric attributes reflecting the morphology and spatial distribution of the bayberry fruit are extracted from the effective light and shadow regions. By extracting geometric attributes from the filtered and optimized "effective light and shadow regions," the obtained geometric attributes are ensured to be of high quality and high relevance, enabling them to 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 and highlight regions. This scheme refines these regions based on this, 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.
[0086] This method filters and optimizes the initially identified shadow and highlight areas, ensuring that the obtained geometric attributes accurately reflect the morphology and spatial distribution of the bayberry flesh. This effectively avoids artifacts interfering with feature extraction, thereby improving the accuracy of bayberry maturity evaluation and enhancing the system's stability under different conditions.
[0087] In some embodiments, the step of extracting first texture features reflecting micro-roughness and detail variations from a local region comprising shadow and highlight areas includes:
[0088] Get a local area containing both shadow and highlight regions;
[0089] By analyzing the brightness distribution in a local area, local brightness gradient information reflecting the directionality of light and shadow changes in the local area can be obtained; the local brightness gradient information includes gradient magnitude and gradient direction.
[0090] Based on local brightness gradient information, identify the main direction or multiple significant directions of light and shadow changes within a local area; the main direction or multiple significant directions reflect the arrangement direction of the bayberry pulp columns or the direction of light interaction.
[0091] Calculate the second texture features of a local region along the main direction or multiple salient directions; the second texture features reflect micro-roughness and detail variations.
[0092] The second texture features are combined to obtain the first texture features that reflect micro-roughness and detail variations.
[0093] Local brightness gradient information refers to the speed and direction of brightness changes within a local area of an image, which can be calculated using edge detection algorithms such as the Sobel operator, Prewitt operator, or Roberts operator. Gradient magnitude refers to the intensity of brightness changes within the local brightness gradient information, which can be calculated using the square root of the sum of the squares of brightness changes in the horizontal and vertical directions of a pixel. Gradient direction refers to the direction of brightness changes within the local brightness gradient information, which can be calculated using the arctangent function of the ratio of brightness changes in the horizontal and vertical directions of a pixel. The main direction or multiple salient directions refer to the directions where light and shadow changes are most obvious or concentrated within a local area, which can be identified using gradient direction histogram analysis, Fourier transform, or wavelet transform. Secondary texture features refer to texture quantization values reflecting micro-roughness and detail changes calculated along a specific direction, which can be calculated using statistics such as energy, contrast, and 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 a comprehensive texture description obtained by combining multiple secondary texture features, which can be formed using feature concatenation, feature fusion, or feature weighting.
[0094] This scheme details how to efficiently and accurately extract primary texture features reflecting the microscopic roughness and detail variations of a bayberry fruit from local regions containing shadow and highlight information on its surface. First, local regions containing shadow and highlight areas are acquired, providing a clear image range for subsequent texture analysis and ensuring the analysis focuses on the visual representation of the interaction between the three-dimensional structure of the bayberry fruit's fleshy column and illumination. Next, by analyzing the brightness distribution of these local regions, the system obtains local brightness gradient information reflecting the directionality of light and shadow changes, including gradient magnitude and direction. This gradient information directly quantifies the microscopic shadow patterns formed by light on the surface of the fleshy column, laying the foundation for understanding the three-dimensional structure and roughness of the column. Based on this, the main direction or multiple significant directions of light and shadow changes within the local region are identified according to the local brightness gradient information. These directions reflect the arrangement direction of the bayberry fleshy column or the direction of light interaction, allowing the system to focus on the directional texture information most strongly associated with the morphology and maturity of the bayberry fleshy column, avoiding information confusion that may result from non-directional analysis. Subsequently, the secondary texture features of the local region are calculated along these identified main directions or multiple significant directions. This directional calculation method can more accurately capture the microscopic roughness and detail variations of the bayberry flesh, such as the fullness of the flesh, edge sharpness, or surface smoothness. Finally, the second texture features calculated along different principal or salient 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 detail variations of the bayberry fruit surface in different directions, providing rich and discriminative information for subsequent feature vector construction and maturity level determination.
[0095] This scheme is closely integrated with other steps in the waxberry maturity detection method. After the waxberry fruit image undergoes brightness normalization and color space conversion, the system can identify and segment the shadow and highlight regions in the target image. This scheme extracts texture features based on these identified local regions containing rich light and shadow information. In this way, the directional texture features extracted by this scheme are directly correlated with the three-dimensional structure of the fleshy pillars on the surface of the waxberry fruit and the lighting interaction pattern, avoiding information confusion caused by uneven lighting in traditional methods. When these directional texture features are combined with the 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 waxberry fruit. This combination allows the system to perform refined evaluation of waxberry maturity not only from macroscopic geometric morphology but also from microscopic texture details, especially its directional features, thereby improving the accuracy of waxberry maturity evaluation under complex lighting and fruit posture.
[0096] This method analyzes the directionality of light and shadow changes within local areas to identify significant directions related to the arrangement of the bayberry flesh columns or light interaction. By calculating texture features along these specific directions, it captures and quantifies the anisotropic characteristics of light and shadow texture on the bayberry fruit surface. This effectively preserves directional texture information associated with the morphology and maturity of the bayberry flesh columns, thereby improving the discriminative power of the extracted features and ultimately enhancing the accuracy and robustness of bayberry maturity assessment.
[0097] In some embodiments, the step of constructing the feature vector of a bayberry fruit by combining geometric properties and first texture features includes:
[0098] The geometric properties are preprocessed to obtain the first standardized feature subset;
[0099] The first texture features are preprocessed to obtain a second standardized feature subset;
[0100] The first and second standardized feature subsets are concatenated to construct the feature vector of the bayberry fruit.
[0101] Geometric attributes refer to the quantitative descriptions extracted from the shadow and highlight areas of a bayberry fruit image, reflecting the morphology and spatial distribution of these areas. These attributes can be characterized using parameters such as area, perimeter, shape factor, principal axis direction, or eccentricity. First texture features refer to the quantitative descriptions extracted from local regions containing shadow and highlight areas, reflecting the microscopic roughness and detail variations on the bayberry fruit surface. These features can be characterized using gray-level co-occurrence matrix (GLCM) features, local binary pattern (LBP) features, wavelet transform coefficients, or Fourier descriptors. Preprocessing refers to transforming the original extracted feature data to eliminate or reduce the influence of differences in dimensions, numerical ranges, or distributions 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 refers to the set of geometric attributes after preprocessing. This subset can be represented by scaling the geometric attribute values to a specific range (e.g., [0,1] or [-1,1]) or making them conform to a specific statistical distribution (e.g., mean 0, variance 1). The second normalized feature subset refers to the preprocessed first texture feature set, which can undergo scaling or distribution adjustment in a similar manner to the first normalized feature subset. Concatenation refers to joining two or more independent feature subsets in a specific order to form a longer, single vector containing all features; this can be achieved using vector concatenation or matrix merging. A feature vector is an ordered list of multiple numerical features used to quantify specific attributes of an object or phenomenon; it can serve as input to machine learning models or classifiers.
[0102] This scheme first preprocesses the geometric attributes extracted from the shadow and highlight regions when constructing the feature vector of the bayberry fruit, thus obtaining a first standardized feature subset. This processing step aims to eliminate the weight imbalance problem that may arise between different geometric attributes due to differences in units or numerical ranges. For example, the area value may be much larger than the shape factor. Without preprocessing, the area feature may dominate the feature vector, masking other equally important geometric features. Through preprocessing, these geometric attributes are transformed to a uniform scale or distribution, ensuring that each geometric feature can participate in the construction of the feature vector with its true information contribution. At the same time, the first texture features extracted from the local regions containing shadow and highlight regions are also preprocessed to obtain a second standardized feature subset. Similar to geometric attributes, texture features may also have different numerical ranges and distributions. Through preprocessing, it is ensured that when texture features are combined with geometric features, their original numerical ranges will not have an undue impact on the overall feature vector, thus ensuring that texture information can be used effectively and fairly. Subsequently, the preprocessed first and second standardized feature subsets are concatenated to construct the feature vector of the bayberry fruit. Because both subsets have undergone standardization, they are comparable on a numerical scale, avoiding the weight imbalance problem that may occur when directly concatenating the original features. This processing method ensures that geometric morphological information and micro-texture information can work synergistically to jointly and evenly represent the maturity of bayberry fruits. It is precisely because of this standardization and balanced combination of different types of features that the constructed feature vector can more comprehensively and accurately reflect the maturity-related information of bayberry fruits. Based on this, combined with the subsequent steps in this method to determine the maturity level of bayberry fruits based on this feature vector, the accuracy and robustness of maturity determination can be significantly improved, avoiding misjudgments caused by uneven feature weights, thus providing a more reliable basis for the automated grading of bayberries.
[0103] Reference Appendix Figure 2 This invention provides a waxberry maturity detection system, comprising:
[0104] Module 100 is used to acquire images of bayberry fruits;
[0105] The processing module 200 is used to perform brightness normalization and color space conversion processing on the bayberry fruit image in order to preserve the brightness difference formed by the interaction between light and the fruit surface in the bayberry fruit image and obtain the target image.
[0106] 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 formed by the three-dimensional structure of the fleshy column on the surface of the bayberry fruit in the target image under fixed illumination.
[0107] Extraction module 400 is used to extract geometric properties reflecting the shape and spatial distribution of shadow and highlight areas, and to extract first texture features reflecting the micro-roughness and detail variations of local areas containing shadow and highlight areas.
[0108] Module 500 is used to construct the feature vector of the bayberry fruit by combining geometric properties and first texture features;
[0109] The determination module 600 is used to determine the maturity level of bayberry fruits based on the feature vector.
[0110] In this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying any such actual relationship or order between these entities or operations.
[0111] The above description is merely an embodiment of the present invention and is not intended to limit the scope of protection of the present invention. For those skilled in the art, the present invention can have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for detecting the maturity of bayberry, characterized in that, Includes the following steps: Obtain an image of a bayberry fruit; Brightness normalization and color space conversion were performed on the image of the bayberry fruit to preserve the brightness difference caused by the interaction between light and the fruit surface, thus obtaining the target image. Based on the brightness distribution characteristics formed by the three-dimensional structure of the fleshy columnar structure on the surface of the bayberry fruit in the target image under fixed illumination, the shadow area and highlight area in the target image are identified and segmented. Geometric properties reflecting the shape and spatial distribution of the shadow and highlight areas are extracted, and first texture features reflecting the micro-roughness and detail variations are extracted from the local areas containing the shadow and highlight areas. By combining geometric properties and first texture features, a feature vector of bayberry fruit is constructed; The maturity level of the bayberry fruit is determined based on the feature vector. Based on the brightness distribution characteristics formed by the three-dimensional structure of the fleshy columnar structure on the surface of the bayberry fruit in the target image under fixed illumination, the steps for identifying and segmenting the shadow and highlight regions in the target image include: By performing local brightness feature analysis on the target image, the brightness change pattern reflecting the three-dimensional structure of the fleshy columnar structure on the surface of the bayberry fruit under fixed illumination was obtained. Based on the brightness variation pattern, candidate regions in the target image are identified and generated; candidate regions include candidate shadow regions and candidate highlight regions. By performing feature analysis on the candidate region's internal brightness uniformity, boundary clarity, and brightness contrast with the surrounding region, the correspondence between the candidate region and the morphology of the bayberry flesh column is evaluated, and the evaluation analysis results are obtained. Based on the evaluation and analysis results, the preset segmentation threshold or region growth criteria are adjusted, and the candidate regions are segmented and optimized to obtain shadow regions and highlight regions.
2. The method for detecting the maturity of bayberry according to claim 1, characterized in that, The steps for performing brightness normalization and color space conversion on the image of the bayberry fruit to preserve the brightness differences caused by the interaction between light and the fruit surface, and obtaining the target image, include: By analyzing the brightness distribution of images of bayberry fruits, local brightness features reflecting the non-uniformity of brightness on the surface of bayberry fruits were obtained. Based on local brightness characteristics, the brightness range of the bayberry fruit image is adaptively adjusted to enhance the local contrast of shadow and highlight areas while preserving the brightness differences formed by the interaction between light and the fruit surface. The color space of the brightened bayberry fruit image was converted to obtain the target image.
3. The method for detecting the maturity of bayberry according to claim 1, characterized in that, Brightness variation patterns include local brightness gradients, distribution of brightness peaks and valleys, and characteristics of brightness transition regions.
4. The method for detecting the maturity of bayberry according to claim 1, characterized in that, The steps for evaluating the correspondence between candidate regions and the morphology of bayberry flesh columns are as follows: This involves analyzing the candidate regions' internal brightness uniformity, boundary sharpness, and brightness contrast with surrounding areas. Obtain the initial brightness distribution of the surrounding area of the candidate region; Based on the brightness distribution of the initial surrounding area, identify the sub-regions in the initial surrounding area that are affected by the light and shadow of adjacent bayberry fruits or fleshy pillars, and obtain the corrected surrounding area by excluding the sub-regions. Based on the corrected surrounding area, calculate the brightness contrast between the candidate area and the corrected surrounding area; By combining the internal brightness uniformity, boundary clarity, and calculated brightness contrast of the candidate regions, the correspondence between the candidate regions and the morphology of the bayberry flesh column is evaluated, and the evaluation analysis results are obtained.
5. The method for detecting the maturity of bayberry according to claim 1, characterized in that, Based on the evaluation and analysis results, the steps of adjusting the preset segmentation threshold or region growth criteria, and segmenting and optimizing the candidate regions to obtain shadow and highlight regions include: Obtain spatial location information of each candidate region and correspondence information between the candidate regions and the morphology of the bayberry flesh column in the evaluation and analysis results; Based on spatial location information, analyze the spatial adjacency relationships and potential connection paths between adjacent candidate regions; Based on spatial adjacency relationships and potential connection paths, and combined with the correspondence information between candidate regions and the morphology of bayberry flesh columns, the overall coherence characteristics and local detail characteristics of the light and shadow areas on the surface of bayberry fruit are identified. Based on 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 area and preserve the local details of the micro-morphology of the flesh column. Based on the segmentation parameter adjustment criteria, the preset segmentation threshold or region growth criteria are adjusted, and the candidate regions are segmented and optimized to obtain shadow regions and highlight regions.
6. The method for detecting the maturity of bayberry according to claim 1, characterized in that, The steps for extracting geometric properties reflecting the shape and spatial distribution of shadow and highlight areas include: Obtain the initial geometric properties of each individual region within the shadow and highlight regions; Based on the initial geometric properties, analyze the geometric morphological characteristics of each independent region, and combine them with the typical geometric pattern of the pre-set bayberry flesh column light and shadow region to evaluate the degree of conformity between each independent region and the typical geometric pattern. 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; Extract geometric attributes that reflect the shape and spatial distribution of the effective light and shadow area.
7. The method for detecting the maturity of bayberry according to claim 1, characterized in that, The step of extracting first texture features reflecting micro-roughness and detail variations from a local region containing shadow and highlight areas includes: obtaining a local region containing shadow and highlight areas; By analyzing the brightness distribution in a local area, local brightness gradient information reflecting the directionality of light and shadow changes in the local area can be obtained. Based on local brightness gradient information, identify the main direction or multiple significant directions of light and shadow changes within a local area; the main direction or multiple significant directions reflect the arrangement direction of the bayberry pulp columns or the direction of light interaction. Calculate the second texture features of a local region along the main direction or multiple salient directions; the second texture features reflect micro-roughness and detail variations. The second texture features are combined to obtain the first texture features that reflect micro-roughness and detail variations.
8. The method for detecting the maturity of bayberry according to claim 1, characterized in that, The steps for constructing the feature vector of a bayberry fruit by combining geometric properties and first texture features include: The geometric properties are preprocessed to obtain the first standardized feature subset; The first texture features are preprocessed to obtain a second standardized feature subset; The first and second standardized feature subsets are concatenated to construct the feature vector of the bayberry fruit.
9. A waxberry maturity detection system based on the waxberry maturity detection method according to any one of claims 1-8, characterized in that, include: The acquisition module is used to acquire images of bayberry fruits; The processing module is used to perform brightness normalization and color space conversion on the bayberry fruit image to preserve the brightness differences in the bayberry fruit image caused by the interaction between light and the fruit surface, so as to obtain the target image. The recognition module is used to identify and segment the shadow and highlight areas in the target image based on the brightness distribution characteristics formed by the three-dimensional structure of the fleshy columnar structure on the surface of the bayberry fruit under fixed illumination. The extraction module is used to extract geometric attributes reflecting the shape and spatial distribution of the shadow and highlight areas, and to extract first texture features reflecting the micro-roughness and detail changes from the local areas containing the shadow and highlight areas; the construction module is used to construct the feature vector of the bayberry fruit by combining the geometric attributes and the first texture features. The determination module is used to determine the maturity level of bayberry fruits based on feature vectors.
Citation Information
Patent Citations
Mature fruit self-adaptive identification method and system
CN114842469A
Nondestructive testing method and system for comprehensive quality of harvested bananas
CN119595556A