An improved YOLOV8 method for multi-pose target recognition and positioning of chili pepper
By calculating the reflective intensity attenuation index and surface reflection distribution coefficient, combining image preprocessing and morphological processing, dynamically adjusting the recognition box, the problem of reflection interference of water droplets on the surface of the pyroxima fruit is solved, the recognition and positioning accuracy is improved, and the system is enhanced Awesome and adaptability.
Patent Information
- Application Number
- CN202411290760.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-09-14
AI Technical Summary
The existing multi-pose target recognition and positioning technology of the fruit is difficult to distinguish the true color and texture of the fruit in the case of reflection caused by water droplets on the surface of the fruit after heavy rain, resulting in misalignment or deformation of the recognition frame, affecting the recognition and positioning accuracy.
By detecting the water droplets on the surface of the fruit in real time, calculate the reflective intensity attenuation index and surface reflection distribution coefficient, predict the impact of the water droplets on recognition accuracy, and perform image preprocessing, graying, edge detection and morphological processing, dynamically adjust the position of the recognition box and Shape, eliminate reflective interference and ensure recognition accuracy.
It improves the system's robustness and recognition accuracy under complex lighting conditions, avoids unnecessary image processing operations, saves computing resources, optimizes the recognition process, and ensures the stability of the recognition results and the reliability of automated operations.
Smart Images

Figure CN118823588B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of multi-pose target recognition and positioning of chili pepper, and in particular to a multi-pose target recognition and positioning method of chili pepper based on an improved YOLOV8. Background Art
[0002] Multi-pose target recognition and positioning of chili peppers refers to the accurate recognition and spatial position determination of chili peppers at different angles, orientations, and postures. Since chili peppers can present various irregular postures (such as bending, rotation, partial occlusion, etc.) in their natural growth environment, traditional target recognition algorithms are prone to false detection and missed detection when faced with these changes. Therefore, improving the algorithm's recognition and positioning capabilities for multi-pose chili peppers can effectively improve recognition accuracy and robustness in complex scenarios, thereby providing more reliable data support for applications such as agricultural automated harvesting and yield estimation.
[0003] An existing multi-pose target recognition and positioning technology for chili peppers based on improved YOLOV8 is specifically used for recognition and positioning in the following ways: First, in view of the diversity of chili peppers in different poses, data enhancement techniques such as rotation, flipping, random occlusion, etc. are used to generate more variable training samples and enhance the robustness of the model. Then, the feature extraction network is optimized on the basis of YOLOV8, and a multi-scale feature fusion mechanism is introduced to better capture the significant features of chili peppers in complex backgrounds and at different scales. At the same time, the algorithm is adjusted in the detection head, and deep information is extracted through multi-layer convolution to improve the recognition ability of small targets and partially occluded targets. In terms of positioning, the position and angle of chili peppers are accurately regressed through an optimized regression algorithm, and high-precision positioning is achieved by combining spatial information. The overall technical solution significantly improves the recognition accuracy and positioning effect of chili peppers in different poses while maintaining real-time performance.
[0004] The prior art has the following deficiencies:
[0005] After a heavy rain, a large number of water droplets adhere to the surface of the chili pepper fruit. Under the sunlight, these water droplets will produce strong reflections. Since the reflective area overlaps with the normal features of the fruit surface, it is difficult for the existing technology to effectively distinguish the true color and texture of the fruit, which will cause the target recognition frame to be misplaced or deformed. Especially in automated picking or spraying operations, the reflective area is easily misidentified as part of the fruit or the fruit boundary cannot be accurately identified. The existing technology cannot effectively correct the reflective interference in this special case, resulting in a decrease in recognition and positioning accuracy, which ultimately affects the reliability and operating efficiency of the overall system.
[0006] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention
[0007] The purpose of the present invention is to provide a multi-pose target recognition and positioning method of chili pepper based on an improved YOLOV8 to solve the problems in the above-mentioned background technology.
[0008] In order to achieve the above object, the present invention provides the following technical solution: a method for multi-pose target recognition and positioning of chili pepper based on improved YOLOV8, which specifically includes the following steps:
[0009] Before performing target recognition, whether water droplets are attached to the surface of the chili pepper fruit is detected in real time, and when water droplets are detected to be attached to the surface of the chili pepper fruit, the following steps are continued;
[0010] Obtain the reflection information of water droplets attached to the surface of the chili pepper fruit, and analyze it after acquisition to predict whether the water droplets attached to the surface of the fruit will affect the target recognition accuracy;
[0011] Under the condition that it is predicted that water droplets attached to the surface of the fruit will affect the target recognition accuracy, the image data of the chili pepper fruit is obtained, and the image data is analyzed after acquisition to identify the real fruit boundary and eliminate the reflection interference;
[0012] According to the recognition results, the position and shape of the target recognition frame are dynamically adjusted to output the final positioning information.
[0013] Preferably, obtaining the reflection information of water droplets attached to the surface of the chili pepper fruit, and analyzing it after obtaining it, to predict whether the water droplets attached to the surface of the fruit will affect the target recognition accuracy, specifically includes the following steps:
[0014] Obtain the reflection information of water droplets attached to the surface of the chili pepper fruit, and perform preprocessing after obtaining;
[0015] Extracting pixel brightness data within the reflective area, distance data between the pixel position and the center of the fruit, and angle data of the incident light and the reflected light from the preprocessed reflective information, and analyzing them after extraction to generate a reflective intensity attenuation index and a surface reflectance distribution coefficient, respectively;
[0016] The generated reflection intensity attenuation index and surface reflection distribution coefficient are used to construct an impact prediction model to generate an impact coefficient. The generated impact coefficient is compared with the pre-set impact coefficient threshold. Based on the comparison results, it is predicted whether the water droplets attached to the fruit surface will affect the target recognition accuracy.
[0017] Preferably, the acquisition logic of the reflection intensity attenuation index is as follows:
[0018] Extract the pixel brightness data in the reflective area from the preprocessed reflective information, including the actual brightness of each pixel in the reflective area, and calibrate the actual brightness of each pixel in the reflective area as , Indicates the first The actual brightness of each pixel, , is a positive integer;
[0019] Extract the distance data between the pixel position and the fruit center in the preprocessed reflective information, including the distance from each pixel point in the reflective area to the fruit center, and calibrate the distance from each pixel point in the reflective area to the fruit center as , Indicates the first The distance from the pixel to the center of the fruit;
[0020] According to the reflective area The distance from the pixel to the center of the fruit , applying an exponential decay function For The actual brightness of the pixel Perform weighted processing, where It is a preset attenuation coefficient, which is used to control the attenuation degree of light intensity with distance;
[0021] Calculate the reflection intensity attenuation index. The specific calculation formula is as follows:
[0022] In the formula, is the reflection intensity attenuation exponent.
[0023] Preferably, the acquisition logic of the surface reflection distribution coefficient is as follows:
[0024] The angle data of incident light and reflected light in the preprocessed reflective information are extracted, including the actual angle of the incident light, the actual angle of the reflected light, and the actual angle between the incident light and the fruit surface. The actual angle of the incident light, the actual angle of the reflected light, and the actual angle between the incident light and the fruit surface are calibrated as , and , represents the actual angle of the incident light, represents the actual angle of reflected light, It represents the actual angle between the incident light and the fruit surface, and defines the integral range of the incident light direction as , ,in is the azimuth of the light on the horizontal plane;
[0025] The bidirectional reflection function BRDF model is used to calculate the reflection intensity in each reflection direction. The expression of BRDF is: , used to describe the relationship between incident light and reflected light at different angles;
[0026] Calculate the surface reflection distribution coefficient. The specific calculation formula is as follows:
[0027] In the formula, is the surface reflection distribution coefficient.
[0028] Preferably, the generated reflection intensity attenuation index and the surface reflection distribution coefficient Construct an impact prediction model and generate impact coefficients through weighted summation , and the generated influence coefficient The influence coefficient threshold is set in advance Compare and predict whether the water droplets attached to the fruit surface will affect the target recognition accuracy based on the comparison results. The specific comparison analysis is as follows:
[0029] like ,Water droplets attached to the surface of the fruit will not affect the target recognition accuracy;
[0030] like ,Water droplets attached to the surface of the fruit will affect the target recognition accuracy.
[0031] Preferably, when it is predicted that water droplets attached to the surface of the fruit will affect the target recognition accuracy, the image data of the chili pepper fruit is obtained, and after the acquisition, the image data is analyzed to identify the real fruit boundary and eliminate the reflection interference, which specifically includes the following steps:
[0032] Under the assumption that water droplets attached to the fruit surface will affect the target recognition accuracy, image data of chili pepper fruit under different lighting conditions and multiple postures are obtained;
[0033] Preprocess the image data of the pepper fruit under different lighting conditions and multiple postures;
[0034] Grayscale the preprocessed image data to convert the color image into a grayscale image;
[0035] Process the grayscale image, extract the edge of the fruit, and generate a preliminary fruit boundary outline;
[0036] Segmenting the fruit area from the background and the reflective area in the image, specifically including setting a dynamic threshold and classifying the image to distinguish the fruit area from other interference areas;
[0037] Perform morphological processing on the segmentation results, including dilation and erosion operations, and repair the discontinuity of the boundary to obtain the precise boundary of the fruit;
[0038] The segmented fruit boundaries are geometrically analyzed to exclude reflective areas that do not match the actual fruit boundaries, and the true fruit boundaries are finally identified through iterative calculations.
[0039] Preferably, according to the recognition result, the position and shape of the target recognition frame are dynamically adjusted to output the final positioning information, which specifically includes the following steps:
[0040] Generate a preliminary target recognition frame by identifying the fruit boundary, and the shape of the recognition frame is determined by the minimum circumscribed rectangle or polygon of the fruit boundary point set;
[0041] Perform brightness analysis on the pixels in the preliminary recognition frame, detect and mark the highlight area in the recognition frame, and modify the shape and position of the recognition frame based on the spatial distance and distribution between the highlight area and the edge of the recognition frame;
[0042] Perform morphological processing on the edge of the recognition frame, and adjust the outline of the recognition frame through edge smoothing and corner point adjustment operations;
[0043] Iteratively adjust the position and size of the recognition frame so that the recognition frame gradually conforms to the actual fruit boundary and determines the shape of the final recognition frame;
[0044] Output the final position information and shape parameters of the recognition box for subsequent target positioning.
[0045] In the above technical solution, the technical effects and advantages provided by the present invention are:
[0046] 1. The present invention establishes an accurate prediction model by calculating the reflection intensity attenuation index and the surface reflection distribution coefficient. This prediction method can quickly determine the interference degree of the reflection area on the recognition accuracy under complex lighting conditions, ensuring that subsequent processing is only started when there is interference. Compared with traditional methods, this interference prediction technology based on key parameters not only improves the judgment accuracy of the system, but also avoids unnecessary image processing operations, thereby saving computing resources and optimizing the recognition process.
[0047] 2. The multi-level image processing steps in the present invention enhance the robustness of the system under complex lighting conditions. From image preprocessing, grayscale to edge detection and segmentation optimization, each step carefully considers the processing requirements of fruit images under multi-posture and multi-lighting conditions. In particular, through dynamic threshold segmentation and morphological processing, noise and discontinuous boundaries are effectively eliminated, so that the system can accurately extract the true boundaries of the fruit and eliminate false features caused by water droplet reflections. This multi-step image processing method not only improves recognition accuracy, but also significantly enhances the system's adaptability in complex environments and ensures the stability of target recognition.
[0048] 3. The dynamic adjustment scheme of the recognition frame in the present invention realizes the precise optimization of the recognition frame through multiple iterations. Through brightness analysis, corner point adjustment and geometric analysis, the system can gradually optimize the position and shape of the recognition frame to ensure that the final recognition result fits the actual boundary of the fruit and avoids interference from reflective areas. This dynamic adjustment method effectively makes up for the deficiency that traditional recognition frames are easily interfered with in complex scenes, improves recognition and positioning accuracy, and provides a reliable positioning basis for subsequent automated operations (such as picking or spraying). This precise recognition frame adjustment method ensures that the system can flexibly respond to lighting changes in a real environment, ultimately improving the reliability and operating efficiency of the overall system. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0050] Figure 1 The present invention is a flowchart of a method for multi-pose target recognition and positioning of chili peppers based on an improved YOLOV8. DETAILED DESCRIPTION
[0051] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of the present disclosure will be more comprehensive and complete, and the concept of the example embodiments will be fully conveyed to those skilled in the art.
[0052] The present invention provides Figure 1 The method for multi-pose target recognition and positioning of chili pepper using improved YOLOV8 is shown, and specifically includes the following steps:
[0053] Before performing target recognition, whether water droplets are attached to the surface of the chili pepper fruit is detected in real time, and when water droplets are detected to be attached to the surface of the chili pepper fruit, the following steps are continued;
[0054] Before target recognition, real-time detection of whether water droplets are attached to the surface of chili pepper fruit can be performed by combining image processing and feature analysis. The specific detection steps include the following aspects:
[0055] First, the image data of the fruit surface is collected by a camera installed on agricultural equipment or a fixed position. Then, the image is preprocessed using computer vision technology, including grayscale, denoising, and edge enhancement to improve the clarity of the image and the contrast of the water drop area. On this basis, the highlight area in the image is analyzed by a highlight detection algorithm. Water droplets usually form obvious highlight reflections under light, and these highlight areas can be extracted by setting the brightness threshold. Furthermore, morphological processing methods, such as dilation and corrosion operations, can be combined to screen the shape and size of the extracted highlight areas, eliminate noise interference, and retain only areas that may belong to water drop reflections.
[0056] At the same time, texture analysis methods can also be used to detect changes in texture features in local areas of the fruit surface. When water droplets adhere to the surface of the fruit, the texture features of the local area will be significantly different from those of the normal fruit surface, especially the smoothness and reflection features will change. These features are extracted by algorithms based on local binary patterns (LBP) or histograms of oriented gradients (HOG), and compared with the preset water drop texture model to further verify whether water droplets are attached.
[0057] Finally, combined with the results of highlight detection and texture analysis, a comprehensive judgment is made through a multi-dimensional feature fusion model, such as using a support vector machine (SVM) or a convolutional neural network (CNN) to classify the extracted features, and finally output a judgment result to determine whether there are water droplets attached to the surface of the fruit. In this way, it is possible to detect in real time and accurately whether there are water droplets on the surface of the chili pepper fruit, providing a reliable basis for the subsequent target recognition steps.
[0058] Obtain the reflection information of water droplets attached to the surface of the chili pepper fruit, and analyze it after acquisition to predict whether the water droplets attached to the surface of the fruit will affect the target recognition accuracy;
[0059] In this embodiment, the reflection information of water droplets attached to the surface of the chili pepper fruit is obtained, and after the acquisition, it is analyzed to predict whether the water droplets attached to the surface of the fruit will affect the target recognition accuracy, which specifically includes the following steps:
[0060] Obtain the reflection information of water droplets attached to the surface of the chili pepper fruit, and perform preprocessing after obtaining;
[0061] Acquiring the reflective information of water droplets attached to the surface of chili pepper fruit can be achieved by combining multispectral imaging with computer vision technology. First, the image data of chili pepper fruit under different lighting conditions is collected by a high-definition camera installed in the field, and the optical reflection feature information is obtained in combination with a multispectral imaging device. Multispectral imaging can capture the reflection of light in different bands, especially the reflection characteristics of visible light and near-infrared light bands, so as to effectively distinguish the difference between water droplet reflection and natural reflection on the fruit surface. Subsequently, the system will detect the highlight area in the image, and by setting the brightness threshold, edge enhancement and morphological processing, identify the area that may belong to the water droplet reflection and extract relevant information, including brightness data, reflection position, incident light angle, etc. The entire acquisition process relies on the cooperation of data acquisition and image processing technology of the visual sensor to ensure that the multi-dimensional characteristics of water droplet reflection can be fully captured.
[0062] The purpose of preprocessing is to improve the accuracy and availability of data, eliminate noise interference and optimize subsequent analysis steps. The key steps of preprocessing include image denoising, grayscale adjustment, contrast enhancement and segmentation of highlight areas. First, the original image is denoised by Gaussian filtering or median filtering to eliminate the messy interference information in the environment. Next, grayscale adjustment and smoothing are performed to make the brightness characteristics of the reflective area of the water droplets more prominent. Then, the local contrast of the highlight area is enhanced by an adaptive contrast enhancement algorithm (such as the CLAHE algorithm), so as to more accurately segment the reflective area. Finally, morphological processing (such as dilation and erosion operations) is used to optimize the shape of the highlight area to ensure that the extracted reflective area has accurate boundaries and contours. These preprocessing steps can significantly improve the quality of reflective information and lay a solid foundation for subsequent feature extraction and index calculation.
[0063] Extracting pixel brightness data within the reflective area, distance data between the pixel position and the center of the fruit, and angle data of the incident light and the reflected light from the preprocessed reflective information, and analyzing them after extraction to generate a reflective intensity attenuation index and a surface reflectance distribution coefficient, respectively;
[0064] The generated reflection intensity attenuation index and surface reflection distribution coefficient are used to construct an impact prediction model to generate an impact coefficient. The generated impact coefficient is compared with the pre-set impact coefficient threshold. Based on the comparison results, it is predicted whether the water droplets attached to the fruit surface will affect the target recognition accuracy.
[0065] The "pre-set impact coefficient threshold" can be trained and optimized through a large amount of historical data and machine learning algorithms to determine the appropriate threshold range. First, through multiple experiments and data collection in actual scenarios, a large number of image samples of fruits under different lighting conditions and water droplet reflection conditions are obtained, and the corresponding reflection intensity attenuation index and surface reflection distribution coefficient are recorded. Then, these sample data are used for classification and annotation to clarify which data will significantly interfere with target recognition, and these samples are marked as "interference data", while other samples are marked as "normal data". Next, statistical analysis methods such as cluster analysis and principal component analysis (PCA) are applied to extract and classify the reflection coefficients of these samples to determine the distribution range of the coefficients under different conditions. On this basis, the impact prediction model is trained through classification algorithms such as support vector machine (SVM) or random forest to determine an optimal threshold that can effectively distinguish interference from normal. Finally, the model is verified and adjusted using the cross-validation method to ensure that the generated threshold can cover most actual application scenarios and accurately distinguish interference situations. The preset threshold will be used as a judgment standard, automatically adjusted and applied in the subsequent recognition process to achieve adaptive prediction in different scenarios.
[0066] In this embodiment, the logic for obtaining the reflection intensity attenuation index is as follows:
[0067] Extract the pixel brightness data in the reflective area from the preprocessed reflective information, including the actual brightness of each pixel in the reflective area, and calibrate the actual brightness of each pixel in the reflective area as , Indicates the first The actual brightness of each pixel, , is a positive integer;
[0068] Extracting pixel brightness data in the reflective area can be achieved through computer vision and image processing technology. First, a high-resolution camera is used to collect image data on the surface of the chili pepper fruit, and the image is converted into a grayscale image to simplify the processing of brightness data. Then, through image segmentation techniques such as threshold segmentation or Otsu algorithm, the area with higher brightness value in the image is extracted and marked as the reflective area. Then, morphological operations (such as corrosion and expansion) are used to optimize the extracted reflective area to ensure that the pixel boundaries in the area are clear and complete. Finally, in the reflective area, the brightness value of each pixel is scanned and read pixel by pixel, and these data are saved as actual brightness data. These brightness data can be directly used in subsequent exponential decay calculations to quantify the impact of water droplet reflection on target recognition. In this way, the software can automatically and accurately extract pixel brightness information in the reflective area, providing a reliable basis for subsequent calculations.
[0069] Extract the distance data between the pixel position and the fruit center in the preprocessed reflective information, including the distance from each pixel point in the reflective area to the fruit center, and calibrate the distance from each pixel point in the reflective area to the fruit center as , Indicates the first The distance from the pixel to the center of the fruit;
[0070] Extracting the distance data between the pixel position in the reflective area and the center of the fruit can be achieved through image processing and geometric analysis methods. First, the boundary of the fruit is determined using image segmentation technology, and the coordinates of the center point of the fruit are obtained by calculating the geometric center. Then, the reflective area is scanned pixel by pixel to obtain the position coordinates of each pixel, and the distance from the pixel to the center of the fruit is calculated based on these coordinates and the coordinates of the center of the fruit. The specific calculation method uses the Euclidean distance formula to calculate the distance from the pixel point to the center of the fruit in each reflective area. In order to improve the accuracy, the morphology of the reflective area can be processed to ensure that the extracted pixel boundary is accurate. The distance data finally obtained is used as the actual distance from each pixel point in the reflective area to the center of the fruit, and these data are used for the subsequent calculation of the reflective intensity attenuation index. Through this method, the software can automatically and accurately extract the distance information between the pixel position and the center of the fruit to ensure the accuracy of the distance calculation.
[0071] According to the reflective area The distance from the pixel to the center of the fruit , applying an exponential decay function For The actual brightness of the pixel Perform weighted processing, where It is a preset attenuation coefficient, which is used to control the attenuation degree of light intensity with distance;
[0072] The exponential decay function is a mathematical function used to describe the phenomenon of gradually weakening as the distance increases. The specific form is ,in is the preset attenuation coefficient, In the reflective area The distance from the pixel to the center of the fruit. This function is used to simulate the natural attenuation of light intensity during propagation, especially in the case of water droplet reflection. The farther the pixel is from the center of the fruit, the less influence it has on the overall light intensity. Therefore, by applying the exponential decay function, the brightness data of these pixels can be reasonably weighted. , so that the influence of the highlight pixels far away from the center of the fruit on the result is weakened, ensuring that the overall calculation result is more consistent with the actual light intensity distribution. is a tuning parameter used to control the rate at which light intensity decays. A higher value means a faster attenuation, which is suitable for situations where the reflective area is concentrated in the center of the fruit; a smaller value means a faster attenuation. The value corresponds to a slower decay, which is suitable for situations where the reflective area is distributed over a wide area. The value can optimize the weighted processing of light intensity according to the actual environment, ensuring that the calculated reflection intensity attenuation index accurately reflects the actual optical characteristics.
[0073] Calculate the reflection intensity attenuation index. The specific calculation formula is as follows:
[0074] In the formula, is the reflection intensity attenuation exponent.
[0075] The magnitude of the reflection intensity attenuation index directly reflects the degree of interference of water droplet reflection on target recognition. When the index value is large, it means that there is still a high light intensity in the pixel area far away from the center of the fruit, which indicates that the water droplet reflection is widely and strongly distributed on the entire fruit surface, which may significantly interfere with the target recognition accuracy; when the index value is small, it means that the reflection intensity is concentrated in the area close to the center of the fruit, and it decays rapidly with the increase of distance. In this case, the influence of water droplet reflection is relatively limited and the interference is small. Therefore, by judging the magnitude of the reflection intensity attenuation index, it is possible to predict whether the water droplet reflection will have a significant impact on the target recognition accuracy, thereby determining whether subsequent processing is needed.
[0076] In this embodiment, the logic for obtaining the surface reflection distribution coefficient is as follows:
[0077] The angle data of incident light and reflected light in the preprocessed reflective information are extracted, including the actual angle of the incident light, the actual angle of the reflected light, and the actual angle between the incident light and the fruit surface. The actual angle of the incident light, the actual angle of the reflected light, and the actual angle between the incident light and the fruit surface are calibrated as , and , represents the actual angle of the incident light, represents the actual angle of reflected light, It represents the actual angle between the incident light and the fruit surface, and defines the integral range of the incident light direction as , ,in is the azimuth of the light on the horizontal plane;
[0078] Extracting the angle data of incident light and reflected light can be achieved through ray tracing and geometric calculation methods. First, in the acquired image, the spatial coordinates of the fruit surface are determined through the three-dimensional morphological reconstruction or depth information of the fruit, and the normal direction of the fruit surface at each pixel point is calculated using the normal vector. Next, ray tracing technology is used to simulate the propagation path of incident light and reflected light on the fruit surface, and the actual angle of the incident light is obtained by calculating the angle between the incident light direction and the surface normal. and the actual angle of reflected light In addition, the angle between the incident light and the fruit surface It can be directly calculated through geometric relationships, and these angle data can be used to further define the integral range of the incident light direction This extraction process relies on image processing and ray tracing algorithms, which can accurately capture the light reflection characteristics at different angles and provide basic data for subsequent surface reflection distribution coefficient calculations.
[0079] The content in the image defines the integration range of the incident light direction , which is used to describe the angular range of the integration operation when calculating the surface reflection distribution coefficient. Specifically, the integration range It is represented by an incident angle and azimuth A binary set consisting of Represents the angle between the incident light and the fruit surface, ranging from 0 to (indicates the angle change from vertical to horizontal); Indicates the azimuth of the light on the horizontal plane, ranging from 0 to (Indicates the full 360-degree azimuth coverage). This definition can accurately describe the propagation path and reflection characteristics of light on the entire hemisphere, which provides a theoretical basis for the integral calculation of the surface reflection distribution coefficient and ensures that the reflection characteristics of light in different directions can be fully considered and calculated.
[0080] The bidirectional reflection function BRDF model is used to calculate the reflection intensity in each reflection direction. The expression of BRDF is: , used to describe the relationship between incident light and reflected light at different angles;
[0081] When calculating the surface reflection distribution coefficient, the bidirectional reflection distribution function (BRDF) model is used to accurately describe the reflection characteristics of light at different incident and reflection angles. The BRDF model is used to represent the intensity of light reflected from a specific surface in a certain direction, which is determined by the incident light angle. and reflected light angle Determine. The expression of BRDF The relationship between incident light and reflected light at different angles is described, which is crucial for simulating surface reflection characteristics. By introducing the BRDF model, the reflection intensity of each incident light in different directions can be accurately calculated, thereby simulating the real light reflection behavior under complex lighting conditions. The BRDF model takes into account the incident and reflection angles of light, the characteristics of the light source, and the properties of the surface material, ensuring the accuracy and authenticity of the reflection intensity calculation, and ultimately providing a reliable basis for predicting the impact of water droplet reflection on target recognition accuracy.
[0082] Calculate the surface reflection distribution coefficient. The specific calculation formula is as follows:
[0083] In the formula, is the surface reflection distribution coefficient.
[0084] The size of the surface reflection distribution coefficient directly reflects the complexity of light reflection of water droplets at different incident and reflection angles. When the coefficient is large, it means that the incident light produces significant reflection in multiple directions, indicating that the distribution of water droplet reflection is complex and wide-ranging. This complex reflection characteristic may make it difficult for the target recognition algorithm to accurately distinguish between the fruit boundary and the reflective area, thereby significantly reducing the recognition accuracy; when the coefficient is small, it indicates that the reflection is concentrated at a specific angle and the overall reflection behavior is relatively simple. In this case, the reflection interference is relatively controllable and the target recognition accuracy will not be seriously affected. Therefore, the size of the surface reflection distribution coefficient can effectively predict the degree of interference of water droplet reflection on target recognition, and then determine whether further recognition optimization processing is needed.
[0085] In this embodiment, the generated reflection intensity attenuation index and the surface reflection distribution coefficient Construct an impact prediction model and generate impact coefficients through weighted summation , and the generated influence coefficient The influence coefficient threshold is set in advance Compare and predict whether the water droplets attached to the fruit surface will affect the target recognition accuracy based on the comparison results. The specific comparison analysis is as follows:
[0086] like , the water droplets attached to the surface of the fruit will not affect the target recognition accuracy, which means that the reflection intensity attenuation index and the surface reflection distribution coefficient comprehensively reflect that the water droplet reflection has little interference with target recognition. In the current environment, the water droplet reflection will not significantly affect the target recognition accuracy. This shows that the reflective characteristics of the fruit surface are within the controllable range of the system, and the positioning of the recognition frame and the recognition of the fruit boundary are still accurate and reliable. Therefore, no further intervention measures are required. In this case, the system can directly output the recognition results to maintain high recognition efficiency and stability;
[0087] like , water droplets attached to the surface of the fruit will affect the target recognition accuracy, which means that the interference of the reflective characteristics of water droplets on target recognition has reached or exceeded the acceptable range, and may have a significant impact on the position, shape and accuracy of the fruit boundary of the recognition frame. This interference may cause a decrease in target recognition accuracy, misidentification, blurred boundaries or positioning errors, which in turn affects the accuracy of automated operations (such as picking or spraying). Therefore, in this case, the system needs to initiate compensation measures, such as dynamically adjusting the recognition frame or performing additional data processing, to eliminate the negative impact of water droplet reflection on the recognition results and ensure that the final output recognition results have sufficient accuracy.
[0088] When building the impact prediction model, the generated reflection intensity attenuation index is first and the surface reflection distribution coefficient Perform weighted processing and obtain the final influence coefficient through weighted summation Specifically, the calculation formula of the influence coefficient is: ,in and The weights of the two coefficients are used to measure the relative importance of each parameter in the final prediction result. The weight coefficient can be determined by training and optimizing a large amount of experimental data, such as using linear regression or machine learning methods, and adjusting according to the recognition accuracy and reflective interference degree in the real environment. and The value of . Generally, the weight distribution depends on the contribution of each coefficient to the recognition accuracy. For example, when the reflection intensity is high and the distribution is complex, the surface reflection distribution coefficient may be assigned a higher weight to more accurately reflect the interference in a complex reflective environment; when the reflective area is concentrated, the reflection intensity attenuation index may play a more critical role. By setting the weight coefficient reasonably, the impact prediction model can more accurately reflect the comprehensive impact of water droplet reflection on recognition accuracy under different lighting conditions.
[0089] Under the condition that it is predicted that water droplets attached to the surface of the fruit will affect the target recognition accuracy, the image data of the chili pepper fruit is obtained, and the image data is analyzed after acquisition to identify the real fruit boundary and eliminate the reflection interference;
[0090] In this embodiment, when it is predicted that water droplets attached to the surface of the fruit will affect the target recognition accuracy, the image data of the chili pepper fruit is obtained, and after the acquisition, the image data is analyzed to identify the real fruit boundary and eliminate the reflection interference, which specifically includes the following steps:
[0091] Under the assumption that water droplets attached to the fruit surface will affect the target recognition accuracy, image data of chili pepper fruit under different lighting conditions and multiple postures are obtained;
[0092] In the case where it is predicted that water droplets attached to the surface of the fruit will affect the accuracy of target recognition, obtaining image data of chili pepper fruits under different lighting conditions and multiple postures can be achieved by deploying multiple cameras and multispectral imaging systems. Specifically, multiple fixed or mobile cameras are arranged in an orchard or experimental environment, which shoot the fruit from different angles and heights to capture its appearance under various lighting conditions such as direct light, diffuse light and backlight. In addition, by adjusting the position of the camera or rotating the fruit in different postures, image data of the fruit at various angles and directions can be collected. These image data will be used to comprehensively analyze the impact of water droplet reflection on the fruit boundary, because the diverse lighting and posture conditions can reflect the complexity of water droplet reflection, thereby helping the recognition algorithm to more accurately separate the true boundary of the fruit and eliminate the interference of water droplet reflection.
[0093] Preprocess the image data of the pepper fruit under different lighting conditions and multiple postures;
[0094] The image data of the obtained chili pepper fruit under different lighting conditions and multiple postures can be preprocessed by techniques such as image denoising, contrast enhancement and brightness standardization. Specifically, the image is first denoised using Gaussian filtering or median filtering to reduce high-frequency noise caused by environmental factors (such as dust or reflection) and improve the overall quality of the image. Then, the image contrast is adjusted using adaptive contrast enhancement technology (such as CLAHE algorithm) to make the brightness difference between the fruit and the background more obvious, thereby highlighting the fruit boundary. In addition, the brightness range of the image is adjusted to a uniform scale through brightness standardization technology to eliminate brightness changes caused by different lighting conditions. The purpose of preprocessing is to remove irrelevant interference in the image, optimize the visual effect of the image, provide clear and unified data input for subsequent grayscale, edge detection and segmentation operations, and ensure the accuracy and stability of recognition in complex environments.
[0095] Grayscale the preprocessed image data to convert the color image into a grayscale image;
[0096] Grayscale processing is performed on the preprocessed image data. Converting a color image into a grayscale image can be achieved by extracting the brightness information of each pixel. Specifically, the RGB values of each pixel in the color image are combined according to certain weights, such as weighted summing the data of the red, green, and blue channels according to the commonly used brightness calculation formula to obtain a single grayscale value. The purpose of grayscale processing is to simplify the image data, remove unnecessary color information, and retain brightness features related to edges and shapes, because brightness information is a key factor in target recognition and boundary extraction. By converting the image to a grayscale image, the system can perform subsequent edge detection and image segmentation operations more efficiently, reduce computational complexity, and ensure that important visual information is retained, improving overall processing speed and recognition accuracy.
[0097] Process the grayscale image, extract the edge of the fruit, and generate a preliminary fruit boundary outline;
[0098] Processing the grayscale image, extracting the edge of the fruit, and generating a preliminary fruit boundary outline can be achieved through edge detection algorithms (such as the Canny algorithm or the Sobel operator). Specifically, the grayscale image is first Gaussian smoothed to reduce noise and small interference in the image, and then the changes in pixel gradients in the image are calculated to identify areas with significant gradient changes, which usually correspond to the boundaries of the object. Taking the Canny algorithm as an example, the system sets high and low double thresholds to filter out strong edge responses and exclude weak edges and noise interference, thereby generating a clear boundary line. The purpose of this step is to accurately determine the outline of the fruit through an edge detection algorithm under complex lighting and reflection conditions, provide reliable boundary information for subsequent image segmentation and morphological processing, and enable the system to extract a stable boundary outline under the interference of water droplet reflections, thereby ensuring the accuracy and robustness of recognition.
[0099] Segmenting the fruit area from the background and the reflective area in the image, specifically including setting a dynamic threshold and classifying the image to distinguish the fruit area from other interference areas;
[0100] The segmentation of the fruit area from the background and reflective area in the image can be achieved by combining the adaptive threshold segmentation algorithm with image classification technology. Specifically, the brightness distribution of different areas in the image is first analyzed, and the threshold is dynamically set based on the local brightness characteristics so that the segmentation process can adapt to changes in lighting conditions. Adaptive threshold segmentation automatically adjusts the threshold according to the local environment of each pixel, so that the fruit area can be effectively distinguished from the background or reflective area. During the segmentation process, the system evaluates the brightness value pixel by pixel, and classifies the area with brightness higher than the set threshold as the foreground (i.e., the fruit area), while the area with lower or abnormally high brightness is classified as the background or interference area, such as water droplet reflection. The main purpose of this step is to achieve accurate fruit area extraction under complex lighting conditions, avoid misjudgment caused by fixed thresholds, ensure that the segmentation results remain stable in a variety of environments, and provide accurate initial data for subsequent morphological processing and boundary optimization.
[0101] Perform morphological processing on the segmentation results, including dilation and erosion operations, and repair the discontinuity of the boundary to obtain the precise boundary of the fruit;
[0102] Morphological processing of the segmentation results can be achieved through dilation and erosion operations to optimize the fruit boundaries and repair discontinuous areas. Specifically, the erosion operation is first performed to remove small noise points and isolated pixels in the segmentation results by using defined structural elements (such as circles or rectangles). These are usually invalid areas caused by segmentation errors or reflections. Then, the dilation operation is performed to fill the boundary gaps caused by erosion, making the boundary smoother and more coherent. In addition, the dilation operation can also expand the fruit area to ensure the integrity of the fruit contour. Through multiple iterations of dilation and erosion processing, the boundary breaks or discontinuities that occur during the segmentation process can be further repaired. The purpose of morphological processing is to further optimize the boundary contour on the basis of segmentation, so that the fruit area is more consistent and complete, thereby improving the accuracy of subsequent geometric analysis and recognition algorithms, and ensuring that accurate fruit boundaries can still be obtained under complex reflection conditions.
[0103] The segmented fruit boundaries are geometrically analyzed to exclude reflective areas that do not match the actual fruit boundaries, and the true fruit boundaries are finally identified through iterative calculations.
[0104] The geometric analysis of the segmented fruit boundary can be performed by evaluating the boundary shape, curvature and position features, and combining the iterative optimization algorithm to eliminate the interference of the reflective area, and finally identify the real fruit boundary. Specifically, the segmented boundary is first geometrically analyzed to extract the shape features of the boundary, such as the curvature change of the contour, the smoothness and continuity of the edge. Generally, the real fruit boundary has a relatively regular shape and a small curvature fluctuation, while the reflective area often appears as a locally prominent highlight edge with irregular curvature changes. Based on these features, by setting reasonable geometric criteria (such as the smoothness of the boundary and the curvature threshold), the abnormal boundary area can be preliminarily screened out. Then, the iterative optimization algorithm (such as the active contour model based on the energy function) is used to further correct the boundary position so that it converges in the direction consistent with the actual boundary of the fruit. In each iteration, by continuously adjusting the shape parameters of the boundary, the false boundary interfered by the reflection is gradually eliminated, and finally a stable and real fruit boundary is obtained. The purpose of geometric analysis and iterative optimization is to ensure that the system can effectively identify and eliminate interference factors in complex lighting and reflective environments, so as to obtain accurate and realistic fruit boundaries and improve recognition accuracy.
[0105] According to the recognition results, the position and shape of the target recognition frame are dynamically adjusted to output the final positioning information, and the recognition and positioning accuracy in the case of reflective interference is improved.
[0106] In this embodiment, according to the recognition result, the position and shape of the target recognition frame are dynamically adjusted to output the final positioning information, which specifically includes the following steps:
[0107] Generate a preliminary target recognition frame by identifying the fruit boundary, and the shape of the recognition frame is determined by the minimum circumscribed rectangle or polygon of the fruit boundary point set;
[0108] By identifying the boundaries of the fruit and generating a preliminary target recognition frame, this can be achieved by calculating the minimum bounding rectangle or polygon of the boundary point set. Specifically, the coordinates of the identified fruit boundary points are first extracted to form a complete boundary point set. Then, a geometric algorithm (such as the convex hull algorithm or the minimum bounding rectangle algorithm) is used to calculate the minimum area containing all boundary points. For simple fruit shapes, the minimum bounding rectangle can be used, which is determined by the outermost point set of the boundary points; for fruits with more irregular shapes, the system can generate a recognition frame that better fits the fruit contour through polygon fitting. The purpose of this step is to provide a preliminary target area for subsequent recognition and positioning in a complex environment, ensure that the recognition frame can cover the main part of the fruit, and minimize the introduction of background and interference areas, thereby laying the foundation for subsequent morphological adjustment and dynamic optimization.
[0109] Perform brightness analysis on the pixels in the preliminary recognition frame, detect and mark the highlight area in the recognition frame, and modify the shape and position of the recognition frame based on the spatial distance and distribution between the highlight area and the edge of the recognition frame to ensure that the highlight area is not included in the recognition frame;
[0110] Performing brightness analysis on the pixels in the preliminary recognition frame, detecting and marking the highlight areas in the recognition frame can be achieved by pixel brightness threshold segmentation and spatial distance calculation. Specifically, first extract the brightness values of all pixels in the recognition frame, set a brightness threshold, filter out pixels that exceed the threshold, and mark these pixels as highlight areas. Then, by calculating the spatial distance between the highlight area and the edge of the recognition frame, analyze the position distribution of these highlight areas. If the highlight area is close to or adjacent to the edge of the recognition frame, the system will determine that these areas may be misjudged due to the reflection of water droplets, and correct the shape and position of the recognition frame according to the positional relationship of these highlight areas, such as by reducing the recognition frame, adjusting the position of the corner points of the recognition frame, etc., to eliminate these interference factors. The purpose of this step is to accurately adjust the recognition frame to ensure that the final recognized boundary fits the actual outline of the fruit as closely as possible, while eliminating possible reflection interference, thereby improving the positioning accuracy of the recognition frame under complex lighting conditions.
[0111] Perform morphological processing on the edge of the recognition frame, and adjust the outline of the recognition frame to correspond to the recognized fruit boundary through edge smoothing and corner point adjustment operations;
[0112] The edges of the recognition frame are morphologically processed, and the outline of the recognition frame is adjusted through edge smoothing and corner adjustment operations. This can be achieved through morphological filtering, corner detection, and position correction. Specifically, the edges of the recognition frame are first smoothed, and morphological filtering (such as corrosion, expansion, or opening operations) is used to eliminate noise and irregular changes at the edges, remove small protrusions or depressions, and make the boundary line smoother and more coherent. Then, the key corner point positions of the recognition frame are identified using a corner detection algorithm (such as Harris corner detection), and the positions of these corner points are adjusted through geometric calculations to ensure that the shape of the recognition frame is more consistent with the actual boundary of the fruit. If it is found that the edge overlaps with the highlight area or noise point during the smoothing or corner adjustment process, further local fine-tuning can be performed to reduce the recognition frame or adjust the corner points to obtain a more accurate outline. The purpose of this step is to optimize the shape of the recognition frame on the basis of the existing recognition frame through fine adjustment of the edges and corner points, so that it is more consistent with the actual outline of the fruit, and provide more reliable boundary information for subsequent iterative adjustment and positioning.
[0113] Iteratively adjust the position and size of the recognition frame so that the recognition frame gradually conforms to the actual fruit boundary and determines the shape of the final recognition frame;
[0114] Iteratively adjusting the position and size of the recognition frame so that the recognition frame gradually conforms to the actual fruit boundary and determining the shape of the final recognition frame can be achieved through a dynamic optimization algorithm based on target detection confidence. Specifically, in each iteration, the system first calculates the matching degree between the fruit features in the recognition frame and the actual boundary, for example, by evaluating the density of boundary pixels, shape symmetry, and the degree of fit with the fruit boundary to judge the accuracy of the recognition frame. Based on the matching result, the system gradually adjusts the position, size, and shape of the recognition frame to make it more fit the actual fruit boundary, for example, by moving the center of the recognition frame, scaling the boundary range, or adjusting the aspect ratio of the recognition frame. After each adjustment, the system recalculates the matching degree and updates the recognition frame until a stable recognition result is achieved. The purpose of this step is to gradually optimize the recognition frame through multiple iterations so that its final shape is highly consistent with the actual boundary of the fruit, ensuring that under complex lighting and reflection conditions, the recognition frame can accurately reflect the true position and outline of the fruit, thereby providing accurate input for positioning and subsequent processing.
[0115] Output the final position information and shape parameters of the recognition box for subsequent target positioning.
[0116] The final position information and shape parameters of the output recognition frame are used for subsequent target positioning, which can be achieved by extracting the boundary coordinates and geometric parameters of the recognition frame and transmitting them to the positioning module. Specifically, after the adjustment of the recognition frame is completed, the system extracts the key geometric information of the recognition frame, including the center coordinates, length, width, angle and specific coordinates of the four vertices of the recognition frame. After the extraction is completed, the system formats these parameter data and passes them to the target positioning module for subsequent automated operations, such as precise positioning of the robotic arm or target locking in image analysis. The purpose of this step is to ensure that after the fruit boundary recognition and optimization are completed, the final position information and shape parameters can be accurately passed to the subsequent processing units, ensuring that automated operations or further analysis still have an accurate positioning basis in complex scenarios. This parameter transfer method ensures that the entire system shares consistent information between the various modules in the processing chain, thereby achieving efficient connection between precise positioning and subsequent operations.
[0117] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.
[0118] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0119] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0120] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0121] In the several embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0122] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0123] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0124] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A multi-pose target recognition and positioning method for chili pepper based on improved YOLOV8, characterized in that: The specific steps include: Before performing target recognition, whether water droplets are attached to the surface of the chili pepper fruit is detected in real time, and when water droplets are detected to be attached to the surface of the chili pepper fruit, the following steps are continued; Obtain the reflection information of water droplets attached to the surface of the chili pepper fruit, and analyze it after acquisition to predict whether the water droplets attached to the surface of the fruit will affect the target recognition accuracy; Under the condition that it is predicted that water droplets attached to the surface of the fruit will affect the target recognition accuracy, the image data of the chili pepper fruit is obtained, and the image data is analyzed after acquisition to identify the real fruit boundary and eliminate the reflection interference; According to the recognition results, the position and shape of the target recognition frame are dynamically adjusted to output the final positioning information; Obtain the reflection information of water droplets attached to the surface of the chili pepper fruit, and analyze it after acquisition to predict whether the water droplets attached to the surface of the fruit will affect the target recognition accuracy, which specifically includes the following steps: Obtain the reflection information of water droplets attached to the surface of the chili pepper fruit, and perform preprocessing after obtaining; Extracting pixel brightness data within the reflective area, distance data between the pixel position and the center of the fruit, and angle data of the incident light and the reflected light from the preprocessed reflective information, and analyzing them after extraction to generate a reflective intensity attenuation index and a surface reflectance distribution coefficient, respectively; The generated reflection intensity attenuation index and surface reflection distribution coefficient are used to construct an impact prediction model to generate an impact coefficient, and the generated impact coefficient is compared with a preset impact coefficient threshold, and the comparison result is used to predict whether the water droplets attached to the fruit surface will affect the target recognition accuracy; The logic for obtaining the reflection intensity attenuation index is as follows: Extract the pixel brightness data in the reflective area from the preprocessed reflective information, including the actual brightness of each pixel in the reflective area, and calibrate the actual brightness of each pixel in the reflective area as , Indicates the first The actual brightness of each pixel, , is a positive integer; Extract the distance data between the pixel position and the fruit center in the preprocessed reflective information, including the distance from each pixel point in the reflective area to the fruit center, and calibrate the distance from each pixel point in the reflective area to the fruit center as , Indicates the first The distance from the pixel to the center of the fruit; According to the reflective area The distance from the pixel to the center of the fruit , applying an exponential decay function For The actual brightness of the pixel Perform weighted processing, where It is a preset attenuation coefficient, which is used to control the attenuation degree of light intensity with distance; Calculate the reflection intensity attenuation index. The specific calculation formula is as follows: In the formula, is the reflection intensity attenuation index; The acquisition logic of the surface reflection distribution coefficient is as follows: The angle data of incident light and reflected light in the preprocessed reflective information are extracted, including the actual angle of the incident light, the actual angle of the reflected light, and the actual angle between the incident light and the fruit surface. The actual angle of the incident light, the actual angle of the reflected light, and the actual angle between the incident light and the fruit surface are calibrated as , and , represents the actual angle of the incident light, represents the actual angle of reflected light, It represents the actual angle between the incident light and the fruit surface, and defines the integral range of the incident light direction as , ,in is the azimuth of the light on the horizontal plane; The bidirectional reflection function BRDF model is used to calculate the reflection intensity in each reflection direction. The expression of BRDF is: , used to describe the relationship between incident light and reflected light at different angles; Calculate the surface reflection distribution coefficient. The specific calculation formula is as follows: In the formula, is the surface reflection distribution coefficient; The generated reflection intensity attenuation index and surface reflection distribution coefficient Construct an impact prediction model and generate impact coefficients through weighted summation , and the generated influence coefficient The influence coefficient threshold is set in advance Compare and predict whether the water droplets attached to the fruit surface will affect the target recognition accuracy based on the comparison results. The specific comparison analysis is as follows: like ,Water droplets attached to the surface of the fruit will not affect the target recognition accuracy; like ,Water droplets attached to the surface of the fruit will affect the target recognition accuracy.
2. According to the improved YOLOV8 method for multi-attitude target recognition and positioning of chili pepper according to claim 1, it is characterized in that: In the case where it is predicted that water droplets attached to the surface of the fruit will affect the target recognition accuracy, the image data of the chili pepper fruit is obtained, and after acquisition, the image data is analyzed to identify the real fruit boundary and eliminate the reflection interference, which specifically includes the following steps: Under the assumption that water droplets attached to the fruit surface will affect the target recognition accuracy, image data of chili pepper fruit under different lighting conditions and multiple postures are obtained; Preprocess the image data of the pepper fruit under different lighting conditions and multiple postures; Grayscale the preprocessed image data to convert the color image into a grayscale image; Process the grayscale image, extract the edge of the fruit, and generate a preliminary fruit boundary outline; Segmenting the fruit area from the background and the reflective area in the image, specifically including setting a dynamic threshold and classifying the image to distinguish the fruit area from other interference areas; Perform morphological processing on the segmentation results, including dilation and erosion operations, and repair the discontinuity of the boundary to obtain the precise boundary of the fruit; The segmented fruit boundaries are geometrically analyzed to exclude reflective areas that do not match the actual fruit boundaries, and the true fruit boundaries are finally identified through iterative calculations.
3. According to the improved YOLOV8 method for multi-attitude target recognition and positioning of chili pepper according to claim 2, it is characterized in that: According to the recognition results, the position and shape of the target recognition frame are dynamically adjusted to output the final positioning information, which specifically includes the following steps: Generate a preliminary target recognition frame by identifying the fruit boundary, and the shape of the recognition frame is determined by the minimum circumscribed rectangle or polygon of the fruit boundary point set; Perform brightness analysis on the pixels in the preliminary recognition frame, detect and mark the highlight area in the recognition frame, and modify the shape and position of the recognition frame based on the spatial distance and distribution between the highlight area and the edge of the recognition frame; Perform morphological processing on the edge of the recognition frame, and adjust the outline of the recognition frame through edge smoothing and corner point adjustment operations; Iteratively adjust the position and size of the recognition frame so that the recognition frame gradually conforms to the actual fruit boundary and determines the shape of the final recognition frame; Output the final position information and shape parameters of the recognition box for subsequent target positioning.
