All-weather vegetation plant height measuring method and device based on binocular stereoscopic vision
Through the plant height measurement method based on binocular stereo vision, combined with the crawler lawn mower to drive the binocular camera displacement, the measurement problems in low-light and complex terrain are solved, and the all-weather accurate measurement and low-cost and efficient device design are achieved.
Patent Information
- Application Number
- CN202411967173.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-12-30
AI Technical Summary
The existing methods of plant height measurement are difficult to achieve accurate measurement in low-light environments and complex terrain areas, and traditional binocular camera devices are costly and susceptible to environmental interference.
The all-weather plant height measurement method based on binocular stereo vision is adopted. The plant height image is obtained through a binocular camera, and the definition processing and feature point extraction are performed, and the disparity map is obtained, the three-dimensional coordinates are calculated, and the average height of the plants is obtained by random point sorting. The device relies on a crawler lawn mower to drive the displacement of the binocular camera, overcoming the influence of terrain and ambient light.
Accurate plant height measurement in all weather, various terrain and ambient light conditions is achieved, manual participation is reduced, the automation level of measurement and applicable scenarios are improved, and the device is cheap.
Smart Images

Figure CN119887876A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of non-contact and automated measurement of crop structural information, and in particular to an all-weather plant height measurement method and device based on binocular stereo vision. Background Art
[0002] As a key phenotypic morphological parameter, crop plant height is often used to assess crop vitality and estimate biomass and its potential yield. Traditional plant height measurement methods are usually performed manually using a ruler. Currently, in the field of crop plant height measurement, the "difference method" that calculates the height difference between the crop canopy and the ground is widely considered to be the most effective and accurate measurement method. This method is usually combined with a three-dimensional system or three-dimensional sensor, including stereo vision systems, LiDAR (light detection and ranging) technology, laser scanning sensors, ultrasonic sensors, depth cameras and other sensing devices; although these advanced technical means have improved the level of measurement automation, various sensors still have some technical challenges.
[0003] With the development of computer vision technology, technical support is provided for high-precision real-time measurement of plant height. For example, one is a plant height measurement method based on point cloud data. By collecting image sequences at different angles, the bottom surface and the three-dimensional point cloud of the plant are extracted respectively, and then the plant height of a single plant is extracted; another example is a plant height measurement method based on a binocular camera. This method calculates the depth by a binocular camera mounted on a tracked vehicle. Both of the above measurement methods work in a visible light environment, and it is difficult to achieve real-time measurement in a weak light environment. Another example is a plant height measurement method based on structured light. Although this method solves the problem of plant height measurement on plains in a weak light environment, it does not consider plant height measurement scenarios in special terrains such as mountains and weak ambient light. At the same time, the existing binocular camera distance measurement device is still too expensive and easily affected by environmental interference. In addition, it is difficult to accurately measure the plant height of plants in complex terrain and weak ambient light.
[0004] Therefore, the existing needs are not met, and we propose an all-weather plant height measurement method and device based on binocular stereo vision. Summary of the invention
[0005] The purpose of the present invention is to provide an all-weather plant height measurement method and device based on binocular stereo vision, which obtains plant height images through a binocular camera and performs clarity processing on the plant height images; then, feature points are extracted and stereo matching is performed on the feature points to obtain a disparity map with depth information, and the three-dimensional coordinates of the plant height image are calculated based on the disparity map; a part of random points in the disparity map are selected, the depths of all random points are sorted, and the average depth is calculated; then, the average height of the plant is obtained by subtracting the average depth from a fixed height, thereby achieving accurate close-range measurement; secondly, the binocular camera is low in cost, and relies on a crawler mower to drive the binocular camera to move, so that it is not constrained by terrain and ambient light, which broadens the applicable scenarios of the device, improves the feasibility of the method, and solves the problems raised in the above-mentioned background technology.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] The all-weather plant height measurement method based on binocular stereo vision includes the following steps:
[0008] Step 1: Calibrate the binocular camera by using a calibration method, establish a mapping relationship between the binocular camera's coordinate system and the actual world coordinate system, and obtain the binocular camera's parameters;
[0009] Step 2: Use a binocular camera to collect images of the plants from a bird's-eye view, cut, correct, and filter the collected plant height images; and when it is identified that the plant height image is not bright enough, automatically turn on the ambient light compensator to perform fill light operation;
[0010] Step 3: extract feature points from the enhanced plant height image, perform stereo matching on the extracted feature points, obtain a disparity map with depth information, and calculate the three-dimensional coordinates of the plant height image based on the disparity map;
[0011] Step 4: Select a portion of random points in the disparity map, sort the depths of all random points, remove the highest and lowest points, average the remaining depths to get the average depth; then subtract the average depth from the fixed height to get the average height of the plant.
[0012] An all-weather plant height measurement device based on binocular stereo vision comprises: a binocular camera, the binocular camera is connected to a processing subsystem, the processing subsystem is used to pre-process the image acquired by the binocular camera, the binocular camera is installed on a crawler mower through a fixing rod, the crawler mower is electrically connected to a telemetry terminal, and the telemetry terminal is used to remotely control the movement and measurement process of the crawler mower in real time;
[0013] The processing subsystem comprises:
[0014] The shooting adjustment unit is used to automatically start the ambient light compensator to perform lighting compensation according to the lighting conditions on site when the binocular camera is shooting the height of plants; and to correct the obtained image through the color correction algorithm according to the color deviation;
[0015] An image processing unit is used to pre-process the plant height image acquired by the binocular camera using image enhancement technology, including: cutting, correction, image enhancement, threshold segmentation, morphological processing, and ROI extraction;
[0016] A feature extraction unit is used to extract feature points from the preprocessed plant height image, and use stereo vision technology to perform stereo matching on the extracted feature points 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 by triangulation based on the disparity map; then the three-dimensional coordinates of each pixel point are reconstructed by combining the intrinsic and extrinsic parameters of the binocular camera and the depth value obtained by triangulation to obtain the three-dimensional coordinates of the plant height image;
[0018] The height confirmation unit is used to select a part of random points in the depth map, sort the depths of the random points, filter out the highest point and the lowest point, average the remaining depths to obtain the average depth; then subtract the average depth from the fixed height to obtain the average height of the grass and trees.
[0019] Furthermore, the plant height image is enhanced, including:
[0020] Extract the gray value of each pixel before image color correction;
[0021] Comparing the grayscale value of each pixel of the image before color correction with a preset grayscale value threshold;
[0022] Extracting the pixel points whose grayscale values exceed a preset grayscale value threshold and their grayscale values as a first pixel point grayscale value set;
[0023] Extracting the grayscale value of the image after color correction corresponding to each pixel point included in the first pixel point grayscale value set as the second pixel point grayscale value set;
[0024] Obtaining a first contrast adjustment coefficient using the grayscale values included in the first pixel grayscale value set and the grayscale values included in the second pixel grayscale value set;
[0025] The first contrast adjustment coefficient is obtained by the following formula:
[0026]
[0027] Among them, U 01 represents the first contrast adjustment coefficient; n represents the number of pixels included in the first pixel gray value set, and the number of pixels included in the first pixel gray value set and the second pixel gray value set is the same; H 01i represents the gray value of the i-th pixel in the first pixel gray value set; H 02i H represents the gray value corresponding to the i-th pixel in the first pixel gray value set and mapped to the second pixel gray value set; y Indicates the preset gray value threshold; H 01b represents the standard deviation of the grayscale values of n pixels in the first pixel grayscale value set; H 02b represents the standard deviation of the grayscale values of n pixels in the second pixel grayscale value set; s represents the adjustment coefficient, and the adjustment coefficient is obtained by the following formula:
[0028]
[0029] Where s represents the adjustment coefficient; H 01i represents the gray value of the i-th pixel in the first pixel gray value set; H 02i H represents the gray value corresponding to the i-th pixel in the first pixel gray value set and mapped to the second pixel gray value set; y Indicates the preset gray value threshold;
[0030] The contrast of the plant height image after the image color correction is adjusted by using the grayscale values of all pixels after the image color correction in combination with the first contrast adjustment coefficient.
[0031] Furthermore, the contrast of the plant height image after the image color correction is adjusted by using the grayscale values of all pixels after the image color correction in combination with the first contrast adjustment coefficient, including:
[0032] Extract the gray value of each pixel after image color correction;
[0033] Extracting the grayscale value of each pixel of the image after color correction and the grayscale value of each pixel of the image before color correction to obtain a second contrast adjustment coefficient;
[0034] The second contrast adjustment coefficient is obtained by the following formula:
[0035]
[0036] Among them, U 02 represents the second contrast adjustment coefficient; m represents the number of pixels contained in the plant height image; H xiRepresents the gray value of the i-th pixel before image color correction; H hi Represents the gray value of the i-th pixel after image color correction; H y Indicates the preset gray value threshold; H 01b represents the standard deviation of the grayscale values of n pixels in the first pixel grayscale value set; H 02b represents the standard deviation of the grayscale values of n pixels in the second pixel grayscale value set; H fb H represents the standard deviation of the grayscale values of the m pixels in the plant height image before image color correction; gb It represents the standard deviation of the gray values of the m pixels in the plant height image after image color correction;
[0037] Using the first contrast adjustment coefficient and the second contrast adjustment coefficient, the contrast of the plant height image after the image color correction is adjusted;
[0038] The adjusted contrast value is obtained by the following formula:
[0039]
[0040] Among them, Y t represents the contrast value after adjustment; Y0 represents the contrast value before adjustment; U 01 represents the first contrast adjustment coefficient; U 02 Represents the second contrast adjustment coefficient.
[0041] Furthermore, it also includes:
[0042] A data feedback unit is used to timely feed back the average height of the grass and trees to the human-computer interaction terminal based on wireless communication technology after obtaining the average height of the grass and trees;
[0043] The human-computer interaction terminal is used to receive the plant height images and the calculated plant height data in real time; and store the plant height images and the corresponding data in time series to obtain a plant height database in the same planting area.
[0044] Furthermore, the shooting adjustment unit includes:
[0045] The model training module is used to collect historical data of various lighting conditions and vegetation types as multiple samples; a neural network model is used to train each sample, and a corresponding adjustment plan is output according to the sample information. The adjustment plan corresponding to each sample includes: fill light parameters and color correction parameters;
[0046] The solution acquisition module is used to predict the lighting conditions and grass types on site based on the trained neural network model, and obtain the fill light parameters and color correction parameters required on site;
[0047] The automatic adjustment module is used to automatically start the ambient light compensator to perform illumination compensation based on the obtained fill light 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 the plant height and divide it into multiple small areas; then the original image of the plant height is geometrically corrected to correct the distortion and deformation caused by the camera or the environment;
[0050] The image enhancement module is used to enhance the plant height image after resizing, including: removing noise, reducing background interference, and increasing edge sharpness;
[0051] A threshold segmentation module is used to perform threshold segmentation on the enhanced plant height image and divide the image into different areas;
[0052] The morphological processing module is used to perform morphological processing on the plant height image after threshold segmentation, including: opening operation, closing operation, corrosion, expansion and affine;
[0053] The ROI extraction module is used to extract the region of interest from the plant height image after threshold segmentation, and to 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 pre-processed plant height image using the SIFT algorithm. The multiple key points are the basis for subsequent stereo matching.
[0056] The feature matching module is used to match the extracted multiple feature points with the 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, and calculate the corresponding disparity value using the principle of stereoscopic vision to obtain multiple disparity values, and then compose the multiple disparity values into a disparity map.
[0058] Furthermore, the coordinate calculation unit includes:
[0059] The depth value acquisition module is used to calculate the vertical distance between the two points on the disparity line based on the disparity map and the triangle interior angle theorem in the triangulation principle. The vertical distance is the corresponding feature point depth, and the depth value of each matching point on the disparity map is obtained. The formula for solving the depth value is as follows:
[0060]
[0061] After simplification, we can get:
[0062]
[0063] Where D is the image depth; f is the focal length; B is the baseline; Bf is the distance from the baseline B to the imaging plane M; X l Represented as P l The coordinate point on the x-axis; X r Represented as P r The coordinate point on the x-axis.
[0064] 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 the trigonometric function relationship; obtain the three-dimensional coordinates of all matching points in the disparity map; the formula for solving the three-dimensional coordinates of the matching points is as follows:
[0065]
[0066] Where x represents the X-axis; y represents the Y-axis; Z represents the depth of the object relative to the camera; Bx l Expressed as baseline B to P l The distance between points on the X axis; l Expressed as baseline B to P l The distance between the points on the Y axis; Bf is the distance between the baseline B and the imaging plane M; X l Represented as P l The coordinate point on the x-axis; X r Represented as P r The coordinate point on the x-axis; l Represented as P l The coordinate point on the Y axis; y r Represented as P r The coordinate point on the Y axis.
[0067] The coordinate confirmation module reconstructs the 3D coordinates of each pixel based on the 3D coordinates of all matching points, combined with the depth value obtained by triangulation and the intrinsic and extrinsic parameters of the binocular camera, to obtain the 3D coordinates of the plant height image;
[0068] The image write-back module is used to write the obtained three-dimensional coordinates into the plant height image to obtain the final plant height image with depth information, which includes: the location information of the plant and the morphological information of the plant.
[0069] Furthermore, the height confirmation unit includes:
[0070] The random point sorting module is used to select a part of random points in the depth map, and the 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 depth and the smallest depth after sorting are screened out; the remaining depth values are averaged to obtain the average value of the depth of all points, and the average value of the depth represents the average depth of the entire plant height image.
[0071] The height calculation module is used to obtain the average height of grass and trees by subtracting the average depth from the fixed height value.
[0072] Compared with the prior art, the present invention has the following beneficial effects:
[0073] 1. The present invention obtains a plant height image through a binocular camera and performs clarity processing on the plant height image; then extracts feature points and 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 according to the disparity map; selects a part of random points in the disparity map, sorts the depths of all random points, and calculates the average depth; then uses a fixed height to subtract the average depth to obtain the average height of the plant, thereby achieving accurate close-range measurement and reducing the need for manual participation.
[0074] 2. The present invention can obtain plant height images and measure plant heights through a cheap and convenient binocular camera, making the method low-cost, efficient and fast; at the same time, relying on a crawler mower to drive the binocular camera to move, it can freely shuttle in the muddy terrain of the field, overcome the camera tilt caused by various terrain and environmental changes, and make the binocular camera not constrained by terrain and ambient light, broadening the applicable scenarios of the all-weather plant height measurement device and improving the feasibility of the all-weather plant height measurement method. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 A diagram of a binocular camera device of the present invention;
[0076] Figure 2 A schematic diagram of a chessboard 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 4It is a composition diagram of the processing subsystem of the present invention;
[0079] Figure 5 It is a diagram showing the program effect of the present invention;
[0080] Figure 6 This is a flow chart of the all-weather plant height measurement method based on binocular stereo vision of the present invention;
[0081] Figure 7 A stereoscopic model diagram of a binocular camera of the present invention;
[0082] Figure 8 This is a binocular camera model diagram of the present invention.
[0083] In the figure: 1. Binocular camera; 2. Fixed rod; 3. Crawler mower; 4. Telemetry terminal. DETAILED DESCRIPTION
[0084] 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.
[0085] In order to solve the technical problems that the existing devices are too expensive, easily affected by the environment, and difficult to accurately measure the height of plants in areas with complex terrain and weak ambient light, please refer to Figure 1-Figure 8 , this embodiment provides the following technical solutions:
[0086] The all-weather plant height measurement method based on binocular stereo vision includes the following steps:
[0087] Step 1: Calibrate the binocular camera 1 by using the chessboard calibration method, establish a 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; specifically, fix the binocular camera 1 on the fixed rod 2, hold the chessboard calibration plate to collect images, require the chessboard to occupy as much area of the image as possible, and ensure the integrity of the chessboard in the image; also require multiple changes in angle, and take a total of 20 pairs of images; during the calibration process, at least half of the images are placed on the chessboard calibration plate on a plane parallel to the ground at the bottom of the plant, so that the ground The obtained coordinate system coincides with the plane coordinate system of the calibration plate to calibrate the installation parameters of the binocular camera 1; the corner point information of the calibration plate is extracted through the computer vision library, and the internal and external parameters of the binocular camera 1 are calculated based on the known corner point information, as well as the internal and external parameters of the binocular camera 1 and the checkerboard calibration algorithm; the internal and external parameters of the binocular camera 1 are linked to the positional relationship of the calibration plate in space, and a mapping relationship between the coordinate system of the binocular camera 1 and the actual world coordinate system is established; through the mapping relationship, the point coordinates in the three-dimensional world coordinate system are restored from the plant height image taken by the binocular camera 1.
[0088] Step 2: Use binocular camera 1 to collect the top-down image of the plant, cut, correct, and filter the collected plant height image, such as image enhancement, threshold segmentation, morphological processing, ROI extraction, etc.; and when it is identified that the brightness of the plant height image is not enough, automatically turn on the ambient light compensator to perform fill light operation; specifically, use binocular camera 1 to monitor the growth status of plants in real time, so as to obtain the top-down image of plants. To further ensure the clarity of the image, the collected plant height image is cut, corrected, and filtered to obtain a clear image for subsequent analysis. By analyzing the image and automatically turning on the ambient light compensator to perform fill light operation when it is identified that the plant height image is not bright enough, the effectiveness of the binocular camera 1 in obtaining the plant height image is ensured.
[0089] Step 3: Extract feature points from the enhanced plant height image, perform stereo matching on the extracted feature points, obtain a disparity map with depth information, and calculate the three-dimensional coordinates of the plant height image based on the disparity map; specifically, enhance and filter the original plant height image to improve the image quality. Extract feature points from the enhanced and filtered image, and perform stereo matching on the extracted feature points to obtain a set of disparity maps rich in depth information. Calculate the depth information of the matching points in the disparity map through triangulation to obtain the three-dimensional coordinates of the plant height image.
[0090] Step 4: Select a portion of random points in the disparity map, sort the depths of all random points, remove the highest and lowest points, average the remaining depths to obtain the average depth; then subtract the average depth from the fixed height to obtain the average height of the plant; specifically, select a portion of random points in the disparity map, sort the depths of the random points, remove the highest and lowest points; then average the remaining depth values to obtain the average depth. Subtract the average depth from the fixed height to obtain the average height of the plant. This method obtains the average height of grass and plants by screening specific points in the disparity map and calculating the average depth of the specific points.
[0091] The beneficial effects achieved by the above content are as follows: 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 the all-weather plant height measurement method.
[0092] The all-weather plant height measuring device based on binocular stereo vision comprises: a binocular camera 1, which can be a cheap and convenient binocular camera, and is provided with an ambient light compensator, and the binocular camera 1 is connected to a processing subsystem, and the processing subsystem is used to pre-process the image acquired by the binocular camera 1, and the binocular camera 1 is installed on a crawler mower 3 through a fixing rod 2, and the fixing rod 2 is made of an adjustable stainless steel pipe, which plays a role in supporting the binocular camera 1, and its height should be higher than the expected height of the shrub and grass plant by more than 30 cm, and can be adjusted according to actual conditions; the fixing rod 2 A lightweight aluminum alloy frame is provided on the top for fixing the binocular camera 1 and making the viewing angle of the binocular camera 1 perpendicular to the ground; the crawler mower 3 is used to drive the binocular camera 1 to freely shuttle in the muddy terrain of the field and overcome the camera tilt caused by various terrain and environmental changes; an onboard computer is provided on the crawler mower 3, which is connected to the binocular camera 1 and the telemetry terminal 4 of the crawler mower 3; the crawler mower 3 is electrically connected to the telemetry terminal 4, and the telemetry terminal 4 is used to remotely control the movement and measurement process of the crawler mower 3 in real time, thereby realizing accurate close-range measurement and reducing the need for manual participation.
[0093] Processing subsystems, including:
[0094] The shooting adjustment unit is used to automatically turn on the ambient light compensator to perform lighting compensation according to the on-site lighting conditions when the binocular camera 1 is shooting the height of plants; and to correct the obtained image through the color correction algorithm according to the color deviation; specifically, the ambient light compensator provides a guarantee for the image clarity of the binocular camera 1, and can automatically fill in the light on rainy days or in poor lighting conditions, thereby alleviating the impact of the external environment on automated measurement; the color correction algorithm mainly corrects the color offset and lens distortion inside the binocular camera 1 to obtain accurate RGB color values.
[0095] Shooting adjustment unit, comprising:
[0096] The model training module is used to collect historical data of various lighting conditions and grass types as multiple samples; a neural network model is used to train each sample, and a corresponding adjustment plan is output according to the sample information. The adjustment plan corresponding to each sample includes: fill light parameters and color correction parameters. The fill light parameters refer to the light intensity required by the plant, and the color correction parameters are color compensation based on the color response characteristics of the plant; specifically, historical data is obtained from historical monitoring records or laboratory experiments, and a neural network model is used to train each sample, and a corresponding adjustment plan is output according to the sample information; based on this, the neural network model is used to learn the complex relationship between different lighting conditions and grass types in the sample, and a personalized adjustment plan is generated according to the information of each sample, which can effectively solve the problem of plant growth regulation under different lighting conditions and different 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 grass types based on the trained neural network model, and obtain the fill-light parameters and color correction parameters required for the scene; specifically, by inputting information such as the on-site lighting conditions and grass types into the trained neural network model; the model predicts the input data to obtain the fill-light parameters and color correction parameters required for the scene; since the parameters are generated based on the actual lighting conditions and grass types at the scene, they can better adapt to the on-site environment; and the obtained fill-light parameters and color correction parameters are output as the final result for the on-site staff to perform actual operations.
[0098] The automatic adjustment module is used to automatically start the ambient light compensator for illumination compensation based on the obtained fill light parameters and color correction parameters, and automatically enable the color correction algorithm to correct the obtained image to achieve the best measurement effect; specifically, by receiving the fill light parameters and color correction parameters output by the neural network model, the brightness and angle of the ambient light compensator are automatically adjusted to make the lighting conditions meet the requirements; and according to the received fill light parameters and color correction parameters, the parameters of the imaging algorithm are automatically adjusted to obtain the best optical imaging effect; thereby ensuring that the binocular camera 1 can maintain a good working state in different environments and obtain the best measurement effect; secondly, in the specific implementation, the mean and variance of the image on the grayscale image can also be calculated. When there is a brightness abnormality, the mean will deviate from the mean point, such as: assuming it is 128, the variance will also be small; by calculating the mean and variance of the grayscale image, it is possible to evaluate whether the image is overexposed or underexposed. When the outdoor light is too strong, the image is processed through histogram equalization, Gaussian filtering, WSL filtering, and median filtering to reduce the side effects of excessive light and improve measurement accuracy. When insufficient brightness is detected, the external ambient light compensator can be turned on to provide sufficient and appropriate brightness to ensure image quality.
[0099] The image processing unit is used to pre-process the plant height image acquired by the binocular camera 1 using image enhancement technology, including: cutting, correction, image enhancement, threshold segmentation, morphological processing, ROI extraction, so as to improve its clarity and accuracy and ensure the quality of the plant height image; the image processing unit includes:
[0100] The size adjustment module is used to cut the original image of the height of the grass and divide the original image into multiple small areas for subsequent processing and recognition; then the original image of the height of the grass and tree is geometrically corrected to correct the distortion and deformation caused by the camera or the environment; specifically, by cutting the original image of the height of the grass and tree, the image is divided into multiple small areas, so that the size and shape of the image are more suitable for subsequent processing. At the same time, the module can also perform geometric correction on the original image to eliminate the image distortion and deformation 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: removing noise, reducing background interference, increasing edge sharpness, and ensuring the contrast and clarity of the plant height image; specifically, by enhancing the resized plant height image to ensure the contrast and clarity of the plant height image, the plant height image is easier to identify later, thereby improving the overall quality of the plant height image.
[0102] Specifically, performing image enhancement on the plant height image includes:
[0103] Extract the gray value of each pixel before image color correction;
[0104] Comparing the grayscale value of each pixel of the image before color correction with a preset grayscale value threshold;
[0105] Extracting the pixel points whose grayscale values exceed a preset grayscale value threshold and their grayscale values as a first pixel point grayscale value set;
[0106] Extracting the grayscale value of the image after color correction corresponding to each pixel point included in the first pixel point grayscale value set as the second pixel point grayscale value set;
[0107] Obtaining a first contrast adjustment coefficient using the grayscale values included in the first pixel grayscale value set and the grayscale values included in the second pixel grayscale value set;
[0108] The first contrast adjustment coefficient is obtained by the following formula:
[0109]
[0110] Among them, U 01 represents the first contrast adjustment coefficient; n represents the number of pixels included in the first pixel gray value set, and the number of pixels included in the first pixel gray value set and the second pixel gray value set is the same; H 01i represents the gray value of the i-th pixel in the first pixel gray value set; H 02i H represents the gray value corresponding to the i-th pixel in the first pixel gray value set and mapped to the second pixel gray value set; y Indicates the preset gray value threshold; H 01b represents the standard deviation of the grayscale values of n pixels in the first pixel grayscale value set; H 02b represents the standard deviation of the grayscale values of n pixels in the second pixel grayscale value set; s represents the adjustment coefficient, and the adjustment coefficient is obtained by the following formula:
[0111]
[0112] Where s represents the adjustment coefficient; H 01i represents the gray value of the i-th pixel in the first pixel gray value set; H 02i H represents the gray value corresponding to the i-th pixel in the first pixel gray value set and mapped to the second pixel gray value set; y Indicates the preset gray value threshold;
[0113] The contrast of the plant height image after the image color correction is adjusted by using the grayscale values of all pixels after the image color correction in combination with the first contrast adjustment coefficient.
[0114] The technical effect of the above technical solution is: by calculating the first contrast adjustment coefficient (U 01 ), the scheme can make fine contrast adjustment for the plant height image after image color correction. This adjustment is based on the pixels within a specific grayscale value range in the image (i.e., the pixels whose grayscale value exceeds the preset threshold), so it can more accurately improve the contrast of the image and make the details in the image clearer. The calculation of the adjustment coefficient (s) takes into account the change of the grayscale value of the pixel, making the contrast adjustment adaptive. When the grayscale value of the pixel in the image changes greatly, the adjustment coefficient will increase accordingly, thereby making a stronger contrast adjustment; conversely, when the grayscale value changes less, the adjustment coefficient will decrease to avoid image distortion caused by excessive adjustment. The scheme not only considers the grayscale value of the image before color correction, but also uses the grayscale value after correction to calculate the contrast adjustment coefficient. This approach can more comprehensively reflect the changes in the image during the color correction process, thereby adjusting the contrast more accurately. By separately processing the pixels that exceed the preset grayscale value threshold, the scheme can retain the detail information in the image while enhancing the contrast. This is very important for applications such as recognition and measurement of plant height images, because the retention of detail information helps to improve the accuracy and reliability of measurement. Although the scheme involves multiple steps and calculation processes, each step is performed on pixels within a specific range, so it has a high processing efficiency. In addition, by presetting the gray value threshold to screen the pixels, it can also reduce unnecessary calculations and further improve the processing speed.
[0115] In summary, the above technical solutions have shown good technical effects in terms of contrast enhancement, adaptive adjustment, gray value correction, detail retention and processing efficiency, etc. These effects are of great significance for image enhancement and subsequent applications of plant height images.
[0116] Specifically, the contrast of the plant height image after the image color correction is adjusted by using the grayscale values of all pixels after the image color correction in combination with the first contrast adjustment coefficient, including:
[0117] Extract the gray value of each pixel after image color correction;
[0118] Extracting the grayscale value of each pixel of the image after color correction and the grayscale value of each pixel of the image before color correction to obtain a second contrast adjustment coefficient;
[0119] The second contrast adjustment coefficient is obtained by the following formula:
[0120]
[0121] Among them, U 02 represents the second contrast adjustment coefficient; m represents the number of pixels contained in the plant height image; H xi Represents the gray value of the i-th pixel before image color correction; H hi Represents the gray value of the i-th pixel after image color correction; H y Indicates the preset gray value threshold; H 01b represents the standard deviation of the grayscale values of n pixels in the first pixel grayscale value set; H 02b represents the standard deviation of the grayscale values of n pixels in the second pixel grayscale value set; H fb H represents the standard deviation of the grayscale values of the m pixels in the plant height image before image color correction; gb It represents the standard deviation of the gray values of the m pixels in the plant height image after image color correction;
[0122] Using the first contrast adjustment coefficient and the second contrast adjustment coefficient, the contrast of the plant height image after the image color correction is adjusted;
[0123] The adjusted contrast value is obtained by the following formula:
[0124]
[0125] Among them, Y t represents the contrast value after adjustment; Y0 represents the contrast value before adjustment; U 01 represents the first contrast adjustment coefficient; U 02 Represents the second contrast adjustment coefficient.
[0126] The technical effect of the above technical solution is: the solution adopts the first contrast adjustment coefficient (U 01 ) and the second contrast adjustment coefficient (U 02) for contrast adjustment. The first contrast adjustment coefficient is calculated based on the pixels within a specific grayscale value range (pixels exceeding a preset threshold), while the second contrast adjustment coefficient takes into account the grayscale value changes of all pixels before and after the image color correction. This dual mechanism can more comprehensively evaluate the image contrast requirements and make more precise adjustments accordingly. By calculating the second contrast adjustment coefficient, the scheme can take into account the impact of image color correction on the overall grayscale value distribution. This adaptability enables contrast adjustment to more flexibly adapt to the color correction effects of different images, thereby ensuring that the adjusted image is more natural and comfortable visually. During the contrast adjustment process, the scheme not only considers the changes in the overall grayscale value, but also pays special attention to the pixels within a specific grayscale value range. This processing method helps to retain the detail information in the image while enhancing the contrast, so that the adjusted image is improved in terms of clarity, detail performance, etc. Although the scheme involves multiple steps and calculation processes, each step is based on the grayscale value before and after the image color correction, so it has a high processing efficiency. At the same time, by accurately calculating the contrast adjustment coefficient, the scheme can ensure the accuracy of contrast adjustment and avoid image distortion caused by over-adjustment or under-adjustment. This technical solution is not only applicable to contrast adjustment of plant height images, but can also be extended to other types of image processing tasks. As long as the image needs color correction and contrast adjustment, this dual contrast adjustment mechanism can be tried to optimize the processing effect.
[0127] In summary, the above technical solutions have demonstrated technical effects in terms of performance indicators, such as dual contrast adjustment mechanism, adaptability and flexibility, detail preservation and contrast enhancement, processing efficiency and accuracy, and wide applicability. These effects work together in the process of image contrast adjustment, so that the adjusted image has improved visual effects, detail expression, and processing efficiency.
[0128] The threshold segmentation module is used to perform threshold segmentation on the enhanced plant height image and divide the image into different areas for subsequent processing and identification. Specifically, the image is threshold segmented through mathematical methods such as Otsu's method to obtain a binary image of the image, so that the pixels in the plant height image can be divided into two categories, namely black and white, for subsequent processing and identification.
[0129] The morphological processing module is used to perform morphological processing on the plant height image after threshold segmentation, including: opening operation, closing operation, corrosion, expansion and affine operation, so as to achieve the functions of removing noise, enhancing edges, connecting adjacent areas, etc., helping to eliminate irregular shapes and unnecessary details in the image, so that the image is easier to be used for subsequent recognition and classification; specifically, by performing morphological processing on each block, while maintaining the overall structure of the plant height image, noise and redundant information are removed as much as possible to facilitate subsequent recognition and classification; further, the opening operation is an expansion operation, through which the area in the plant height image is expanded and the non-intersecting parts in the plant height image are merged; the closing operation is a corrosion operation, which can reduce the area in the plant height image and merge the non-intersecting parts in the image; the affine operation can connect adjacent areas, and some areas in the plant height image can be stretched and compressed according to certain rules, so as to connect different parts in the plant height image to obtain better results.
[0130] The ROI extraction module is used to extract the region of interest from the plant height image after threshold segmentation, and perform vegetation classification on the ROI to divide the region into different categories for subsequent analysis; specifically, by extracting the region of interest from the processed image, and performing vegetation classification on the ROI, the region is divided into different categories; and then further analyzing the classified region, including: statistics and prediction of the height and growth density of the plant; in this embodiment, when analyzing the plant height image, the ROI extraction module can be applied to the image of each plant, and vegetation classification can be performed on it. By classifying the plants, the growth status of each plant, such as height, growth density and other information, can be understood, thereby providing useful reference information for agricultural production management.
[0131] The feature extraction unit is used to extract feature points from the preprocessed plant height image, and use stereo vision technology to perform stereo matching on the extracted feature points 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 plant height image using the SIFT algorithm, and the multiple key points serve as the basis for subsequent stereo matching. Specifically, the preprocessed plant height image is subjected to feature extraction using the SIFT algorithm to obtain a series of feature points. This series of feature points represents the local structure of the plant body in the plant height image and can provide assistance for subsequent stereo matching and semantic analysis. The obtained feature points are then screened, and feature points with good stability and uniqueness are retained, which will be used for subsequent stereo matching to determine whether the plant body in the plant height image remains consistent under different viewing angles.
[0133] The feature matching module is used to match the extracted multiple feature points with the feature points pre-stored in the stereo vision library. The matching principles are: maximum similarity and minimum angular distance. The maximum similarity refers to the maximum value of the similarity between two feature points, which is also the maximum value of all possible minimum similarities between two feature points. The minimum angular distance refers to the minimum distance between the two shortest paths formed by two feature points in space. The maximum similarity and the minimum angular distance are used to measure the closeness of the relationship between two feature points. The greater the similarity, the more similar the two feature points are, and the smaller the angular distance, the smaller the angle change between the two feature points. Specifically, the extracted feature points are matched with the feature points pre-stored in the stereo vision library, specifically: by calculating the similarity or angular distance between the two feature points, and traversing each feature point based on this method, it is matched with each feature point in the stereo vision library to find the feature point with the smallest similarity or angular distance; and then the matching result is returned as the current matching result.
[0134] The image generation module is used to obtain each successfully matched feature pair, and use the principle of stereoscopic vision to calculate the corresponding disparity value to obtain multiple disparity values, and then combine the multiple disparity values into a disparity map; the disparity map contains an image of depth information and can be used to represent the position relationship of objects in space; specifically, the depth value of each feature point is obtained by calculating the distance from each feature point to the corresponding feature point; then, based on the distribution of the depth value, the depth value of each pixel point 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 a disparity map.
[0135] The coordinate calculation unit is used to calculate the depth value of each matching point in the disparity map by triangulation principle based on the disparity map; and then reconstruct the three-dimensional coordinates of each pixel point by combining the internal parameters and external parameters of the binocular camera 1 and the depth value obtained by triangulation to obtain the three-dimensional coordinates of the plant height image; the coordinate calculation unit includes:
[0136] The depth value acquisition module is used to calculate the vertical distance between the line connecting two points on the disparity line based on the disparity map and the triangle interior angle sum theorem in the triangulation principle. The distance is the depth of the corresponding feature point. This process is repeated to obtain the depth value obtained by each matching point on the disparity map. Specifically, in this embodiment, for example, assuming that there are two pairs of matching points on the disparity map: AB and CD, where AB and CD are respectively located on the disparity line, the midpoints E and F of the line segments AB and CD can be first calculated, and then the triangle interior angle sum theorem can be used to calculate the vertical distance between AE and CF. Further, an angle θ can be calculated in the triangles AEF and BED, so that AE=EFsinθ, AF=FDsinθ, then AE and AF are candidate values of the depth values of the corresponding points on the disparity map. If the two candidate values meet certain accuracy requirements and are consistent with the depth estimation values of other matching points, the two candidate values can be considered to be relatively reliable depth values. Repeating this process can obtain the depth value obtained by each matching point on the disparity map.
[0137] In a specific implementation, since the binocular camera 1 is easily affected by external factors in real production life, which may cause the optical axes of the binocular camera 1 to be non-parallel, the positions of the two cameras need to be calibrated and corrected through camera calibration before three-dimensional reconstruction.
[0138] like Figure 7-Figure 8 As shown in the figure: The figure shows the position model of the binocular camera after calibration; the figure contains the triangular relationship between a point P in the real world and the two cameras. This triangular relationship is the key to recovering the three-dimensional information of the 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 images is defined by the imaging optical center of the left camera represented by Z. l -X l Y l ,Or-X r Y r ;P l (X l ,Y l ) and P r (X r ,Y r ) are the points in the real three-dimensional world where point P is mapped on the left and right image coordinate systems by the binocular camera 1; the depth distance of a three-dimensional space point is the vertical distance from point P (x, y, z) to the baseline B of the binocular camera 1; therefore, the formula for solving the depth D is as follows:
[0139]
[0140] After simplification, we can get:
[0141]
[0142] Where D is the image depth; f is the focal length; B is the baseline; Bf is the distance from the baseline B to the imaging plane M; X l Represented as P l The coordinate point on the x-axis; X r Represented as P r The coordinate point on the x-axis.
[0143] A 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 a trigonometric function relationship; repeat this process to obtain the three-dimensional coordinates of all matching points in the disparity map;
[0144] Specifically, the three-dimensional coordinates of point P are solved, and the solution formula is as follows:
[0145]
[0146] Where x represents the X-axis; y represents the Y-axis; Z represents the depth of the object relative to the camera; Bx l Expressed as baseline B to P l The distance between points on the X axis; l Expressed as baseline B to P l The distance between the points on the Y axis; Bf is the distance between the baseline B and the imaging plane M; X l Represented as P l The coordinate point on the x-axis; X r Represented as P r The coordinate point on the x-axis; l Represented as P l The coordinate point on the Y axis; y r Represented as P r The coordinate point on the Y axis.
[0147] The coordinate confirmation module is based on the three-dimensional coordinates of all matching points, combined with the depth value obtained by triangulation and the intrinsic and extrinsic parameters of the binocular camera 1. The intrinsic parameters include: the inner diameter of the camera and the distortion coefficient, and the extrinsic parameters include: the position and orientation of the camera in space and the three-dimensional coordinates of each matching point, to reconstruct the three-dimensional coordinates of each pixel point and obtain the three-dimensional coordinates of the plant height image; specifically, the three-dimensional image is reconstructed by using the intrinsic and extrinsic parameters of the binocular camera 1 and the three-dimensional coordinates of each matching point, and each matching point is back-projected to restore the three-dimensional coordinates to the two-dimensional image; then, according to the extrinsic parameters of the binocular camera 1 and the three-dimensional coordinates of each pixel point, it is converted into pixel coordinates in the three-dimensional space; finally, for each pixel point, the above steps are repeated to obtain the three-dimensional coordinates of each pixel point.
[0148] The image write-back module is used to write the obtained three-dimensional coordinates to the plant height image to obtain the final plant height image with depth information, which includes: the location information of the plant and the morphological information of the plant; specifically, the obtained three-dimensional coordinates are corrected to match the depth information of the corresponding pixel points in the plant height image; a mapping relationship between the coordinates and the pixel points is established according to the corrected three-dimensional coordinates and the image depth information; the obtained three-dimensional coordinates are converted into corresponding image coordinates using the above-mentioned mapping relationship between coordinates and pixel points, and the final plant height depth image is constructed using the image coordinates and the original image depth information; the generated plant height depth image is further processed, such as: removing noise, enhancing contrast, etc., to obtain a clearer plant height depth image; the image can be used to further analyze the growth status of the plants and evaluate the planting conditions of the plants.
[0149] The height confirmation unit is used to select a portion of random points in the depth map, sort the depths of the random points, remove the highest point and the lowest point, average the remaining depths to obtain the average depth; then subtract the average depth from the fixed height to obtain the average height of the grass and trees; the height confirmation unit includes:
[0150] The random point sorting module is used to select a part of random points in the depth map. The random points can be points within a certain range of depth values, such as points within a certain range of depth values. The selected points are sorted using the bubble sorting method, and the points with the largest depth and the smallest depth after sorting are screened out; because these two points may be outliers and are not representative. The remaining depth values are averaged to obtain the average depth of all points, and the average depth represents the average depth of the entire plant height image. The height calculation module is used to obtain the average height of the plant height by subtracting the average depth from the fixed height value. Specifically, the coordinates (x, y) of the point are the position coordinates of the point in the 640×480 pixel image, and Z is the distance from the point to the binocular camera 1, that is, the depth value. 90 data points are selected within the target range, and the coordinates (x, y) and depth values of the points are obtained. The invalid points with a depth of 0 are deleted, and the remaining valid points are stored in the file. The valid points in the file are sorted by depth value, and the middle 30 points are taken. The average of these 30 points is the filtered data. The plant height is calculated by the average vertical distance between the binocular camera 1 and the top of the plant, and the height of the binocular camera 1 from 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 from the ground.
[0151] The data feedback unit is used to provide timely feedback to the human-computer interaction terminal based on wireless communication technology after obtaining the average height of the grass plants, so that the user can make corresponding adjustments and management based on this information, such as deciding when to fertilize and water.
[0152] The human-computer interaction terminal is used to receive the plant height image and the calculated plant height data in real time; and store the plant height image and the corresponding data in time series to obtain the plant height database in the same planting area; specifically, by storing in time series, the plant height of plants in different dates or periods can be compared to obtain the growth trend. Plants in different areas can also be compared to determine whether there are significant differences; and visual reports and charts are generated at the same time, which can help users better understand the growth of plants and make more informed decisions accordingly.
[0153] The beneficial effects achieved by the above content are as follows: through the above method, accurate close-range measurement can be achieved, reducing the need for manual participation; secondly, the device is a cheap and convenient binocular camera 1, which makes the device have the advantages of low cost, high efficiency and speed; at the same time, relying on the crawler mower 3 to drive the binocular camera 1 to move, the surveyor does not need to arrive at the scene in person, and can complete the entire measurement process through remote control; at the same time, it can freely shuttle in the muddy terrain of the field, overcome the camera tilt caused by various terrain and environmental changes, and ensure that the binocular camera 1 is not constrained by terrain and ambient light, thereby broadening the applicable scenarios of the all-weather plant height measurement device and improving the feasibility of the all-weather plant height measurement method.
[0154] Working principle: The plant height image is acquired through the binocular camera 1, and the plant height image is processed for clarity; then feature points are extracted and stereo matching is performed on the feature points to obtain a disparity map with depth information, and the three-dimensional coordinates of the plant height image are calculated based on the disparity map; a part of random points in the disparity map is selected, the depths of all random points are sorted, and the average depth is calculated; then 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 article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0156] 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. An all-weather plant height measurement method based on binocular stereo vision, characterized in that: The following steps are involved: Step 1: calibrate the binocular camera (1) by using a calibration method, establish a 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: Using the binocular camera (1) to collect images of the plants from a bird's-eye view, and performing cutting, correction, and filtering on the collected plant height images; When it is detected that the image brightness of the plant height is not enough, the ambient light compensator is automatically turned on to perform fill light operation; Step 3: extract feature points from the enhanced plant height image, perform stereo matching on the extracted feature points, obtain a disparity map with depth information, and calculate the three-dimensional coordinates of the plant height image based on the disparity map; Step 4: Select a portion of random points in the disparity map, sort the depths of all random points, remove the highest and lowest points, average the remaining depths to get the average depth; then subtract the average depth from the fixed height to get the average height of the plant.
2. The all-weather plant height measurement device based on binocular stereo vision is applied to the all-weather plant height measurement method based on binocular stereo vision as claimed in claim 1, characterized in that: The invention comprises a binocular camera (1), wherein the binocular camera (1) is connected to a processing subsystem, the processing subsystem is used to pre-process images acquired by the binocular camera (1), the binocular camera (1) is installed on a crawler mower (3) through a fixing rod (2), the crawler mower (3) is electrically connected to a telemetry terminal (4), and the telemetry terminal (4) is used to remotely control the movement and measurement process of the crawler mower (3) in real time; The processing subsystem comprises: The shooting adjustment unit is used to automatically start the ambient light compensator to perform lighting compensation according to the lighting conditions at the scene when the binocular camera (1) is shooting the height of the grass and trees; and to correct the obtained image through a color correction algorithm according to the color deviation; An image processing unit, used for preprocessing the plant height image acquired by the binocular camera (1) using image enhancement technology, including: cutting, correction, image enhancement, threshold segmentation, morphological processing, and ROI extraction; A feature extraction unit is used to extract feature points from the preprocessed plant height image, and use stereo vision technology to perform stereo matching on the extracted feature points to obtain a disparity map containing depth information; A coordinate calculation unit is used to calculate the depth value of each matching point in the disparity map by triangulation based on the disparity map; and then reconstruct the three-dimensional coordinates of each pixel point by combining the intrinsic parameters and extrinsic parameters of the binocular camera (1) and the depth value obtained by triangulation to obtain the three-dimensional coordinates of the plant height image; The height confirmation unit is used to select a part of random points in the depth map, sort the depths of the random points, filter out the highest point and the lowest point, average the remaining depths to obtain the average depth; then subtract the average depth from the fixed height to obtain the average height of the grass and trees.
3. The all-weather plant height measurement device based on binocular stereo vision according to claim 2 is characterized in that: Performing image enhancement on the plant height image includes: Extract the gray value of each pixel before image color correction; Comparing the grayscale value of each pixel of the image before color correction with a preset grayscale value threshold; Extracting the pixel points whose grayscale values exceed a preset grayscale value threshold and their grayscale values as a first pixel point grayscale value set; Extracting the grayscale value of the image after color correction corresponding to each pixel point included in the first pixel point grayscale value set as the second pixel point grayscale value set; Obtaining a first contrast adjustment coefficient using the grayscale values included in the first pixel grayscale value set and the grayscale values included in the second pixel grayscale value set; The first contrast adjustment coefficient is obtained by the following formula: Among them, U 01 represents the first contrast adjustment coefficient; n represents the number of pixels included in the first pixel gray value set, and the number of pixels included in the first pixel gray value set and the second pixel gray value set is the same; H 01i represents the gray value of the i-th pixel in the first pixel gray value set; H 02i H represents the gray value corresponding to the i-th pixel in the first pixel gray value set and mapped to the second pixel gray value set; y Indicates the preset gray value threshold; H 01b represents the standard deviation of the grayscale values of n pixels in the first pixel grayscale value set; H 02b represents the standard deviation of the grayscale values of n pixels in the second pixel grayscale value set; s represents the adjustment coefficient, and the adjustment coefficient is obtained by the following formula: Where s represents the adjustment coefficient; H 01i represents the gray value of the i-th pixel in the first pixel gray value set; H 02i H represents the gray value corresponding to the i-th pixel in the first pixel gray value set and mapped to the second pixel gray value set; y Indicates the preset gray value threshold; The contrast of the plant height image after the image color correction is adjusted by using the grayscale values of all pixels after the image color correction in combination with the first contrast adjustment coefficient.
4. The all-weather plant height measurement device based on binocular stereo vision according to claim 3 is characterized in that: The contrast of the plant height image after the image color correction is adjusted by using the grayscale values of all pixels after the image color correction in combination with the first contrast adjustment coefficient, including: Extract the gray value of each pixel after image color correction; Extracting the grayscale value of each pixel of the image after color correction and the grayscale value of each pixel of the image before color correction to obtain a second contrast adjustment coefficient; The second contrast adjustment coefficient is obtained by the following formula: Among them, U 02 represents the second contrast adjustment coefficient; m represents the number of pixels contained in the plant height image; H xi Represents the gray value of the i-th pixel before image color correction; H hi Represents the gray value of the i-th pixel after image color correction; H y Indicates the preset gray value threshold; H 01b represents the standard deviation of the grayscale values of n pixels in the first pixel grayscale value set; H 02b represents the standard deviation of the grayscale values of n pixels in the second pixel grayscale value set; H fb H represents the standard deviation of the grayscale values of the m pixels in the plant height image before image color correction; gb It represents the standard deviation of the gray values of the m pixels in the plant height image after image color correction; Using the first contrast adjustment coefficient and the second contrast adjustment coefficient, the contrast of the plant height image after the image color correction is adjusted; The adjusted contrast value is obtained by the following formula: Among them, Y t represents the contrast value after adjustment; Y0 represents the contrast value before adjustment; U 01 represents the first contrast adjustment coefficient; U 02 Represents the second contrast adjustment coefficient.
5. The all-weather plant height measurement device based on binocular stereo vision according to claim 2 is characterized in that: Also includes: A data feedback unit is used to timely feed back the average height of the grass and trees to the human-computer interaction terminal based on wireless communication technology after obtaining the average height of the grass and trees; The human-computer interaction terminal is used to receive the plant height images and the calculated plant height data in real time; and store the plant height images and the corresponding data in time series to obtain a plant height database in the same planting area.
6. The all-weather plant height measurement device based on binocular stereo vision according to claim 2, characterized in that: The shooting adjustment unit comprises: The model training module is used to collect historical data of various lighting conditions and vegetation types as multiple samples; a neural network model is used to train each sample, and a corresponding adjustment plan is output according to the sample information. The adjustment plan corresponding to each sample includes: fill light parameters and color correction parameters; The solution acquisition module is used to predict the lighting conditions and grass types on site based on the trained neural network model, and obtain the fill light parameters and color correction parameters required on site; The automatic adjustment module is used to automatically start the ambient light compensator to perform illumination compensation based on the obtained fill light parameters and color correction parameters, and automatically enable the color correction algorithm to correct the obtained image.
7. The all-weather plant height measurement device based on binocular stereo vision according to claim 2, characterized in that: The image processing unit comprises: The size adjustment module is used to cut the original image of the plant height and divide it into multiple small areas; then the original image of the plant height is geometrically corrected to correct the distortion and deformation caused by the camera or the environment; The image enhancement module is used to enhance the plant height image after resizing, including: removing noise, reducing background interference, and increasing edge sharpness; A threshold segmentation module is used to perform threshold segmentation on the enhanced plant height image and divide the image into different areas; The morphological processing module is used to perform morphological processing on the plant height image after threshold segmentation, including: opening operation, closing operation, corrosion, expansion and affine; The ROI extraction module is used to extract the region of interest from the plant height image after threshold segmentation, and to classify the ROI into different categories.
8. The all-weather plant height measurement device based on binocular stereo vision according to claim 2 is characterized in that: The feature extraction unit comprises: The feature extraction module is used to extract multiple feature points from the pre-processed plant height image using the SIFT algorithm. The multiple key points are the basis for subsequent stereo matching. A feature matching module, used to match the extracted multiple feature points with feature points pre-stored in a stereo vision library; The image generation module is used to obtain each successfully matched feature pair, and calculate the corresponding disparity value using the principle of stereoscopic vision to obtain multiple disparity values, and then compose the multiple disparity values into a disparity map.
9. The all-weather plant height measurement device based on binocular stereo vision according to claim 2, characterized in that: The coordinate calculation unit comprises: The depth value acquisition module is used to calculate the vertical distance between the two points on the disparity line based on the disparity map and the triangle interior angle theorem in the triangulation principle. The vertical distance is the corresponding feature point depth, and the depth value of each matching point on the disparity map is obtained. The formula for solving the depth value is as follows: Where D is the image depth; f is the focal length; B is the baseline; Bf is the distance from the baseline B to the imaging plane M; X l Represented as P l The coordinate point on the x-axis; X r Represented as P r The coordinate point on the x-axis; 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 the trigonometric function relationship; obtain the three-dimensional coordinates of all matching points in the disparity map; the formula for solving the three-dimensional coordinates of the matching points is as follows: Where x represents the X-axis; y represents the Y-axis; Z represents the depth of the object relative to the camera; Bx l Expressed as baseline B to P l The distance between points on the X axis; l Expressed as baseline B to P l The distance between the points on the Y axis; Bf is the distance between the baseline B and the imaging plane M; X l Represented as P l The coordinate point on the x-axis; X r Represented as P r The coordinate point on the x-axis; l Represented as P l The coordinate point on the Y axis; y r Represented as P r The coordinate point on the Y axis; The coordinate confirmation module reconstructs the three-dimensional coordinates of each pixel point based on the three-dimensional coordinates of all matching points and combines the depth value obtained by triangulation with the intrinsic and extrinsic parameters of the binocular camera (1) to obtain the three-dimensional coordinates of the plant height image; The image write-back module is used to write the obtained three-dimensional coordinates into the grass plant height image to obtain the final grass plant height image with depth information. The grass plant height image includes: the location information of the grass plant and the morphological information of the grass plant.
10. The all-weather plant height measurement device based on binocular stereo vision according to claim 2, characterized in that: The height confirmation unit comprises: The random point sorting module is used to select a part of random points in the depth map, sort the selected points using the bubble sort method, and filter out the points with the largest depth and the smallest depth after sorting; the remaining depth values are averaged to obtain the average value of the depth of all points, and the average value of the depth represents the average depth of the plant height image; The height calculation module is used to obtain the average height of grass and trees by subtracting the average depth from the fixed height value.
Citation Information
Patent Citations
Plug seedling growth vigor non-destructive monitoring method and device based on color and depth information
CN109115776A
Wide-narrow row ratooning rice harvesting regulation and control system and method based on binocular vision
CN113016331A
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
Method of determining parameters of forest
RU2828596C1