All-weather grass height measuring method and device based on binocular stereo vision
By combining binocular stereo vision with a tracked lawnmower, the accuracy problem of vegetation height measurement in low light and complex terrain has been solved, enabling efficient and low-cost all-weather vegetation height measurement.
Patent Information
- Application Number
- CN202411967173.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2044-12-30
AI Technical Summary
Existing methods for measuring the height of vegetation are difficult to achieve high-precision measurements in low-light environments and complex terrains, and are also costly and susceptible to environmental interference.
A binocular stereo vision-based method is adopted to acquire images of plant height through a binocular camera, perform sharpness processing and feature point extraction, calculate three-dimensional coordinates, use a tracked lawnmower to move the camera, and combine an ambient light compensator and a color correction algorithm to achieve all-weather measurement.
It enables high-precision measurement of plant height under various environmental conditions, reduces costs, expands applicable scenarios, and improves the feasibility and efficiency of measurement.
Smart Images

Figure CN119887876B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of non-contact and automated measurement technology of crop structure information, specifically to a method and device for measuring the height of vegetation in all weather conditions based on binocular stereo vision. Background Technology
[0002] Crop plant height, as a key phenotypic morphological parameter, is commonly used to assess crop vigor and, consequently, estimate biomass and potential yield. Traditional methods of plant height measurement typically involve manual measurement using a ruler. Currently, the "finite difference method," which calculates the height difference between the crop canopy and the ground, is widely considered the most effective and accurate measurement method in the field of crop plant height measurement. This method usually incorporates three-dimensional systems or sensors, including stereo vision systems, LiDAR (Light Detection and Ranging) technology, laser scanning sensors, ultrasonic sensors, and depth cameras. Although these advanced technologies have improved the automation level of measurement, various sensors still present some technical challenges.
[0003] With the development of computer vision technology, technical support has been provided for high-precision real-time measurement of plant height. For example, one method is based on point cloud data, which extracts the 3D point cloud of the base and the plant from image sequences at different angles, and then extracts the height of a single plant. Another method is based on a binocular camera, which uses a binocular camera mounted on a tracked vehicle to calculate depth. Both of these methods operate in visible light environments, making real-time measurement in low-light conditions difficult. Yet another method is based on structured light, which solves the problem of measuring plant height in low-light plains, but does not consider special terrains such as mountains or low-light environments. Furthermore, existing binocular camera distance measurement devices are still too costly, susceptible to environmental interference, and difficult to accurately measure plant height in complex terrains and low-light conditions.
[0004] Therefore, to address the shortcomings of existing methods, we propose an all-weather method and device for measuring the height of vegetation based on binocular stereo vision. Summary of the Invention
[0005] The purpose of this invention is to provide a method and device for measuring the height of vegetation based on binocular stereo vision in all weather conditions. The method involves acquiring images of vegetation height using a binocular camera, processing the images for clarity, extracting feature points, and performing stereo matching to obtain a disparity map with depth information. The three-dimensional coordinates of the vegetation height image are then calculated based on the disparity map. A subset of random points in the disparity map are selected, and the depths of all random points are sorted and the average depth is calculated. Finally, the average height of the plant is obtained by subtracting the average depth from a fixed height, thus achieving accurate close-range measurement. Furthermore, the binocular camera is inexpensive, and its movement is driven by a tracked lawnmower, making it unaffected by terrain and ambient light, thus broadening the applicability of the device, improving the feasibility of the method, and solving the problems mentioned in the background section.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] A method for measuring the height of vegetation in all weather conditions based on binocular stereo vision includes the following steps:
[0008] Step 1: Calibrate the stereo camera using the calibration method, establish the mapping relationship between the stereo camera's coordinate system and the actual world coordinate system, and obtain the stereo camera's parameters;
[0009] Step 2: Acquire images of the plants from a top-down perspective using a binocular camera; cut, correct, and filter the acquired plant height images; and automatically activate the ambient light compensator to provide supplemental lighting when the brightness of the plant height images is insufficient.
[0010] Step 3: Extract feature points from the enhanced plant height image and perform stereo matching on the extracted feature points to obtain a disparity map with depth information. Calculate the three-dimensional coordinates of the plant height image based on the disparity map.
[0011] Step 4: Select a subset of random points in the disparity map and sort the depths of all random points. Remove the highest and lowest points and calculate the average depth of the remaining depths. Then, subtract the average depth from the fixed height to obtain the average height of the plant.
[0012] The all-weather vegetation height measurement device based on binocular stereo vision includes: a binocular camera, which is connected to a processing subsystem. The processing subsystem is used to preprocess the images acquired by the binocular camera. The binocular camera is mounted on a tracked lawnmower via a fixed rod. The tracked lawnmower is electrically connected to a telemetry terminal, which is used to remotely control the movement and measurement process of the tracked lawnmower in real time.
[0013] The processing subsystem includes:
[0014] The shooting adjustment unit is used to automatically activate the ambient light compensator to compensate for lighting conditions based on the ambient light conditions when the binocular camera is shooting the height of plants; and to correct the obtained image through a color correction algorithm based on color deviation.
[0015] The image processing unit is used to preprocess the plant height images acquired by the binocular camera using image enhancement techniques, including: cropping, correction, image enhancement, threshold segmentation, morphological processing, and ROI extraction.
[0016] The feature extraction unit is used to extract feature points from the preprocessed image of plant height and to perform stereo matching on the extracted feature points using stereo vision technology to obtain a disparity map containing depth information.
[0017] The coordinate calculation unit is used to calculate the depth value of each matching point in the disparity map based on the disparity map and the principle of triangulation. Then, by combining the intrinsic and extrinsic parameters of the binocular camera and the depth value obtained by triangulation, the three-dimensional coordinates of each pixel are reconstructed to obtain the three-dimensional coordinates of the vegetation height image.
[0018] The height confirmation unit is used to select a portion of random points in the depth map, sort the depths of these random points, remove the highest and lowest points, and calculate the average depth of the remaining depths. Then, the average depth is obtained by subtracting the average depth from the fixed height.
[0019] Furthermore, image enhancement is performed on the image of the plant height, including:
[0020] Extract the grayscale value of each pixel in the image before color correction;
[0021] The grayscale value of each pixel before color correction is compared with a preset grayscale value threshold.
[0022] Extract the pixels whose gray values exceed a preset gray value threshold and their gray values, and use them as the first set of pixel gray values;
[0023] Extract the grayscale value of each pixel in the first set of grayscale values after image color correction, and use it as the second set of grayscale values.
[0024] A first contrast adjustment coefficient is obtained by using the gray values contained in the first set of gray values of pixels and the gray values contained in the second set of gray values of pixels.
[0025] The first contrast adjustment coefficient is obtained by the following formula:
[0026]
[0027] in, denoted as the first contrast adjustment coefficient; n represents the number of pixels contained in the first pixel grayscale value set, and the number of pixels contained in the first pixel grayscale value set and the second pixel grayscale value set are the same; This represents the gray value of the i-th pixel in the set of gray values of the first pixel. This indicates that the i-th pixel in the set of gray values of the first pixel corresponds to the gray value in the set of gray values of the second pixel; This indicates the preset grayscale value threshold; This represents the standard deviation of the gray values of n pixels in the set of gray values of the first pixel. represents the standard deviation of gray values of n pixels in the set of gray values of the second pixel; s represents the adjustment coefficient, and the adjustment coefficient is obtained by the following formula:
[0028]
[0029] Where s represents the adjustment coefficient; This represents the gray value of the i-th pixel in the set of gray values of the first pixel. This indicates that the i-th pixel in the set of gray values of the first pixel corresponds to the gray value in the set of gray values of the second pixel; This indicates the preset grayscale value threshold;
[0030] The contrast of the plant height image after color correction is adjusted by combining the gray values of all pixels after color correction with the first contrast adjustment coefficient.
[0031] Furthermore, the contrast of the vegetation height image after color correction is adjusted by combining the grayscale values of all pixels after image color correction with the first contrast adjustment coefficient, including:
[0032] Extract the grayscale value of each pixel after color correction of the image;
[0033] The grayscale value of each pixel after image color correction is extracted and compared with the grayscale value of each pixel before image color correction to obtain the second contrast adjustment coefficient;
[0034] The second contrast adjustment coefficient is obtained by the following formula:
[0035]
[0036] in, This represents the second contrast adjustment coefficient; m represents the number of pixels contained in the vegetation height image. This represents the grayscale value of the i-th pixel before image color correction; This represents the grayscale value of the i-th pixel after color correction. This indicates the preset grayscale value threshold; This represents the standard deviation of the gray values of n pixels in the set of gray values of the first pixel. This represents the standard deviation of the gray values of n pixels in the set of gray values of the second pixel. The standard deviation of grayscale values of m pixels contained in the image of plant height before color correction is represented. The standard deviation of the grayscale values of the m pixels contained in the image of plant height after color correction is represented.
[0037] The contrast of the plant height image after color correction is adjusted using the first contrast adjustment coefficient and the second contrast adjustment coefficient.
[0038] The adjusted contrast value is obtained using the following formula:
[0039]
[0040] in, This indicates the adjusted contrast value; This indicates the contrast value before adjustment; This represents the first contrast adjustment factor; This represents the second contrast adjustment coefficient.
[0041] Furthermore, it also includes:
[0042] The data feedback unit is used to promptly feed back the average height of the vegetation to the human-computer interaction terminal based on wireless communication technology after obtaining the average height of the vegetation.
[0043] The human-computer interaction terminal is used to receive real-time images of plant height and the calculated plant height data; and to store the plant height images and corresponding data in a time series to obtain a plant height database for the same planting area.
[0044] Furthermore, the shooting adjustment unit includes:
[0045] The model training module is used to collect historical data on various lighting conditions and vegetation types as multiple samples. A neural network model is used to train each sample and outputs a corresponding adjustment scheme based on the sample information. The adjustment scheme for each sample includes: supplementary lighting parameters and color correction parameters.
[0046] The solution acquisition module is used to predict the on-site lighting conditions and vegetation types based on the trained neural network model, and obtain the supplementary lighting parameters and color correction parameters required on-site.
[0047] The automatic adjustment module is used to automatically activate the ambient light compensator for illumination compensation based on the obtained supplementary lighting parameters and color correction parameters, and automatically enable the color correction algorithm to correct the obtained image.
[0048] Furthermore, the image processing unit includes:
[0049] The size adjustment module is used to cut the original image of plant height into multiple small regions; then, the original image of plant height is geometrically corrected to correct distortions and deformations caused by the camera or environment.
[0050] The image enhancement module is used to enhance the image of plant height after resizing, including: noise removal, background interference reduction, and edge sharpening.
[0051] The threshold segmentation module is used to perform threshold segmentation on the enhanced image of plant height, dividing the image into different regions.
[0052] The morphological processing module is used to perform morphological processing on the plant height images after threshold segmentation, including: opening operation, closing operation, erosion, dilation and affine transformation.
[0053] The ROI extraction module is used to extract the region of interest from the thresholded vegetation height image and classify the ROI into different categories.
[0054] Furthermore, the feature extraction unit includes:
[0055] The feature extraction module is used to extract multiple feature points from the preprocessed image of plant height using the SIFT algorithm. These feature points form the basis for subsequent stereo matching.
[0056] The feature matching module is used to match multiple extracted feature points with feature points pre-stored in the stereo vision library. The matching principle is: maximum similarity and minimum angular distance.
[0057] The image generation module is used to obtain each successfully matched feature pair, calculate the corresponding disparity value using the principle of stereo vision, obtain multiple disparity values, and then combine the multiple disparity values to form a disparity map.
[0058] Furthermore, the coordinate calculation unit includes:
[0059] The depth value acquisition module calculates the perpendicular distance between two points on the disparity line based on the disparity map and using the triangle interior angle sum theorem from the triangulation principle. The perpendicular distance represents the depth of the corresponding feature point, thus obtaining the depth value for each matching point on the disparity map. The formula for calculating the depth value is shown below:
[0060]
[0061] After simplification, we get:
[0062]
[0063] Where D represents image depth; f represents focal length; and B represents baseline. It is expressed as the distance between baseline B and imaging plane M; Represented as The coordinate point located on the x-axis; Represented as The coordinate point located on the x-axis.
[0064] The coordinate acquisition module uses trigonometric functions to calculate the coordinates of a third matching point, as well as the angle between the third and first matching points, from the known coordinates of two matching points and the angle between the two matching points. This yields the 3D coordinates of all matching points in the disparity map. The formula for calculating the 3D coordinates of the matching points is shown below:
[0065]
[0066] Where x represents the X-axis; y represents the Y-axis; and Z represents the depth of the object relative to the camera. Represented as baseline B to The distance between points on the X-axis; Represented as baseline B to The distance between points on the Y-axis; It is expressed as the distance between baseline B and imaging plane M; Represented as The coordinate point located on the x-axis; Represented as The coordinate point located on the x-axis; Represented as The coordinate point located on the Y-axis; Represented as The coordinate point located on the Y-axis.
[0067] The coordinate confirmation module, based on the three-dimensional coordinates of all matching points, combined with the depth values obtained from triangulation and the intrinsic and extrinsic parameters of the binocular camera, reconstructs the three-dimensional coordinates of each pixel to obtain the three-dimensional coordinates of the vegetation height image.
[0068] The image write-back module is used to transfer the obtained three-dimensional coordinates to the vegetation height image to obtain the final vegetation height image with depth information. This image includes: the location information of the vegetation and the morphological information of the vegetation.
[0069] Furthermore, the altitude confirmation unit includes:
[0070] The random point sorting module is used to select a subset of random points in the depth map. These random points can be points within a certain range of depth values. The selected points are sorted using the bubble sort method, and the points with the largest and smallest depths after sorting are selected. The remaining depth values are averaged to obtain the average depth of all points. This average depth represents the average depth of the entire vegetation height image.
[0071] The height calculation module is used to subtract the average depth from a fixed height value to obtain the average height of the vegetation.
[0072] Compared with the prior art, the beneficial effects of the present invention are:
[0073] 1. This invention acquires plant height images using a binocular camera, performs image sharpness processing on the plant height images, extracts feature points, performs stereo matching on the feature points to obtain a disparity map with depth information, and calculates the three-dimensional coordinates of the plant height image based on the disparity map; selects a subset of random points in the disparity map, sorts the depths of all random points, and calculates the average depth; then subtracts the average depth from a fixed height to obtain the average height of the plant, thereby achieving accurate close-range measurement and reducing the need for manual intervention.
[0074] 2. This invention allows for the acquisition and measurement of plant height images using an inexpensive and convenient binocular camera, making the method cost-effective, efficient, and fast. Furthermore, by utilizing a tracked lawnmower to move the binocular camera, it can freely navigate muddy terrain, overcoming camera tilt caused by various terrain changes. This eliminates the constraints of terrain and ambient light, broadening the applicability of the all-weather plant height measurement device and improving the feasibility of the all-weather plant height measurement method. Attached Figure Description
[0075] Figure 1 This is a diagram of the binocular camera device of the present invention;
[0076] Figure 2 This is a schematic diagram of the chessboard grid of the present invention;
[0077] Figure 3 This is a structural diagram of the all-weather plant height measurement device based on binocular stereo vision of the present invention;
[0078] Figure 4This is a diagram showing the composition of the processing subsystem of the present invention;
[0079] Figure 5 This is a diagram illustrating the program effect of the present invention;
[0080] Figure 6 This is a flowchart of the all-weather plant height measurement method based on binocular stereo vision of the present invention;
[0081] Figure 7 This is a stereoscopic model of the binocular camera of the present invention;
[0082] Figure 8 This is a model diagram of the binocular camera of the present invention.
[0083] In the picture: 1. Binocular camera; 2. Fixed pole; 3. Tracked lawnmower; 4. Telemetry terminal. Detailed Implementation
[0084] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0085] To address the technical problems of existing devices, such as high cost, susceptibility to environmental interference, and difficulty in accurately measuring plant height in areas with complex terrain and low light, please refer to [link to relevant documentation]. Figures 1-8 This embodiment provides the following technical solution:
[0086] A method for measuring the height of vegetation in all weather conditions based on binocular stereo vision includes the following steps:
[0087] Step 1: Calibrate the binocular camera 1 using the checkerboard calibration method, establishing the mapping relationship between the coordinate system of the binocular camera 1 and the actual world coordinate system, and acquiring the parameters of the binocular camera 1. Specifically, fix the binocular camera 1 on the fixed rod 2, and hold the checkerboard calibration board to acquire images, requiring the checkerboard to occupy as much area as possible in the image and ensuring the integrity of the checkerboard in the image; it is also required to change the angle multiple times, capturing a total of 20 pairs of images; during the calibration process, at least half of the images should be taken with the checkerboard calibration board placed on a plane parallel to the ground at the bottom of the plant, so that the ground... The coordinate system is aligned with the calibration board's planar coordinate system to calibrate the installation parameters of the binocular camera 1. Corner information of the calibration board is extracted using a computer vision library. Based on the known corner information, as well as the intrinsic and extrinsic parameters of the binocular camera 1, the intrinsic and extrinsic parameters of the binocular camera 1 are calculated using a checkerboard calibration algorithm. The intrinsic and extrinsic parameters of the binocular camera 1 are linked to the spatial position of the calibration board, and a mapping relationship is established between the coordinate system of the binocular camera 1 and the actual world coordinate system. Through this mapping relationship, the point coordinates in the three-dimensional world coordinate system are recovered from the plant height images captured by the binocular camera 1.
[0088] Step 2: The binocular camera 1 acquires images of the plants from a top-down perspective. The acquired plant height images are then processed through cropping, correction, and filtering, including image enhancement, thresholding, morphological processing, and ROI extraction. When insufficient brightness is detected in the plant height images, an ambient light compensator is automatically activated to provide supplemental lighting. Specifically, the binocular camera 1 monitors the growth status of the plants in real time, thereby acquiring top-down images. To further ensure image clarity, the acquired plant height images are cropped, corrected, and filtered to obtain clear images for subsequent analysis. Image analysis and the automatic activation of the ambient light compensator when insufficient brightness is detected ensure the effectiveness of the plant height images acquired by the binocular camera 1.
[0089] Step 3: Extract feature points from the enhanced vegetation height image and perform stereo matching on the extracted feature points to obtain a disparity map with depth information. Calculate the 3D coordinates of the vegetation height image based on the disparity map. Specifically, the original vegetation height image is enhanced and filtered to improve image quality. Feature points are extracted from the enhanced and filtered image, and stereo matching is performed on the extracted feature points to obtain a set of disparity maps rich in depth information. The depth information of the matching points in the disparity map is calculated using triangulation to obtain the 3D coordinates of the vegetation height image.
[0090] Step 4: Select a subset of random points in the disparity map, sort the depths of all random points, remove the highest and lowest points, and average the remaining depths to obtain the average depth. Then, subtract the average depth from a fixed height to obtain the average plant height. Specifically, this method obtains the average height of vegetation by selecting specific points in the disparity map and calculating their average depth.
[0091] The beneficial effects achieved by the above method are: the method is simple and easy to implement, suitable for various types of plants, and can complete the height estimation of a large number of plants in a short time, thereby improving the feasibility and effectiveness of this all-weather plant height measurement method.
[0092] The all-weather vegetation height measurement device based on binocular stereo vision includes: a binocular camera 1, which can be any inexpensive and convenient binocular camera; an ambient light compensator is installed on the binocular camera 1; the binocular camera 1 is connected to a processing subsystem, which is used to preprocess the images acquired by the binocular camera 1; the binocular camera 1 is mounted on a tracked lawnmower 3 via a fixing rod 2; the fixing rod 2 is made of adjustable stainless steel tubing, which supports the binocular camera 1, and its height should be at least 30cm higher than the expected height of the shrubs and grasses, adjustable according to the actual situation; the fixing rod 2... A lightweight aluminum alloy frame is installed on top to fix the binocular camera 1, ensuring that the binocular camera 1's viewing angle is perpendicular to the ground. The tracked lawnmower 3 is used to move the binocular camera 1 freely in muddy terrain, overcoming camera tilt caused by various terrain changes. The tracked lawnmower 3 is equipped with an onboard computer, which is connected to the binocular camera 1 and the remote telemetry terminal 4 of the tracked lawnmower 3. The tracked lawnmower 3 is electrically connected to the remote telemetry terminal 4, which is used to remotely control the movement and measurement process of the tracked lawnmower 3 in real time, thereby achieving accurate close-range measurement and reducing the need for manual intervention.
[0093] The processing subsystem includes:
[0094] The shooting adjustment unit is used to automatically activate the ambient light compensator for illumination compensation based on the ambient lighting conditions when the binocular camera 1 is shooting the height of plants. It also corrects the obtained image through a color correction algorithm based on color deviation. Specifically, the ambient light compensator ensures the image clarity of the binocular camera 1 and can automatically supplement light in rainy days or poor lighting conditions, mitigating the impact of the external environment on automated measurement. The color correction algorithm mainly corrects the color shift and lens distortion inside the binocular camera 1 to obtain accurate RGB color values.
[0095] The shooting adjustment unit includes:
[0096] The model training module collects historical data on various light conditions and plant types as multiple samples. A neural network model is trained on each sample, and an adjustment scheme is output based on the sample information. Each sample's adjustment scheme includes supplemental lighting parameters and color correction parameters. Supplemental lighting parameters refer to the light intensity required by the plant, while color correction parameters compensate for color based on the plant's color response characteristics. Specifically, historical data is obtained from historical monitoring records or laboratory experiments, and a neural network model is used to train each sample. Based on the sample information, a corresponding adjustment scheme is output. This allows the neural network model to learn the complex relationships between different light conditions and plant types within the samples, and to generate personalized adjustment schemes based on the information of each sample. This effectively solves the problem of plant growth regulation under different light conditions and plant types, thereby improving the accuracy and efficiency of plant growth.
[0097] The solution acquisition module is used to predict the on-site lighting conditions and vegetation types based on the trained neural network model, and obtain the required supplemental lighting parameters and color correction parameters. Specifically, the on-site lighting conditions and vegetation types are input into the trained neural network model; the model predicts the input data to obtain the required supplemental lighting parameters and color correction parameters. Since these parameters are generated based on the actual on-site lighting conditions and vegetation types, they can better adapt to the on-site environment; and the obtained supplemental lighting parameters and color correction parameters are output as the final results for on-site personnel to perform actual operations.
[0098] The automatic adjustment module automatically activates the ambient light compensator for illumination compensation based on the obtained supplementary lighting parameters and color correction parameters, and automatically uses the color correction algorithm to correct the acquired image to achieve the best measurement results. Specifically, by receiving the supplementary lighting parameters and color correction parameters output by the neural network model, it automatically adjusts the brightness and angle of the ambient light compensator to ensure that the lighting conditions meet the requirements; and based on the received supplementary lighting parameters and color correction parameters, it automatically adjusts the parameters of the imaging algorithm to obtain the best optical imaging effect. This ensures that the binocular camera 1 can maintain good working condition and obtain the best measurement results in different environments. Secondly, in specific implementation, the mean and variance of the image on the grayscale image can also be calculated. When there is an abnormality in brightness, the mean will deviate from the mean point. For example, if it is 128, the variance will also be smaller. By calculating the mean and variance of the grayscale image, it is possible to assess whether the image is underexposed. When outdoor light is too strong, the image is processed using histogram equalization, Gaussian filtering, WSL filtering, and median filtering to reduce the side effects of excessive light and thus improve measurement accuracy. When insufficient brightness is detected, the external ambient light compensator can be activated to provide sufficient and appropriate brightness, ensuring image quality.
[0099] The image processing unit is used to preprocess the plant height images acquired by the binocular camera 1 using image enhancement techniques, including: cropping, correction, image enhancement, threshold segmentation, morphological processing, and ROI extraction, to improve their clarity and accuracy and ensure the quality of the plant height images; the image processing unit includes:
[0100] The size adjustment module is used to segment the original image of plant height into multiple smaller regions to facilitate subsequent processing and recognition. It then performs geometric correction on the original image of plant height to correct distortions and deformations caused by the camera or environment. Specifically, by segmenting the original image of plant height into multiple smaller regions, the size and shape of the image are made more suitable for subsequent processing. Simultaneously, this module can also perform geometric correction on the original image to eliminate image distortions and deformations caused by the binocular camera 1 or the environment, thereby greatly improving the accuracy and efficiency of subsequent processing and recognition.
[0101] The image enhancement module is used to enhance the resized plant height image, including: noise removal, background interference reduction, and edge sharpening, to ensure the contrast and clarity of the plant height image. Specifically, by enhancing the resized plant height image, the contrast and clarity of the plant height image are ensured, making the plant height image easier to identify in subsequent steps and improving the overall quality of the plant height image.
[0102] Specifically, image enhancement is performed on the plant height image, including:
[0103] Extract the grayscale value of each pixel in the image before color correction;
[0104] The grayscale value of each pixel before color correction is compared with a preset grayscale value threshold.
[0105] Extract the pixels whose gray values exceed a preset gray value threshold and their gray values, and use them as the first set of pixel gray values;
[0106] Extract the grayscale value of each pixel in the first set of grayscale values after image color correction, and use it as the second set of grayscale values.
[0107] A first contrast adjustment coefficient is obtained by using the gray values contained in the first set of gray values of pixels and the gray values contained in the second set of gray values of pixels.
[0108] The first contrast adjustment coefficient is obtained by the following formula:
[0109]
[0110] in, denoted as the first contrast adjustment coefficient; n represents the number of pixels contained in the first pixel grayscale value set, and the number of pixels contained in the first pixel grayscale value set and the second pixel grayscale value set are the same; This represents the gray value of the i-th pixel in the set of gray values of the first pixel. This indicates that the i-th pixel in the set of gray values of the first pixel corresponds to the gray value in the set of gray values of the second pixel; This indicates the preset grayscale value threshold; This represents the standard deviation of the gray values of n pixels in the set of gray values of the first pixel. represents the standard deviation of gray values of n pixels in the set of gray values of the second pixel; s represents the adjustment coefficient, and the adjustment coefficient is obtained by the following formula:
[0111]
[0112] Where s represents the adjustment coefficient; This represents the gray value of the i-th pixel in the set of gray values of the first pixel. This indicates that the i-th pixel in the set of gray values of the first pixel corresponds to the gray value in the set of gray values of the second pixel; This indicates the preset grayscale value threshold;
[0113] The contrast of the plant height image after color correction is adjusted by combining the gray values of all pixels after color correction with the first contrast adjustment coefficient.
[0114] The technical effect of the above technical solution is as follows: by calculating the first contrast adjustment coefficient This scheme enables fine-tuning of contrast in color-corrected images of vegetation height. This adjustment is based on pixels within a specific grayscale range (i.e., pixels with grayscale values exceeding a preset threshold), thus more accurately improving image contrast and making details clearer. Adjustment coefficient The calculation takes into account the changes in pixel grayscale values, making the contrast adjustment adaptive. When the grayscale value of a pixel in the image changes significantly, the adjustment coefficient increases accordingly, resulting in a stronger contrast adjustment; conversely, when the grayscale value changes slightly, the adjustment coefficient decreases to avoid image distortion caused by over-adjustment. This scheme considers not only the grayscale values before color correction but also the corrected grayscale values to calculate the contrast adjustment coefficient. This approach can more comprehensively reflect the changes in the image during the color correction process, thus adjusting the contrast more accurately. By processing pixels exceeding a preset grayscale value threshold individually, this scheme can enhance contrast while preserving the image's detail information. This is crucial for applications such as the recognition and measurement of plant height images, as preserving detail information helps improve the accuracy and reliability of measurements. Although this scheme involves multiple steps and calculations, each step is performed on pixels within a specific range, thus achieving high processing efficiency. Furthermore, filtering pixels by setting a preset grayscale value threshold can reduce unnecessary computation and further improve processing speed.
[0115] In summary, the above-mentioned technical solutions demonstrate excellent performance in contrast enhancement, adaptive adjustment, grayscale correction, detail preservation, and processing efficiency. These effects are of great significance for image enhancement and subsequent applications of vegetation height images.
[0116] Specifically, the contrast of the vegetation height image after color correction is adjusted by combining the grayscale values of all pixels after image color correction with a first contrast adjustment coefficient, including:
[0117] Extract the grayscale value of each pixel after color correction of the image;
[0118] The grayscale value of each pixel after image color correction is extracted and compared with the grayscale value of each pixel before image color correction to obtain the second contrast adjustment coefficient;
[0119] The second contrast adjustment coefficient is obtained by the following formula:
[0120]
[0121] in, This represents the second contrast adjustment coefficient; m represents the number of pixels contained in the vegetation height image. This represents the grayscale value of the i-th pixel before image color correction; This represents the grayscale value of the i-th pixel after color correction. This indicates the preset grayscale value threshold; This represents the standard deviation of the gray values of n pixels in the set of gray values of the first pixel. This represents the standard deviation of the gray values of n pixels in the set of gray values of the second pixel. The standard deviation of grayscale values of m pixels contained in the image of plant height before color correction is represented. The standard deviation of the grayscale values of the m pixels contained in the image of plant height after color correction is represented.
[0122] The contrast of the plant height image after color correction is adjusted using the first contrast adjustment coefficient and the second contrast adjustment coefficient.
[0123] The adjusted contrast value is obtained using the following formula:
[0124]
[0125] in, This indicates the adjusted contrast value; This indicates the contrast value before adjustment; This represents the first contrast adjustment factor; This represents the second contrast adjustment coefficient.
[0126] The technical effect of the above solution is as follows: This solution adopts a first contrast adjustment coefficient. Second contrast adjustment coefficient This scheme employs a dual mechanism for contrast adjustment. The first contrast adjustment coefficient is calculated based on pixels within a specific grayscale range (pixels exceeding a preset threshold), while the second contrast adjustment coefficient considers the grayscale value changes of all pixels before and after image color correction. This dual mechanism allows for a more comprehensive assessment of image contrast requirements and enables more precise adjustments. By calculating the second contrast adjustment coefficient, the scheme takes into account the impact of image color correction on the overall grayscale value distribution. This adaptability allows contrast adjustment to more flexibly adapt to the color correction effects of different images, ensuring that the adjusted image is visually more natural and comfortable. During contrast adjustment, this scheme considers both the overall grayscale value changes and pays special attention to pixels within a specific grayscale range. This approach helps to enhance contrast while preserving image detail, resulting in improved clarity and detail in the adjusted image. Although the scheme involves multiple steps and calculations, each step is based on the grayscale values before and after image color correction, thus achieving high processing efficiency. Furthermore, by accurately calculating the contrast adjustment coefficient, the scheme ensures the accuracy of contrast adjustment, avoiding image distortion caused by over- or under-adjustment. This technical solution is not only applicable to contrast adjustment of images showing plant height, but can also be extended to other types of image processing tasks. Whenever an image requires both color correction and contrast adjustment, this dual contrast adjustment mechanism can be tried to optimize the processing results.
[0127] In summary, the aforementioned technical solutions demonstrate superior performance in terms of dual contrast adjustment mechanisms, adaptability and flexibility, detail preservation and contrast enhancement, processing efficiency and accuracy, and broad applicability. These effects work together during image contrast adjustment, resulting in improvements in visual quality, detail representation, and processing efficiency.
[0128] The threshold segmentation module is used to perform threshold segmentation on the enhanced plant height image, dividing the image into different regions to facilitate subsequent processing and recognition. Specifically, it uses mathematical methods, such as Otsu's method, to perform threshold segmentation on the image, thereby obtaining a binary image. This allows the pixels in the plant height image to be divided into two categories: black and white, facilitating subsequent processing and recognition.
[0129] The morphological processing module performs morphological processing on the thresholded plant height image, including opening, closing, erosion, dilation, and affine operations. This achieves functions such as noise removal, edge enhancement, and connecting adjacent regions, helping to eliminate irregular shapes and unnecessary details in the image, making it easier for subsequent recognition and classification. Specifically, by performing morphological processing on each block, noise and redundant information are removed as much as possible while maintaining the overall structure of the plant height image, facilitating subsequent recognition and classification. Furthermore, the opening operation is a dilation operation that expands the region in the plant height image and merges non-overlapping parts. The closing operation is a erosion operation that reduces the region in the plant height image and merges non-overlapping parts. The affine operation connects adjacent regions by stretching and compressing certain regions in the plant height image according to certain rules, thereby linking different parts of the plant height image to achieve better results.
[0130] The ROI extraction module is used to extract regions of interest from the thresholded plant height images and classify the ROIs into different categories for subsequent analysis. Specifically, it extracts the ROIs from the processed images and classifies them into different categories. Further analysis is then performed on the classified regions, including statistical analysis and prediction of plant height and growth density. In this embodiment, for example, when analyzing plant height images, the ROI extraction module can be applied to the image of each plant and classified into different categories. By classifying the plants, the growth status of each plant, such as height and growth density, can be understood, thus providing useful reference information for agricultural production management.
[0131] The feature extraction unit is used to extract feature points from the preprocessed image of plant height and to perform stereo matching on the extracted feature points using stereo vision technology to obtain a disparity map containing depth information. The feature extraction unit includes:
[0132] The feature extraction module is used to extract multiple feature points from the preprocessed vegetation height image using the SIFT algorithm. These feature points form the basis for subsequent stereo matching. Specifically, the SIFT algorithm is used to extract features from the preprocessed vegetation height image, resulting in a series of feature points. These feature points represent the local structure of the vegetation in the image and can help with subsequent stereo matching and semantic analysis. The obtained feature points are then filtered, retaining those with good stability and uniqueness, which will be used for subsequent stereo matching to determine whether the vegetation in the image remains consistent under different viewpoints.
[0133] The feature matching module is used to match multiple extracted feature points with feature points pre-stored in a stereo vision database. The matching principles are: maximum similarity and minimum angular distance. Maximum similarity refers to the maximum similarity between two feature points, which is also the maximum of all possible minimum similarities between two feature points. Minimum angular distance refers to the minimum distance between the two shortest paths formed by two feature points in space. Both maximum similarity and minimum angular distance are used to measure the closeness of the relationship between two feature points. The higher the similarity, the more similar the two feature points are; the smaller the angular distance, the smaller the angular change between the two feature points. Specifically, the extracted feature points are matched with feature points pre-stored in the stereo vision database by calculating the similarity or angular distance between two feature points, and then iterating through each feature point using this method, matching it with each feature point in the stereo vision database, and finding the feature point with the smallest similarity or angular distance. This matching result is then returned as the current matching result.
[0134] The image generation module is used to acquire each successfully matched feature pair and calculate the corresponding disparity value using the principle of stereo vision, obtaining multiple disparity values. These multiple disparity values are then combined to form a disparity map. The disparity map contains depth information and can be used to represent the spatial positional relationship of objects. Specifically, the depth value of each feature point is obtained by calculating the distance from each feature point to its corresponding feature point. Then, based on the distribution of depth values, the depth value of each pixel is determined and used as a pixel value of the image. Through interpolation and other methods, all pixel values are combined into a complete image to obtain the disparity map.
[0135] The coordinate calculation unit is used to calculate the depth value of each matching point in the disparity map based on the disparity map and the principle of triangulation; then, by combining the intrinsic and extrinsic parameters of the binocular camera 1 and the depth values obtained from triangulation, it reconstructs the three-dimensional coordinates of each pixel to obtain the three-dimensional coordinates of the vegetation height image; the coordinate calculation unit includes:
[0136] The depth value acquisition module is used to calculate the perpendicular distance between two points on the disparity line based on the disparity map and using the triangle angle sum theorem in triangulation. This distance is the depth of the corresponding feature point. This process is repeated to obtain the depth value of each matching point on the disparity map. Specifically, in this embodiment, assuming there are two pairs of matching points AB and CD on the disparity map, where AB and CD are located on the disparity line, the midpoints E and F of line segments AB and CD can be found first, and then the perpendicular distance between AE and CF can be calculated using the triangle angle sum theorem. Furthermore, an angle can be calculated in triangles AEF and BED. , making , Then AE and AF are candidate values for the depth of the corresponding point on the disparity map. If the two candidate values meet certain accuracy requirements and are consistent with the depth estimates of other matching points, then the two candidate values can be considered to be relatively reliable depth values. Repeating this process will yield the depth value of each matching point on the disparity map.
[0137] In practice, because the optical axes of the binocular camera 1 are easily affected by external factors in real production and life, it is necessary to calibrate and correct the positions of the two cameras before performing 3D reconstruction.
[0138] like Figures 7-8 As shown: The figure illustrates the calibrated binocular camera position model; the figure contains a triangular relationship between a real-world point P and the two cameras, which is key to reconstructing the 3D information of that point; the origin of the world coordinate system O-XYZ is... Figure 7 The image coordinate system on the horizontal plane of the left and right camera imaging planes is defined by the imaging optical center represented by Z. , These are the points P in the real 3D world mapped onto the left and right image coordinate systems by the stereo camera 1; the depth distance of the point in 3D space is... The perpendicular distance from the point to the baseline B of the stereo camera 1; therefore, the formula for solving the depth D is as follows:
[0139]
[0140] After simplification, we get:
[0141]
[0142] Where D represents image depth; f represents focal length; and B represents baseline. It is expressed as the distance between baseline B and imaging plane M; Represented as The coordinate point located on the x-axis; Represented as The coordinate point located on the x-axis.
[0143] The coordinate acquisition module is used to calculate the coordinates of the third matching point and the angle between the third matching point and the first matching point from the known coordinates of the two matching points and the angle between the two matching points using trigonometric function relationships; repeating this process, the three-dimensional coordinates of all matching points in the disparity map are obtained.
[0144] Specifically, the three-dimensional coordinates of point P are solved using the following formula:
[0145]
[0146] Where x represents the X-axis; y represents the Y-axis; and Z represents the depth of the object relative to the camera. Represented as baseline B to The distance between points on the X-axis; Represented as baseline B to The distance between points on the Y-axis; It is expressed as the distance between baseline B and imaging plane M; Represented as The coordinate point located on the x-axis; Represented as The coordinate point located on the x-axis; Represented as The coordinate point located on the Y-axis; Represented as The coordinate point located on the Y-axis.
[0147] The coordinate confirmation module, based on the 3D coordinates of all matching points, combines the depth values obtained from triangulation with the intrinsic and extrinsic parameters of the binocular camera 1. The intrinsic parameters include the camera's inner diameter and distortion coefficients, while the extrinsic parameters include the camera's position and orientation in space, as well as the 3D coordinates of each matching point. This process reconstructs the 3D coordinates of each pixel, resulting in the 3D coordinates of the vegetation height image. Specifically, the 3D image is reconstructed using the intrinsic and extrinsic parameters of the binocular camera 1 and the 3D coordinates of each matching point. Each matching point is then back-projected to restore the 3D coordinates to the 2D image. Next, based on the extrinsic parameters of the binocular camera 1 and the 3D coordinates of each pixel, they are converted into pixel coordinates in 3D space. Finally, for each pixel, the above steps are repeated to obtain the 3D coordinates of each pixel.
[0148] The image write-back module is used to transfer the obtained 3D coordinates to the vegetation height image, resulting in a final vegetation height image with depth information. This image includes the location and morphological information of the vegetation. Specifically, the obtained 3D coordinates are corrected to match the depth information of corresponding pixels in the vegetation height image. Based on the corrected 3D coordinates and image depth information, a coordinate-to-pixel mapping relationship is established. Using this mapping relationship, the obtained 3D coordinates are converted into corresponding image coordinates, and these image coordinates, along with the original image depth information, are used to construct the final vegetation height depth image. The generated vegetation height depth image is further processed, such as removing noise and enhancing contrast, to obtain a clearer image. This image can be used to further analyze plant growth and assess planting conditions.
[0149] The height confirmation unit is used to select a subset of random points in the depth map, sort the depths of these random points, remove the highest and lowest points, and calculate the average depth of the remaining depths. Then, a fixed height is subtracted from the average depth to obtain the average height of vegetation. The height confirmation unit includes:
[0150] The random point sorting module selects a subset of random points from the depth map. These random points can be points within a certain range of depth values. A bubble sort algorithm is used to sort these points, and the points with the highest and lowest depths are selected, as these may be outliers and not representative. The remaining depth values are then averaged to obtain the average depth of all points, which represents the average depth of the entire vegetation height image. The height calculation module subtracts the average depth from a fixed height value to obtain the average height of the vegetation. Specifically, the coordinates (x, y) of a point are its position coordinates in the 640×480 pixel image, and Z is the distance from the point to the stereo camera 1, i.e., the depth value. Ninety data points are selected within the target area, and their coordinates (x, y) and depth values are obtained. Invalid points with a depth of 0 are deleted, and the remaining valid points are stored in a file. The valid points in the file are sorted by depth value, and the middle 30 points are taken. The average value of these 30 points is the filtered data. The plant height is calculated from the average vertical distance between the binocular camera 1 and the top of the plant, and from the height of the binocular camera 1 above the ground. The average plant height is obtained by subtracting the average vertical distance between the binocular camera 1 and the top of the plant from the height of the binocular camera 1 above the ground.
[0151] The data feedback unit is used to promptly transmit the average height of the vegetation to the human-computer interaction terminal based on wireless communication technology, so that users can make corresponding adjustments and management based on this information, such as deciding when to fertilize or water.
[0152] The human-computer interaction terminal receives real-time images of plant height and calculates the plant height data. It stores the plant height images and corresponding data in a time series, creating a database of plant heights within the same planting area. Specifically, by storing data in a time series, it allows comparison of plant heights at different dates or periods to obtain growth trends. It can also compare plants in different areas to determine if significant differences exist. Simultaneously, it generates visual reports and charts to help users better understand plant growth and make more informed decisions.
[0153] The beneficial effects achieved by the above methods are as follows: First, accurate close-range measurement is achieved through the above methods, reducing the need for manual intervention. Second, the device is an inexpensive and convenient binocular camera 1, which gives the device the advantages of low cost, high efficiency and speed. At the same time, relying on the tracked lawn mower 3 to move the binocular camera 1, the measurement personnel do not need to go to the site in person, and can complete the entire measurement process through remote control. Furthermore, it can move freely in muddy terrain in the field, overcome the camera tilt caused by various terrain changes, and ensure that the binocular camera 1 is not constrained by terrain and ambient light. This broadens the applicable scenarios of this all-weather vegetation height measurement device and improves the feasibility of this all-weather vegetation height measurement method.
[0154] Working principle: Images of plant height are acquired through binocular camera 1, and the images are processed for clarity. Feature points are then extracted and stereo matching is performed to obtain a disparity map with depth information. The three-dimensional coordinates of the plant height image are calculated based on the disparity map. A subset of random points in the disparity map are selected, and the depths of all random points are sorted and the average depth is calculated. Finally, the average height of the plant is obtained by subtracting the average depth from the fixed height.
[0155] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0156] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for all-weather measurement of the height of a plant based on binocular stereo vision, characterized in that, The method comprises the following steps: Step 1: calibrate the binocular camera (1) by using calibration method, establish the mapping relationship between the coordinate system of the binocular camera (1) and the actual world coordinate system, and obtain the parameters of the binocular camera (1); Step 2: collect the overhead view image of the plant by using the binocular camera (1), cut, correct and filter the collected plant height image; When the brightness of the plant height image is not enough, automatically turn on the ambient light compensator to perform light compensation operation; Step 3: extract feature points from the enhanced plant height image, and perform stereo matching on the extracted feature points to obtain a disparity map with depth information, and calculate the three-dimensional coordinates of the plant height image according to the disparity map; Step 4: select a part of random points in the disparity map, sort the depths of all random points, filter out the highest point and the lowest point, calculate the average depth of the remaining depths, and then subtract the average depth from the fixed height to obtain the average height of the plant.
2. The all-weather grass height measuring device based on binocular stereo vision is applied to the all-weather grass height measuring method based on binocular stereo vision in claim 1, characterized in that: The method comprises the following steps: The processing subsystem is used for preprocessing the image obtained by the binocular camera (1), the binocular camera (1) is installed on the track mower (3) through the fixed rod (2), the track mower (3) is electrically connected with the telemetry terminal (4), and the telemetry terminal (4) is used for remotely controlling the movement and measurement process of the track mower (3) in real time; The processing subsystem comprises: The shooting adjustment unit is used for automatically turning on the ambient light compensator to compensate the light according to the on-site light condition when the binocular camera (1) shoots the plant height, and correcting the obtained image through color correction algorithm according to color deviation; The image processing unit is used for preprocessing the plant height image obtained by the binocular camera (1) by using image enhancement technology, including cutting, correcting, image enhancement, threshold segmentation, morphological processing and ROI extraction; The feature extraction unit is used for extracting feature points from the preprocessed plant height image, and performing stereo matching on the extracted feature points by using stereo vision technology to obtain a disparity map containing depth information; The coordinate calculation unit is used for calculating the depth value of each matching point in the disparity map according to the disparity map by using the principle of triangulation; then, the three-dimensional coordinates of each pixel point are reconstructed by combining the internal and external parameters of the binocular camera (1) and the depth value obtained by triangulation, so as to obtain the three-dimensional coordinates of the plant height image; 3. The binocular stereo vision based all-weather grass height measuring device according to claim 2, characterized in that: The height confirmation unit is used for selecting a part of random points in the depth map, sorting the depths of the random points, filtering out the highest point and the lowest point, calculating the average depth of the remaining depths, and then subtracting the average depth from the fixed height to obtain the average height of the plant height. The image enhancement of the plant height image comprises: Extracting the gray value of each pixel point before image color correction; Comparing the gray value of each pixel point before image color correction with a preset gray value threshold; Extracting the pixel points and their gray values whose gray values exceed the preset gray value threshold as a first pixel point gray value set; Extract the gray value corresponding to each pixel point contained in the first pixel point gray value set after image color correction as the second pixel point gray value set; Obtain the first contrast adjustment coefficient by using the gray values contained in the first pixel point gray value set and the gray values contained in the second pixel point gray value set; The first contrast adjustment coefficient is obtained by the following formula: ; wherein, represents a first contrast adjustment coefficient; n represents the number of pixels contained in the first pixel gray value set, and the number of pixels contained in the first pixel gray value set and the second pixel gray value set is the same; represents the gray value of the i-th pixel in the first pixel gray value set; represents the gray value of the i-th pixel in the first pixel gray value set corresponding to the second pixel gray value set; represents a preset gray value threshold; represents the gray value standard deviation of the n pixels in the first pixel gray value set; represents the gray value standard deviation of the n pixels in the second pixel gray value set; s represents an adjustment coefficient, and the adjustment coefficient is obtained by the following formula: ; wherein s represents an adjustment coefficient; represents a gray value of the i-th pixel point in the first pixel point gray value set; represents a gray value of the i-th pixel point in the first pixel point gray value set corresponding to the second pixel point gray value set; represents a preset gray value threshold. Adjust the contrast of the grass and tree height image after image color correction by using the gray values of all pixel points after image color correction and the first contrast adjustment coefficient.
4. The binocular stereo vision based all-weather grass height measuring device according to claim 3, characterized in that: Adjusting the contrast of the grass and tree height image after image color correction by using the gray values of all pixel points after image color correction and the first contrast adjustment coefficient, comprising: Extract the gray value of each pixel point after image color correction; Extract the second contrast adjustment coefficient by using the gray value of each pixel point after image color correction and the gray value of each pixel point before image color correction; The second contrast adjustment coefficient is obtained by the following formula: ; wherein, represents the second contrast adjustment coefficient; m represents the number of pixel points contained in the grass and tree height image; represents the gray value of the i-th pixel point before the image color correction; represents the gray value of the i-th pixel point after the image color correction; represents the preset gray value threshold; represents the gray value standard deviation of n pixel points in the first pixel gray value set; represents the gray value standard deviation of n pixel points in the second pixel gray value set; represents the gray value standard deviation of m pixel points contained in the grass and tree height image before the image color correction; represents the gray value standard deviation of m pixel points contained in the grass and tree height image after the image color correction; Adjust the contrast of the grass and tree height image after image color correction by using the first contrast adjustment coefficient and the second contrast adjustment coefficient; The adjusted contrast value is obtained by the following formula: ; wherein, represents the adjusted contrast value; represents the unadjusted contrast value; represents the first contrast adjustment factor; represents the second contrast adjustment factor.
5. The binocular stereo vision based all-weather grass height measuring device according to claim 2, characterized in that: Also includes: A data feedback unit for timely feedback to a human-computer interaction terminal based on wireless communication technology after obtaining the average height of the grass and tree height; A human-computer interaction terminal for receiving the grass and tree height image and the calculated grass and tree height data in real time; and storing the grass and tree height image and the corresponding data in time sequence to obtain a grass and tree height database in the same planting area.
6. The binocular stereo vision based all-weather grass height measuring device according to claim 2, characterized in that: The shooting adjustment unit comprises: A model training module for collecting historical data of various different light conditions and grass and tree types as a plurality of samples; training each sample by using a neural network model, and outputting a corresponding adjustment scheme according to sample information, wherein the adjustment scheme corresponding to each sample comprises a light supplement parameter and a color correction parameter; A scheme acquisition module for predicting the on-site light condition and the grass and tree type according to the trained neural network model to obtain the required light supplement parameter and color correction parameter on site; An automatic adjustment module for automatically starting the ambient light compensator for light compensation and automatically enabling the color correction algorithm to correct the obtained image according to the obtained light supplement parameter and color correction parameter.
7. The binocular stereo vision based all-weather grass height measuring device according to claim 2, characterized in that: The image processing unit comprises: A size adjustment module for cutting the original image of the grass and tree height to divide the original image into a plurality of small areas; and performing geometric correction on the original image of the grass and tree height to correct the distortion and deformation caused by the camera or the environment; An image enhancement module for enhancing the size-adjusted grass and tree height image, including removing noise, reducing background interference, and increasing edge sharpening; A threshold segmentation module for threshold segmentation of the enhanced grass and tree height image to divide the image into different areas; A morphological processing module for morphological processing of the threshold segmented grass and tree height image, including opening operation, closing operation, erosion, dilation, and affine; The ROI extraction module is configured to extract a region of interest (ROI) from the grass and tree height image after threshold segmentation, and perform vegetation classification on the ROI to divide the region into different categories.
8. The binocular stereo vision based all-weather grass height measuring device according to claim 2, characterized in that: The feature extraction unit comprises: The feature extraction module is configured to extract a plurality of feature points from the preprocessed grass and tree height image by using a SIFT algorithm, and the plurality of feature points are the basis for subsequent stereo matching. The feature matching module is configured to match the extracted plurality of feature points with feature points pre-stored in a stereo vision library. The picture generation module is configured to obtain each matched feature pair, calculate a corresponding parallax value by using a stereo vision principle, obtain a plurality of parallax values, and form a parallax map by using the plurality of parallax values.
9. The binocular stereo vision based all-weather grass height measuring device according to claim 2, characterized in that: The coordinate calculation unit comprises: The depth value acquisition module is configured to calculate a vertical distance between the connecting line of two points on a parallax line by using the theorem of the sum of angles in a triangle in the principle of triangulation, according to the parallax map, and the vertical distance is the depth of the corresponding feature point, to obtain the depth value of each matched point on the parallax map. ; where D represents the image depth; f represents the focal length; and B represents the base line; represents the distance between the base line B and the imaging plane M; represents the distance between the base line B and the imaging plane M; the coordinate point on the x-axis; represents the distance between the base line B and the imaging plane M; the coordinate point on the x-axis; The coordinate acquisition module is configured to calculate the third matched point coordinate and the angle between the third matched point and the first matched point by using the trigonometric function relationship, from the known two matched point coordinates and the angle between the two matched points. ; wherein x represents the X axis; y represents the Y axis; Z represents the depth of the object relative to the camera; represents the distance between the baseline B to the point located between the X axis; represents the distance between the baseline B to the point located between the Y axis; represents the distance between the baseline B to the imaging plane M; represents the coordinate point located on the x axis; represents the coordinate point located on the x axis; represents the coordinate point located on the Y axis; represents the coordinate point located on the Y axis; The coordinate confirmation module is configured to reconstruct the three-dimensional coordinates of each pixel point based on the three-dimensional coordinates of all matched points, the depth value obtained by triangulation, and the internal and external parameters of the binocular camera (1), to obtain the three-dimensional coordinates of the grass and tree height image. The image write-back module is configured to write the obtained three-dimensional coordinates into the grass and tree height image, to obtain the final grass and tree height image with depth information, and the grass and tree height image comprises position information and morphological information of the grass and tree plants.
10. The binocular stereo vision based all-weather grass height measuring device according to claim 2, characterized in that: The height confirmation unit comprises: The random point sorting module is configured to select a part of random points in the depth map, sort the selected points by using the bubble sorting method, and filter out the point with the largest depth and the point with the smallest depth after sorting. The height calculation module is configured to obtain the average height of the grass and trees by subtracting the average depth from the fixed height value.
Citation Information
Patent Citations
Crop plant height telemetering method and system based on machine vision
CN117128874A
Multi-terrain all-weather plant height measuring device and plant height measuring method thereof
CN118424119A