Pineapple image preprocessing method and system based on feature enhancement and multi-strategy fusion

CN122929152APending Publication Date: 2026-10-16HEPU GUOXIANGYUAN FOOD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611113426.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-26
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0003]由于菠萝为球状曲面结构,现有的机器视觉识别算法在提取菠萝的菠萝眼边缘曲面特征中主要存在着如下难题:1.透视畸变问题:边缘区域曲面曲率大,导致菠萝眼形状在边缘处发生严重变形;2.特征衰减问题:边缘菠萝眼通常只呈现部分可见区域,特征不完整;3.噪声干扰问题:菠萝表面存在天然纹理、斑点和不规则凸起,这些噪声特征容易与目标菠萝眼混淆

Benefits of technology

1.本发明通过获取原始菠萝图像的菠萝区域掩码,然后在菠萝区域掩码的约束下,对原始菠萝图像执行自适应形态学变换、伽马校正处理和局部对比度增强,实现对原始菠萝图像的菠萝眼区域的特征增强和果皮区域的特征弱化,完整保留各位置菠萝眼灰度信息,降低菠萝球面边缘菠萝眼漏检概率,同时,提高了目标菠萝眼和背景果皮的区分难度;通过利用原始菠萝图像的亮度数据对对应的增强菠萝图像进行亮度补偿,实现不再依赖单张图像处理,实现原图与增强图信息互补,保留原生果皮色彩,避免色彩维度信息丢失;然后从亮度、色彩双维度缓解明暗失衡、斑点噪声干扰,稳定提升菠萝眼识别精度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122929152A_ABST
    Figure CN122929152A_ABST
Patent Text Reader

Abstract

The application discloses a pineapple image preprocessing method and system based on feature enhancement and multi-strategy fusion, which comprises the following steps: collecting multi-angle pineapple image to construct a data set, using YOLOv11-seg to generate a pineapple segmentation mask, and then delimiting a processing area after Gaussian filtering and morphological dilation optimization; sequentially completing adaptive morphological transformation, gamma correction and local contrast enhancement in the limited area, then combining the original image brightness data to do brightness compensation, and finally outputting the preprocessed image after edge sharpening, denoising and saturation enhancement. The application extracts three types of features of pineapple eye dark pixel proportion, curved surface edge proportion and global brightness deviation based on the mask, builds a mask perception adaptive parameter regulation framework, and combines a pineapple eye detection loss closed-loop self-training mechanism, so that the processing parameters can be dynamically adjusted for high-light skin, dark concave pineapple eye and spherical distortion scene, the problems of processing imbalance, pineapple eye missed detection and color distortion caused by fixed parameters are solved, and the accuracy of the subsequent visual detection model is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image recognition and processing technology in machine vision, specifically relating to a pineapple image preprocessing method and system based on feature enhancement and multi-strategy fusion. Background Technology

[0002] In the industrial automation process of pineapple processing, the vision system needs to accurately identify the "eyes" on the surface of the pineapple and return their three-dimensional coordinates. Then, based on the returned three-dimensional coordinate data, a mechanical tool is used to remove the "eyes".

[0003] Because pineapples have a spherical curved surface structure, existing machine vision recognition algorithms face the following main challenges in extracting the edge surface features of the pineapple's "eye": 1. Perspective distortion: The large curvature of the surface in the edge region causes severe deformation of the pineapple's "eye" shape at the edge; 2. Feature attenuation: The edge of the pineapple's "eye" usually only shows a partially visible area, resulting in incomplete features; 3. Noise interference: The pineapple surface has natural textures, spots, and irregular bumps, and these noise features are easily confused with the target pineapple's "eye".

[0004] Chinese invention patent CN2021109783670 discloses an automatic pineapple eye removal device and method. This method acquires an image of the pineapple's shape using a camera, then performs basic preprocessing techniques such as filtering, noise reduction, binarization, and PCA principal component analysis to obtain the center coordinates of the pineapple's eye in the preprocessed image. Next, the Canny edge detection algorithm is used to extract the pineapple's contour. Based on this contour, the transformation equation of the pineapple's radius as a function of the pineapple cutter's translation is determined, and the real-time radius of the pineapple is calculated. Finally, the spiral trajectory of the pineapple's eye is calculated based on the angle between the pineapple's slope and the horizontal plane. A movement control command is generated based on the identified spiral trajectory, controlling the pineapple cutter to move along the spiral trajectory of the eye. Combined with the pineapple's rotation, this allows for accurate and rapid removal of the pineapple's eye, making the entire process safer and more efficient. However, this method has the following shortcomings: Firstly, because pineapples have a spherical curved surface structure, the curvature of the fruit edge surface in the collected pineapple shape image is large, and the shape of the pineapple eye will be severely deformed at the edge. The edge pineapple eye is only locally visible, resulting in the problem of missing features. However, this solution only uses existing simple image filtering, noise reduction and binarization processing, which will directly truncate the distorted and incomplete pineapple eye features, which is very easy to cause the edge pineapple eye to be missed. Secondly, although the scheme uses Gaussian noise reduction to smooth the image in Canny edge detection, which can eliminate the influence of complex lighting in the environment to a certain extent, the pineapple peel has natural yellow spots, bumps, and small spots. The texture grayscale and shape are very similar to the pineapple eyes, forming a lot of interference noise. Relying solely on a simple Gaussian filtering algorithm is difficult to meet the processing of the dark and concave details of the pineapple eyes, and it is easy to cause overexposure of the peel in the high-brightness areas, which exacerbates the difficulty of distinguishing the target (i.e., pineapple eyes) area from the background (peel) area. Third, this scheme only performs basic processing on a single pineapple shape image, lacking a fusion process between the original pineapple shape image and the processed image. A single image cannot simultaneously maintain the authenticity of the original peel color and enhance the pineapple eye features. Relying solely on gradients makes it difficult to accurately separate the dark recessed pineapple eyes from the peel shadows, easily leading to the loss of color dimension information. Single images are prone to overall low brightness and difficulty in distinguishing spots. It cannot alleviate noise interference and brightness imbalance from the color dimension, thus limiting the accuracy of pineapple eye recognition.

[0005] Fourth, the images extracted by Canny still retain small fruit peel noise, the edges of the pineapple eyes are blurred, and the color differentiation is weak, making it difficult to meet the needs of high-precision and high-detection-rate automated industrial inspection.

[0006] Fifth, in the existing pineapple image preprocessing pipeline, each image processing module operates independently with manually preset fixed kernels, fixed coefficients, and fixed thresholds. There is no feature data exchange or linkage constraint relationship between modules. It is impossible to dynamically adjust the processing intensity of each module according to the degree of pineapple surface distortion, the density of pineapple eyes, and the lighting conditions of a single image. After multi-level image enhancement and superposition, it is very easy to cause overexposure of the peel, color distortion, and edge artifacts. Moreover, the parameters of the entire pipeline rely on manual adjustment of each module and cannot be automatically adapted to changes in production line lighting and pineapple varieties, resulting in poor industrial versatility. Summary of the Invention

[0007] The purpose of this invention is to provide a pineapple image preprocessing method and system based on feature enhancement and multi-strategy fusion to solve the technical problems mentioned above.

[0008] To achieve the above objectives, in a first aspect, the present invention provides a pineapple image preprocessing method based on feature enhancement and multi-strategy fusion, comprising the following steps: S1. Collect original pineapple images from different angles, construct an original pineapple image set, and define three types of global linkage features, including the proportion of curved edges, the proportion of dark pixels in the pineapple eye, and the global brightness deviation. S2. Input the original pineapple image set into the YOLOv11-seg segmentation model to obtain the segmentation mask corresponding to each original pineapple image, and perform Gaussian filtering and morphological dilation operations on the segmentation mask in sequence to obtain the pineapple region mask corresponding to each original pineapple image. S3. Using the pineapple region mask as the operation area, perform adaptive morphological transformation, gamma correction processing, and unsharpened mask local contrast enhancement processing on each original pineapple image in sequence to obtain an enhanced pineapple image set; S4. Using the brightness data of the original pineapple images in the original pineapple image set and the corresponding enhanced pineapple images in the enhanced pineapple image set, brightness compensation is performed to obtain the enhanced pineapple image set after brightness restoration. S5. Perform edge sharpening, noise reduction, and saturation enhancement operations sequentially on the enhanced pineapple image set after brightness restoration to obtain a preprocessed pineapple image set; Further, step S2 includes: Gaussian filtering is applied to the segmentation mask to obtain a smooth mask; the proportion of the surface edge corresponding to the smooth mask is calculated, and the Gaussian kernel size and standard deviation of the Gaussian filter are adjusted based on the proportion of the surface edge; Gaussian filtering is re-applied based on the adjusted Gaussian kernel size and standard deviation to update and obtain the optimized smooth mask; The optimized smooth mask is sequentially subjected to closing and morphological dilation operations to obtain the dilated mask. The proportion of the curved edge corresponding to the dilated mask is calculated, and the size of the closing kernel and the dilation kernel is adjusted based on the proportion of the curved edge. The closing operation and morphological dilation are re-executed based on the adjusted kernel size to update the final pineapple region mask, and the proportion of the curved edge and the proportion of dark pixels in the pineapple eye corresponding to the current mask are calculated.

[0009] Further, step S3 includes: An adaptive morphological transformation is performed on the updated pineapple region mask to obtain a feature-enhanced intermediate image; the proportion of dark pixels in the pineapple eye corresponding to the intermediate image is calculated, and the size of the structuring element of the adaptive morphological transformation is adjusted based on the proportion of dark pixels in the pineapple eye; the intermediate image is updated based on the adjusted structuring element size, and the proportion of dark pixels in the pineapple eye corresponding to the current intermediate image is calculated. Perform gamma correction on the updated intermediate image to obtain the corrected image; calculate the proportion of dark pixels in the pineapple eye and the global brightness deviation corresponding to the corrected image, and adjust the gamma value of the gamma correction based on the proportion of dark pixels in the pineapple eye and the global brightness deviation; update the corrected image based on the adjusted gamma value. The updated corrected image is subjected to local contrast enhancement using an unsharpened mask to obtain an enhanced pineapple image. The proportion of dark pixels in the pineapple eye and the proportion of curved edges corresponding to the enhanced pineapple image are calculated, and the gain of the unsharpened mask is adjusted based on the proportion of dark pixels in the pineapple eye and the proportion of curved edges. Based on the adjusted unsharpened mask gain, the enhanced pineapple image is updated, and the proportion of curved edges, the proportion of dark pixels in the pineapple eye, and the global brightness deviation corresponding to the current enhanced pineapple image are calculated.

[0010] Further, step S4 includes: Based on the original pineapple image set and the enhanced pineapple image set, an image list is constructed, and the image list is traversed to perform a validity check and update on each image in the image list to obtain a valid image list; A global brightness analysis is performed on the valid images in the list of valid images to obtain the global average brightness value of all valid images and the brightness value of each valid image; A brightness-aware fusion processor is configured to perform brightness compensation on each enhanced pineapple image in the effective image list based on the average brightness and the global average brightness.

[0011] Each enhanced pineapple image after brightness compensation is evaluated, and a set of enhanced pineapple images after brightness restoration is output.

[0012] Furthermore, the method for brightness compensation of the enhanced pineapple image includes: In the YUV space, separate the original pineapple image from the list of valid images and the enhanced pineapple image corresponding to the original pineapple image to obtain the valid original pineapple image and the valid enhanced pineapple image in the YUV channel; The enhanced pineapple image and the original pineapple image in the YUV channels are fused and merged to obtain a brightness-compensated enhanced pineapple image. The relevant fusion calculation formula is as follows:

[0013]

[0014] In the formula, These are the pixel values ​​of the fused image for the Y, U, and V channels, respectively. These are the grayscale values ​​in the Y channel of the original pineapple image and the enhanced pineapple image, respectively. These are the weighted values ​​of the Y-channel fusion of the original pineapple image and the enhanced pineapple image, respectively. These are the grayscale values ​​of the U channel for the original pineapple image and the enhanced pineapple image, respectively. The values ​​are the grayscale values ​​of the original pineapple image and the enhanced pineapple image in the V channel, respectively.

[0015] Furthermore, the method for evaluating the enhanced pineapple image is as follows: calculate an adaptive brightness repair judgment threshold; if the brightness value of the brightness-compensated enhanced pineapple image is less than the repair judgment threshold, then perform brightness repair on the brightness-compensated enhanced pineapple image; otherwise, take the brightness-compensated enhanced pineapple image as the output to obtain the brightness-repaired enhanced pineapple image.

[0016] Furthermore, the formula for calculating the fusion weighted value of the Y channel is as follows:

[0017]

[0018] In the formula, It is the variance function. For Laplace filtering, The brightness value of the original pineapple image. To enhance the brightness of the pineapple image, This is the brightness deviation coefficient. This is the surface edge proportion coefficient.

[0019] Further, step S5 includes: Calculate the percentage of curved edges, the percentage of dark pixels in the pineapple eye, and the global brightness deviation for each enhanced pineapple image in the brightness-restored enhanced pineapple image set; Based on the calculated proportion of curved edges, proportion of dark pixels in the pineapple eye, and global brightness deviation, the sharpening convolution kernel size for edge sharpening, the filtering diameter for bilateral filtering denoising, and the enhancement coefficient for saturation enhancement are set.

[0020] Furthermore, the method described in this invention also includes constructing a pineapple image training set, and using the pineapple image training set to perform the contents of steps S2-S5 to obtain a preprocessed pineapple image set corresponding to the pineapple image training set. Based on the results of the preprocessed pineapple image set, the configuration parameters in steps S2-S5 are trained.

[0021] Secondly, this invention also proposes a pineapple image preprocessing system based on feature enhancement and multi-strategy fusion, comprising: A testing unit and a training unit, wherein the testing unit and the training unit are interactively connected; The test unit includes a first input module, a first calculation module, a first linkage feature quantity distribution module, and a first output module; The first input module is used to store the original pineapple image set in step S1, the first calculation module is used to execute the steps in steps S2 to S5, the first linkage feature quantity distribution module is used to store the three types of global linkage features in step S1, and interact with the first calculation module in real time to update the three types of global linkage features in steps S2 to S5, and the first output module is used to output the preprocessed pineapple image set. The training unit includes a second input module, a second operation module, a second linkage feature quantity distribution module, and a second output module; The second input module is used to store the pineapple image training set, the second operation module is used to execute the steps in steps S2 to S5, the second linkage feature quantity distribution module is used to store the three types of global linkage features in step S1, and interacts with the second operation module in real time to update the three types of global linkage features in steps S2 to S5, and the second output module is used to output the preprocessed pineapple image set and synchronize the configuration parameters of the second operation module to the first operation module.

[0022] Compared with existing technologies, the present invention has the following advantages: 1. This invention obtains the pineapple region mask of the original pineapple image, and then, under the constraint of the pineapple region mask, performs adaptive morphological transformation, gamma correction processing, and local contrast enhancement on the original pineapple image. This achieves feature enhancement of the pineapple eye region and feature weakening of the peel region in the original pineapple image, fully preserving the grayscale information of the pineapple eye at each location, reducing the probability of missing pineapple eyes at the pineapple's spherical edge, and simultaneously increasing the difficulty of distinguishing the target pineapple eye from the background peel. By utilizing the brightness data of the original pineapple image to perform brightness compensation on the corresponding enhanced pineapple image, it achieves information complementarity between the original and enhanced images, no longer relying on single-image processing, preserving the original peel color, and avoiding the loss of color dimension information. Then, it alleviates the imbalance of light and dark and speckle noise interference from both brightness and color dimensions, steadily improving the pineapple eye recognition accuracy.

[0023] 2. This invention abandons the traditional production line model where each module has independent and fixed parameters. The first computation module of the testing unit sequentially performs Gaussian filtering, morphological dilation, adaptive morphological transformation, gamma correction, local contrast enhancement using an unsharpened mask, brightness enhancement and repair, edge sharpening, denoising, and saturation enhancement on the original pineapple image, resulting in a preprocessed pineapple image set. This set is then sent to the first output module for display. During this process, the first linkage feature distribution module stores three types of global linkage features in real time and distributes them to the first computation module to constrain the configuration parameters of each operation within the first computation module. The training unit runs training on the pineapple image, and the second computation module performs the same operations as the first, configuring the parameters for each step and sending them to the first computation module for execution and updating. This achieves linkage between the testing and training units, eliminating the need for staff to repeatedly adjust kernel size, gain, and threshold for different operating conditions, significantly reducing production line deployment and debugging costs. Attached Figure Description

[0024] Figure 1 This is a schematic diagram illustrating the implementation process of the pineapple image preprocessing method based on feature enhancement and multi-strategy fusion provided by the present invention. Figure 2 The first comparative diagram shows the implementation effects of the method provided by this invention and the method in the background art. Figure 3 The second comparative diagram shows the implementation effects of the method provided by this invention and the method in the background art. Detailed Implementation

[0025] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings, but it should be understood that the scope of protection of the invention is not limited to the specific embodiments.

[0026] refer to Figures 1 to 3 The pineapple image preprocessing method based on feature enhancement and multi-strategy fusion includes the following steps: Step S1: Acquire original pineapple images from different angles to construct an original pineapple image set, and define three types of globally linked features, including the proportion of curved edges. Pineapple eye dark pixel ratio and global brightness deviation ; In this embodiment, original pineapple images are collected from different angles by rotating them 360 degrees at 15° intervals, thereby establishing an original pineapple image set.

[0027] In one embodiment, the proportion of the curved edge The mathematical formula is:

[0028]

[0029] In the formula, The number of pixels within the mask boundary expansion buffer. This represents the total number of pixels in the overall mask. The proportion of the curved surface edge; The formula for calculating the proportion of dark pixels in a pineapple eye shape is:

[0030]

[0031] In the formula, This represents the total number of pixels within the mask area whose grayscale value is lower than the baseline grayscale value of the pineapple eye depression. This represents the total number of valid pixels in the pineapple mask. The percentage of dark pixels in the "lotus eye" image; The formula for calculating global brightness deviation is:

[0032]

[0033] In the formula, The average brightness of a single-image mask. The average brightness of the global dataset. This refers to the global brightness deviation.

[0034] It should be noted that, in this embodiment, the proportion of the curved surface edge is... Used to characterize image edge distortion and the degree of incompleteness of the pineapple eye; the proportion of dark pixels in the pineapple eye. Used to characterize the density and brightness of pineapple eyes; global brightness deviation. Used to characterize overexposed or underexposed images.

[0035] Step S2: Input the original pineapple image set into the YOLOv11-seg segmentation model to obtain the segmentation mask for each original pineapple image. Then, perform morphological dilation and Gaussian filtering operations on the segmentation mask to obtain the pineapple region mask for each original pineapple image. ; In one embodiment, the segmentation mask for the background environment is denoted as 0, and the segmentation mask for the pineapple region is denoted as 255; It is understandable that the segmentation mask is a black and white image, which is essentially a two-dimensional matrix. When the mask value is 0, it represents that the background (background area) is black, and when the mask value is 255, it represents that the target (pineapple area) is white.

[0036] Specifically, step S2 includes: Step S2.1: Perform Gaussian filtering on the original segmentation mask output by YOLOv11-seg to obtain a smooth mask; For example, the initial parameters of the Gaussian filter in step S2.1 include the size and standard deviation of the Gaussian kernel. The initial Gaussian kernel size is set to (7,7) and the initial standard deviation σ=1.5. The Gaussian filter operation eliminates the pixel stair-step jaggedness of the original segmentation mask, making the edges of the mask more natural.

[0037] Step S2.2: Calculate the proportion of the curved surface edges corresponding to the smooth mask. Based on the surface edge proportion Re, the Gaussian kernel size and standard deviation of the Gaussian filter are adjusted; Step S2.3: Based on the adjusted Gaussian kernel size and standard deviation of the Gaussian filter, re-execute the Gaussian filter update to obtain the optimized smoothing mask, and calculate the surface edge ratio corresponding to the optimized smoothing mask. Pineapple Eye Dark Pixel Ratio The Gaussian parameter is adjusted only once, and the Gaussian filtering process will not be repeated after this step is completed.

[0038] Step S2.4: Perform morphological closing and dilation operations sequentially on the optimized smooth mask to obtain the dilated mask; For example, the initial parameters of morphological dilation in step S2.4 include the size of the elliptical structuring element, the closing kernel, and the dilation kernel; the size of the closing kernel is calculated from the length W and width H of the pineapple image, the size of the initial dilation kernel is the size of the closing kernel + 2, and the initial dilation iteration number is 1; the morphological operation first fills the small holes inside the segmentation mask through the closing operation to ensure the integrity of the pineapple body, and then expands the mask boundary outward through the dilation operation so that the mask contains more information about the pineapple spherical edge.

[0039] Step S2.5: Calculate the surface edge ratio Re corresponding to the expanded mask, and adjust the size of the morphological expansion closing kernel and expansion kernel based on the surface edge ratio Re. Step S2.6: Based on the adjusted size of the closing kernel and the dilation kernel of the morphological dilation, re-execute the closing and dilation operations to update and obtain the final pineapple region mask.

[0040] For example, in this embodiment, the parameter linkage adjustment process of Gaussian filtering and morphological dilation is as follows: 1) Preset the high distortion threshold to 0.18 and the low distortion threshold to 0.06; 2) When When the value is greater than 0.18, the number of morphological dilation iterations is set to 3, the overall size of the dilation kernel is increased by 4, and the standard deviation σ of the Gaussian filter is reduced from 1.5 to 0.8. In this embodiment, A value greater than 0.18 indicates severe distortion at the edge of the pineapple sphere and numerous missing pineapple eyes at the edge. The above adjustments widen the mask coverage area to completely cover the distorted edge area and prevent the pineapple eyes at the edge from being truncated by the mask.

[0041] 3) When When <0.06, the number of morphological dilation iterations is set to 0, the overall size of the dilation kernel is reduced by 2, and the standard deviation of the Gaussian filter σ is increased to 2.2; In this embodiment, <0.06 indicates that the pineapple was photographed from the front with minimal surface distortion. By adjusting the above parameters, the mask boundary was simplified, and irrelevant fruit peel background was reduced from being included in the processing area.

[0042] 4) When 0.06≤ When the value is ≤0.18, the initial parameters of morphological dilation and Gaussian filtering are kept unchanged; In this embodiment, the initial parameter values ​​in this range are adapted to the current image distortion level, without the need to adjust the Gaussian and morphological operation parameters.

[0043] S3, using pineapple region mask As the operating area, each original pineapple image is sequentially subjected to adaptive morphological transformation, gamma correction, and local contrast enhancement using a non-sharpened mask to obtain an enhanced pineapple image set. Specifically, step S3 includes: Step S3.1: Perform adaptive morphological transformation on the original pineapple image: 1) Using pineapple region mask As the operating region, an adaptive morphological transformation is performed on the original pineapple image to obtain an intermediate image with enhanced features; For example, in this embodiment, the process of adaptive morphological transformation is as follows: 1) By performing RGB channel separation on the original pineapple image, an original pineapple image containing three channels, Red, Green, and Blue, is obtained; 2) Perform top-hat transform and bottom-hat transform on the original pineapple images of the three channels respectively to obtain feature-enhanced images of each channel. Then merge the channels to obtain the intermediate image with enhanced features. Step S3.2: Calculate the proportion of dark pixels in the pineapple eye corresponding to the intermediate image, and adjust the parameters of the structural element of the adaptive morphological transformation based on the proportion of dark pixels in the pineapple eye. For example, the parameter adjustment process for a structuring element is as follows: 1) Set the structuring element of the adaptive morphological transformation to an elliptical kernel with an initial size of 15×15; 2) Set the pineapple eye density threshold pineapple eye sparsity threshold ; 3) When At that time, the size of the elliptical kernel was set to 21×21; In this embodiment, Characterizing dense, sunken, and dark pineapple eyes, the size of the elliptical kernel is enlarged to enhance the extraction of dark pineapple eye features by the bottom cap transformation, thereby increasing the dark feature gain of the "original image + bottom cap - top cap" image.

[0044] 4) When At that time, the size of the elliptical core was set to 9×9; In this embodiment, Characterized by smooth peel, sparse pineapple eyes, and numerous highlight spots, the weight of the top-hat operation is reduced by shrinking the elliptical kernel, thus suppressing noise interference from the highlight texture of the peel.

[0045] 5) When Choose the initial size for the elliptical core. In this embodiment, The initial size is characterized as a suitable value, and this value is applied to... The adaptive morphological transformation performed on the pineapple images within the region can effectively suppress the bright features of the peel and enhance the dark features of the pineapple eyes.

[0046] Step S3.3: Based on the adjusted structuring element size, update the intermediate image and calculate the proportion of dark pixels in the pineapple eye corresponding to the current intermediate image; Step S3.4: Perform gamma correction on the updated intermediate image to obtain the corrected image; For example, the gamma correction process includes: 1) Calculate the average gray value of the intermediate image. ,when When setting the gamma value ,when When, set ; 2) Normalize the grayscale values ​​(0-255) of the intermediate image to [0,1]; 3) Construct a gamma correction lookup table. Using the gamma values ​​from step 3.31), calculate the correction values ​​for 256 gray levels. The calculation formula is as follows:

[0047]

[0048] In the formula, Grayscale value For rounding operation, Original grayscale The corresponding corrected pixel values; 4) Replace the pixel values ​​of the intermediate image with the correction values ​​from step 3) to obtain the corrected image.

[0049] In this embodiment, gamma correction is used. Set the gamma value for the dark areas. Then, by looking up a table and updating the calibration values, the pixel grayscale values ​​in the dark areas are increased, thereby brightening the originally dark and blackish pineapple eye. Set the gamma value in the bright areas. By updating the calibration value through a lookup table, the pixel grayscale value of the bright area (peel) is reduced, thereby suppressing the brightness of the bright area. By correcting the brightness of the intermediate image, the difference in brightness between the pineapple spherical peel is balanced, the concave pineapple eyes are brightened, the recognition of the pineapple eyes is improved, and the missed detection is reduced.

[0050] Step S3.5: Calculate the proportion of dark pixels corresponding to the pineapple eye in the corrected image. And the global brightness deviation ΔL, and based on the proportion of dark pixels in the pineapple eye. and global brightness deviation Adjust the gamma value of the gamma correction. ; For example, the adjustment process for gamma correction includes: 1) Set the underexposure threshold and overexposure threshold In this embodiment, Take 100, Take 200; 2) When and At that time, lower This brightens the dark areas of the pineapple-eye effect; 3) When and At that time, adjust This allows for the suppression of the grayscale of the bright areas of the peel, preventing overexposure of the peel from obscuring the small pineapple eyes.

[0051] In this embodiment, The step value is 0.2.

[0052] Step S3.6, based on the adjusted gamma value Update and correct the image; Step S3.7: Perform unsharpened mask local contrast enhancement on the updated corrected image to obtain the enhanced pineapple image; For example, the process for creating an unsharpened mask includes: 1) Apply Gaussian blur to the corrected image to obtain a Gaussian blurred image; For example, the kernel size of the Gaussian blur is (5,5) and the standard deviation is σ=1.0 (extracting low-frequency components and preserving high-frequency details). The Gaussian blur map represents the low-frequency components in the corrected image, namely the flat, textureless areas of the peel.

[0053] 2) Extract the high-frequency detail layer from the corrected image based on the Gaussian blur map; In this embodiment, the pineapple eye texture detail is a high-frequency detail, and the high-frequency detail layer = corrected image - Gaussian blur map.

[0054] 3) The high-frequency detail layer is superimposed on the corrected image to obtain the enhanced pineapple image.

[0055] In this embodiment, the enhanced pineapple image = corrected image + 0.5 high-frequency detail layer, where 0.5 is the detail enhancement coefficient. By adding the enhanced high-frequency detail layer back to the corrected image, the edge of the pineapple eye is enhanced, highlighting the texture and improving visual sharpness.

[0056] Step S3.8: Calculate the proportion of dark pixels in the pineapple eye and the proportion of curved edges corresponding to the enhanced pineapple image, and adjust the gain of the unsharpened mask based on the proportion of dark pixels in the pineapple eye and the proportion of curved edges. The process for adjusting the detail enhancement factor is as follows: 1) Set a high distortion threshold Pineapple eye density threshold ; 2) When At that time, the detail enhancement factor was increased to 0.8; In this embodiment, This method characterizes the current image as having severe spherical edge distortion and incomplete pineapple eyes. By increasing the detail enhancement coefficient, the edge contour of the incomplete pineapple eyes is strengthened, thus avoiding missed detection of edge pineapple eyes.

[0057] 3) When At that time, the detail enhancement factor was reduced to 0.2; In this embodiment, The image shows a dense concentration of dark pineapple eyes. By lowering the detail enhancement coefficient, we can prevent the appearance of ring-shaped over-enhancement artifacts at the edges of the pineapple eyes and avoid subsequent misjudgments.

[0058] 4) When and At that time, the detail enhancement factor takes the default value.

[0059] Step S3.9: Based on the adjusted unsharpened mask gain, update the enhanced pineapple image and calculate the surface edge ratio, dark pixel ratio of the pineapple eye, and global brightness deviation of the corresponding current enhanced pineapple image.

[0060] Step S4: Use the brightness data of the original pineapple images in the original pineapple image set and the corresponding enhanced pineapple images in the enhanced pineapple image set to perform brightness compensation, and obtain the enhanced pineapple image set after brightness restoration; Specifically, in this embodiment, step S4 includes: Step S4.1: Based on the original pineapple image set and the enhanced pineapple image set, construct an image list, traverse the image list, perform a validity check and update each image in the image list, and obtain a valid image list; For example, in this embodiment, the image attributes examined include the image size and mask region of the original pineapple image and the corresponding enhanced pineapple image. Whether they are consistent, including whether the pixel storage type of the original pineapple image and the corresponding enhanced pineapple image is unsigned integer, images that do not meet the requirements are discarded. By recording the number of original pineapple images and corresponding enhanced pineapple images that are correct in both image attributes and data type, the information of the printed image includes the image height × width × number of channels.

[0061] Step S4.2: Perform global brightness analysis on the valid images in the valid image list to obtain the global average brightness value of all valid images and the brightness value of each valid image; In this embodiment, each valid image is converted to a grayscale image, and then the average brightness is calculated. The relevant calculation formula is as follows:

[0062]

[0063] In the formula, The average brightness of the original pineapple image. To enhance the average brightness of the pineapple image, To correspond to the global average brightness of the original pineapple image and the enhanced pineapple image, To calculate the average, and The grayscale values ​​are those of the original pineapple image and the enhanced pineapple image, respectively. For area mask.

[0064] Step S4.3: Set up a brightness-aware fusion processor. Based on the global average brightness, use the brightness-aware fusion processor to perform brightness compensation on each enhanced pineapple image in the effective image list. For example, the process of performing brightness compensation on an enhanced pineapple image includes: 1) Define the BrightnessAwareFusion fusion class and initialize the target brightness of the fusion class to [value missing]. ; 2) Convert the enhanced pineapple image and the original pineapple image to YUV space, and perform brightness compensation on the enhanced pineapple image in YUV space; For example, the brightness compensation process for an enhanced pineapple image is as follows: 1) Separate the original pineapple image and the enhanced pineapple image corresponding to the original pineapple image from the list of valid images in the YUV space to obtain the valid original pineapple image and the valid enhanced pineapple image in the YUV channel; 2) The enhanced pineapple image from the YUV channels and the original pineapple image are fused and merged to obtain a brightness-compensated enhanced pineapple image. The relevant fusion calculation formula is as follows:

[0065]

[0066] In the formula, These are the pixel values ​​of the fused image for the Y, U, and V channels, respectively. These are the grayscale values ​​in the Y channel of the original pineapple image and the enhanced pineapple image, respectively. These are the weighted values ​​of the Y-channel fusion of the original pineapple image and the enhanced pineapple image, respectively. These are the grayscale values ​​of the U channel for the original pineapple image and the enhanced pineapple image, respectively. The values ​​are the grayscale values ​​of the original pineapple image and the enhanced pineapple image in the V channel, respectively.

[0067] In one embodiment, the formula for calculating the fusion weighting value of the Y channel is:

[0068]

[0069] In the formula, It is the variance function. For Laplace filtering, The brightness value of the original pineapple image. To enhance the brightness of the pineapple image, This is the brightness deviation coefficient. This represents the percentage of dark pixels in the pineapple eye effect.

[0070] In one embodiment, the global brightness deviation of the enhanced pineapple image after brightness compensation and the proportion of dark pixels in the pineapple eye are calculated to adjust... and To achieve a balance between color fidelity and enhanced pineapple-eye effect, the adjustment process is as follows: when and When, then the corresponding reduction and To enhance image weights in underexposed scenes ; when and When that happens, the corresponding increase will be made. and To enhance the weight of the original image in overexposed scenes. .

[0071] Step S4.4: Evaluate each enhanced pineapple image after brightness compensation and output a set of enhanced pineapple images after brightness restoration.

[0072] For example, step S4.4 includes: 1) Calculate the adaptive brightness restoration judgment threshold, the formula is:

[0073]

[0074] In the formula, The threshold for adaptive brightness repair is set. The global average brightness The preset adjustment coefficient, In this embodiment, the proportion of dark pixels in the pineapple eye is calculated as the enhanced pineapple image after brightness compensation. Take 12.

[0075] It should be noted that in this embodiment, the higher the proportion of pineapple eye, the lower the repair judgment threshold, and the dark pineapple eye image automatically triggers LAB brightness stretching; 2) If the brightness value of the enhanced pineapple image after brightness compensation is less than the repair judgment threshold. If the output is positive, then brightness restoration is performed on the enhanced pineapple image after brightness compensation; otherwise, the enhanced pineapple image after brightness compensation is used as the output to obtain the enhanced pineapple image after brightness restoration. In this embodiment, the higher the proportion of the pineapple eye (Rb) in the image, the lower the adaptive threshold value. Dark pineapple eye images will automatically trigger brightness stretching to solve the underexposure problem in the dark pineapple eye area. In this case, brightness repair is performed on the brightness-compensated enhanced pineapple image; otherwise, the brightness-compensated enhanced pineapple image is used as the output to obtain the brightness-repaired enhanced pineapple image. For example, in this embodiment, if the brightness value of the enhanced pineapple image after brightness compensation is less than the repair determination threshold... If the LAB channel brightness stretching repair is successful, then the brightness-compensated image will be output directly.

[0076] In one embodiment, the process of luminance stretching repair in the LAB channel includes: 1) Convert the brightness-compensated enhanced pineapple image and its corresponding original pineapple image into LAB format; 2) Calculate the minimum value of the L channel of the enhanced pineapple image after brightness compensation. The maximum value of the L channel of the original pineapple image ; 3) If Then, the L channel is stretched to 0-100 times the L channel range of LAB, and the original result is mixed with the stretched result. The relevant calculation formula is:

[0077]

[0078] in, This is the stretch value. The original value; like Use the original L channel value directly; 4) Merge the enhanced LAB channels and convert them back to the BGR color space to return the repaired image. The merging formula is as follows:

[0079] .

[0080] Step S4.5: Calculate the proportion of curved edges, the proportion of dark pixels in the pineapple eye, and the global brightness deviation for each enhanced pineapple image in the enhanced pineapple image set after brightness restoration.

[0081] In this embodiment, the proportion of curved edges, the proportion of dark pixels in the pineapple eye, and the global brightness deviation of each enhanced pineapple image in the enhanced pineapple image set after brightness restoration are calculated and updated, and the updated proportion of curved edges, the proportion of dark pixels in the pineapple eye, and the global brightness deviation are synchronized to step S5 for linkage.

[0082] Step S5: Perform edge sharpening, noise reduction, and saturation enhancement operations sequentially on the enhanced pineapple image set after brightness restoration to obtain the preprocessed pineapple image set.

[0083] In this embodiment, firstly, the luminance-restored pineapple images in the enhanced pineapple image set are convolutionally sharpened using a sharpening convolution kernel to enhance the high-frequency components in the images, thereby improving the edge clarity of the luminance-restored pineapple images; then, bilateral filtering is performed on the masked region of the luminance-restored pineapple images to smoothly filter out minor noise and spots on the peel; finally, the luminance-restored pineapple images are converted to the HSV (H: Hue, S: Saturation, V: Lightness) color space, the HSV channels are separated, and then the saturation (S) channel image is enhanced to obtain the preprocessed pineapple image set.

[0084] For example, step S5 includes: Step S5.1, based on the calculated surface edge proportion Pineapple eye dark pixel ratio and global brightness deviation Adjust the sharpening convolution kernel size for edge sharpening, the filter diameter for bilateral filtering denoising, and the enhancement coefficient for saturation enhancement; For example, the initial parameters of the sharpening convolution kernel are: the weight at the center of the kernel is positive (2.0), the weight around the edges is negative (-0.25), the total sum of kernel elements is 1.0, and the average brightness of the image remains unchanged; the initial parameters of the bilateral filter are: the filter diameter d=5, the color space standard deviation sigmaColor=75, and the coordinate space standard deviation sigmaSpace=75; the initial parameters of the saturation enhancement are: the enhancement coefficient alpha = 1.2.

[0085] For example, the method for adjusting the size of the sharpening convolution kernel for edge sharpening is as follows: 1) When At the same time, increase the weight of the sharpening convolution kernel to enhance the sharpening intensity of underexposed images and fill in the blurring of dark edges; It should be noted that when This indicates that the current image is underexposed, and the blurring of dark edges is compensated by increasing the weight of the sharpening convolution kernel.

[0086] 2) When When the image is overexposed, the sharpening kernel weights are reduced to decrease the sharpening intensity and avoid jagged noise in the highlights.

[0087] It should be noted that when This indicates that the current image is overexposed. By reducing the sharpening intensity, jagged noise is avoided from the highlights of the fruit peel.

[0088] The method for adjusting the filter diameter in bilateral filtering denoising is as follows: 1) When To achieve the filtering of minute noise from the fruit peel, the filter diameter of the bilateral filter is increased. It should be noted that when This characterizes the edge distortion and numerous small spots in the current image, through... Increase the spatial kernel of the bilateral filter to filter out minute noise in the fruit peel.

[0089] 2) When In this case, the filter diameter of the bilateral filter is reduced to preserve the details of the pineapple eye depression without smoothing it out.

[0090] It should be noted that when This characterizes the dense dark pineapple eye effect, and by reducing the filter kernel, the recessed details of the pineapple eye are preserved without being smoothed.

[0091] The method for adjusting the enhancement coefficient of saturation enhancement is as follows: 1) When At the same time, the enhancement coefficient is increased to enhance the saturation of the pineapple image and restore the color distinction between the pineapple eye and the peel; It should be noted that when At the same time, the HSV saturation channel gain is increased by increasing the enhancement coefficient to restore the color distinction between the pineapple eye and the peel.

[0092] 2) When At the same time, the enhancement coefficient is reduced to decrease the saturation of the pineapple image and suppress the color noise of the yellow spots on the peel.

[0093] It should be noted that when By reducing saturation, color noise in the yellow spots of the fruit peel can be suppressed.

[0094] In another embodiment, the method proposed in this invention further includes: Construct a pineapple image training set, and use the pineapple image training set to perform the contents of steps S2-S5 to obtain a preprocessed pineapple image set corresponding to the pineapple image training set. Based on the results of the preprocessed pineapple image set, train the configuration parameters in steps S2-S5.

[0095] For example, by collecting pineapple eye images from different angles under different lighting conditions and different varieties of pineapples, rotating 360° at 15° intervals, and manually annotating the pineapple eyes, performing offline transformation and normalization processing on the pineapple images, and extracting basic grayscale, gradient, color distribution statistics and other features of the images, a pineapple image training set is formed.

[0096] For example, by using the labeled content of the pineapple image training set and the preprocessed pineapple image set, with the false negative rate, false positive rate and recognition confidence as loss values, and with the optimization objective of maximizing the comprehensive detection rate of pineapple eyes, the steps S2-S5 are iterated in reverse, and the parameters in steps S2-S5 are adjusted.

[0097] A pineapple image preprocessing system based on feature enhancement and multi-strategy fusion includes a test unit and a training unit, wherein the test unit and the training unit are interactively connected. The test unit includes a first input module, a first calculation module, a first linkage feature quantity distribution module, and a first output module; In this embodiment, the first input module is used to store the original pineapple image set in step S1, the first operation module is used to execute the steps in steps S2 to S5, the first linkage feature quantity distribution module is used to store the three types of global linkage features in step S1, and interacts with the first operation module in real time to update the three types of global linkage features in steps S2 to S5, and the first output module is used to output the preprocessed pineapple image set. In this embodiment, the first calculation module reads the data from the first input module and the first linkage feature quantity sending module, and sequentially executes the method described in this invention on the original pineapple image to obtain a preprocessed pineapple image set, which is then sent to the first output module for display.

[0098] The training unit includes a second input module, a second operation module, a second linkage feature quantity distribution module, and a second output module.

[0099] In this embodiment, the second input module is used to store the pineapple image training set, the second operation module is used to execute the steps in steps S2 to S5, the second linkage feature quantity distribution module is used to store the three types of global linkage features in step S1, and interacts with the second operation module in real time to update the three types of global linkage features in steps S2 to S5, and the second output module is used to output the preprocessed pineapple image set and synchronize the configuration parameters of the second operation module to the first operation module for use by the first operation module.

[0100] In this embodiment, both the testing unit and the training unit are program modules composed of computer programs.

[0101] To verify the technical effect achieved by the method described in this invention, the preprocessed pineapple image obtained by the method described in this invention was compared with the pineapple eye effect detected by the same Canny edge detection algorithm and the pineapple eye effect detected by the background technology method. The comparison results are as follows: Figure 2 and Figure 3 As shown, where, Figure 2 and Figure 3 The left image shows the pineapple eye effect detected using the method described in the background technique, and the right image shows the pineapple eye effect detected using the method described in this invention. Figure 2 As can be seen, the confidence scores for identifying the pineapple eye at the edge and the two pineapple eyes with indistinct features in the left image are 0.56 and 0.28, respectively. After optimization using the method described in this invention, their confidence scores are significantly improved to 0.82 and 0.68. Figure 3 As can be seen, the method described in the background on the left misses four pineapple eyes on the edge of the pineapple, while the method described in this invention is able to identify these four missed pineapple eyes.

[0102] The foregoing description of specific exemplary embodiments of the invention is for illustrative and explanatory purposes. These descriptions are not intended to limit the invention to the precise forms disclosed, and it will be apparent that many changes and variations can be made in accordance with the foregoing teachings. The exemplary embodiments were chosen and described in order to explain the specific principles of the invention and its practical application, thereby enabling those skilled in the art to implement and utilize various different exemplary embodiments of the invention, as well as various different choices and variations. The scope of the invention is intended to be defined by the claims and their equivalents.

Claims

1. A pineapple image preprocessing method based on feature enhancement and multi-strategy fusion, characterized in that, Includes the following steps: S1. Collect original pineapple images from different angles, construct an original pineapple image set, and define three types of global linkage features, including the proportion of curved edges, the proportion of dark pixels in the pineapple eye, and the global brightness deviation. S2. Input the original pineapple image set into the YOLOv11-seg segmentation model to obtain the segmentation mask corresponding to each original pineapple image, and perform Gaussian filtering and morphological dilation operations on the segmentation mask in sequence to obtain the pineapple region mask corresponding to each original pineapple image. S3. Using the pineapple region mask as the operation area, perform adaptive morphological transformation, gamma correction processing, and unsharpened mask local contrast enhancement processing on each original pineapple image in sequence to obtain an enhanced pineapple image set; S4. Using the brightness data of the original pineapple images in the original pineapple image set and the corresponding enhanced pineapple images in the enhanced pineapple image set, brightness compensation is performed to obtain the enhanced pineapple image set after brightness restoration. S5. Perform edge sharpening, noise reduction, and saturation enhancement operations sequentially on the enhanced pineapple image set after brightness restoration to obtain a preprocessed pineapple image set.

2. The method according to claim 1, wherein step S2 comprises: Perform Gaussian filtering on the segmentation mask to obtain a smooth mask; Calculate the surface edge ratio corresponding to the smoothing mask, and adjust the Gaussian kernel size and standard deviation of the Gaussian filter based on the surface edge ratio; update the smoothing mask based on the adjusted Gaussian filter parameters; A morphological dilation operation is performed on the updated smooth mask to obtain the dilated segmentation mask; the surface edge ratio corresponding to the dilated segmentation mask is calculated, and the size of the morphological dilation closing kernel and the dilation kernel is adjusted based on the surface edge ratio; the dilated segmentation mask is updated based on the adjusted morphological dilation kernel size to obtain the pineapple region mask of the original pineapple image, and the surface edge ratio and the dark pixel ratio of the pineapple eye corresponding to the current pineapple region mask are calculated.

3. The method according to claim 2, characterized in that, Step S3 includes: An adaptive morphological transformation is performed on the updated pineapple region mask to obtain a feature-enhanced intermediate image; the proportion of dark pixels in the pineapple eye corresponding to the intermediate image is calculated, and the size of the structuring element of the adaptive morphological transformation is adjusted based on the proportion of dark pixels in the pineapple eye; the intermediate image is updated based on the adjusted structuring element size, and the proportion of dark pixels in the pineapple eye corresponding to the current intermediate image is calculated. Perform gamma correction on the updated intermediate image to obtain the corrected image; calculate the proportion of dark pixels in the pineapple eye and the global brightness deviation corresponding to the corrected image, and adjust the gamma value of the gamma correction based on the proportion of dark pixels in the pineapple eye and the global brightness deviation; update the corrected image based on the adjusted gamma value. The updated corrected image is subjected to local contrast enhancement using an unsharpened mask to obtain an enhanced pineapple image. The proportion of dark pixels in the pineapple eye and the proportion of curved edges corresponding to the enhanced pineapple image are calculated, and the gain of the unsharpened mask is adjusted based on the proportion of dark pixels in the pineapple eye and the proportion of curved edges. Based on the adjusted unsharpened mask gain, the enhanced pineapple image is updated, and the proportion of curved edges, the proportion of dark pixels in the pineapple eye, and the global brightness deviation corresponding to the current enhanced pineapple image are calculated.

4. The method according to claim 3, wherein step S4 comprises: Based on the original pineapple image set and the enhanced pineapple image set, an image list is constructed, and the image list is traversed to perform a validity check and update on each image in the image list to obtain a valid image list; A global brightness analysis is performed on the valid images in the list of valid images to obtain the global average brightness value of all valid images and the brightness value of each valid image; A brightness-aware fusion processor is configured to perform brightness compensation on each enhanced pineapple image in the effective image list based on the average brightness and the global average brightness. Each enhanced pineapple image after brightness compensation is evaluated, and a set of enhanced pineapple images after brightness restoration is output.

5. The method according to claim 4, characterized in that, The method for brightness compensation of the enhanced pineapple image includes: In the YUV space, separate the original pineapple image from the list of valid images and the enhanced pineapple image corresponding to the original pineapple image to obtain the valid original pineapple image and the valid enhanced pineapple image in the YUV channel; The enhanced pineapple image and the original pineapple image in the YUV channels are fused and merged to obtain a brightness-compensated enhanced pineapple image. The relevant fusion calculation formula is as follows: In the formula, These are the pixel values ​​of the fused image for the Y, U, and V channels, respectively. These are the grayscale values ​​in the Y channel of the original pineapple image and the enhanced pineapple image, respectively. These are the weighted values ​​of the Y-channel fusion of the original pineapple image and the enhanced pineapple image, respectively. These are the grayscale values ​​of the U channel for the original pineapple image and the enhanced pineapple image, respectively. The values ​​are the grayscale values ​​of the original pineapple image and the enhanced pineapple image in the V channel, respectively.

6. The method according to claim 4, characterized in that, The method for evaluating the enhanced pineapple image is as follows: calculate the adaptive brightness repair judgment threshold; if the brightness value of the enhanced pineapple image after brightness compensation is less than the repair judgment threshold, then perform brightness repair on the enhanced pineapple image after brightness compensation; otherwise, take the enhanced pineapple image after brightness compensation as the output to obtain the enhanced pineapple image after brightness repair. The formula for calculating the adaptive brightness restoration threshold is: In the formula, The threshold for adaptive brightness repair is set. The global average brightness The preset adjustment coefficient, The percentage of dark pixels in the pineapple eye of the enhanced pineapple image after brightness compensation.

7. The method according to claim 4, characterized in that, The formula for calculating the fusion weighted value of the Y channel is as follows: In the formula, It is the variance function. For Laplace filtering, The brightness value of the original pineapple image. To enhance the brightness of the pineapple image, This is the brightness deviation coefficient. This is the surface edge proportion coefficient.

8. The method according to claim 1, characterized in that, Step S5 includes: Calculate the percentage of curved edges, the percentage of dark pixels in the pineapple eye, and the global brightness deviation for each enhanced pineapple image in the brightness-restored enhanced pineapple image set; Based on the calculated proportion of curved edges, proportion of dark pixels in the pineapple eye, and global brightness deviation, the sharpening convolution kernel size for edge sharpening, the filtering diameter for bilateral filtering denoising, and the enhancement coefficient for saturation enhancement are set.

9. The method according to claim 1, characterized in that, It also includes constructing a pineapple image training set, and using the pineapple image training set to perform the contents of steps S2-S5 to obtain a preprocessed pineapple image set corresponding to the pineapple image training set. Based on the results of the preprocessed pineapple image set, the configuration parameters in steps S2-S5 are trained.

10. A pineapple image preprocessing system based on feature enhancement and multi-strategy fusion, used to implement the method according to any one of claims 1 to 9, characterized in that, include: A testing unit and a training unit, wherein the testing unit and the training unit are interactively connected; The test unit includes a first input module, a first calculation module, a first linkage feature quantity distribution module, and a first output module; The first input module is used to store the original pineapple image set in step S1, the first calculation module is used to execute the steps in steps S2 to S5, the first linkage feature quantity distribution module is used to store the three types of global linkage features in step S1, and interact with the first calculation module in real time to update the three types of global linkage features in steps S2 to S5, and the first output module is used to output the preprocessed pineapple image set. The training unit includes a second input module, a second operation module, a second linkage feature quantity distribution module, and a second output module; The second input module is used to store the pineapple image training set, the second operation module is used to execute the steps in steps S2 to S5, the second linkage feature quantity distribution module is used to store the three types of global linkage features in step S1, and interacts with the second operation module in real time to update the three types of global linkage features in steps S2 to S5, and the second output module is used to output the preprocessed pineapple image set and synchronize the configuration parameters of the second operation module to the first operation module.