Machine vision-based automatic classification and screening method and device for preserved flowers
By using machine vision-based automatic grading and screening methods and devices, the problems of low efficiency and poor consistency caused by manual grading of preserved flowers have been solved. The grading process has been fully automated, reducing labor costs and improving product consistency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- EROS (YUNNAN) CULTURE TECHNOLOGY CO LTD
- Filing Date
- 2026-04-13
- Publication Date
- 2026-06-30
AI Technical Summary
The current method of grading preserved flowers relies on manual labor, which leads to low efficiency, subjective grading standards, poor product consistency, and high labor costs.
An automated grading and screening method based on machine vision is adopted, including image preprocessing, ROI region extraction, color space conversion, defect detection and comprehensive scoring. Combined with conveyor belts, segmented inspection trays, light-proof darkroom inspection stations and flexible sorting fixtures, the entire process is automated.
It has achieved full automation of the preserved flower grading process, with unified and consistent grading standards, reducing labor costs and improving grading efficiency and product quality consistency.
Smart Images

Figure CN122298698A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of preserved flower processing and inspection technology, and in particular to an automatic grading and screening method and device for preserved flowers based on machine vision. Background Technology
[0002] Preserved flowers, also known as everlasting flowers, are floral products made from fresh flowers through processes such as dehydration, decolorization, dyeing, and drying. They can retain the original texture, shape, and color of fresh flowers for a long time, with a preservation period of up to several years. They are widely used in floral decorations, gift boxes, home furnishings, and other scenarios. In recent years, domestic market demand has continued to rise, and the industry scale has maintained stable growth.
[0003] In the large-scale production and processing of preserved flowers, grading and sorting are the core processes that determine product quality, market pricing, and added value. Key grading indicators include flower head diameter, flower shape integrity, color difference defects, and damage / crease defects. Currently, the preserved flower industry generally uses the traditional method of manual visual grading, where each flower is individually inspected and judged. This method suffers from extremely low grading efficiency and high labor costs. Furthermore, manual grading results heavily rely on the operator's subjective experience, making it susceptible to interference from factors such as visual fatigue, emotional state, and ambient lighting. This leads to inconsistent grading standards, poor quality consistency within the same batch, and a high rate of misjudgment, directly reducing product qualification rates and corporate economic benefits. This has become a key bottleneck restricting the standardization and automation upgrade of the preserved flower industry. Summary of the Invention
[0004] In order to overcome the problems existing in the background technology, the present invention provides an automatic grading and screening method and device for preserved flowers based on machine vision, which solves the problems of low efficiency, subjective grading standards, poor product consistency and high labor costs caused by the reliance on manual grading of preserved flowers, and realizes the fully automated operation of the grading and screening of preserved flowers.
[0005] To achieve the above objectives, the present invention is implemented through the following technical solution: An automatic grading and screening method for preserved flowers based on machine vision includes the following steps: S1 transports the inspection tray containing preserved flowers to the light-proof darkroom inspection station, where an industrial camera acquires the original RGB image of the preserved flowers. S2 performs noise reduction, foreground and background segmentation, ROI (Region of Interest) extraction, and coordinate matching on the acquired RGB raw image to obtain the ROI region image corresponding to a single preserved flower to be tested, and determines whether each ROI region image is a valid flower material region. If invalid, the subsequent detection process is skipped. S3 converts the images of each ROI region into the HSV color space, separating them into three independent channels: H (chroma), S (saturation), and V (luminance); it also generates a single-channel grayscale image of the corresponding ROI region image; and performs linear luminance normalization on the V luminance channel and the single-channel grayscale image respectively. S4 extracts the flower head diameter of the preserved flowers in each ROI region image, completes the flower type scoring based on the flower head diameter, and performs a pre-defective product rejection judgment. The pre-defective product rejection judgment is set with a veto rule. The veto rule is set based on the flower head diameter: flowers whose flower head diameter exceeds the preset specification range ±10% are directly judged as defective products, and preserved flowers that do not trigger the rejection rule enter the subsequent detection process. S5 performs color difference defect detection and damage / crease defect detection on the preserved flowers entering the subsequent inspection process. The color difference defect detection is based on a pre-established standard color value library for preserved flowers. Based on the matching of flower material categories, standard H chroma channel range and S saturation channel range are obtained. For each pixel in the ROI foreground area, the deviation of the H chroma channel and S saturation channel from the standard range is calculated. Then, the pixel-level total color difference deviation is calculated. Pixels with a pixel-level total color difference deviation exceeding the preset color difference deviation threshold are judged as color difference defect pixels. Color difference defect areas are extracted through connected component analysis to quantify the severity of color difference and score the color difference defect based on the quantification results. The damage and crease defect detection process involves using the Sobel operator to perform edge enhancement on the normalized grayscale image to obtain a gradient magnitude map, extracting defect candidate regions through threshold segmentation, filtering natural texture interference based on the geometric features of the defect candidate regions to identify the real defect regions, thereby quantifying the severity of the defects, and scoring the damage and crease defects based on the quantification results. Based on the scoring results of flower shape, color difference defect, and damage / crease defect, S6 calculates the comprehensive score of the preserved flower according to the preset weight system, and completes the final grade determination of the preserved flower. Based on the final grade determination result of the preserved flowers, S7 drives the automatic sorting unit to complete the grade sorting of the preserved flowers.
[0006] Furthermore, step S2 includes: S21 Image Denoising: Perform 3 steps sequentially on the acquired RGB original image. 3 Median filtering and 5 5. Gaussian smoothing filter; S22 Foreground and Background Segmentation: The original RGB image is converted into a single-channel grayscale image. Based on the grayscale difference, an adaptive threshold segmentation is used to obtain a binary image. The small holes in the flower material area are filled by morphological closing operation and small connected components are removed to generate a binary mask image of the foreground of the preserved flower. S23ROI Region Image Extraction and Coordinate Matching: Based on the positioning markers of the detection tray, image distortion correction is completed, and the mapping relationship between the image coordinate system and the physical coordinate system of the tray is established; based on the preset grid of the tray, the original RGB image is cropped to obtain multiple independent ROI regions. After the background is masked by the foreground binary mask, the ROI region image is obtained, and each ROI region image is bound to a unique physical coordinate. S24 Invalid Region Determination: The validity of each ROI region image is determined. If the foreground pixel ratio of the ROI is <10%, it is determined to be an invalid region without flowers, and all subsequent detection processes are skipped directly; if the foreground pixel ratio of the ROI is ≥10%, it is determined to be a valid flower material region, and the subsequent detection process is entered.
[0007] Furthermore, in step S3, linear brightness normalization is performed on the V brightness channel and the single-channel grayscale image to eliminate brightness unevenness caused by light source fluctuations and differences in flower material height, thus unifying the defect detection benchmark; the brightness normalization formula is: In the formula I normalized I represents the normalized pixel value, and I represents the original pixel value. min I represents the minimum pixel value of the foreground region of the ROI. max This represents the maximum pixel value in the foreground region of the ROI.
[0008] Furthermore, in step S5, the color difference defect detection includes: The formula for calculating the pixel-level total color difference deviation is: Pixel-level total deviation = H deviation 0.7+S deviation 0.3, where: H deviation is the H chroma channel deviation, and S deviation is the S saturation channel deviation; The preset color difference deviation threshold is 5°. Pixels with a total color difference deviation ≥ 5° at the pixel level are identified as color difference defect pixels, and a color difference defect binary map is generated. Morphological closing operation is performed on the color difference defect binary map to fill the small holes in the defect area and connect adjacent color difference areas. Connectivity analysis is performed to filter out tiny areas with an area < 10 pixels and extract all independent color difference defect connected components. The formula for quantifying the severity of color difference is: Color difference area ratio = Total pixel area of all color difference defect areas / Total pixel area of ROI foreground region. 100%; Average color difference deviation = Sum of the total deviation values of all color difference defect pixels / Total number of color difference defect pixels.
[0009] Furthermore, in step S5, the detection of damage and crease defects includes: Use 3 The 3-window Sobel operator calculates the gradient magnitudes in the X and Y directions of the normalized grayscale image, synthesizes the gradient magnitude map, highlights the edge regions of grayscale abrupt changes, and sets the gradient magnitude threshold to 30. Gradient values below the threshold are set to 0 to filter out weak texture interference. The gradient magnitude map is binarized with a fixed threshold of 50 to generate a binary map of the defect candidate region. Morphological opening is then performed on the binary map of the defect candidate region to remove isolated noise points and retain continuous defect regions. Finally, connected component analysis is performed to extract all independent defect candidate connected components. Based on the geometric features of the candidate connected regions of the defects, the interference of the natural texture of the petals is filtered out. The specific filtering rules are: the area of the connected region is ≥20 pixels, 3≤the aspect ratio of the connected region≤20, the average gradient within the connected region is ≥80, and 80% or more of the area of the connected region is located in the foreground area of the flower head. Only the connected regions that simultaneously meet the above rules are retained and determined as real candidate areas of defects. The quantitative calculation formula for the severity of damage and creases is: Defect area ratio = Total pixel area of all real defect areas / Total pixel area of ROI foreground area. 100%.
[0010] Furthermore, in step S6, the default ratio of the preset weight system is: 30% for flower shape scoring results, 30% for color difference defect scoring results, and 40% for damage, crease, and missing defect scoring results; the preset weight system can be dynamically adjusted according to the category of preserved flowers.
[0011] An automated grading and sorting device for preserved flowers based on machine vision is disclosed, used to execute the automated grading and sorting method for preserved flowers based on machine vision as described in any one of claims 1-5. The device includes a material transport unit, a darkroom detection station, an automatic sorting unit, and a control unit. The material transport unit includes a conveyor belt and a detection tray, the detection tray being used to carry the preserved flowers. The darkroom detection station is located in the middle section of the conveyor belt, and has a built-in industrial camera and light source for acquiring RGB images of the preserved flowers and performing visual inspection. The automatic sorting unit includes sorting robots located on both sides of the conveyor belt for grasping and sorting the preserved flowers. The control unit is electrically connected to the conveyor belt, the darkroom detection station, and the automatic sorting unit, respectively, for driving the collaborative operation of each mechanism.
[0012] Furthermore, the light-proof darkroom inspection station is a hollow cavity, with electric doors at both ends of the cavity that are linked to the conveyor belt. The industrial camera and light source are fixed at the top of the cavity, and the light source is a ring light source.
[0013] Furthermore, the detection tray is a matte black divided tray; the front end of the sorting robot is equipped with a flexible silicone suction cup.
[0014] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention adopts a machine vision-based automated inspection and full-process linkage sorting technical solution, equipped with a conveyor belt, segmented inspection tray, light-proof darkroom inspection station, and flexible sorting fixture. By replacing manual visual judgment with standardized vision algorithms, it solves the industry pain points of low efficiency, subjective grading standards, poor product consistency, and high labor costs caused by the reliance on manual grading of preserved flowers. It realizes the full-process automation of preserved flower operation from conveying, inspection, grading to sorting. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0016] Figure 1 This is a schematic diagram of the structure of the device of the present invention; Figure 2 This is a side view of the darkroom testing station of the device of the present invention; Figure 3 This is a top view of the internal structure of the cavity of the device of the present invention.
[0017] In the diagram, 1 – conveyor belt; 2 – inspection tray; 3 – cavity; 4 – industrial camera; 5 – light source; 6 – electric door; 7 – sorting robot; 8 – flexible silicone suction cup; 9 – positioning marker; 10 – hopper. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.
[0019] Where the following description relates to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.
[0020] In the description of this invention, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Those skilled in the art can understand the specific meaning of these terms in this invention according to the specific circumstances. Furthermore, in the description of this invention, unless otherwise stated, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0022] Example 1 This invention proposes an automated grading and screening method for preserved flowers based on machine vision, comprising the following steps: S1: The inspection tray containing the preserved flowers is transported to the light-proof darkroom inspection station, and the original RGB image of the preserved flowers is acquired through an industrial camera.
[0023] In this embodiment, the testing tray containing the preserved flower to be tested is placed stably on the conveyor belt, which transports the testing tray to the light-proof dark chamber testing station. After the electric doors at both ends of the chamber close to form a fully enclosed testing environment free from ambient light interference, the industrial camera inside the chamber is triggered to acquire the original RGB image of the preserved flower.
[0024] S2: Denoise the acquired RGB original image, segment the foreground and background, extract the ROI (Region of Interest) and match the coordinates to obtain the ROI image corresponding to a single preserved flower to be tested, and determine whether each ROI image is a valid flower material area. If invalid, skip the subsequent detection process.
[0025] In this embodiment, S21 image denoising: 3 steps are performed sequentially on the acquired RGB original image. 3. Window value filtering and 5. Five-window Gaussian smoothing filter; median filtering removes salt and pepper noise and impulse noise while preserving the edge features of the flower material; Gaussian smoothing filter weakens high-frequency texture interference and improves the accuracy of subsequent image segmentation and defect detection.
[0026] In this embodiment, S22 foreground and background segmentation: The original RGB image is converted into a single-channel grayscale image. Based on the grayscale difference between the preserved flower foreground and the detection tray background, the Otsu method is used for adaptive threshold segmentation to binarize the image. The pixel value of the foreground (preserved flower) is set to 255, and the pixel value of the background (tray) is set to 0. Morphological closing operation is performed on the binarized image to fill the small holes in the foreground area. Then, small connected components with an area of less than 500 pixels are removed to remove dust and impurities, generating a pure binary mask image of the preserved flower foreground.
[0027] In this embodiment, the S23ROI region image extraction and coordinate matching are performed as follows: Based on the four positioning markers at the four corners of the tray, image distortion correction is performed, and a mapping relationship between the image pixel coordinate system and the physical XY coordinate system of the tray is established with a mapping accuracy of ≤0.1mm; the original RGB image is cropped according to the preset grid of the tray to obtain multiple independent ROI regions corresponding to a single preserved flower; the background of the tray is masked by a foreground binary mask to obtain ROI region images containing only a single preserved flower, and each ROI region image is bound to a unique physical coordinate to provide a basis for subsequent robotic arm sorting and positioning.
[0028] In this embodiment, S24 invalid region determination: the validity of each ROI region image is determined. If the foreground pixel ratio of the ROI is <10%, it is determined to be an invalid region without flowers and is directly skipped to the next detection. If the foreground pixel ratio is ≥10%, it is determined to be a valid flower material region and enters the subsequent detection process.
[0029] S3: Convert the images of each ROI region to the HSV color space and separate them into three independent channels: H (chroma), S (saturation), and V (luminance); at the same time, generate a single-channel grayscale image of the corresponding ROI region image; and perform linear luminance normalization on the V luminance channel and the single-channel grayscale image respectively.
[0030] In this embodiment, the images of each effective ROI region are converted from the RGB color space to the HSV luminance color space, resulting in independent H chroma channels, S saturation channels, and V luminance channels. Simultaneously, single-channel grayscale images of the corresponding ROI regions are generated. Linear luminance normalization is then performed on the V luminance channel and the single-channel grayscale images to eliminate luminance unevenness caused by light source fluctuations and differences in flower material height, thus unifying the defect detection benchmark. The luminance normalization formula is: In the formula For normalized pixel values, The original pixel value. The minimum pixel value in the foreground region of the ROI. This represents the maximum pixel value in the foreground region of the ROI.
[0031] S4: Extract the diameter of the flower head of the preserved flower in each ROI region image, score the flower shape based on the flower head diameter, and perform a pre-defective product rejection judgment. The pre-defective product rejection judgment is set with a veto rule. The veto rule is set based on the flower head diameter: the flower material whose flower head diameter exceeds the preset specification range of ±10% is directly judged as a defective product. Preserved flowers that do not trigger the rejection rule enter the subsequent detection process.
[0032] In this embodiment, a scoring standard for flower pattern is set (maximum score 100 points): Flower head diameter conforms to nominal specification ±5%: 100 points; If the diameter of the flower head conforms to the nominal specification of ±5%~±10%, points will be deducted linearly according to the deviation ratio, with a minimum of 60 points. The deduction formula is: Deduction = (actual diameter deviation percentage - 5%) × 8, Flower shape score = 100 - Deduction.
[0033] S5: Perform color difference defect detection and damage / crease defect detection on the preserved flowers that enter the subsequent inspection process.
[0034] Color difference defect detection: Collect A-grade standard preserved flower sample images of corresponding categories and color systems, with no less than 100 samples per category; extract the mean and upper and lower tolerance ranges of the H chroma and S saturation channels of the sample ROI foreground area, and store them according to flower material category and color system to form a preserved flower standard color value library; based on the established preserved flower standard color value library, obtain the corresponding standard H chroma channel range and S saturation channel range based on flower material category matching; calculate the deviation of the H chroma channel and S saturation channel from the standard range for each pixel in the ROI foreground area, and then calculate the pixel-level total color difference deviation. Pixels with pixel-level total color difference deviation exceeding the preset color difference deviation threshold are identified as color difference defect pixels. Extract the color difference defect area through connected component analysis, and then complete the quantification of the severity of color difference, and complete the color difference defect scoring based on the quantification results.
[0035] In this embodiment, the formula for calculating the pixel-level total color difference deviation is: Pixel-level total deviation = H deviation 0.7+S deviation 0.3, where: H deviation is the H chroma channel deviation, and S deviation is the S saturation channel deviation; The preset color difference deviation threshold is 5°. Pixels with a total color difference deviation ≥ 5° at the pixel level are identified as color difference defect pixels, and a color difference defect binary map is generated. Morphological closing operation is performed on the color difference defect binary map to fill the small holes in the defect area and connect adjacent color difference areas. Connectivity analysis is performed to filter out tiny areas with an area < 10 pixels and extract all independent color difference defect connected components. The formula for quantifying the severity of color difference is: Color difference area ratio = Total pixel area of all color difference defect areas / Total pixel area of ROI foreground region. 100%; Average color difference deviation = Sum of the total deviation values of all color difference defect pixels / Total number of color difference defect pixels.
[0036] In this embodiment, the scoring criteria for color difference defects (out of 100 points) are as follows: For every 1% increase in the area of color difference, 4 points will be deducted. An average color difference deviation of ≥15° will result in an additional deduction of 20 points. An average color difference deviation of ≥30° will result in a deduction of 0 points. The final score range is 0-100 points.
[0037] Damage and crease defect detection: Gradient magnitude map is obtained by edge enhancement processing of the normalized grayscale image using the Sobel operator. Defect candidate regions are extracted by threshold segmentation, and natural texture interference is filtered based on the geometric features of the defect candidate regions to identify the real defect regions. The severity of the defect is then quantified, and the damage and crease defects are scored based on the quantification results.
[0038] In this embodiment, 3 is used. The 3-window Sobel operator calculates the gradient magnitudes in the X and Y directions of the normalized grayscale image, synthesizes the gradient magnitude map, highlights the edge regions of grayscale abrupt changes, and sets the gradient magnitude threshold to 30. Gradient values below the threshold are set to 0 to filter out weak texture interference. The gradient magnitude map is binarized with a fixed threshold of 50 to generate a binary map of the defect candidate region. Morphological opening is then performed on the binary map of the defect candidate region to remove isolated noise points and retain continuous defect regions. Finally, connected component analysis is performed to extract all independent defect candidate connected components. Based on the geometric features of the candidate connected regions of the defects, the interference of the natural texture of the petals is filtered out. The specific filtering rules are: the area of the connected region is ≥20 pixels, 3≤the aspect ratio of the connected region≤20, the average gradient within the connected region is ≥80, and 80% or more of the area of the connected region is located in the foreground area of the flower head. Only the connected regions that simultaneously meet the above rules are retained and determined as real candidate areas of defects. The quantitative calculation formula for the severity of damage and creases is: Defect area ratio = Total pixel area of all real defect areas / Total pixel area of ROI foreground area. 100%.
[0039] In this embodiment, the scoring criteria for breakage defects (out of 100 points) are as follows: For every 1% increase in the defect area percentage, 5 points will be deducted. For a maximum defect size ≥5mm, an additional 20 points will be deducted. For a maximum defect size ≥10mm, the score will be reduced to 0 points. The final score range is 0-100 points.
[0040] S6: Based on the scoring results of flower shape, color difference defect, and damage / crease defect, calculate the comprehensive score of the preserved flower according to the preset weight system to complete the final grade determination of the preserved flower.
[0041] In this embodiment, the default weighting of the preset weighting system is as follows: flower shape score accounts for 30%, color difference defect score accounts for 30%, and damage / crease defect score accounts for 40%. The preset weighting system can be dynamically adjusted according to the category of preserved flowers. The comprehensive score calculation formula is: comprehensive score = flower shape score × 30% + color difference defect score × 30% + damage / crease defect score × 40%.
[0042] The grading levels and corresponding score thresholds for preserved flowers can be customized according to production needs. In this embodiment, three valid grading levels are set, and the grading levels and corresponding score standards are as follows: Grade A floral materials: Overall score ≥ 85 points, no obvious defects, regular flower shape, and uniform color; Grade B flowers: Overall score of 60-84 points, minor defects that do not affect the overall quality of the flowers; Defective products: If the overall score is less than 60 points, or if the S4 veto rule is triggered, the product will be directly removed.
[0043] S7: Based on the final grade determination result of the preserved flowers, drive the automatic sorting unit to complete the grade sorting of the preserved flowers.
[0044] In this embodiment, the final grade determination result and the corresponding physical coordinates are transmitted to the control unit. The control unit drives the automatic sorting unit to grab Grade A and Grade B flowers respectively and put them into the corresponding silos. Defective products do not trigger the automatic sorting unit to grab them. They are transported to the end of the conveyor belt along with the detection tray to complete automatic rejection, realizing full-process grade sorting.
[0045] Example 2 like Figures 1-3 As shown, this embodiment of the invention also provides an automated grading and sorting device for preserved flowers based on machine vision, including a material transport unit, a darkroom detection station, an automatic sorting unit, and a control unit. The material transport unit includes a conveyor belt 1 and a detection tray 2, which is used to carry the preserved flowers. The darkroom detection station is located in the middle section of the conveyor belt 1 and has an industrial camera 4 and a light source 5 built in it, which are used to collect RGB images of the preserved flowers and complete visual inspection. The automatic sorting unit includes sorting robots 7 set on both sides of the conveyor belt 1, which are used to grab and sort the preserved flowers according to their grade. The control unit is electrically connected to the conveyor belt 1, the darkroom detection station, and the automatic sorting unit, respectively, and is used to drive the various mechanisms to work together.
[0046] In this embodiment, the material transport unit includes a conveyor belt 1 and a test tray 2. The test tray 2 is placed on the upper surface of the conveyor belt 1 and is transported synchronously with the conveyor belt 1. The test tray 2 is a matte black segmented tray. The four corners of the test tray 2 are provided with positioning mark points 9. Multiple independent segments are opened on the test tray 2 for positioning and supporting a single preserved flower.
[0047] In this embodiment, the darkroom inspection station includes a hollow cavity 3, an industrial camera 4, a light source 5, and two sets of electric doors 6. The cavity 3 is a matte black, fully enclosed cavity structure, which is fixed across the middle section of the conveyor belt 1. The two ends of the cavity 3 are open to allow the inspection tray 2 to pass through. The two sets of electric doors 6 are respectively installed at the two ends of the cavity 3 and are linked to the conveyor belt 1 to open and close, forming a darkroom inspection environment. The industrial camera 4 is fixedly installed at the top center of the cavity 3. The light source 5 is a ring light source, which is coaxially fixed around the industrial camera 4 at the top of the cavity 3 and located on the outer periphery of the lens of the industrial camera 4. It provides uniform illumination for imaging and, through the cooperation of the darkroom and the ring light source, eliminates ambient light interference and improves the consistency of image acquisition.
[0048] In this embodiment, the automatic sorting unit includes two sets of sorting robots 7 and flexible silicone suction cups 8. The two sets of sorting robots 7 are arranged sequentially on both sides of the conveyor belt 1 along the conveying direction of the conveyor belt 1. The flexible silicone suction cups 8 are fixedly installed at the front end of the sorting robots 7 and are a vacuum adsorption type flexible structure used for non-destructive gripping of preserved flowers.
[0049] In this embodiment, the control unit is responsible for receiving image data, executing algorithm judgment, calculating comprehensive score, classifying levels, and sending control commands to realize the full-process automated linkage of the material transportation unit, the light-proof darkroom detection station, and the automatic sorting unit.
[0050] In this embodiment, after the device is started, the inspection tray 2 containing preserved flowers is conveyed forward by the conveyor belt 1. When the tray reaches the entrance of the cavity 3, the electric door 6 on the entrance side opens, and after the inspection tray 2 enters the cavity 3, the electric door 6 closes to form a fully enclosed light-proof environment. At this time, the ambient light interference is eliminated by the light-proof dark chamber and the ring light source. The industrial camera 4 captures the original RGB image of the preserved flowers and transmits it to the control unit. The control unit completes the entire process of image preprocessing, feature extraction, defect detection, and grading judgment. After the inspection is completed, the electric door 6 on the exit side of the cavity 3 opens, and the conveyor belt 1 conveys the inspection tray 2 to the sorting station. The control unit drives the corresponding sorting robot 7 to move according to the grading result. The sorting robot 7 grabs the preserved flowers of the corresponding grade through the flexible silicone suction cup 8 at the end and puts them into the corresponding hopper 10. Defective preserved flowers do not trigger the grabbing action and are conveyed to the end by the conveyor belt 1 along with the inspection tray 2 to complete the automatic rejection, completing a single automated grading and screening operation of preserved flowers. This embodiment achieves fully automated operation of preserved flowers from conveying, image acquisition, preprocessing, flower type screening, defect detection, comprehensive grading to automated sorting by using fixed scoring weights and quantitative calculation formulas, combined with standardized image preprocessing, dual-dimensional defect detection, and pre-removal logic for defective products. The grading standards are unified, with high accuracy and strong consistency, completely solving the industry pain points of low efficiency, subjective standards, and high labor costs of manual grading, and is suitable for the industrial mass production of preserved flowers.
[0051] In the accompanying drawings of this embodiment, the same or similar reference numerals correspond to the same or similar components. In the description of this invention, it should be understood that if terms such as "upper," "lower," "left," and "right" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting this invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.
[0052] Finally, it should be noted that the above preferred embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail through the above preferred embodiments, those skilled in the art should understand that various changes can be made to it in form and detail without departing from the scope defined by the claims of the present invention.
Claims
1. A machine vision-based automatic grading and screening method for preserved flowers, characterized in that, Includes the following steps: S1 transports the inspection tray containing preserved flowers to the light-proof darkroom inspection station, where an industrial camera acquires the original RGB image of the preserved flowers. S2 performs noise reduction, foreground and background segmentation, ROI (Region of Interest) extraction, and coordinate matching on the acquired RGB raw image to obtain the ROI region image corresponding to a single preserved flower to be tested, and determines whether each ROI region image is a valid flower material region. If invalid, the subsequent detection process is skipped. S3 converts the images of each ROI region into the HSV color space, separating them into three independent channels: H (chroma), S (saturation), and V (luminance); it also generates a single-channel grayscale image of the corresponding ROI region image; and performs linear luminance normalization on the V luminance channel and the single-channel grayscale image respectively. S4 extracts the flower head diameter of the preserved flowers in each ROI region image, completes the flower type scoring based on the flower head diameter, and performs a pre-defective product rejection judgment. The pre-defective product rejection judgment is set with a veto rule. The veto rule is set based on the flower head diameter: flowers whose flower head diameter exceeds the preset specification range ±10% are directly judged as defective products, and preserved flowers that do not trigger the rejection rule enter the subsequent detection process. S5 performs color difference defect detection and damage / crease defect detection on the preserved flowers entering the subsequent inspection process. The color difference defect detection is based on a pre-established standard color value library for preserved flowers. Based on the matching of flower material categories, standard H chroma channel range and S saturation channel range are obtained. For each pixel in the ROI foreground area, the deviation of the H chroma channel and S saturation channel from the standard range is calculated. Then, the pixel-level total color difference deviation is calculated. Pixels with a pixel-level total color difference deviation exceeding the preset color difference deviation threshold are judged as color difference defect pixels. Color difference defect areas are extracted through connected component analysis to quantify the severity of color difference and score the color difference defect based on the quantification results. The damage and crease defect detection process involves using the Sobel operator to perform edge enhancement on the normalized grayscale image to obtain a gradient magnitude map, extracting defect candidate regions through threshold segmentation, filtering natural texture interference based on the geometric features of the defect candidate regions to identify the real defect regions, thereby quantifying the severity of the defects, and scoring the damage and crease defects based on the quantification results. Based on the scoring results of flower shape, color difference defect, and damage / crease defect, S6 calculates the comprehensive score of the preserved flower according to the preset weight system, and completes the final grade determination of the preserved flower. Based on the final grade determination result of the preserved flowers, S7 drives the automatic sorting unit to complete the grade sorting of the preserved flowers.
2. The automatic grading and screening method for preserved flowers based on machine vision as described in claim 1, characterized in that, Step S2 includes: S21 Image Denoising: Perform 3 steps sequentially on the acquired RGB original image. 3 Median filtering and 5 5. Gaussian smoothing filter; S22 Foreground and Background Segmentation: The original RGB image is converted into a single-channel grayscale image. Based on the grayscale difference, an adaptive threshold segmentation is used to obtain a binary image. The small holes in the flower material area are filled by morphological closing operation and small connected components are removed to generate a binary mask image of the foreground of the preserved flower. S23ROI Region Image Extraction and Coordinate Matching: Based on the positioning markers of the detection tray, image distortion correction is completed, and the mapping relationship between the image coordinate system and the physical coordinate system of the tray is established; based on the preset grid of the tray, the original RGB image is cropped to obtain multiple independent ROI regions. After the background is masked by the foreground binary mask, the ROI region image is obtained, and each ROI region image is bound to a unique physical coordinate. S24 Invalid Region Determination: The validity of each ROI region image is determined. If the foreground pixel ratio of the ROI is <10%, it is determined to be an invalid region without flowers, and all subsequent detection processes are skipped directly; if the foreground pixel ratio of the ROI is ≥10%, it is determined to be a valid flower material region, and the subsequent detection process is entered.
3. The automatic grading and screening method for preserved flowers based on machine vision as described in claim 1, characterized in that, In step S3, linear brightness normalization is performed on the V brightness channel and the single-channel grayscale image to eliminate the brightness unevenness caused by light source fluctuations and height differences of flower materials, and to unify the defect detection benchmark. The formula for normalizing brightness is: In the formula For normalized pixel values, The original pixel value. The minimum pixel value in the foreground region of the ROI. This represents the maximum pixel value in the foreground region of the ROI.
4. The automatic grading and screening method for preserved flowers based on machine vision as described in claim 1, characterized in that, In step S5, the color difference defect detection includes: The formula for calculating the pixel-level total color difference deviation is: Pixel-level total deviation = H deviation 0.7+S deviation 0.3, where: H deviation is the H chroma channel deviation, and S deviation is the S saturation channel deviation; The preset color difference deviation threshold is 5°. Pixels with a total color difference deviation ≥ 5° at the pixel level are identified as color difference defect pixels, and a color difference defect binary map is generated. Morphological closing operation is performed on the color difference defect binary map to fill the small holes in the defect area and connect adjacent color difference areas. Connectivity analysis is performed to filter out tiny areas with an area < 10 pixels and extract all independent color difference defect connected components. The formula for quantifying the severity of color difference is: Color difference area ratio = Total pixel area of all color difference defect areas / Total pixel area of ROI foreground region. 100%; Average color difference deviation = Sum of the total deviation values of all color difference defect pixels / Total number of color difference defect pixels.
5. The automatic grading and screening method for preserved flowers based on machine vision as described in claim 1, characterized in that, In step S5, the detection of damage and crease defects includes: Adopt 3 The 3-window Sobel operator calculates the gradient magnitudes in the X and Y directions of the normalized grayscale image, synthesizes the gradient magnitude map, highlights the edge regions of grayscale abrupt changes, and sets the gradient magnitude threshold to 30. Gradient values below the threshold are set to 0 to filter out weak texture interference. The gradient magnitude map is binarized with a fixed threshold of 50 to generate a binary map of the defect candidate region. Morphological opening is then performed on the binary map of the defect candidate region to remove isolated noise points and retain continuous defect regions. Finally, connected component analysis is performed to extract all independent defect candidate connected components. Based on the geometric features of the candidate connected regions of the defects, the interference of the natural texture of the petals is filtered out. The specific filtering rules are: the area of the connected region is ≥20 pixels, 3≤the aspect ratio of the connected region≤20, the average gradient within the connected region is ≥80, and 80% or more of the area of the connected region is located in the foreground area of the flower head. Only the connected regions that simultaneously meet the above rules are retained and determined as real candidate areas of defects. The quantitative calculation formula for the severity of damage and creases is: Defect area ratio = Total pixel area of all real defect areas / Total pixel area of ROI foreground area. 100%.
6. The automatic grading and screening method for preserved flowers based on machine vision as described in claim 1, characterized in that, In step S6, the default weighting of the preset weighting system is as follows: flower shape score accounts for 30%, color difference defect score accounts for 30%, and damage, crease and missing defect score accounts for 40%. The preset weighting system can be dynamically adjusted according to the category of preserved flowers.
7. An automated grading and sorting device for preserved flowers based on machine vision, characterized in that, The method for automatically grading and screening preserved flowers based on machine vision as described in any one of claims 1-6 includes a material transport unit, a darkroom detection station, an automatic sorting unit, and a control unit. The material transport unit includes a conveyor belt (1) and a detection tray (2), the detection tray (2) being used to carry preserved flowers. The darkroom detection station is located in the middle section of the conveyor belt (1), and the darkroom detection station has an industrial camera (4) and a light source (5) built in it, used to collect RGB images of preserved flowers and complete visual inspection. The automatic sorting unit includes sorting robots (7) set on both sides of the conveyor belt (1), used to grab and sort preserved flowers. The control unit is electrically connected to the conveyor belt (1), the darkroom detection station, and the automatic sorting unit respectively, and is used to drive the various mechanisms to work together.
8. The automated grading and screening device for preserved flowers as described in claim 7, characterized in that: The light-proof darkroom testing station is a hollow cavity (3). The cavity (3) is equipped with electric doors (6) that are linked to the conveyor belt (1) at both ends. The industrial camera (4) and the light source (5) are fixed inside the top of the cavity (3). The light source (5) is a ring light source.
9. The automated grading and screening device for preserved flowers as described in claim 7, characterized in that: The detection tray (2) is a matte black compartmentalized tray; the front end of the sorting robot (7) is equipped with a flexible silicone suction cup (8).