Crop adaptability detection method based on HSV color segmentation algorithm
Through the HSV color segmentation algorithm combined with dual TOF cameras and solid-state lidar, combined with dual-camera depth perception technology, the problem of insufficient detection accuracy of HSV algorithm in complex environments is solved, and crop detection accuracy in a single sensor configuration is achieved. Improved robustness.
Patent Information
- Application Number
- CN202411196537.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-12-24
AI Technical Summary
The existing HSV color segmentation algorithms face insufficient detection accuracy and robustness in complex environment changes in scenarios with a single sensor configuration, especially in poor performance when light changes and shadow interference.
Using a combination of dual TOF cameras and solid-state lidar, HSV color space conversion and preset threshold segmentation are used, and color and depth information are fused with dual-photograph depth perception technology to generate adaptive detection results to improve crop recognition accuracy and robustness sex.
Effective detection and tracking of crops in complex environments improves the recognizability of crops in images, reduces false detection caused by changes in the external environment, and enhances the accuracy and stability of the detection.
Smart Images

Figure CN119180952A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of agricultural engineering, and in particular to a crop adaptability detection method based on an HSV color segmentation algorithm. Background Art
[0002] In the field of agricultural automation, crop adaptability detection is an important part of evaluating crop growth conditions and their environmental adaptability. Crop detection methods based on image processing technology can play an important role in large-scale agricultural production. Among them, the crop adaptability detection method based on the HSV color segmentation algorithm has received widespread attention. Due to the separation characteristics of hue, saturation and brightness in the HSV color space, the algorithm has high effectiveness in distinguishing target crops from background noise.
[0003] The core of this method is to achieve accurate segmentation of crops by selecting appropriate thresholds in the HSV color space, so that the target crops can be effectively extracted from the complex background. This feature makes the HSV model more robust in crop detection than other color spaces. However, although the HSV color segmentation algorithm performs well under ideal conditions, it still faces some challenges in practical applications.
[0004] In scenarios with a single sensor configuration, the complexity of environmental conditions, such as changes in light intensity and self-occlusion, may lead to insufficient recognition of crop shapes and edges, or even difficulty in distinguishing crop rows. These factors will greatly affect the accuracy of the algorithm and the stability of the system. In particular, when dealing with lighting changes and shadow interference, the performance of the algorithm often shows a significant decline, resulting in insufficient detection accuracy and robustness. Summary of the invention
[0005] The purpose of the present invention is to provide a crop adaptability detection method based on the HSV color segmentation algorithm to solve the problem that in a scenario with a single sensor configuration, the existing HSV color segmentation algorithm has some shortcomings when coping with complex environmental changes, resulting in insufficient detection accuracy and robustness.
[0006] To achieve the above object, the present invention provides the following technical solution: a crop adaptability detection method based on HSV color segmentation algorithm, the method comprising:
[0007] S1: Use two TOF cameras to capture the same crop area;
[0008] S2: Through the fusion of solid-state LiDAR and camera, the three-dimensional information and color information of crops are obtained synchronously, so that the LiDAR point cloud has RGB color information, the image captured by each TOF camera is converted into HSV color space, and the color segmentation is performed using the preset threshold to obtain the area of interest of the crop area;
[0009] S3: Based on dual-camera depth perception technology, the color information and depth information obtained by two TOF cameras are integrated;
[0010] S4: Generate adaptive detection results based on the fused information.
[0011] Preferably, the fusion of the solid-state laser radar and the camera in step S2 specifically includes:
[0012] Use solid-state LiDAR and two TOF cameras to synchronously acquire 3D point cloud data and RGB color information of crops;
[0013] The lidar point cloud is aligned with the camera’s RGB image using extrinsic and intrinsic calibration.
[0014] Preferably, the HSV color space conversion in step S2 specifically includes:
[0015] Describe the color type using the formula:
[0016]
[0017] To describe the purity of color, the formula is:
[0018]
[0019] To describe the brightness of a color, use the formula:
[0020] V = max(R, G, B);
[0021] Among them, H represents hue, that is, the type of color; S represents saturation, that is, the purity of the color; V represents brightness; R represents the intensity of the red channel; G represents the intensity of the green channel; B represents the intensity of the blue channel.
[0022] Preferably, the color segmentation using a preset threshold in step S2 specifically includes:
[0023] According to the crop type and color characteristics, the threshold range in the HSV color space is pre-set. For the green area of the crop, the threshold may be set as follows: H is between 35° and 85°, S is between 0.4 and 1, and V is between 0.3 and 1. The HSV image is processed using a threshold segmentation algorithm to separate the crop area from the background area.
[0024] The threshold segmentation algorithm adopts the K-means clustering algorithm, and the specific steps are:
[0025] Pixel representation: Each pixel of the HSV image is represented as a three-dimensional vector (H, S, V).
[0026] Initialize cluster centers: Select K initial cluster centers, K is set to 2, corresponding to the crop area and background area respectively.
[0027] Iterative update: Through iterative update, the distance from each pixel to the cluster center is calculated and classified into the nearest cluster center.
[0028] Update center point: Update the cluster center to the mean of all points in the current cluster, and repeat the above steps until convergence.
[0029] Segmentation result: The final output clustering result is the segmentation image of the crop area and the background area.
[0030] Preferably, the step S2 of aligning the laser radar point cloud with the camera's RGB image using external parameter calibration and internal parameter calibration includes:
[0031] Using the pinhole camera model, the intrinsic parameter matrix is expressed as:
[0032]
[0033] Among them, f x and f y are the horizontal and vertical focal lengths of the camera, respectively, and c x and c y is the pixel coordinate of the principal point;
[0034] Use the chessboard calibration tool to estimate the camera's intrinsic parameter matrix and distortion coefficients by taking chessboard images at multiple different angles and applying the findchessboardcorners and calibratecamera functions in the OpenCV library.
[0035] Rotation and translation parameters, extrinsic parameters are usually expressed as a rotation matrix R and a translation vector t. The extrinsic parameter matrix can be expressed as:
[0036]
[0037] Where R is a 3x3 rotation matrix and t is a 3x1 translation vector;
[0038] During the calibration process, Lie algebra is used to optimize the rotation and translation parameters by expressing the rotation matrix R as an exponential map in, is an antisymmetric matrix, ξ is a Lie algebra vector representing a small change in rotation;
[0039] First, the initial rotation matrix, R0, and translation vector t0 are obtained through rough calibration;
[0040] The calibration problem is transformed into a problem of minimizing the error function, which is the projection error of the lidar point cloud on the image plane. The goal is to minimize the difference between the projection position of each lidar point and the corresponding image pixel point. The error function can be expressed as:
[0041]
[0042] Among them, P i is the coordinate of the i-th lidar point in the lidar coordinate system, project(P i ,R,t) is the projection position of the point on the camera image plane, P i is the corresponding image pixel, N is the total number of matching point pairs;
[0043] During the optimization process, a small perturbation δξ of the Lie algebra is used to update the rotation matrix R and the translation vector t:
[0044]
[0045] Then, the optimization algorithms such as gradient descent or Gauss-Newton method are used to iteratively update until the error function converges to the minimum value. The optimized rotation matrix R and translation vector t are the external parameters of the lidar and camera.
[0046] Preferably, the step S3 of fusing the color information and depth information acquired by the two TOF cameras based on the dual-camera depth perception technology includes:
[0047] The color images captured by the two TOF cameras are used to obtain their respective feature descriptors through feature extraction algorithms;
[0048] Use dual-camera depth perception technology to perform point-to-point matching and optimize the consistency of color information;
[0049] Apply the fusion criterion to calculate the comprehensive weight of color and depth information at each pixel in the two TOF images;
[0050] Get new images with accurate depth and color information through synthesis processing;
[0051] The method for calculating the comprehensive weight of the color and depth information at each pixel in the two TOF images by applying the fusion criterion is:
[0052] Based on comprehensive weighted calculation, if the consistency of the depth information is better than the set threshold M and the color consistency is higher than another threshold N, the weight is preferentially biased towards the depth information Wdeep=α, otherwise it is biased towards the color information Wcolor=β (here α+β=1);
[0053] Check each pixel i in the two TOF cameras;
[0054] Different weight ratios α or β are assigned to each pixel according to the consistency comparison between color information and depth information;
[0055] After obtaining the weight α or β corresponding to each pixel color information I and depth information D, a weight calculation C(i)=α×I+β×D is performed to ensure that the image maintains a balance between clarity and authenticity during the fusion process.
[0056] Preferably, the process of calculating C(i)=α×I+β×D for each pixel is:
[0057] For each pixel position, before calculation, based on predefined conditions, the consistency of pixel color information and depth information is evaluated according to thresholds M and N to see whether they meet the standards;
[0058] When the evaluation result shows that the depth information D is higher than the consistency level M and the consistency of the color information I is higher than N, the weight coefficient is set to: α = max (threshold K1, threshold consistency coefficient),
[0059] Keep the sum of the two equal to 1; β = min(α1,1)
[0060] For pixels that do not meet the above conditions, the weight coefficient is set to β = max (threshold K1, 1 threshold consistency coefficient),
[0061]
[0062] Use the calculated weights for fusion, and finally get the comprehensive weighted value C(i)=α×I+β×D;
[0063] For each pixel position, the preliminary evaluation of consistency is performed according to the thresholds M and N before calculating C(i)=α×I+β×D, including:
[0064] Assuming that the threshold consistency and threshold K1 are given values, firstly, based on whether the depth difference and color difference of the current point are less than M and N as the benchmark, determine whether the feature type of the pixel is color-dominant or depth-dominant and process them respectively;
[0065] For the feature pixel position i dominated by color, when its depth difference D is consistent with the standard (|ΔD| < M), set α = max(threshold K1, consistency coefficient threshold); otherwise
[0066]
[0067] Relatively, for the case dominated by depth, if its color difference satisfies (|ΔC| < N), β is set to max(threshold K1, consistency coefficient threshold);
[0068] Finally, adjust the color and depth performance of the image through C(i) = α×I + β×D to meet the expected goal.
[0069] Preferably, the specific implementation method for dynamically adjusting the threshold parameters after determining whether the color or depth information consistency meets the threshold standard includes:
[0070] If the light is bright in the current environment, resulting in large color changes, increase the color consistency threshold N and appropriately decrease the value of M to increase the weight of color information β = max((1 / γ, (threshold K1 + γ / 5)) / 1.5, α = min(1 / β, (threshold K2 / 1.2));
[0071] If the influence on TOF depth measurement is significantly increased due to dim ambient light or obstacles, reduce the consistency threshold M and appropriately increase the value of N to enhance the weight of depth data α = max((1 / γ, (threshold K1 + γ / 2)), β = min((1 / α, ((threshold K2×1.2) / 2.8));
[0072] Predict the possible changes in ambient light in future frames and further dynamically adjust the thresholds M and N based on the current γ value (the proportionality factor γ ∈ [1, 10] of the current brightness level and the future predicted level) to ensure different.
[0073] Preferably, the specific steps of step S4 include:
[0074] The fused data obtained from step S3 includes the three-dimensional point cloud and color information of the crop. First, process the three-dimensional point cloud data to extract the morphological characteristics of the crop. By analyzing the three-dimensional morphological characteristics, the growth state of the crop can be identified;
[0075] Compare the fused color information with the standard color model of the crop, analyze the color change situation, and pay special attention to the change of hue in the HSV color space to detect whether there is color abnormality;
[0076] Calculate the health index of the crop according to the extracted morphological characteristics and color information;
[0077] Compare the calculated health index with the standard adaptability threshold to determine the adaptability of the crop in the current environment. If the health index is higher than a preset threshold, it indicates that the crop is well adapted; otherwise, further intervention or adjustment may be required;
[0078] Summarize all test results, generate a detailed test report, and generate recommendations for farmers or agricultural managers based on the test results;
[0079] The test results are fed back in real time and compared with historical data to analyze crop growth trends.
[0080] Preferably, the crop health index is calculated using the formula:
[0081] Health index = α × morphological feature score + β × color feature score, calculated,
[0082] Among them, α and β are weight coefficients used to adjust the contribution of morphological and color features to the health index.
[0083] It can be seen from the above technical solution that the present invention has the following beneficial effects:
[0084] The crop adaptability detection method based on the HSV color segmentation algorithm obtains the three-dimensional information and color information of the crop synchronously by fusing the solid-state laser radar with the camera, so that the laser radar point cloud has RGB color information, performs HSV color space conversion on the image captured by each TOF camera, and uses a preset threshold to perform color segmentation to obtain the area of interest of the crop area. The color information and depth information obtained by the two TOF cameras are fused based on the dual-camera depth perception technology, and the adaptability detection result is generated according to the fused information, which improves the recognizability of crops in the image, reduces false detections caused by changes in the external environment, and realizes effective detection and tracking of crop rows in complex environments. It solves the problem that in the scenario with a single sensor configuration, the existing HSV color segmentation algorithm shows some shortcomings in dealing with complex environmental changes, resulting in insufficient detection accuracy and robustness. BRIEF DESCRIPTION OF THE DRAWINGS
[0085] Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION
[0086] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0087] like Figure 1 As shown, a crop adaptability detection method based on HSV color segmentation algorithm, the method comprises:
[0088] By using two TOF cameras, the target crop area is photographed from different angles or positions. Such a dual-viewpoint perspective can effectively compensate for the potential occlusion problem caused by a single perspective and ensure that different parts of the crop can be detected. For example, in a crop planting area, if a field of wheat is in the shadow or some branches and leaves are blocked by shorter crops in front, detection from a single perspective may ignore some parts. Using a dual TOF camera system, this information can be captured from different directions, and the complementary characteristics of multi-perspective data can be used in subsequent steps to improve the final result.
[0089] The TOF camera can calculate the distance to the crop by measuring the time difference between the emission and re-reflection of the light signal, generating a high-precision depth image. When the two cameras shoot at the same time, they will provide different representations of the crops in the two fields of view. After the initial image acquisition, the subsequent processing and matching of the synchronously obtained color information and spatial depth information further improves the accuracy of crop recognition.
[0090] By transforming the acquired color image data using the HSV color space, we can better cope with problems such as uneven light intensity in complex environments, because HS is more resistant to light than the common red, green, and blue (RGB) color space representation. First, the color images captured by the two TOF cameras are converted into a color model in the form of HSV, where V represents Value, i.e., brightness. Then, the HS range value corresponding to the pre-defined crop-specific color features, such as the green hue of wheat, the red hue of tomatoes, or the corresponding hues of other crops, is used as the threshold to screen out the Region of Interest (ROI), i.e., identify the target object, such as the area where crops such as wheat fields and apple orchards are located.
[0091] In order to make the point cloud acquired by the lidar have the color information of the crop surface, the image captured by the TOF camera and the solid-state lidar data need to be matched. This step is mainly achieved by combining the 3D data points of the lidar with the RGB data captured by the camera. Ideally, each 3D coordinate point from the lidar should be mapped and connected to the corresponding pixel in the image. After this processing, each data point with color features can correspond to a depth value obtained by the TOF camera. This synchronously acquired information, combined with the HSV color transformation processing flow, can significantly improve the accuracy of recognition and has better resistance to complex scenes and environmental factors such as uneven illumination. For example, even if the crop surface is obscured by local darkness or shadows that affect its overall color, this fusion method can be used to effectively improve the efficiency of crop feature extraction.
[0092] Through the processing of the above fusion technology and the optimization and improvement of the algorithm, more reliable and stable detection results can be generated in the end. When the lidar point cloud has RGB data, it still maintains strong trackability even under different lighting conditions or crop growth conditions; coupled with the complementary effect of receiving information from two TOF cameras, it can ensure higher consistency and reliability under wider conditions. In addition, due to the use of multi-angle sensors and depth-assisted positioning of laser point clouds, it can adapt well even in complex lighting or occluded crop environments, reducing the defects that may be caused by a single device and improving accuracy and robustness.
[0093] The fusion of the solid-state laser radar and the camera in step S2 specifically includes:
[0094] A solid-state LiDAR and two TOF cameras are used to synchronously acquire the three-dimensional point cloud data and RGB color information of crops. External and internal calibration are used to align the LiDAR point cloud with the camera’s RGB image.
[0095] The solid-state LiDAR and two TOF cameras can simultaneously obtain the three-dimensional point cloud and RGB image information of crops through synchronous shooting and measurement. Through internal parameter calibration, the precise internal parameter matrix and distortion parameters of the camera are obtained to ensure the spatial consistency of the image and point cloud data. External parameter calibration is used to align the coordinate system of the LiDAR point cloud and the camera image, so that each point in the point cloud can be accurately mapped to the corresponding image pixel position, realizing spatial fusion of data.
[0096] Through internal and external parameter calibration, the lidar point cloud and camera image are accurately aligned, so that the 3D point cloud data contains not only depth information but also accurate color information. This fusion method can more accurately characterize the physical and color characteristics of crops, effectively improving the accuracy and robustness of crop adaptability detection.
[0097] In this embodiment, in addition to using solid-state laser radar, other types of laser ranging devices or sensors can also be used to obtain three-dimensional information. In addition, more complex calibration methods, such as joint calibration, can be considered to improve the accuracy of data fusion. For the alignment of images and point clouds, feature matching-based methods can also be used instead of relying solely on calibration data.
[0098] The HSV color space conversion in step S2 specifically includes:
[0099] Describe the color type using the formula
[0100]
[0101] To describe the purity of a color, use the formula
[0102]
[0103] Describe the brightness of a color using the formula
[0104] V = max((R, G, B);
[0105] Among them, H represents hue, that is, the type of color; S represents saturation, that is, the purity of the color; V represents brightness; R represents the intensity of the red channel; G represents the intensity of the green channel; B represents the intensity of the blue channel.
[0106] In the HSV color space, hue H, saturation S, and brightness V are calculated using specific formulas. Hue H reflects the basic type of color, such as red, green, etc.; saturation S represents the purity of the color, and the higher the value, the brighter the color; brightness V reflects the brightness of the color. This conversion method can effectively separate color information, making subsequent color segmentation more accurate.
[0107] The calculation formula of hue H is:
[0108]
[0109] Among them, max and min represent the maximum and minimum values in RGB values respectively;
[0110] The calculation formula of saturation S is: S = (max-min) / max. When max is 0, S is defined as 0 to avoid division by zero error.
[0111] Brightness indicates the lightness or darkness of a color, which directly corresponds to the maximum value in the RGB value, i.e., V=max. Through the above steps, each pixel in the RGB color space is converted into a triplet (H, S, V) in the HSV color space for subsequent color processing and analysis.
[0112] In this embodiment, different color spaces can be selected for conversion, such as YUV or Lab color space, to adapt to different image processing requirements. In addition, more complex color correction algorithms can be used to improve the accuracy of color conversion, especially when processing images under non-standard lighting conditions. The calculation method of saturation and brightness in HSV space can also be adjusted according to application requirements, such as adding weight factors to enhance sensitivity to specific colors.
[0113] The color segmentation using the preset threshold in step S2 specifically includes:
[0114] According to the crop type and color characteristics, the threshold range in the HSV color space is pre-set. For the green area of the crop, the threshold may be set as follows: H is between 35° and 85°, S is between 0.4 and 1, and V is between 0.3 and 1. The HSV image is processed using a threshold segmentation algorithm to separate the crop area from the background area.
[0115] The threshold segmentation algorithm adopts the K-means clustering algorithm, and the specific steps are as follows:
[0116] Pixel representation: Each pixel of the HSV image is represented as a three-dimensional vector (H, S, V).
[0117] Initialize cluster centers: Select K initial cluster centers, K is set to 2, corresponding to the crop area and background area respectively.
[0118] Iterative update: Through iterative update, the distance from each pixel to the cluster center is calculated and classified into the nearest cluster center.
[0119] Update center point: Update the cluster center to the mean of all points in the current cluster, and repeat the above steps until convergence.
[0120] Segmentation result: The final output clustering result is the segmentation image of the crop area and the background area.
[0121] In this embodiment, the color segmentation algorithm preliminarily separates the crop area from the background area by using the set HSV threshold. In order to further improve the segmentation accuracy, the K-means clustering algorithm is used to process the HSV image. Through the clustering algorithm, the system can cluster pixels with similar color features together, thereby effectively segmenting the crop area. During the clustering process, the system continuously iteratively adjusts the cluster center until the optimal segmentation effect is achieved.
[0122] This implementation effectively combines the advantages of threshold segmentation and cluster analysis, can accurately identify crop areas, and is particularly suitable for crop adaptability detection under complex backgrounds. The introduction of the K-means clustering algorithm makes the segmentation results more stable and accurate, and improves the reliability and adaptability of detection.
[0123] In this embodiment, the K-means clustering algorithm can be replaced by other clustering algorithms, such as Gaussian mixture model (GMM) or fuzzy C-means (FCM), to improve the segmentation ability of nonlinear data. In addition, the threshold range can be dynamically adjusted according to different crop types and environmental conditions, and even a machine learning algorithm can be introduced to automatically optimize the threshold. For real-time applications, the execution speed of the segmentation algorithm can be increased by hardware acceleration.
[0124] The step S2 uses external parameter calibration and internal parameter calibration to align the laser radar point cloud with the camera's RGB image, including:
[0125] Using the pinhole camera model, the intrinsic parameter matrix is expressed as:
[0126]
[0127] Among them, f x and f y are the horizontal and vertical focal lengths of the camera, respectively, and c x and c y is the pixel coordinate of the principal point;
[0128] Use the chessboard calibration tool to estimate the camera's intrinsic parameter matrix and distortion coefficients by taking chessboard images at multiple different angles and applying the findchessboardcorners and calibratecamera functions in the OpenCV library.
[0129] Rotation and translation parameters, extrinsic parameters are usually expressed as a rotation matrix R and a translation vector t. The extrinsic parameter matrix can be expressed as:
[0130]
[0131] Where R is a 3x3 rotation matrix and t is a 3x1 translation vector;
[0132] During the calibration process, Lie algebra is used to optimize the rotation and translation parameters by expressing the rotation matrix R as an exponential map
[0133]
[0134] in, is an antisymmetric matrix, ξ is a Lie algebra vector representing a small change in rotation;
[0135] First, the initial rotation matrix, R0, and translation vector t0 are obtained through rough calibration;
[0136] The calibration problem is transformed into a problem of minimizing the error function, which is the projection error of the lidar point cloud on the image plane. The goal is to minimize the difference between the projection position of each lidar point and the corresponding image pixel point. The error function can be expressed as:
[0137]
[0138] Among them, P i is the coordinate of the i-th lidar point in the lidar coordinate system,
[0139] project(P i , R, t)
[0140] is the projection position of the point on the camera image plane, P i is the corresponding image pixel, N is the total number of matching point pairs;
[0141] During the optimization process, a small perturbation δξ of the Lie algebra is used to update the rotation matrix R and the translation vector t:
[0142]
[0143] Then, the optimization algorithms such as gradient descent or Gauss-Newton method are used to iteratively update until the error function converges to the minimum value. The optimized rotation matrix R and translation vector t are the external parameters of the lidar and camera.
[0144] In this embodiment, the system achieves spatial alignment of the lidar point cloud and the camera RGB image through intrinsic and extrinsic calibration. The pinhole camera model is used to describe the imaging process of the camera, and the checkerboard calibration tool is used to estimate the intrinsic parameter matrix of the camera to ensure that the intrinsic parameters of the camera are accurately calibrated. The extrinsic calibration optimizes the rotation matrix and translation vector by minimizing the projection error of the lidar point cloud on the image plane. The small perturbation method of Lie algebra is used to fine-tune these extrinsic parameters to ensure the alignment accuracy of the point cloud and the image. The final extrinsic parameters provide a reliable multi-sensor data fusion basis for crop adaptability detection.
[0145] This implementation achieves high-precision alignment of the lidar point cloud and the camera image through accurate internal and external parameter calibration. The Lie algebra small perturbation method combined with the error minimization strategy effectively improves the calibration accuracy and convergence speed. This high-precision alignment can significantly improve the effect of crop adaptability detection and provide a solid foundation for subsequent data processing and analysis.
[0146] In this embodiment, the error minimization algorithm can be replaced by other optimization methods, such as the Levenberg-Marquardt algorithm, to accelerate convergence or improve optimization accuracy. In addition, more reference images or point cloud data can be introduced during the calibration process to enhance the robustness and adaptability of external parameter estimation. For specific application scenarios, the pinhole camera model can also be expanded to a more complex imaging model to handle a wider range of camera types and imaging conditions.
[0147] Next, the specific steps of fusing the color information and depth information obtained by two TOF cameras in the crop adaptability detection method are described:
[0148] The characteristic descriptors of the color images captured by the two TOF cameras are obtained through the feature extraction algorithm.
[0149] In this embodiment, before the crop image is preliminarily analyzed in the HSV color space, a specific image feature extraction algorithm is used to process the color images captured by two time of flight (TOF) cameras installed at different positions or angles, and the most critical color information feature descriptors for crop shape and structure recognition are extracted from them. This step can be implemented using various feature detectors, such as scale-invariant feature transform SIFT, fast feature extraction method FAST combined with BRIEF feature descriptors, or more modern technologies such as ORB, etc. to detect and match crop features in images to improve the correlation and matching degree between images.
[0150] The matching results are optimized using dual-camera depth perception technology to improve color consistency between the two images.
[0151] All feature matching relationships obtained in the above steps are further processed to improve accuracy. The dual-camera depth technology in the dual-camera system may be combined with multiple computational vision technologies such as optical flow and structured illumination to obtain the depth information of each corresponding matching feature; then, based on this, corrections are made and the matching effect is optimized according to the dual-camera technology to ensure the high consistency of the extracted color information in the two fields of view.
[0152] Formulate fusion rules and calculate the fusion weight of the position of each pixel on the color image and the depth information of its corresponding feature point.
[0153] According to the different requirements of the actual crop growth environment and imaging conditions, the proportion of color and three-dimensional spatial information in the final result is reasonably determined and a suitable calculation model or criterion is established. These criteria may include but are not limited to determining the contribution ratio of each input source data in the fusion process according to factors such as pixel value difference and spatial distance to generate a more accurate and reliable color and deep scene fusion result image. At the same time, it is also necessary to avoid overfitting to reduce the impact of noise and maintain good stability.
[0154] Image compositing processing creates new color and depth composite images with enhanced detail.
[0155] The previously obtained weights are used to integrate the independent color information and depth map generated by each TOF camera to produce a new high-resolution composite image, and the post-processing algorithm ensures that the entire image has a better sense of reality and recognition to assist the next step of the HSV color model application process. This final integrated color depth composite image contains both high-precision spatial three-dimensional positioning data and can better reflect plant status changes to support a deeper analysis of crop health status.
[0156] Next, the specific steps of the fusion criteria in the crop adaptability detection method are described:
[0157] Determine the weight priority. In order to evaluate the consistency of the color and depth information of each pixel in the TOF image, according to the thresholds M and N set for depth consistency and color consistency, if the value of depth consistency is greater than M and the color consistency exceeds N, the depth information is given priority; otherwise, the color information is emphasized. The weight setting adopts a comprehensive weighted calculation method. Under these two conditions, when the depth is more reliable, the weight is Wdeep = α, when the color information is more decisive, the weight is WColor = β, and α+β=1 remains constant, which ensures that the sum of the two weights is 1 in either case.
[0158] Check each pixel - According to the set logic, the color and depth consistency check process is performed on each pixel one by one for the data collected from the two TOF cameras. Specifically, each pixel is regarded as an inspection unit, where we define i as an index symbol representing a single pixel position or element, and this position contains two different measurement information about color and depth to be compared.
[0159] Different weights are quantized based on consistency - Since each pixel may exhibit different behavioral characteristics and have different colors and depth characteristics, the corresponding quantization values are assigned to this information according to the results of the previous steps to reflect the distribution of the importance levels of different attributes; for each i, if the judgment of the previous step indicates that more emphasis should be placed on depth indicators, the color part of the pixel i will have fewer contribution factors, on the contrary, if the decision is to rely more on color information, the corresponding proportion will be increased to compensate for the missing or inaccurate data. For example, if a certain position is proven to be more suitable for taking depth as the benchmark, then its weight coefficient is set to α and the proportion left for hue becomes a relatively smaller β. This dynamic process enables the algorithm to respond quickly in a changing environment and accurately evaluate the feature content shown in the current image.
[0160] The color information and depth information are comprehensively considered and calculated to obtain the fused pixel. Finally, the output value Ci of the corresponding coordinate pixel i on a synthetic image is calculated according to the corresponding weights α for depth / β for color of each pixel color information I and depth information D obtained previously. The calculation formula is as follows: Ci=α×I+β×D. Such a weighted average operation can effectively ensure the quality of the final output image and maintain a high degree of accuracy, while also retaining as rich a number of scene details as possible, so as to achieve the goal of optimal visual effects while maintaining authenticity.
[0161] By completing all necessary technical steps and mathematical model setting processes in this way, a complete automatic detection and identification system for crop growth conditions in the HSV-based color space can be constructed through the above mechanism.
[0162] Next, the specific steps involved in a key feature of the crop adaptation detection method are described:
[0163] The consistency level of each pixel at a specific position is determined by analyzing the color and depth information of the pixel. In order to calculate whether the color information I and depth information D of these points meet the set standard values under specific conditions, that is, the consistency threshold M for depth information and N for color information, the system first obtains the relevant values of each pixel. Then, based on the pre-set threshold, the calculation process will judge whether the current pixel information exceeds the threshold according to the above criteria.
[0164] After the above steps, if the consistency level D of the depth information of a specific pixel exceeds the threshold M and the consistency of the color information of the pixel also exceeds the threshold N, the pixel is assigned a new weight coefficient to determine the final fusion ratio. In this case, the system calculates a larger value α=max threshold K1, the threshold consistency coefficient, based on the threshold K1 and the preset color consistency coefficient, and calculates the remaining part as the influence coefficient of the depth information.
[0165]
[0166] Here, it is ensured that the sum of the two weight factors is equal to 1.
[0167] Conversely, if a given pixel does not meet the above standard conditions, that is, the color consistency I of the pixel is lower than the threshold N and the consistency level of the depth information D is lower than the threshold M, then the pixel will be given a new weight scheme for comprehensive evaluation. At this time, the coefficient assigned to the pixel point is set as:
[0168]
[0169] The goal of doing this is still to keep α within the range of [0, 1], and calculate the remaining value as the contribution of color consistency:
[0170]
[0171] In summary, by allocating weights in this way, the target object and the background can be effectively separated in the image, especially when there are certain differences in color or depth features between the crop and the environment. Finally, the obtained weights are used to calculate the new weight value of each pixel, that is, C(i) = α × I + β × D, so as to achieve a more accurate segmentation effect for the entire scene.
[0172] Next, the specific steps of consistency evaluation in the crop adaptability detection method are described:
[0173] Initial consistency evaluation and determination of feature type. In this step, the initial consistency evaluation is pre-executed for each pixel position. Here, the thresholds M and N are used as reference values. If the depth difference D between this point and surrounding pixels or the color difference C between standard pixels is within the thresholds M and N, then this feature point is judged to be color-dominated. Conversely, it is regarded as being dominated by depth differences.
[0174] Adjust the coefficient according to the feature priority. For the feature pixel i dominated by color difference, before calculating Ci, it is necessary to check whether the depth difference |ΔD| from the reference point or adjacent point is less than the threshold M; when the depth difference meets the standard, that is, |ΔD| < M, set the coefficient α as a function of consistency max threshold K1, the consistency coefficient threshold, which is used to emphasize the importance of color features; if it exceeds the threshold range, then set it accordingly, and β is set as max(threshold K1, consistency coefficient threshold) consistency coefficient threshold to reduce the contribution of color features in the fusion.
[0175] Determine the depth-based adjustment coefficient. If it is determined that the position feature of this pixel is controlled by depth, further judge whether its color difference |ΔC| is lower than the threshold of N. In this case, if |ΔC| < N, we set β = max(threshold K1, consistency coefficient threshold), so as to give priority to the influence of depth change in the calculation process.
[0176] Calculate Ci. After obtaining the optimal parameters adjusted previously, in this step, adjust the performance of the image in the way of C(i) = α×I + β×D. Here, α×I and β×D reflect the importance and weighting of the two aspects of color difference I and depth difference D. The finally combined new index Ci enables the processed crop image to consider both depth information and important color features, so as to better realize the comprehensive evaluation of the crop growth status.
[0177] This processing flow can significantly improve the adaptability of the recognition system to the specific characteristics of crops in different growth environments. Take an example:
[0178] When analyzing a rice leaf, if there is a local area where the depth changes significantly due to uneven light intensity but the color is still relatively consistent in the leaf part, then this feature may be marked as mainly caused by depth change. At this time, the coefficient we calculate will tend to increase the weight of D and reduce the proportion of color features to ensure that the overall performance matches the actual situation.
[0179] Such a method makes the color segmentation based on the HSV space more accurate and reliable, and is applicable to a wide range of crop application scenarios, such as early disease prediction, health status assessment, and yield estimation, etc.
[0180] Next, describe the specific steps for dynamically adjusting the threshold parameters in the crop adaptability detection method:
[0181] Adjust the consistency and weight allocation based on the bright environment
[0182] According to the above characteristics, if the crop is in an environment with relatively strong light, which causes the color of the crop in the image to have a large deviation change, measures are taken to increase the value of the threshold standard N; here, the consistency requirement of color information is more stringent to exclude some unrepresentative samples or avoid over-matching. At the same time, the M value is appropriately reduced to make the color information have a higher proportion relative to the Toftime of Flight depth value, and the relative weight of color information and TOF information is adjusted accordingly. When calculating β, the color weight proportional coefficient, the proportional relationship γ between the existing threshold and the brightness factor and the additional compensation factors K1 and K2 are taken into account; by setting the maximum weight coefficient β=max((1 / γ,(threshold K1+γ / 5)) / 1.5, α=min(1 / β,(threshold K2 / 1.2)), it is ensured that the detection performance can be maintained even in the scenario where the light is weakened in the future.
[0183] Adjust consistency and weight configuration in dark environments
[0184] When the system finds that the effective distance for the TOF module to obtain information is limited due to low ambient light or external obstacles, thereby affecting the accuracy and stability of crop adaptive quality inspection, the system will reduce the M value and increase the N value to make the system tend to adopt TOF data rather than rely on color change information that may be misidentified. At the same time, α, the depth data weight coefficient, is updated; by setting the minimum coefficient to α=max((1 / γ,(threshold K1+γ / 2)) and β=min((1 / α,((threshold K2×1.2) / 2.8)) to maintain a balance between the two different attributes, it can ensure that the crop detection effect is still stable and effective even in harsh environments.
[0185] Predicting light change trends to further adjust consistency thresholds
[0186] According to the existing light level γ value range falling within the interval [1,10] and the expected possibility of environmental spectrum changes, N and M are adjusted in advance to cope with possible situations. For example: when it is predicted that there will be a trend of light reduction in the next time period, that is, the value of γ is less than the average brightness level, the M threshold is lowered in advance to allow more close crop instances to be included in the matching evaluation range, and the N value is increased adaptively to give TOF information higher reliability; on the contrary, when it is known that the probability of light enhancement is greater than the average level, the consistency condition N is adjusted accordingly to reduce the noise interference caused by irrelevant objects, and the rigor and accuracy of color difference detection are enhanced by reducing M. On this basis, combined with the current light conditions and future judgments, the threshold is dynamically adjusted to ensure the overall detection quality.
[0187] By reasonably adjusting and combining the thresholds such as N, M parameters and βα weight coefficients, this scheme effectively solves the problem that it is difficult to obtain accurate and reliable adaptive characteristic judgment results due to the fact that crops are under the influence of constantly changing external factors. It improves the versatility and flexibility of the method while ensuring detection accuracy and response speed.
[0188] The step S4 specifically includes:
[0189] The fused data obtained from step S3 includes the three-dimensional point cloud and color information of the crop. First, the three-dimensional point cloud data is processed to extract the morphological features of the crop. By analyzing the three-dimensional morphological features, the growth status of the crop can be identified;
[0190] Compare the fused color information with the standard color model of the crop to analyze the color changes, pay special attention to the changes in hue in the HSV color space, and detect whether there are color anomalies;
[0191] Calculate the crop health index based on the extracted morphological features and color information;
[0192] Compare the calculated health index with the standard adaptability threshold to determine the adaptability of the crop in the current environment. If the health index is higher than a preset threshold, it indicates that the crop is well adapted; otherwise, further intervention or adjustment may be required;
[0193] Summarize all test results, generate a detailed test report, and generate recommendations for farmers or agricultural managers based on the test results;
[0194] The test results are fed back in real time and compared with historical data to analyze crop growth trends.
[0195] In this embodiment, the system first extracts the three-dimensional point cloud and color information of the crop from the fused data obtained in step S3. The three-dimensional point cloud data is used to analyze the morphological characteristics of the crop, such as height, canopy volume, and leaf shape, which can reflect the growth status of the crop. Through the changes in morphological characteristics, the system can evaluate whether the crop is in a normal growth state.
[0196] At the same time, the system compares the color information extracted from the HSV color space with the standard color model, paying special attention to the changes in hue (H), because hue changes can usually reflect the health of the crop. For example, yellowing of leaves may indicate nitrogen deficiency, or redding of leaves may indicate phosphorus deficiency. The system assesses the health of the crop by detecting these color anomalies.
[0197] Next, the system calculates the health index of the crop, which takes into account morphological and color characteristics, and compares the calculation result with the standard adaptability threshold. If the health index is higher than the preset threshold, it indicates that the crop is well adapted to the current environment; conversely, if the health index is lower than the threshold, it indicates that the crop may need further intervention, such as fertilization or adjustment of irrigation strategy.
[0198] Finally, the system summarizes all test results, generates a detailed test report, and provides suggestions to farmers or agricultural managers based on the test results. The system can also compare current test results with historical data, analyze crop growth trends, and provide real-time feedback to facilitate timely decision-making.
[0199] This implementation provides a comprehensive crop adaptability detection method by combining 3D morphological features and color information. The system can not only monitor the health status of crops in real time, but also provide data-driven suggestions to help agricultural managers optimize crop management strategies. By analyzing historical data, the system can also predict crop growth trends and improve the scientificity and accuracy of agricultural management.
[0200] In this embodiment, other analysis methods, such as machine learning algorithms, can be used for 3D point cloud data processing to improve the accuracy of morphological feature extraction. In color feature analysis, in addition to focusing on hue, saturation and brightness can also be combined for a more comprehensive analysis to further improve the accuracy of crop health detection. The calculation method of the health index can also be customized according to different crop types and growth environments, and the weight coefficient and threshold can be dynamically adjusted to meet different agricultural production needs.
[0201] The crop health index is calculated using the formula:
[0202] Health index = α × morphological feature score + β × color feature score, calculated,
[0203] Among them, α and β are weight coefficients used to adjust the contribution of morphological and color features to the health index.
[0204] In this embodiment, the health index of the crop is calculated by two main features: morphological feature score and color feature score. The morphological feature score is based on the crop morphological features extracted from the 3D point cloud data, such as height, canopy density, leaf shape, etc. These features reflect the growth status of the crop and can usually be quantified by a standardized scoring method.
[0205] The color feature score is based on the color information extracted from the HSV color space, especially the change in hue. The color feature score can reflect the health status of the crop, such as the greenness of the leaves, whether there is yellowing, etc.
[0206] By assigning different weight coefficients α\alphaα and β\betaβ to the morphological feature scores and color feature scores, the system can flexibly adjust the impact of different features on the health index. For example, for crops with relatively stable growth environments, the weight of morphological features can be increased to highlight the sensitivity to morphological changes; while for crops that are sensitive to color changes, the weight of color features can be increased.
[0207] The health index finally calculated reflects the overall health status of the crop. The system judges the adaptability of the crop based on this index and provides corresponding management suggestions.
[0208] This implementation method provides a more accurate method for assessing crop health by introducing weight coefficients and flexibly combining morphological and color features. According to the characteristics and growth environment of different crops, the system can customize the assessment criteria to improve the accuracy and applicability of health index calculation. This method can provide agricultural managers with more targeted suggestions, help optimize crop management strategies, and improve crop yields and quality.
[0209] In this embodiment, the calculation method of the morphological feature score and the color feature score can be further refined. For example, more morphological parameters, such as stem diameter or leaf inclination, can be introduced to increase the dimension of evaluation. In color feature analysis, multispectral or hyperspectral data can also be combined to improve the accuracy of detection. The weight coefficients α\alphaα and β\betaβ can be dynamically adjusted in a data-driven manner according to different crop types and environmental conditions to optimize the calculation of the health index.
[0210] In actual operation, when used, two Time of Flight, or TOF, cameras are first placed in appropriate positions to ensure that they can simultaneously capture different perspectives of the same crop area. Once data collection begins, the solid-state LiDAR works synchronously with the two TOF cameras to scan the area by emitting continuous light pulses to collect depth information of the environment. Due to the fusion solution of solid-state LiDAR and camera, this advanced integration technology can ensure that the information obtained by the LiDAR accurately corresponds to the physical spatial position of each pixel in the camera image, so the data reflected by each laser beam can not only provide accurate distance measurement results but also be combined with the image from the TOF camera for subsequent color information fusion processing. Next, the image captured by the TOF camera will be converted to the HSV color space, which is an effective color model that can effectively distinguish the complex color changes of crops under different light; each converted image uses a preset HSV color threshold range for color segmentation to screen the color characteristics of a specific crop type, highlighting the area of interest where the target crop is located from a complex background. In order to further improve the efficiency and accuracy of crop identification, the system combines the depth and color data from the dual TOF camera and solid-state laser radar to accurately extract the target of interest and perform feature fusion: specifically, the real position coordinates of each target are determined by integrating and comparing these multi-dimensional data based on dual-camera depth technology. Finally, the key indicator parameters such as the actual layout and status of the crop area are determined based on the complete three-dimensional image construction information after integrating features such as depth and color, thereby realizing the automatic adaptability evaluation and precise tracking and monitoring functions under the complex changes of the crop growth environment, providing strong support for modern agricultural science and technology management.
[0211] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A crop adaptability detection method based on HSV color segmentation algorithm, characterized in that: The method comprises: S1: Use two TOF cameras to capture the same crop area; S2: Through the fusion of solid-state LiDAR and camera, the three-dimensional information and color information of crops are obtained synchronously, so that the LiDAR point cloud has RGB color information, the image captured by each TOF camera is converted into HSV color space, and the color segmentation is performed using the preset threshold to obtain the area of interest of the crop area; S3: Based on dual-camera depth perception technology, the color information and depth information obtained by two TOF cameras are integrated; S4: Generate adaptive detection results based on the fused information.
2. The crop adaptability detection method based on the HSV color segmentation algorithm according to claim 1, characterized in that: The fusion of the solid-state laser radar and the camera in step S2 specifically includes: Use solid-state LiDAR and two TOF cameras to synchronously acquire 3D point cloud data and RGB color information of crops; The lidar point cloud is aligned with the camera’s RGB image using extrinsic and intrinsic calibration.
3. The crop adaptability detection method based on the HSV color segmentation algorithm according to claim 1, characterized in that: The HSV color space conversion in step S2 specifically includes: Describe the color type using the formula: To describe the purity of color, the formula is: To describe the brightness of a color, use the formula: V = max(R, G, B); Among them, H represents hue, that is, the type of color; S represents saturation, that is, the purity of the color; V represents brightness; R represents the intensity of the red channel; G represents the intensity of the green channel; B represents the intensity of the blue channel.
4. The crop adaptability detection method based on the HSV color segmentation algorithm according to claim 3, characterized in that: The color segmentation using the preset threshold in step S2 specifically includes: According to the crop type and color characteristics, the threshold range in the HSV color space is pre-set. For the green area of the crop, the threshold may be set as follows: H is between 35° and 85°, S is between 0.4 and 1, and V is between 0.3 and 1. The HSV image is processed using a threshold segmentation algorithm to separate the crop area from the background area. The threshold segmentation algorithm adopts the K-means clustering algorithm, and the specific steps are as follows: Pixel representation: Each pixel of the HSV image is represented as a three-dimensional vector (H, S, V). Initialize cluster centers: Select K initial cluster centers, K is set to 2, corresponding to the crop area and background area respectively. Iterative update: Through iterative update, the distance from each pixel to the cluster center is calculated and classified into the nearest cluster center. Update center point: Update the cluster center to the mean of all points in the current cluster, and repeat the above steps until convergence. Segmentation result: The final output clustering result is the segmentation image of the crop area and the background area.
5. The crop adaptability detection method based on HSV color segmentation algorithm according to claim 2, characterized in that: The step S2 uses external parameter calibration and internal parameter calibration to align the laser radar point cloud with the camera's RGB image, including: Using the pinhole camera model, the intrinsic parameter matrix is expressed as: Among them, f x and f y are the horizontal and vertical focal lengths of the camera, respectively, and c x and c y is the pixel coordinate of the principal point; Use the chessboard calibration tool to estimate the camera's intrinsic parameter matrix and distortion coefficients by taking chessboard images at multiple different angles and applying the findchessboardcorners and calibratecamera functions in the OpenCV library. Rotation and translation parameters, extrinsic parameters are usually expressed as a rotation matrix R and a translation vector t. The extrinsic parameter matrix can be expressed as: Where R is a 3x3 rotation matrix and t is a 3x1 translation vector; During the calibration process, Lie algebra is used to optimize the rotation and translation parameters by expressing the rotation matrix R as an exponential map in, is an antisymmetric matrix, ξ is a Lie algebra vector representing a small change in rotation; First, obtain the initial rotation matrix, R0, and translation vector, t0, through rough calibration; The calibration problem is transformed into a problem of minimizing the error function, which is the projection error of the lidar point cloud on the image plane. The goal is to minimize the difference between the projection position of each lidar point and the corresponding image pixel point. The error function can be expressed as: Among them, P i is the coordinate of the i-th lidar point in the lidar coordinate system, project(P i , R, t) is the projection position of the point on the camera image plane, P i is the corresponding image pixel, N is the total number of matching point pairs; During the optimization process, use the small perturbation δξ of Lie algebra to update the rotation matrix R and translation vector t: Then, iterate and update through optimization algorithms such as gradient descent or Gauss-Newton method until the error function converges to the minimum value. The optimized rotation matrix R and translation vector t are the external parameters between the lidar and the camera.
6. The crop adaptability detection method based on HSV color segmentation algorithm according to claim 1, characterized in that: The step S3 based on binocular depth perception technology to fuse the color information and depth information obtained by two TOF cameras includes: Obtain the respective feature descriptors of the color images collected by the two TOF cameras through feature extraction algorithms; Use binocular depth perception technology for point-to-point correspondence matching to optimize the consistency of color information; Apply the fusion criterion to calculate the comprehensive weights of color and depth information at each pixel in the two TOF images; Obtain a new image with accurate depth and color information through synthesis processing; The calculation method of applying the fusion criterion to calculate the comprehensive weights of color and depth information at each pixel in the two TOF images is: Based on comprehensive weighted calculation, if the consistency of depth information is better than the set threshold M and the color consistency is higher than another threshold N, the weight is preferentially biased towards depth information W 深 = α, otherwise it tends to favor color information W 色 =β (where α+β=1); Check each pixel i in the two TOF cameras; Assign different weight ratios α or β to each pixel according to the result of the comparison of the consistency of color information and depth information; After obtaining the weights α or β corresponding to the color information I and depth information D of each pixel, perform the weight calculation C(i) = α×I + β×D to ensure the balance of clarity and authenticity of the image during the fusion process.
7. The crop adaptability detection method based on HSV color segmentation algorithm according to claim 6, characterized in that: The process of calculating C(i) = α×I + β×D for each pixel is: For the position of each pixel, before calculation, based on predefined conditions, evaluate whether the consistency of pixel color information and depth information meets the standards according to the thresholds M and N; When the evaluation result shows that the depth information D is higher than the consistency level M and the consistency of the color information I is higher than N, the weight coefficient is set to: α = max (threshold K1, threshold consistency coefficient), Keep the sum of the two as 1; β = min(α1, 1) For pixels that do not meet the above conditions, set their weight coefficient to β = max(threshold K1, 1 threshold consistency coefficient), Use the calculated weights for fusion to finally obtain the comprehensive weighted value C(i) = α×I + β×D; The preliminary evaluation of consistency for each pixel position before calculating C(i) = α×I + β×D according to the thresholds M and N includes: Assume that the threshold consistency and threshold K1 are given values. First, based on whether the depth difference and color difference of the current point are less than M and N as a benchmark, determine whether the feature type of the pixel is color-dominated or depth-dominated and process them separately; For the position i of the feature pixel dominated by color, when its depth difference D is consistent with the standard (|ΔD| < M), set α = max(threshold K1, consistency coefficient threshold), otherwise Relatively, for the case dominated by depth, if its color difference satisfies (|ΔC| < N), β is set to max(threshold K1, consistency coefficient threshold); Finally, adjust the color and depth performance of the image through C(i) = α×I + β×D to meet the expected goal.
8. The crop adaptability detection method based on HSV color segmentation algorithm according to claim 7, characterized in that: The specific implementation method of dynamically adjusting the threshold parameters after determining whether the color or depth information consistency meets the threshold standard includes: If the light in the current environment is bright and the color changes greatly, increase the color consistency threshold N and appropriately reduce the M value so that the color information weight increases by β=max((1 / γ,(threshold K1+γ / 5)) / 1.5, α=min(1 / β,(threshold K2 / 1.2)); If the influence on TOF depth measurement is significantly increased due to dim ambient light or obstacles, the consistency threshold M needs to be lowered and the N value needs to be appropriately increased to enhance the depth data weight α=max((1 / γ,(threshold K1+γ / 2)),β=min((1 / α,((threshold K2×1.2) / 2.8)); Predict the possible changes in ambient light in future frames and further dynamically adjust the thresholds M and N based on the current γ value (the proportional factor γ∈[1,10] between the current brightness level and the future predicted level) to ensure that they are different.
9. The crop adaptability detection method based on HSV color segmentation algorithm according to claim 1, characterized in that: The step S4 specifically includes: The fused data obtained from step S3 includes the three-dimensional point cloud and color information of the crop. First, the three-dimensional point cloud data is processed to extract the morphological features of the crop. By analyzing the three-dimensional morphological features, the growth status of the crop can be identified; Compare the fused color information with the standard color model of the crop to analyze the color changes, pay special attention to the changes in hue in the HSV color space, and detect whether there are color anomalies; Calculate the crop health index based on the extracted morphological features and color information; Compare the calculated health index with the standard adaptability threshold to determine the adaptability of the crop in the current environment. If the health index is higher than a preset threshold, it indicates that the crop is well adapted; otherwise, further intervention or adjustment may be required; Summarize all test results, generate a detailed test report, and generate recommendations for farmers or agricultural managers based on the test results; The test results are fed back in real time and compared with historical data to analyze crop growth trends.
10. The crop adaptability detection method based on HSV color segmentation algorithm according to claim 9, characterized in that: The crop health index is calculated using the formula: Health index = α × morphological feature score + β × color feature score, calculated, Among them, α and β are weight coefficients used to adjust the contribution of morphological and color features to the health index.
Citation Information
Cited By
Model construction method and device based on holder scanning identification
CN120014171A
Model construction method and device based on pan-tilt scanning recognition
CN120014171B
Crop whole growth cycle identification method and system based on deep learning
CN120125918A
Large complex workpiece space alignment real-time judgment method, system and device
CN120655573A
Color threshold adjustment method and system based on light brightness adaptive change
CN120765763A
