A method and system for detecting lettuce leaf area
By applying optical marking points on the lettuce leaves and combining multi-angle image analysis, the problem that traditional methods cannot accurately measure the complex morphology of the leaves is solved, and efficient and automatic lettuce leaf area detection is achieved, improving the accuracy and applicability of the measurement.
Patent Information
- Application Number
- CN202410288578.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-14
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-03-14
AI Technical Summary
Traditional lettuce leaf area measurement methods cannot accurately capture the complex geometric properties of the blade, such as folds and bending, and it is difficult to achieve large-scale automated measurements.
By applying optical marking points and obtaining lettuce leaf images from different angles, the area is divided by image processing technology, the adjustment factor, edge detection and wrinkle information is calculated, and the blade area is automatically calculated to adapt to different shapes and image quality.
It improves the accuracy and automation of measurements, is suitable for large-scale lettuce leaf area detection, and reduces errors and manual intervention in traditional methods.
Smart Images

Figure CN118037821B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of agricultural bioinformatics, and in particular to a method and system for detecting the area of lettuce leaves. Background Art
[0002] In agricultural production and plant physiology research, accurate measurement of lettuce leaf area is one of the important indicators for evaluating lettuce growth status, health and biomass.
[0003] Traditional methods for measuring the area of lettuce leaves often rely on physical contact measurement or simple two-dimensional image analysis technology, which cannot accurately capture the complex geometric characteristics of leaves, such as wrinkles and bends, thus affecting the accuracy and efficiency of the measurement. In addition, traditional methods also have certain limitations in operation, such as requiring multiple manual interventions, making it difficult to achieve large-scale automated measurement. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method and system for detecting the area of lettuce leaves, which can automatically, accurately and efficiently measure the area of lettuce leaves and simultaneously obtain the wrinkle information of the leaves.
[0005] In order to solve the above technical problems, the technical solution of the present invention is as follows:
[0006] In a first aspect, a method for detecting the leaf area of lettuce is provided, the method comprising:
[0007] Applying optical marking points on lettuce leaves and acquiring images of the lettuce leaves at different angles;
[0008] Dividing the lettuce leaf image into a plurality of regions according to the optical marking points, and calculating the adjustment factors corresponding to the regions;
[0009] Calculating the edge detection adjustment degree corresponding to the region according to the adjustment factor, and obtaining the contour information of the lettuce leaf image to extract the effective leaf region;
[0010] The estimated leaf area is calculated based on the pixels in the effective leaf area, and the wrinkle information of the lettuce leaf is obtained based on the difference data of the optical marker points in the effective leaf area at different angles;
[0011] The estimated leaf area is corrected according to the wrinkle information of the lettuce leaves to obtain the target leaf area.
[0012] Furthermore, optical marking points are applied to lettuce leaves, and images of lettuce leaves at different angles are obtained, including:
[0013] Collecting initial lettuce leaf images at different angles, and highlighting optical marker points in the initial lettuce leaf images;
[0014] A high-pass filter was used to remove the low-frequency background noise in the initial image, and images of lettuce leaves at different angles were obtained.
[0015] Furthermore, initial lettuce leaf images at different angles are collected, and optical marker points in the initial lettuce leaf images are highlighted, including:
[0016] The brightness value of each pixel in the initial lettuce leaf image is counted to generate a histogram;
[0017] Obtaining the minimum and maximum values of the brightness values in the histogram, and obtaining a brightness range according to the minimum and maximum values of the brightness values;
[0018] Mapping the brightness range to the full brightness range and performing a linear transformation adjustment on each pixel;
[0019] Locate the gray or white areas in the image and determine the color temperature deviation based on the actual color characteristics;
[0020] The RGB channels of the image are adjusted accordingly according to the color temperature deviation to compensate for the color temperature deviation.
[0021] Furthermore, the lettuce leaf image is divided into a plurality of regions according to the optical marking points, and the adjustment factors corresponding to the regions are calculated, including:
[0022] Preset the optical marker color threshold, and traverse the color of each pixel in the lettuce leaf image to determine the optical marker pixel;
[0023] The division radius is calculated based on the statistical characteristics of the optical marker pixels and the image characteristics of the lettuce leaf;
[0024] Taking the optically marked pixel point as the center, pixels within the division radius are divided into the same area to obtain multiple areas;
[0025] The number of optical marking points in each area was calculated and divided by the total number of pixels in the area to obtain the marking density;
[0026] For each region, calculate the standard deviation of the gradient value of each pixel in the region;
[0027] The adjustment factor corresponding to each region is calculated according to the label density and the standard deviation of the gradient value.
[0028] Furthermore, taking the optically marked pixel point as the center, the pixels within the division radius are divided into the same area to obtain multiple areas, including:
[0029] Extract overlapping pixels in adjacent areas;
[0030] The overlapping pixels are traversed in sequence, the distances from the overlapping pixels to all related optical marker pixels are calculated, and the area centered on the optical marker pixel with the smallest distance is selected as its belonging area.
[0031] Further, the edge detection adjustment degree corresponding to the region is calculated according to the adjustment factor, and contour information of the lettuce leaf image is obtained to extract the effective leaf region, including:
[0032] Setting a global baseline threshold, and calculating an edge detection threshold for a corresponding area according to the adjustment factor;
[0033] Use edge detection algorithm to extract edge of the region according to edge detection threshold of the corresponding region;
[0034] The edges detected in each area are integrated to obtain the effective leaf area.
[0035] Furthermore, the estimated leaf area is calculated based on the pixels in the effective leaf area, and the wrinkle information of the lettuce leaf is obtained based on the difference data of the optical marker points in the effective leaf area at different angles, including:
[0036] The effective blade area is divided into multiple triangular areas, and the sum of the areas of the multiple triangles is calculated to obtain the effective blade area;
[0037] Obtaining the inclination angle between the blade and the photographic imaging plane, and correcting the effective area of the blade to obtain the estimated area of the blade;
[0038] The displacement of each optical marker relative to the reference plane is measured in the images of lettuce leaves at different angles;
[0039] Calculate the vertical depth of the optical marker point based on the displacement and the viewing angle difference;
[0040] The depth difference between adjacent optical markers is analyzed to calculate the local curvature.
[0041] In a second aspect, a lettuce leaf area detection system comprises:
[0042] An acquisition module, used for applying optical marking points on lettuce leaves and acquiring images of the lettuce leaves at different angles;
[0043] A processing module, used for dividing the lettuce leaf image into a plurality of regions according to the optical marking points, and calculating the adjustment factors corresponding to the regions;
[0044] An extraction module, used for calculating the edge detection adjustment degree corresponding to the region according to the adjustment factor, and obtaining the contour information of the lettuce leaf image to extract the effective leaf region;
[0045] A calculation module, used to calculate the estimated leaf area according to the pixels in the effective leaf area, and obtain the wrinkle information of the lettuce leaf according to the difference data of the optical marking points in the effective leaf area at different angles;
[0046] The correction module is used to correct the estimated leaf area according to the wrinkle information of the lettuce leaves to obtain the target leaf area.
[0047] According to a third aspect, a computing device includes:
[0048] one or more processors;
[0049] The storage system is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the above method.
[0050] In a fourth aspect, a computer-readable storage medium stores a program, and the program implements the above method when executed by a processor.
[0051] The above solution of the present invention includes at least the following beneficial effects:
[0052] The above scheme of the present invention, by applying optical marking points on lettuce leaves and combining with multi-angle image analysis, this method can accurately capture the three-dimensional morphological characteristics of the leaves, effectively consider the influence of wrinkles and bending on area measurement, thereby improving the accuracy of measurement; by using image processing technology to automatically identify optical marking points and leaf contours, and by using computer algorithms to automatically divide areas and calculate areas, this method significantly improves the automation level and work efficiency of leaf area measurement; this method dynamically adjusts the sensitivity of edge detection and pre-processes the image to adapt to different image qualities and shooting conditions, thereby enhancing the applicability and flexibility of the method. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 It is a flow chart of a method for detecting the area of lettuce leaves provided in an embodiment of the present invention.
[0054] Figure 2 It is a schematic diagram of a lettuce leaf area detection system provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0055] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0056] like Figure 1 As shown, an embodiment of the present invention provides a method for detecting the area of lettuce leaves, the method comprising:
[0057] Step 1, applying optical marking points on lettuce leaves, and acquiring images of the lettuce leaves at different angles;
[0058] Step 2, dividing the lettuce leaf image into a plurality of regions according to the optical marking points, and calculating the adjustment factors corresponding to the regions;
[0059] Step 3, calculating the edge detection adjustment degree corresponding to the region according to the adjustment factor, and obtaining the contour information of the lettuce leaf image to extract the effective leaf region;
[0060] Step 4, calculating the estimated leaf area according to the pixels in the effective leaf area, and obtaining the lettuce leaf wrinkle information according to the difference data of the optical markers in the effective leaf area at different angles;
[0061] Step 5: Correct the estimated leaf area according to the wrinkle information of the lettuce leaf to obtain the target leaf area.
[0062] In this embodiment, before photographing the lettuce leaves at multiple angles in step 1, non-invasive optical marking points are applied to the lettuce leaves. For example, edible pigments that are harmless to lettuce are selected as marking materials, and dot marks of uniform size are applied to the surface of the leaves using a fine brush or a marking pen. These marks can be evenly distributed on the surface of the leaves, or they can be differentially distributed on the surface of the lettuce leaves according to the differences in leaf shapes, so as to assist in the subsequent analysis of the three-dimensional morphology and wrinkle depth of the leaves; more preferably, more dense optical marking points are applied to the wrinkles of the lettuce leaves to facilitate the subsequent identification of the wrinkle information of the leaves.
[0063] In the method for detecting the area of lettuce leaves described in the embodiment of the present invention, by applying optical marking points and using images at multiple angles, the present invention can more accurately identify and measure the area of lettuce leaves. The optical marking points provide reference points for the image, so that the area calculation can be more accurately based on the actual size of the lettuce, reducing the measurement error caused by angle deviation; analyzing different areas and calculating the corresponding adjustment factors and edge detection adjustment degrees, so that the method can adapt to different shapes and sizes of lettuce leaves, and can be widely used in various types of lettuce, not just leaves of a specific shape or size. Compared with manual measurement or methods that rely entirely on manual recognition, the method greatly improves the processing speed and efficiency, and is suitable for large-scale lettuce leaf area detection tasks; by calculating the adjustment factors corresponding to different areas, and adjusting the sensitivity of edge detection according to these factors, it can flexibly adapt to the characteristics of different leaves and different image quality situations, and can be widely used in leaf area detection under various environmental conditions, including images taken under different lighting and backgrounds, and by correcting the estimated area based on wrinkle information, the accuracy of area measurement is further improved, and the error caused by ignoring the three-dimensional structure of the leaf in the traditional two-dimensional area measurement method can be effectively reduced.
[0064] In another optional embodiment of the present invention, the above step 1, applying optical marking points on lettuce leaves and acquiring images of lettuce leaves at different angles, includes:
[0065] Step 11, collecting initial lettuce leaf images at different angles, and highlighting optical marker points in the initial lettuce images;
[0066] Step 12: Use a high-pass filter to remove low-frequency background noise in the initial image to obtain images of lettuce leaves at different angles.
[0067] In the lettuce leaf area detection method described in the embodiment of the present invention, by applying optical markers on the lettuce leaves, specific positions on the leaves can be clearly identified, providing accurate reference points for subsequent geometric and three-dimensional reconstruction analysis, and being suitable for capturing the wrinkles and curved parts of the leaves, so that these three-dimensional features are taken into account when calculating the leaf area; acquiring images of the lettuce leaves from multiple angles can comprehensively capture the morphological characteristics of the leaves, providing rich data support for subsequent three-dimensional morphological reconstruction and area estimation; highlighting the optical markers in the initial image to make them more eye-catching in the image, which not only helps the automated algorithm to identify these points, but also improves the accuracy of marker positioning; removing low-frequency background noise in the image by a high-pass filter can more clearly highlight the leaves and optical markers, reduce background interference, and enhance the adaptability of the method to different shooting conditions and background noise, so that the algorithm can run stably in a variety of environments, thereby improving versatility and flexibility.
[0068] In another optional embodiment of the present invention, the above step 11, highlighting the optical marking points in the initial lettuce image, includes:
[0069] Step 111, counting the brightness value of each pixel in the initial lettuce image to generate a histogram;
[0070] Step 112, obtaining the minimum and maximum values of the brightness values in the histogram, and obtaining a brightness range according to the minimum and maximum values of the brightness values;
[0071] Step 113, mapping the brightness range to the full brightness range, and performing a linear transformation adjustment on each pixel to improve the overall contrast and brightness of the image;
[0072] Step 114, locating the gray or white area in the image, and determining the color temperature deviation according to the actual color characteristics;
[0073] Step 115 , adjusting the RGB channels of the image accordingly according to the color temperature deviation to compensate for the color temperature deviation.
[0074] In the lettuce leaf area detection method described in the embodiment of the present invention, steps 111 to 113 can effectively improve the overall contrast and brightness of the image by analyzing the brightness histogram of the image and adjusting the brightness range, so that the optical marker points in the image are more obvious and easy to automatically identify and analyze subsequently, thereby improving the accuracy of processing. Steps 114 and 115 locate the gray or white areas in the image and evaluate the actual color characteristics, which are helpful to identify and compensate for color temperature deviations. By adjusting the RGB channels of the image, color distortion caused by different color temperatures of the shooting light source can be corrected to ensure the authenticity and consistency of the image color.
[0075] In another optional embodiment of the present invention, the above step 12, using a high-pass filter to remove low-frequency background noise in the initial image to obtain images of lettuce leaves at different angles, includes:
[0076] Step 121, converting the image from the spatial domain to the frequency domain, and analyzing the frequency components in the image;
[0077] Step 122, pre-design a high-pass filter and determine a suitable cut-off frequency to filter out low-frequency components and retain high-frequency components, and apply the high-pass filter in the frequency domain to retain only frequency components higher than the cut-off frequency.
[0078] Step 123, converting the processed frequency domain image back to the spatial domain to obtain an image with the low-frequency background removed, so as to make the optical markers and the edges of the leaf veins more prominent.
[0079] In the lettuce leaf area detection method described in the embodiment of the present invention, step 121 converts the image from the spatial domain to the frequency domain, which can intuitively analyze the frequency components in the image. The pre-designed high-pass filter in step 122 accurately filters out the low-frequency components in the image, namely, background noise and flat areas, by determining a suitable cutoff frequency, while retaining important high-frequency components, such as optical markers and leaf vein edges. Step 123 converts the frequency domain image processed by high-pass filtering back to the spatial domain, and the obtained image removes the interfering low-frequency background, making the optical markers and leaf vein edges more prominent.
[0080] In another optional embodiment of the present invention, the above step 2, dividing the lettuce leaf image into a plurality of regions according to the optical marking points, and calculating the adjustment factors corresponding to the regions, comprises:
[0081] Step 21, presetting an optical marker color threshold, and traversing the color of each pixel in the lettuce leaf image to determine the optical marker pixel;
[0082] Step 22, calculating the partition radius according to the statistical characteristics of the optical marker pixels and the image characteristics of the lettuce leaf;
[0083] Step 23, taking the optically marked pixel point as the center, dividing the pixels within the dividing radius into the same area to obtain multiple areas;
[0084] Step 24, calculating the number of optical marking points in each area and dividing it by the total number of pixels in the area to obtain the marking density;
[0085] Step 25, calculating the standard deviation of the gradient value of each pixel in each region;
[0086] Step 26, calculating the adjustment factor corresponding to each region according to the label density and the standard deviation of the gradient value.
[0087] In this embodiment, the adjustment factor may be set as a weighted sum of the mark density and the standard deviation of the structure complexity, and the factor is used to adjust the sensitivity of edge detection in subsequent steps.
[0088] When performing edge detection, the detection threshold is dynamically adjusted according to the adjustment factor of each area; more specifically, if the adjustment factor of a region is high, it means that the region is more complex, such as the wrinkled area of lettuce, so the edge detection threshold is lowered to capture more subtle edges; conversely, if the adjustment factor is low, it means that the region is relatively simple, such as the root area of a lettuce leaf, and the edge detection threshold can be appropriately increased to avoid noise interference.
[0089] In the lettuce leaf area detection method described in the embodiment of the present invention, by presetting the optical marker color threshold and traversing the color of each pixel in the image, the optical marker point can be accurately identified, ensuring that the marker point can be correctly identified, and the division radius is calculated according to the characteristics of the optical marker point and the image characteristics of the lettuce leaf, so that the division of each area can be based on actual data rather than a fixed standard, which is more in line with the actual growth of the lettuce leaf and can more accurately reflect the actual differences between different leaf areas; the pixels within the division radius are divided into the same area, which can simplify the data processing process and reduce the amount of calculation. The marker density is obtained by calculating the number of optical marker points in each area and dividing it by the total number of pixels in the area. The standard deviation of the gradient value of the pixel points in each area is calculated, which can effectively reflect the texture and structure changes inside the area. The adjustment factor corresponding to each area is calculated according to the standard deviation of the marker density and the gradient value, so that the analysis and area estimation of each area can be adjusted according to the actual situation, thereby improving the accuracy and efficiency of the entire measurement process.
[0090] In another optional embodiment of the present invention, the above step 22, calculating the division radius according to the statistical characteristics of the optical marker pixels and the image characteristics of the lettuce leaf, includes:
[0091] Step 221, generating a distance set D according to the Euclidean distances between the optically marked pixels in the lettuce leaf image, and calculating the median D of the distance set D median and standard deviation σ D ;
[0092] Step 222, calculating the image resolution R of the lettuce leaf image img , the total number of optically labeled pixels in the lettuce leaf image N marks , and the average grayscale gradient of the lettuce leaf image
[0093] Step 223, by formula: The partition radius R is calculated, where λ, κ and ξ are preset weight coefficients for balancing the influence of various parameters on R.
[0094] In this embodiment, the average grayscale gradient of the image can be obtained by calculating the average of the absolute values of the grayscale value differences between each pixel in the image and its adjacent pixels, and then by calculating the formula in step 223, the median and dispersion of the distance between the optical marker pixels, the density of the marker points, and the complexity of the details of the lettuce leaf image can be considered to dynamically adjust the division radius value to match the detection of each different lettuce leaf area.
[0095] In the lettuce leaf area detection method described in an embodiment of the present invention, by combining the distance between optical marker pixels, image resolution, the total number of marker points and the average grayscale gradient of the image, the division radius can be adjusted according to different lettuce leaves and image characteristics, and the Euclidean distance between each pair of optical marker pixels is calculated and the statistical characteristics of these distances are used to effectively capture the spatial characteristics of the marker point distribution, thereby ensuring that the area division better reflects the actual distribution of the marker points on the lettuce leaves.
[0096] In another optional embodiment of the present invention, in the above step 23, taking the optically marked pixel point as the center, pixels within the division radius are divided into the same area to obtain multiple areas, including:
[0097] Step 231, extracting overlapping pixels in adjacent areas;
[0098] Step 232, traverse the overlapping pixels in sequence, calculate the distances from the overlapping pixels to all relevant optical marker pixels, and select an area centered on an optical marker pixel with the smallest distance as its belonging area.
[0099] In the lettuce leaf area detection method described in the embodiment of the present invention, by classifying the pixels within the division radius into corresponding areas, it is ensured that the area division based on the optical marker points is accurate and orderly, and that each area is organized around a central marker point, thereby optimizing the definition of the area. By calculating the distance between the overlapping pixels and all relevant optical marker points and selecting the marker point with the minimum distance as its belonging area, the accurate attribution of the overlapping pixels is ensured, the consistency and accuracy of data processing is guaranteed, and the errors and inconsistencies in data processing can be greatly reduced.
[0100] In another optional embodiment of the present invention, the above step 3, calculating the edge detection adjustment degree corresponding to the region according to the adjustment factor, and obtaining the contour information of the lettuce leaf image to extract the effective leaf region, includes:
[0101] Step 31, setting a global baseline threshold, and calculating an edge detection threshold of a corresponding area according to the adjustment factor;
[0102] Step 32, using an edge detection algorithm to extract edges of the region according to the edge detection threshold of the corresponding region;
[0103] Step 33: Integrate the edges detected in each area to obtain a valid leaf area.
[0104] In this embodiment, by the formula: T region =T base ×(1+γ·C), calculate the edge detection threshold T region , where T baseis the global baseline threshold, γ is the adjustment coefficient, which is used to control the influence of the adjustment factor on the threshold, and C is the adjustment factor.
[0105] In the lettuce leaf area detection method described in the embodiment of the present invention, by setting a global baseline threshold and combining an adjustment factor to calculate a specific edge detection threshold for each region, edge detection in different regions can be adjusted individually. Compared with using a single global threshold, it can more accurately adapt to the characteristics of each region, thereby improving the accuracy of edge detection. In step 32, the edge of the region is extracted using an edge detection algorithm according to the edge detection threshold of each region, which optimizes the edge extraction process and can more effectively identify the true contour of the lettuce leaf, especially when the contrast between the leaf edge and the background is not obvious; by integrating the edges detected in each region, the complete lettuce leaf contour information can be effectively obtained. It ensures that the effective leaf area is accurately separated from the overall image, and the actual situation of the leaf is more realistically reflected.
[0106] In another optional embodiment of the present invention, the above step 4, calculating the estimated leaf area according to the pixels in the effective leaf area, and obtaining the lettuce leaf wrinkle information according to the difference data of the optical markers in the effective leaf area at different angles, includes:
[0107] Step 41, dividing the effective blade area into a plurality of triangular areas, and calculating the sum of the areas of the plurality of triangles to obtain the effective blade area;
[0108] Step 42, obtaining the inclination angle between the blade and the photographic imaging plane, and correcting the effective area of the blade to obtain the estimated area of the blade;
[0109] Step 43, measuring the displacement of each optical marking point relative to the reference plane in the lettuce leaf images at different angles;
[0110] Step 44, calculating the vertical depth of the optical marking point according to the displacement and the viewing angle difference;
[0111] Step 45, analyzing the depth difference between adjacent optical marking points and calculating the local curvature.
[0112] In this embodiment, the estimated blade area in step 42 can be calculated by the formula: true =A measured / cos(θ), calculate the estimated blade area A true , where A measured is the effective area of the blade, and θ is the inclination angle between the blade and the camera imaging plane.
[0113] In this embodiment, calculating the local curvature in step 45 includes: obtaining the three-dimensional coordinates (x i,y i ,z i ), local curvature κ i It can be done by fitting the optical marker point and its neighboring points to a minimum quadratic surface z = ax 2 +by 2 +cxy+dx+ey+g, and calculated based on the shape parameters of the surface, the local curvature κ i The calculation formula is: Where x, y, and z are the coordinate values on the coordinate axes in three-dimensional space; a, b, c, d, e, and g are the coefficients of the quadratic surface equation. Specifically, a and b are related to x. 2 and 2 The coefficient of the multiplication of the terms reflects the degree of curvature of the surface in the x and y directions, c is the coefficient of the xy term, which indicates the mixed bending effect in the x and y directions, d and e are the coefficients of the linear terms x and y, which reflect the inclination of the surface along the x and y directions, and g is a constant term, which indicates the position offset of the surface relative to the origin. In this way, the local geometric characteristics of the surface can be inferred from a set of scattered 3D marker points, and then the curvature distribution of the entire blade surface can be analyzed.
[0114] In the lettuce leaf area detection method described in the embodiment of the present invention, by dividing the effective leaf area into multiple triangles and calculating the sum of the areas of these triangles, the effective area of the leaf can be obtained very accurately, which is suitable for lettuce leaves of complex shapes and can provide more accurate area estimation than traditional methods; by obtaining the inclination angle between the leaf and the photographic imaging plane and correcting the effective area of the leaf, the accuracy of the area estimation is improved; steps 43 and 44 measure the displacement of each optical marker point relative to the reference plane at different angles and calculate the vertical depth generated by these displacements, so that detailed information of the leaf wrinkles can be extracted from the optical data; step 45 analyzes the depth difference between adjacent optical marker points and calculates the local curvature, which can reveal subtle changes and features on the leaf surface, such as wrinkles and bends.
[0115] In another optional embodiment of the present invention, the above step 44, calculating the vertical depth of the optical marking point according to the displacement and the viewing angle difference, includes:
[0116] Step 441, obtain the optical marking point P i At least two different angles correspond to the projection point P in the lettuce leaf image i1 and P i2 ;
[0117] Step 442, by calculating the projection point P i1 and P i2 , calculate the distance d between the projection points of the optical marker on the lettuce leaf image at two different angles 12;
[0118] Step 443, obtaining the distance D from the camera to the camera imaging plane, and the baseline distance B between the cameras;
[0119] Step 444, assuming that the camera centers are O1 and O2 respectively, by the formula: Calculate the depth Z of the optical marker i , where f is the focal length of the camera and θ1 is the angle between the optical marker point and the camera baseline.
[0120] In the lettuce leaf area detection method described in the embodiment of the present invention, by obtaining the projection points of the optical marker points at at least two different angles and calculating the distance between these projection points, the type of data that can be obtained from the image is greatly enriched, so that the analysis of the leaf is not limited to the surface area, but also includes its spatial form, taking into account the distance D from the camera to the imaging plane, the baseline distance B between the cameras, and the angle θ1 from the optical marker point to the camera baseline, thereby making the depth measurement more accurate and reliable. By calculating the vertical depth of the optical marker point, the degree of wrinkling and the overall form of the leaf can be better understood.
[0121] In another optional embodiment of the present invention, the above step 5, correcting the estimated leaf area according to the wrinkle information of the lettuce leaf to obtain the target leaf area, includes:
[0122] Step 51, based on the optical markers and their vertical depths, for each region, a local three-dimensional surface model is constructed using a polynomial surface fitting method; for example, if there are enough markers distributed in a region, a quadratic polynomial can be used to fit the surface of the region;
[0123] Step 52, for each constructed local surface model, performing surface integral to calculate the actual area of the surface;
[0124] Step 53, the areas of all local three-dimensional surfaces are accumulated and added with the estimated area to obtain the target area of the blade.
[0125] In the above embodiment, considering that the local three-dimensional surface may be described by a polynomial z=f(x, y), the microelement area dA is expressed as: in, and are the partial derivatives of the surface in the x and y directions, representing the inclination of the surface along these two directions; by the formula: Integrate the above expression in the surface area to get the total area A of the local three-dimensional surface local , where the integral region R corresponds to the projection area of the lettuce leaf on the two-dimensional plane; then, the area A of all local three-dimensional surfaces local Add them up and add them together with the original two-dimensional area A2D Compare and correct. Correction term ΔA 3D It can be expressed as the sum of the areas of all local three-dimensional surfaces and the difference between their two-dimensional projection areas: ΔA 3D =∑(A local -A projected ), where A projected is the projected area of each local surface on the two-dimensional plane, which can be estimated by directly measuring the area of the corresponding area in the two-dimensional image; the final corrected total area A total is the original 2D estimated area plus the area increase due to wrinkles: A total =A 2D +ΔA 3D .
[0126] In the lettuce leaf area detection method described in the embodiment of the present invention, a local three-dimensional surface model is constructed by using a polynomial surface fitting method, which allows a more accurate description of the true geometric shape of each area. In particular, when there are wrinkles or bends on the leaf surface, the actual area of the leaf can be estimated more accurately. Compared with the estimation method based only on two-dimensional images, the accuracy of area calculation can be significantly improved; by performing surface integral on each constructed local surface model, the actual area of each local surface can be calculated; every tiny bump on the leaf surface can be accurately captured and quantified, and the comprehensiveness and accuracy of the final area estimation are ensured by accumulating the areas of all local three-dimensional surfaces and adding the estimated area to obtain the target area of the leaf.
[0127] like Figure 2 As shown, an embodiment of the present invention further provides a lettuce leaf area detection system, comprising:
[0128] An acquisition module 10 is used to apply optical marking points on the lettuce leaves and acquire images of the lettuce leaves at different angles;
[0129] A processing module 20, for dividing the lettuce leaf image into a plurality of regions according to the optical marking points, and calculating the adjustment factors corresponding to the regions;
[0130] An extraction module 30, for calculating the edge detection adjustment degree corresponding to the region according to the adjustment factor, and obtaining the contour information of the lettuce leaf image to extract the effective leaf region;
[0131] A calculation module 40 is used to calculate the estimated leaf area according to the pixels in the effective leaf area, and obtain the lettuce leaf wrinkle information according to the difference data of the optical marking points in the effective leaf area at different angles;
[0132] The correction module 50 is used to correct the estimated leaf area according to the wrinkle information of the lettuce leaf to obtain the target leaf area.
[0133] It should be noted that the system is a system corresponding to the above method, and all implementation methods in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.
[0134] The embodiment of the present invention further provides a computing device, comprising: a processor, a memory storing a computer program, wherein when the computer program is executed by the processor, the method described above is executed. All implementations in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.
[0135] The embodiment of the present invention also provides a computer-readable storage medium storing instructions, which, when executed on a computer, enable the computer to execute the method described above. All implementations in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.
[0136] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0137] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, systems and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0138] In the embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or units, which can be electrical, mechanical or other forms.
[0139] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0140] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0141] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.
[0142] In addition, it should be noted that in the system and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. Moreover, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order, and some steps can be performed in parallel or independently of each other. For those of ordinary skill in the art, it is understood that all or any steps or components of the method and system of the present invention can be implemented in any computing system (including processors, storage media, etc.) or a network of computing systems in hardware, firmware, software or a combination thereof, which can be achieved by those of ordinary skill in the art using their basic programming skills after reading the description of the present invention.
[0143] Therefore, the purpose of the present invention can also be achieved by running a program or a group of programs on any computing system. The computing system can be a well-known general system. Therefore, the purpose of the present invention can also be achieved by simply providing a program product containing a program code that implements the method or system. That is to say, such a program product also constitutes the present invention, and the storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any well-known storage medium or any storage medium developed in the future. It should also be pointed out that in the system and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. In addition, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order. Some steps can be performed in parallel or independently of each other.
[0144] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for detecting the area of lettuce leaves, characterized in that: The method comprises: Applying optical marking points on lettuce leaves and acquiring images of the lettuce leaves at different angles; dividing the lettuce leaf images into a plurality of regions according to the optical marking points, and calculating adjustment factors corresponding to the regions; The edge detection adjustment degree corresponding to the area is calculated according to the adjustment factor, and the contour information of the lettuce leaf image is obtained to extract the effective leaf area; the estimated leaf area is calculated according to the pixel points in the effective leaf area, and the wrinkle information of the lettuce leaf is obtained according to the difference data of the optical marker points in the effective leaf area at different angles; the estimated leaf area is corrected according to the wrinkle information of the lettuce leaf to obtain the target leaf area; The method of applying optical marking points on lettuce leaves and obtaining images of lettuce leaves at different angles includes: collecting initial images of lettuce leaves at different angles, and highlighting the optical marking points in the initial images of lettuce leaves; using a high-pass filter to remove low-frequency background noise in the initial images, and obtaining images of lettuce leaves at different angles; The method collects initial lettuce leaf images at different angles and highlights the optical marker points in the initial lettuce leaf images, including: performing statistics on the brightness value of each pixel in the initial lettuce leaf image to generate a histogram; obtaining the minimum and maximum values of the brightness values in the histogram, and obtaining a brightness range according to the minimum and maximum values of the brightness values; mapping the brightness range to a full brightness range, and performing a linear transformation adjustment on each pixel; locating a gray or white area in the image, and determining a color temperature deviation according to actual color features; and adjusting the RGB channels of the image accordingly according to the color temperature deviation to compensate for the color temperature deviation; The method divides the lettuce leaf image into a plurality of regions according to the optical marker points, and calculates the adjustment factors corresponding to the regions, including: presetting an optical marker color threshold, and traversing the color of each pixel point in the lettuce leaf image to determine the optical marker pixel point; calculating the division radius according to the statistical characteristics of the optical marker pixel point and the characteristics of the lettuce leaf image; taking the optical marker pixel point as the center, dividing the pixels within the division radius into the same region to obtain a plurality of regions; calculating the number of optical marker points in each region, and dividing the number by the total number of pixels in the region to obtain the marker density; calculating the standard deviation of the gradient value of each pixel point in each region; and calculating the adjustment factor corresponding to each region according to the marker density and the standard deviation of the gradient value; The method of calculating the division radius according to the statistical characteristics of the optical marker pixels and the characteristics of the lettuce leaf image includes: generating a distance set D according to the Euclidean distance between the optical marker pixels in the lettuce leaf image, and calculating the median D of the distance set D. median and standard deviation σ D ; Calculate the image resolution R of the lettuce leaf image img , the total number of optically labeled pixels in the lettuce leaf image N marks , and the average grayscale gradient of the lettuce leaf image By formula: Calculate the partition radius R, where λ, κ and ξ are preset weight coefficients, which are used to balance the influence of various parameters on R; The method takes the optical marker pixel point as the center and divides the pixels within the division radius into the same area to obtain multiple areas, including: extracting overlapping pixels in adjacent areas; traversing the overlapping pixels in sequence, calculating the distances from the overlapping pixels to all related optical marker pixels, and selecting the area with the optical marker pixel point with the smallest distance as the center as its belonging area; The method of calculating the edge detection adjustment degree corresponding to the region according to the adjustment factor and obtaining the contour information of the lettuce leaf image to extract the effective leaf region includes: setting a global baseline threshold and calculating the edge detection threshold of the corresponding region according to the adjustment factor, wherein, by formula: T region =T base ×(1+γ·C), calculate the edge detection threshold T region , where T base is the global baseline threshold, γ is the adjustment coefficient, which is used to control the influence of the adjustment factor on the threshold, and C is the adjustment factor; according to the edge detection threshold of the corresponding area, the edge detection algorithm is used to extract the edge of the area; the edges detected in each area are integrated to obtain the effective leaf area; The method calculates the estimated leaf area according to the pixel points of the effective leaf area, and obtains the lettuce leaf wrinkle information according to the difference data of the optical marker points in the effective leaf area at different angles, including: dividing the effective leaf area into multiple triangular areas, and calculating the sum of the areas of the multiple triangles to obtain the effective leaf area; obtaining the inclination angle between the leaf and the photographic imaging plane, and correcting the effective leaf area to obtain the estimated leaf area; measuring the displacement of each optical marker point relative to the reference plane in the lettuce leaf image at different angles; calculating the vertical depth of the optical marker point according to the displacement and the viewing angle difference; analyzing the depth difference between adjacent optical marker points to calculate the local curvature The method corrects the estimated leaf area according to the wrinkle information of the lettuce leaf to obtain the target leaf area, including: constructing a local three-dimensional surface model for each area using a polynomial surface fitting method according to the optical marking points and their vertical depths; performing surface integral on each constructed local surface model to calculate the actual area of the surface; and accumulating the areas of all local three-dimensional surfaces and adding the estimated area to obtain the target leaf area.
2. A lettuce leaf area detection system, characterized in that: Applied in the method as claimed in claim 1, comprising: An acquisition module, used for applying optical marking points on lettuce leaves and acquiring images of the lettuce leaves at different angles; A processing module, used for dividing the lettuce leaf image into a plurality of regions according to the optical marking points, and calculating the adjustment factors corresponding to the regions; An extraction module, used for calculating the edge detection adjustment degree corresponding to the region according to the adjustment factor, and obtaining the contour information of the lettuce leaf image to extract the effective leaf region; A calculation module, used to calculate the estimated leaf area according to the pixels in the effective leaf area, and obtain the wrinkle information of the lettuce leaf according to the difference data of the optical marking points in the effective leaf area at different angles; The correction module is used to correct the estimated leaf area according to the wrinkle information of the lettuce leaves to obtain the target leaf area.
3. A computing device, characterized in that: include: one or more processors; A storage system for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the method as claimed in claim 1.
4. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program, which implements the method as claimed in claim 1 when executed by a processor.
Citation Information
Patent Citations
Area and circumference nondestructive measurement method of small irregular object
CN103839283A
Leaf area image measurement method based on saturation segmentation
CN112435290A
Quantifying plant infestation by estimating number of biological objects on leaf using convolutional neural network of training images obtained by semi-supervised method
CN115104133A
Method for measuring phenotypic characters of leaves in batches and related equipment
CN116105691A
Quantifying biotic damage on plants, by separating plant-images and subsequently operating a convolutional neural network
US20230141945A1
