A mobile terminal-based forest and fruit planting guidance information pushing method and system
By collecting images of fruit tree leaves using mobile terminals, this technology solves the problems of data collection methods in existing technologies, enabling real-time and accurate data collection for fruit tree planting guidance information. It achieves rapid, non-destructive, and refined diagnosis and guidance during the fruit tree planting process, solving the problems of long data collection cycles, high costs, information transmission delays, and low accuracy in existing technologies, and realizing real-time and accurate guidance information for fruit tree planting.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- YULIN HONGMANYUAN GREEN DATE IND DEV CO LTD
- Filing Date
- 2026-02-05
- Publication Date
- 2026-05-05
AI Technical Summary
Existing methods for disseminating guidance information on fruit and forestry planting rely on manual data collection, resulting in long data cycles, high costs, large diagnostic errors, and delayed and inaccurate information delivery, making it difficult to meet the timeliness and data accuracy requirements of refined planting management.
Images of fruit leaves are collected via mobile terminals. Brightness variance is calculated to filter valid images. Color space is converted to separate channel data. Texture entropy and grayscale statistics are performed. Morphological segmentation is used to extract leaf veins and leaf mesophyll regions. Multidimensional feature vectors are constructed. Euclidean distance is calculated to generate fertilization guidance information and push it to users.
It enables rapid, non-destructive diagnosis and precise quantitative guidance of plant nutrition status during fruit and forestry planting, ensuring the timeliness and accuracy of agricultural management.
Smart Images

Figure CN121640284B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of agricultural data processing technology, and in particular to a method and system for pushing guidance information on fruit and forestry planting based on mobile devices. Background Technology
[0002] The field of agricultural data processing technology encompasses the use of computer hardware and software to digitally collect and comprehensively analyze environmental parameters, biological characteristics, and management strategies related to agricultural production. One traditional method of disseminating guidance information for fruit tree planting involves agricultural extension workers regularly driving to planting areas to manually collect data on tree height, crown width, and leaf color using handheld notebooks and measuring tapes. This data, combined with printed planting technical specifications, is used to find corresponding management measures, which are then compiled into paper guidance plans. These plans are then read aloud through the village committee's broadcasting system or posted on bulletin boards for growers to copy and read on-site.
[0003] Current technologies rely on manual labor, with vehicles driven to the site and measurements taken manually. This results in long data collection cycles and high labor costs. Subjective judgments based solely on visual observation of leaf color are prone to errors in diagnosing plant health. The process of searching through paper books for standards and handwriting solutions severely limits the efficiency of generating guidance information. One-way communication methods, such as broadcasting or posting paper documents, cannot achieve immediate access to and retention of information. Growers find it difficult to obtain targeted management advice in a timely manner. The information transmission process is significantly delayed and inaccurate, failing to meet the timeliness and data accuracy requirements of refined planting management. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of existing technologies and propose a method and system for pushing guidance information on fruit and forestry planting based on mobile terminals.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: a method for pushing guidance information on fruit tree planting based on a mobile terminal, comprising the following steps:
[0006] S1: Call the mobile terminal to collect a sequence of images of forest fruit leaves including multiple angles and poses, calculate the variance of the brightness value of the central region of each frame in the forest fruit leaf image sequence, and filter valid leaf images from the forest fruit leaf image sequence based on the variance value.
[0007] S2: Convert the effective leaf image from the red-green-blue color space to the hue-saturation-brightness color space and separate the brightness channel data. Calculate the texture entropy value of the brightness channel data using the gray-level co-occurrence matrix algorithm, and statistically analyze the arithmetic mean and standard deviation of the pixel gray values of the brightness channel data.
[0008] S3: Perform morphological segmentation processing on the effective leaf image to extract the pixel set of the leaf vein region and the pixel set of the leaf mesophyll region, calculate the difference between the average gray value of the pixel set of the leaf vein region in the green channel and the average gray value of the pixel set of the leaf mesophyll region in the yellow-green channel, and calculate the slope of the difference value along the growth direction of the main leaf vein.
[0009] S4: Construct a multidimensional feature vector based on the texture entropy value, the arithmetic mean, standard deviation, difference value, and the slope value of change. Calculate the Euclidean distance between the multidimensional feature vector and the preset standard healthy plant feature vector. Map the Euclidean distance value to the nitrogen deficiency level range to generate fertilization guidance information and push it to the mobile terminal.
[0010] As a further aspect of the present invention, step S1 specifically comprises:
[0011] S11: Call the rear camera of the mobile terminal to continuously capture multiple frames of original leaf images in autofocus mode, and generate the forest fruit leaf image sequence;
[0012] S12: Using the geometric center of each frame image as the origin, a rectangular area is cropped according to a preset cropping ratio as the central region of interest, and the brightness components of all pixels within the central region of interest are extracted.
[0013] S13: Calculate the dispersion of the brightness components within the central region of interest using a brightness statistical model, and generate a variance value;
[0014] S14: Obtain the preset minimum sharpness threshold and maximum exposure threshold, and mark the images whose variance values are between the minimum sharpness threshold and the maximum exposure threshold as the effective leaf images.
[0015] As a further aspect of the present invention, step S2 specifically comprises:
[0016] S21: Obtain the red, green and blue component data of the effective leaf image, map it to the HSV color space through a nonlinear transformation matrix, and extract the V component matrix as the brightness channel data.
[0017] S22: Set the calculation step size and direction parameters of the gray-level co-occurrence matrix, traverse the brightness channel data to statistically analyze the joint probability distribution of gray levels, and establish the gray-level co-occurrence matrix;
[0018] S23: Calculate the randomness index of image texture based on the gray-level co-occurrence matrix, and generate texture entropy value;
[0019] S24: Traverse all pixels of the brightness channel data and calculate the arithmetic mean of the overall brightness and the standard deviation of the brightness distribution using the first-order statistical moment algorithm.
[0020] As a further aspect of the present invention, step S3 specifically comprises:
[0021] S31: Perform Otsu's binarization process on the effective leaf image, combine opening and closing operations to remove noise, and generate an initial binary mask.
[0022] S32: Use a morphological thinning algorithm to extract the skeleton structure of the initial binary mask as the pixel set of the leaf vein region, and mark the remaining part of the initial binary mask after removing the skeleton structure as the pixel set of the leaf mesophyll region.
[0023] S33: Extract the average gray value of the pixel set in the leaf vein region in the G channel and the average gray value of the pixel set in the leaf mesophyll region in the yellow-green area obtained by weighted synthesis of the R and G channels, respectively, and calculate the difference between the two to obtain the difference value.
[0024] S34: Divide the pixel set of the leaf vein region into several continuous micro-segments along the extension direction of the main leaf vein, calculate the gradient of the difference value corresponding to the adjacent micro-segments in turn, and obtain the slope value of the change by linear regression fitting.
[0025] As a further aspect of the present invention, step S4 specifically comprises:
[0026] S41: The texture entropy value, the arithmetic mean, the standard deviation, the difference value and the change slope value are mapped to a unified dimension interval by using the maximum-minimum normalization method, and the multidimensional feature vector is generated by combining them in a preset dimension order.
[0027] S42: Retrieve the feature vector of the standard healthy plant corresponding to the current fruit variety from the cloud database, calculate the straight-line distance between it and the multi-dimensional feature vector in the vector space, and generate the Euclidean distance value;
[0028] S43: Compare the Euclidean distance value with multiple preset grading thresholds to determine the nitrogen deficiency level range to which the current plant belongs;
[0029] S44: Based on the nitrogen deficiency level range, retrieve the corresponding topdressing formula and recommended application rate, generate the fertilization guidance information, and send it to the display interface of the mobile terminal.
[0030] As a further aspect of the present invention, the calculation process of the slope value includes:
[0031] Obtain the first leaf vein in the direction of growth. The difference value corresponding to each micro segment and the relative distance between the micro-segment and the base of the petiole Construct a set of coordinate points;
[0032] Based on the principle of least squares, the slope value is calculated using the following formula. :
[0033] ;
[0034] in, This represents the numerical value of the slope of the change. Represents the total number of micro-segments. Representing the The relative distance between each micro-segment and the base of the petiole The arithmetic mean representing the relative distances of all the micro-segments. Representing the The difference value corresponding to each micro-segment The arithmetic mean of the differences between all the micro-segments is given.
[0035] As a further aspect of the present invention, the process of calculating the texture entropy value includes:
[0036] Obtain the first gray-level co-occurrence matrix. Line number Column element values The element value It is determined by the normalized probability of two gray levels appearing simultaneously under a preset step size and direction;
[0037] Calculate the texture entropy value using the following formula. :
[0038] ;
[0039] in, Represents texture entropy value, This represents the total number of gray levels after quantization of the brightness channel data. Represents the th in the gray-level co-occurrence matrix Line number The element values of the column, This represents a very small positive constant used to avoid overflow in logarithmic operations.
[0040] As a further aspect of the present invention, the mapping process of the nitrogen deficiency level interval includes:
[0041] Get the preset first grading threshold Second-level threshold With the third grade threshold And satisfy ;
[0042] If the Euclidean distance value is less than or equal to If the nitrogen deficiency level range is determined to be in a normal state, no fertilization recommendation will be generated.
[0043] If the Euclidean distance value is greater than and less than or equal to If the nitrogen deficiency level range is determined to be mild nitrogen deficiency, the fertilization guidance information will be generated.
[0044] If the Euclidean distance value is greater than If the nitrogen deficiency level is determined to be moderate to severe, the fertilization guidance information recommending root application of urea will be generated.
[0045] As a further aspect of the present invention, the screening process for the effective leaf images includes:
[0046] Obtain the shooting timestamp and gyroscope attitude angle data for each frame in the image sequence of the fruit leaves;
[0047] Calculate the reference attitude angle corresponding to the image with the largest variance value, and remove edge view images whose deviation from the reference attitude angle exceeds a preset angle threshold;
[0048] Among the remaining images, images with variance values within the preset optimal imaging range are selected as the effective leaf images. If the variance values of all images are lower than the minimum sharpness threshold, a retake prompt instruction is generated and pushed to the mobile terminal.
[0049] A mobile-based forestry and fruit tree planting guidance information push system, wherein the mobile-based forestry and fruit tree planting guidance information push system is used to implement the above-mentioned mobile-based forestry and fruit tree planting guidance information push method, the system comprising:
[0050] The image acquisition and filtering module is used to call the mobile terminal to acquire a sequence of images of forest fruit leaves including multiple angles and poses, calculate the variance of the brightness value of the central region of each frame in the forest fruit leaf image sequence, and filter the valid leaf images from the forest fruit leaf image sequence based on the variance value.
[0051] The color texture analysis module is used to convert the effective leaf image from the red-green-blue color space to the hue-saturation-brightness color space and separate the brightness channel data. It calculates the texture entropy value of the brightness channel data through the gray-level co-occurrence matrix algorithm and calculates the arithmetic mean and standard deviation of the pixel gray values of the brightness channel data.
[0052] The leaf vein morphology feature extraction module is used to perform morphological segmentation processing on the effective leaf image to extract the pixel set of the leaf vein region and the pixel set of the leaf mesophyll region, calculate the difference between the average gray value of the pixel set of the leaf vein region in the green channel and the average gray value of the pixel set of the leaf mesophyll region in the yellow-green channel, and calculate the slope value of the difference value along the growth direction of the main leaf vein.
[0053] The decision generation and push module is used to construct a multi-dimensional feature vector by using the texture entropy value, the arithmetic mean, the standard deviation, the difference value, and the slope value; calculate the Euclidean distance between the multi-dimensional feature vector and the preset standard healthy plant feature vector; map the Euclidean distance value to the nitrogen deficiency level interval to generate fertilization guidance information; and push it to the mobile terminal.
[0054] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0055] In this invention, leaf images are collected by a mobile terminal and filtered based on brightness variance to ensure data source quality. The color space is converted to separate channel data to accurately calculate texture entropy and grayscale statistical features. Morphological segmentation to extract leaf veins and mesophyll regions helps to quantitatively analyze channel color differences and their changing trends along the growth direction. A multidimensional feature vector containing texture and color difference is constructed and the nitrogen deficiency level is accurately mapped through Euclidean distance calculation. Fertilization guidance is automatically generated and pushed to the terminal to ensure the immediacy of agricultural management. This enables rapid, non-destructive diagnosis and refined quantitative guidance of plant nutrition status during the fruit and forestry planting process. Attached Figure Description
[0056] Figure 1 This is a flowchart of the method for pushing guidance information on fruit and forestry planting according to the present invention;
[0057] Figure 2 This is a flowchart of the effective leaf image screening process of the present invention;
[0058] Figure 3 This is a flowchart illustrating the calculation of texture entropy and brightness index in this invention.
[0059] Figure 4 This is a flowchart of the numerical calculation of the slope variation in this invention;
[0060] Figure 5 This is a flowchart illustrating the process of generating fertilization guidance information for this invention. Detailed Implementation
[0061] To make the objectives, technical solutions, and advantages of this invention clearer, the software-based technical solution is described in detail below with reference to system architecture diagrams and embodiments. It should be understood that the specific embodiments described herein are only for explaining the technical solutions of this invention and do not constitute a limitation on the scope of protection.
[0062] In the description of this invention, the system architecture relationships or data processing flows indicated by terms such as "layer," "module," "interface," "data flow," "client," and "server" are all defined based on the architecture diagram or flowchart corresponding to the embodiments. This way of describing is only used to clearly illustrate the logical relationships between the elements in the technical solution, and not to limit the physical deployment form. The term "multiple" includes two or more technical units, including but not limited to multiple data nodes, processing threads, service instances, or functional components and other scalable elements. The specific number is determined according to the actual business scenario and needs to be specifically specified.
[0063] Please see Figure 1 and Figure 2 This invention provides a technical solution: a method for pushing guidance information on fruit tree planting based on mobile terminals, comprising the following steps:
[0064] S1: Call the mobile terminal to collect a sequence of images of forest fruit leaves including multiple angles and poses, calculate the variance of the brightness value of the central region of each frame in the forest fruit leaf image sequence, and filter the valid leaf images from the forest fruit leaf image sequence based on the variance value.
[0065] The specific steps of S1 are as follows:
[0066] S11: Call the rear camera of the mobile terminal to continuously capture multiple frames of original leaf images in autofocus mode and generate a sequence of forest fruit leaf images.
[0067] S12: Using the geometric center of each frame as the origin, a rectangular area is cropped according to a preset cropping ratio as the central region of interest, and the brightness components of all pixels within the central region of interest are extracted.
[0068] S13: Calculate the dispersion of the brightness components within the central region of interest using a brightness statistical model, and generate the variance value;
[0069] S14: Obtain the preset minimum sharpness threshold and maximum exposure threshold, and mark images with variance values between the minimum sharpness threshold and the maximum exposure threshold as valid leaf images;
[0070] The process of selecting valid leaf images includes:
[0071] Obtain the capture timestamp and gyroscope attitude angle data for each frame in the image sequence of fruit leaves;
[0072] Calculate the reference attitude angle corresponding to the image with the largest variance value, and remove edge view images whose deviation from the reference attitude angle exceeds a preset angle threshold;
[0073] Among the remaining images, images with variance values within the preset optimal imaging range are selected as valid leaf images. If the variance values of all images are lower than the minimum sharpness threshold, a retake prompt is generated and pushed to the mobile terminal.
[0074] This embodiment selects a Fuji apple demonstration orchard located in Luochuan County, Shaanxi Province as the experimental setting, and collects and filters images of apple tree leaves during the peak growth period (mid-July). To ensure the quality of input data for subsequent image processing algorithms, this step constructs a collection and filtering mechanism based on mobile hardware-level control and sensor fusion.
[0075] In step S11, after receiving the acquisition command triggered by the user through the application, the mobile terminal (in this embodiment, a smartphone running iOS 15 with a 12-megapixel rear camera and an aperture of f / 1.6) directly calls the underlying camera API through the AVFoundation framework. The program first locks the white balance gain parameter and fixes the color temperature at 5500K to simulate a standard natural light environment, eliminating the interference of ambient light color temperature changes on leaf color reproduction; then, it activates the phase detection autofocus (PDAF) function, locking the focus frame in the center of the screen. Within 200 milliseconds after receiving a "True" confirmation signal for the focus status, it continuously captures an image stream at a sampling rate of 30 frames per second for a duration of 2 seconds, thereby generating a sequence of 60 original images of the fruit leaves. This sequence is temporarily stored in the mobile terminal's RAM, with the image format uniformly encoded as JPEG and a color depth of 24 bits.
[0076] In step S12, the processor reads each frame of RGB image from the buffer and obtains its resolution attribute (denoted as ). ,For example (Based on the geometric center coordinates of the image) Based on this, the boundary coordinates of the central region of interest (ROI) are calculated according to a preset cropping ratio of 0.6 (i.e., cropping 60% of the original image's width and height). The cropped ROI effectively eliminates interference from orchard weeds and adjacent branches in the background. Subsequently, grayscale processing is performed on the pixels within the ROI to extract the luminance component. This embodiment uses the Rec.601 standard weighted formula, which conforms to the characteristics of human visual perception, for extraction. .in, Represents brightness value. These represent the pixel values in the red, green, and blue channels, respectively. This process compresses the three-channel data into a single-channel luminance matrix with dimensions of [missing information]. The numerical range is .
[0077] In step S13, the processor loads a luminance statistical model, which is based on the gradient variance calculation logic of the Laplacian operator. First, a... Laplace convolution kernel ( (This is a second-order differential operator containing a center value of -4 and a neighborhood value of 1). The convolution kernel is then convolved with the brightness matrix generated in step S12, and the second derivative of each pixel is calculated to generate an edge gradient map. Subsequently, the statistical variance of all pixel values in the edge gradient map is calculated. A larger variance value indicates richer high-frequency texture information in the image, meaning sharper edges and a clearer image; conversely, a smaller variance value indicates a blurrier image.
[0078] In step S14, the system executes a dual-threshold-based filtering logic. First, the system presets a minimum resolution threshold. With maximum exposure threshold . The baseline was set by calculating the mean variance of 1,000 apple leaf samples that were manually judged to be blurry. Based on brightness histogram statistics, an overexposure threshold is defined as a brightness mean exceeding 230. The processor iterates through the variance values of each frame in the image sequence. Only retain those that meet the requirements. The image frame. If a frame is blurred due to hand tremor ( Or due to overexposure caused by direct sunlight ( If the condition is invalid, it is directly marked as invalid and removed from the sequence index.
[0079] In the selection process for the aforementioned valid blade images, a multi-sensor fusion and spatiotemporal constraint algorithm was introduced. First, the system synchronously reads gyroscope data at the instant each frame was captured (accurate to millisecond timestamps) using the CoreMotion framework to obtain the phone's attitude angles in the spatial coordinate system: pitch, roll, and yaw. Second, for the image set initially screened by S14, the system identifies the frame with the largest variance value, defining it as the "clearest frame," and records the corresponding attitude angle data as the "reference attitude angle" (e.g., Pitch = 45°, Roll = 0°). Next, the Euclidean deviation between the attitude angle of each remaining frame and the reference attitude angle is calculated. A preset angle threshold of 15° is set; any image deviating more than 15° from the reference attitude angle (meaning the shooting angle is too off, potentially causing blade geometric deformation) is discarded. Finally, in the remaining candidate image set, an "optimal imaging interval" selection strategy is implemented. The optimal imaging interval is defined as the variance distribution... The system prioritizes images falling within a specific interval as the final valid leaf images. If, after the above-mentioned filtering process, the candidate set is empty (i.e., the variance of all images is less than 150), the system triggers an exception handling logic, generates a text prompt command such as "Insufficient light or focus failure, please keep your phone stable and retake the shot," and pushes it to the mobile terminal screen through the UI interface.
[0080] Please see Figure 1 and Figure 3 S2: Convert the effective leaf image from the red-green-blue color space to the hue-saturation-brightness color space and separate the brightness channel data. Calculate the texture entropy value of the brightness channel data using the gray-level co-occurrence matrix algorithm, and statistically calculate the arithmetic mean and standard deviation of the pixel gray values of the brightness channel data.
[0081] The specific steps of S2 are as follows:
[0082] S21: Obtain the red, green and blue component data of the effective leaf image, map it to the HSV color space through a nonlinear transformation matrix, and extract the V component matrix as the brightness channel data.
[0083] S22: Set the calculation step size and direction parameters of the gray-level co-occurrence matrix, traverse the brightness channel data to statistically analyze the joint probability distribution of gray levels, and establish the gray-level co-occurrence matrix;
[0084] S23: Calculate the randomness index of image texture based on the gray-level co-occurrence matrix and generate texture entropy value;
[0085] S24: Traverse all pixels of the brightness channel data and calculate the arithmetic mean of the overall brightness and the standard deviation of the brightness distribution using the first-order statistical moment algorithm;
[0086] The process of calculating texture entropy includes:
[0087] Obtain the first gray-level co-occurrence matrix. Line number Column element values Element value It is determined by the normalized probability of two gray levels appearing simultaneously under a preset step size and direction;
[0088] Calculate the texture entropy value using the following formula. :
[0089] ;
[0090] in, Represents texture entropy value, This represents the total number of gray levels after quantization of the brightness channel data. Represents the first gray-level co-occurrence matrix. Line number The element values of the column, This represents a very small positive constant used to avoid overflow in logarithmic operations.
[0091] In this embodiment, step S2 is executed in the GPU acceleration unit of the mobile terminal, aiming to mine the micro-texture features of leaves to reflect the nutritional status of plants.
[0092] In step S21, the processor acquires the valid leaf images (RGB format) selected in S1 and performs RGB to HSV color space conversion. The input data is the normalized data. (range of values) The calculation process is as follows: First, calculate the maximum brightness value. and minimum value .tone With saturation The calculation is based on the colorimetric formula, and the lightness channel data (V component) extracted in this step is directly taken as the value. After the transformation is complete, the V component matrix is requantized. The grayscale integers form a brightness channel data matrix. This matrix eliminates the interference of color information and purely reflects the changes in light and dark texture on the leaf surface. It is highly sensitive to identifying leaf chlorosis caused by nitrogen deficiency (which leads to changes in the smoothness of brightness texture).
[0093] In step S22, to balance computational efficiency and texture capture capability, the system first compresses the grayscale levels of the luminance channel data matrix from 256 levels to 64 levels (quantization processing) to reduce the matrix dimension. The computation step size is then set. Pixels, with the direction parameter set to Four directions. The processor traverses the compressed brightness matrix and counts the values at a distance of 1 and in the direction of... At that time, gray level With gray level The frequency of simultaneous occurrences is filled into the range. In the initial matrix, to eliminate direction dependence, the matrices generated in the four directions are summed and averaged. Finally, each element in the matrix is divided by the total number of pixel pairs for normalization, resulting in the probability matrix. .
[0094] In step S23, the system calculates the texture entropy value based on information theory. Texture entropy reflects the complexity of image texture or the randomness of information. For nitrogen-deficient leaves, due to uneven chlorophyll distribution and changes in tissue structure, their surface texture often exhibits a degree of disorder that differs from that of healthy leaves.
[0095] The process of calculating texture entropy is as follows:
[0096] Calculate the texture entropy value using the following formula. :
[0097] ;
[0098] in, Represents texture entropy value; This represents the total number of gray levels after the brightness channel data has been quantized (64 in this example). Represents the first gray-level co-occurrence matrix. Line number The element values of the column, i.e., the normalized probability of two gray levels appearing simultaneously; Represents a minimal positive constant (in this embodiment, we take...) ), used to prevent when Logarithmic operations can sometimes result in mathematically undefined situations.
[0099] To verify the calculation process, assume that after processing by S22, a portion of the GLCM matrix is extracted. Sub-region (for simplification only, actual is) ), its normalized element value As shown in Table 1.
[0100] Table 1. Data on the local gray-level co-occurrence matrix P(x,y):
[0101]
[0102] Substitute into the formula to calculate:
[0103] 1. Regarding : Calculation item is ;
[0104] 2. For : Calculation item is ;
[0105] 3. Regarding (Total 3): Calculation items are ;
[0106] 4. For the four items with a value of 0.05: the calculated item is... Summing the above terms yields the local entropy value: This result indicates that the texture of this local region possesses a certain amount of information, and its numerical value is directly related to the roughness of the leaf surface. In actual full-image calculations, the texture entropy value of a healthy leaf is typically within [a certain range]. The entropy value shifts significantly in nitrogen-deficient leaves due to surface smoothing or lesions. This calculation result... It will be passed as part of the feature vector to subsequent steps.
[0107] In step S24, the processor iterates through the brightness channel data matrix again. First, it calculates the arithmetic mean (Mean), using the formula: ,in Total number of pixels For the first The brightness value of each pixel. Then calculate the standard deviation (StdDev), using the formula: For example, if the average pixel value of the brightness channel of a leaf is 120 and the standard deviation is 15, it indicates that the overall brightness of the leaf is moderate and relatively uniform. These two statistics respectively characterize the overall reflective intensity and the uniformity of surface brightness of the leaf, and are important auxiliary indicators for judging whether the leaf has lost its chlorophyll.
[0108] Please see Figure 1 and Figure 4 S3: Perform morphological segmentation on the effective leaf image to extract the pixel set of the leaf vein region and the pixel set of the leaf mesophyll region, calculate the difference between the average gray value of the pixel set of the leaf vein region in the green channel and the average gray value of the pixel set of the leaf mesophyll region in the yellow-green channel, and calculate the slope of the difference value along the growth direction of the main leaf vein.
[0109] The specific steps for S3 are as follows:
[0110] S31: Perform Otsu's method binarization on the effective leaf image, combine opening and closing operations to remove noise, and generate an initial binary mask.
[0111] S32: Use the morphological thinning algorithm to extract the skeleton structure of the initial binary mask as the set of pixels in the leaf vein region, and mark the remaining part of the initial binary mask after removing the skeleton structure as the set of pixels in the leaf mesophyll region.
[0112] S33: Extract the mean gray value of the pixel set in the leaf vein region in the G channel and the mean gray value of the yellow-green area synthesized by the weighted combination of the pixel set in the leaf mesophyll region in the R and G channels respectively, and calculate the difference between the two to obtain the difference value.
[0113] S34: Divide the pixel set of the leaf vein region into several continuous micro segments along the extension direction of the main leaf vein, calculate the gradient of the difference value corresponding to the adjacent micro segments in turn, and obtain the slope value of the change by linear regression fitting.
[0114] The calculation process for the slope value includes:
[0115] Obtain the first leaf vein in the direction of growth. The difference value corresponding to each micro segment and the relative distance between the micro-segment and the base of the petiole Construct a set of coordinate points;
[0116] Based on the principle of least squares, the slope value is calculated using the following formula. :
[0117] ;
[0118] in, This represents the numerical value of the slope of change. Represents the total number of micro-segments. Representing the The relative distance between each micro-segment and the base of the petiole The arithmetic mean of the relative distances of all micro-segments. Representing the The difference value corresponding to each micro-segment This represents the arithmetic mean of the differences between all the micro-segments.
[0119] In this embodiment, step S3 aims to quantify the "yellowing gradient" between leaf veins and leaf mesophyll through refined morphological analysis, which is a key pathological feature for diagnosing nitrogen deficiency.
[0120] In step S31, the processor receives a valid leaf image and first applies Otsu's method to its G (green) channel data to automatically find the optimal global threshold. The Otsu algorithm calculates the maximum inter-class variance when dividing the image into foreground (vein / mesophyll structure) and background classes by traversing all gray levels from 0 to 255. In this embodiment, the calculated threshold is 128; pixels greater than 128 are set to 1 (white), and the rest are set to 0 (black). Subsequently, a morphological opening operation (erosion followed by dilation) is performed. The rectangular structuring element is used to remove isolated noise points in the binary mask; then the closing operation (dilation followed by erosion) is performed to fill the tiny holes inside the blade, generating a complete initial binary mask.
[0121] In step S32, the system invokes the Zhang-Suen morphological thinning algorithm to iteratively peel away the initial binary mask. This algorithm, through multiple iterations, peels away the white regions in the binary image layer by layer while maintaining connectivity, until only a single-pixel-width centerline remains, i.e., the "skeleton structure." This skeleton structure is labeled as the "leaf vein region pixel set" (mainly containing the main leaf vein and first-order lateral veins). Subsequently, using logical operations, the dilated skeleton structure is subtracted from the initial binary mask (the dilation width is set to 3 pixels to cover the thick main leaf vein), and the remaining white region is the "mesophyll region pixel set."
[0122] In step S33, according to plant physiology, nitrogen deficiency first leads to chlorophyll decomposition, causing the leaf mesophyll to turn yellow, while the veins tend to remain green for a longer period. Therefore, the system extracts the average grayscale value of the pixel set in the vein region in the G channel (green component), denoted as . For the mesophyll region, to highlight the yellow characteristic, the system does not simply use the R or G channels, but instead calculates a weighted composite value of the R and G channels: Extract the average grayscale value of the pixel set in the mesophyll region under this synthesis channel, denoted as . Calculate the difference value. .like A positive and relatively large value indicates that the veins are significantly greener than the leaf tissue, exhibiting a phenomenon of "green veins and yellow leaf tissue".
[0123] In step S34, in order to capture the dynamic features of nitrogen deficiency symptoms spreading from the petiole to the leaf tip and from the midrib to the edge, the system divides the extracted main vein skeleton into a micro-segment every 50 pixels.
[0124] The calculation process for the slope value is as follows:
[0125] Calculate the slope value using the following formula. :
[0126] ;
[0127] in, The slope value represents the rate of change of the difference along the leaf vein direction; Represents the total number of micro-segments; Representing the The relative distances of each micro-segment from the base of the petiole (normalized to 0-1); The arithmetic mean of the relative distances of all the micro-segments; Representing the The difference value corresponding to each micro-segment; This represents the arithmetic mean of the differences between all the micro-segments.
[0128] A practical example is introduced for calculation: assuming that the leaf petiole is divided into 5 micro-segments from the base to the tip (i.e., ... The system measured and collected the following data:
[0129] distance : ;
[0130] Difference : ;
[0131] First, calculate the arithmetic mean: , ;
[0132] Molecular part :
[0133] ;
[0134] ;
[0135] ;
[0136] ;
[0137] ;
[0138] Total of numerators ;
[0139] denominator :
[0140] ;
[0141] Final calculation of slope .
[0142] The results show that the difference values exhibit a significant positive increasing trend along the main vein direction, with a slope of 16.0. This means that the further away from the petiole (closer to the leaf tip), the greater the color difference between the veins and the leaf mesophyll, quantifying the spatial distribution gradient of nitrogen deficiency symptoms. This slope value... This will be used as a key feature input in step S4.
[0143] Please see Figure 1 and Figure 5 S4: Construct a multidimensional feature vector based on texture entropy, arithmetic mean, standard deviation, difference value, and slope value. Calculate the Euclidean distance between the multidimensional feature vector and the preset standard healthy plant feature vector. Map the Euclidean distance value to the nitrogen deficiency level range to generate fertilization guidance information and push it to the mobile terminal.
[0144] The specific steps for S4 are as follows:
[0145] S41: The maximum-minimum normalization method is used to map the texture entropy value, arithmetic mean, standard deviation, difference value and change slope value to a unified dimension interval, and then combine them according to the preset dimension order to generate a multi-dimensional feature vector.
[0146] S42: Retrieve the feature vector of a standard healthy plant corresponding to the current fruit variety from the cloud database, calculate the straight-line distance between it and the multi-dimensional feature vector in the vector space, and generate the Euclidean distance value.
[0147] S43: Compare the Euclidean distance value with multiple preset grading thresholds to determine the nitrogen deficiency level range to which the current plant belongs.
[0148] S44: Based on the nitrogen deficiency level range, retrieve the corresponding topdressing formula and recommended application rate, generate fertilization guidance information, and send it to the display interface of the mobile terminal.
[0149] The mapping process for nitrogen deficiency level intervals includes:
[0150] Get the preset first grading threshold Second-level threshold With the third grade threshold And satisfy ;
[0151] If the Euclidean distance value is less than or equal to If the nitrogen deficiency level is determined to be within the normal range, no additional fertilizer recommendation will be generated.
[0152] If the Euclidean distance value is greater than and less than or equal to If the nitrogen deficiency level is determined to be mild nitrogen deficiency, fertilization guidance information will be generated.
[0153] If the Euclidean distance value is greater than If the nitrogen deficiency level is determined to be moderate to severe, fertilization guidance information recommending root application of urea will be generated.
[0154] In this embodiment, step S4 is the decision-making center of the entire scheme, which integrates the "fragmented" image features extracted in the previous steps into specific agricultural guidance decisions.
[0155] In step S41, because the dimensions and orders of magnitude of texture entropy, arithmetic mean, standard deviation, difference value, and slope of change are vastly different, directly calculating the distance would lead to the feature with the larger value dominating the result. The system adopts the Min-MaxNormalization method.
[0156] Define the empirical value range for each feature: texture entropy mean Standard deviation Difference slope ;
[0157] Texture entropy value calculated in S23 For example, after normalization ;
[0158] The slope calculated in S34 For example, after normalization ;
[0159] Assume that the normalized values for other features are: mean 0.5, standard deviation 0.3, and difference 0.6.
[0160] Then construct the multidimensional feature vector of the current plant. .
[0161] In step S42, the system accesses the cloud database via a 4G / 5G network, retrieves data records for "Fuji Apple - Peak Fruiting Period - Health Standard", and obtains the corresponding standard healthy plant feature vector. In this embodiment, the standard vector is (Represents a healthy state with rich texture, moderate brightness, small color difference, and gentle slope). Using the Euclidean distance formula... Calculate distance:
[0162] ;
[0163] ;
[0164] ;
[0165] ;
[0166] ;
[0167] Summation: ;
[0168] Euclidean distance value .
[0169] In step S43, the system presets grading thresholds determined based on a large number of field trials: the first grading threshold. Second-level threshold Third-level threshold .
[0170] The decision logic is as follows:
[0171] 1. If : Determined to be in "normal state";
[0172] 2. If The diagnosis is "mild nitrogen deficiency";
[0173] 3. If The diagnosis is "moderate nitrogen deficiency";
[0174] 4. If The condition is classified as "severe nitrogen deficiency". In this example, the calculated Euclidean distance value... In The range indicated that the plant is currently in a state of "moderate nitrogen deficiency." This result suggests that the leaf characteristics have significantly deviated from healthy standards, requiring immediate intervention.
[0175] In step S44, based on the diagnosis result of "moderate nitrogen deficiency", the system queries the knowledge graph database. For Fuji apple trees in their peak fruiting period, the topdressing formula corresponding to moderate nitrogen deficiency is: "Apply quick-acting nitrogen fertilizer (urea, nitrogen content 46%) per tree".
[0176] The recommended application rate calculation model is as follows: ;
[0177] in, This is the recommended dosage; The standard weight is 150 grams; The severity level coefficient is set to 1.5 for moderate nitrogen deficiency. The tree age coefficient (10-year-old trees are set to 1.2);
[0178] The calculation shows that: gram.
[0179] The system generates the final fertilization guidance information: "Your fruit trees are in a state of moderate nitrogen deficiency. It is recommended to apply root fertilizer immediately, with an estimated 270 grams of urea per tree. Please apply the fertilizer in a trench at the drip line of the canopy and water the tree promptly." This information is packaged in JSON format and pushed to the user's mobile app interface for visualization via HTTPS protocol.
[0180] To verify the beneficial effects of this technical solution, we selected 30 sample trees in the same orchard for a comparative experiment. Nitrogen deficiency was diagnosed using the method of this invention, a portable SPAD chlorophyll meter (traditional instrument method), and manual judgment, respectively. Laboratory chemical analysis (total nitrogen content determination) results were used as the true value standard. The experimental results are shown in Table 2.
[0181] Table 2. Comparison of accuracy and time consumption of different diagnostic methods:
[0182]
[0183] As shown in Table 2, the average diagnostic accuracy of the method of this invention reaches 92.5%, which is 16 percentage points higher than that of manual judgment and slightly higher than that of SPAD instrument detection. In terms of efficiency, this invention can complete the entire process from taking a picture to getting the results in just 3.5 seconds, which is much faster than instrument detection. This proves that by fusing multi-dimensional image features (texture, morphology, color difference gradient), this scheme can more comprehensively and sensitively capture the weak signals of early nitrogen deficiency, achieving low-cost and high-precision diagnosis of forest and fruit nutrition.
[0184] A mobile-based forestry and fruit tree planting guidance information push system, the system being used to execute the aforementioned mobile-based forestry and fruit tree planting guidance information push method, the system comprising:
[0185] The image acquisition and filtering module is used to call the mobile terminal to acquire a sequence of images of forest fruit leaves including multiple angles and poses, calculate the variance of the brightness value of the central region of each frame in the forest fruit leaf image sequence, and filter valid leaf images from the forest fruit leaf image sequence based on the variance value.
[0186] The color texture analysis module is used to convert the effective leaf image from the red-green-blue color space to the hue-saturation-brightness color space and separate the brightness channel data. It calculates the texture entropy value of the brightness channel data through the gray-level co-occurrence matrix algorithm and calculates the arithmetic mean and standard deviation of the pixel gray values of the brightness channel data.
[0187] The leaf vein morphology feature extraction module is used to perform morphological segmentation processing on effective leaf images to extract the pixel set of the leaf vein region and the pixel set of the leaf mesophyll region. It calculates the difference between the average gray value of the pixel set of the leaf vein region in the green channel and the average gray value of the pixel set of the leaf mesophyll region in the yellow-green channel, and calculates the slope value of the difference value along the growth direction of the main leaf vein.
[0188] The decision generation and push module is used to construct a multi-dimensional feature vector by using texture entropy value, arithmetic mean, standard deviation, difference value and change slope value, calculate the Euclidean distance value between the multi-dimensional feature vector and the preset standard healthy plant feature vector, map the Euclidean distance value to the nitrogen deficiency level interval to generate fertilization guidance information, and push it to the mobile terminal.
[0189] The above embodiments illustrate preferred embodiments of the present invention. Any equivalent adjustments to the technical solution based on software engineering methods are within the scope of protection, including but not limited to: implementing algorithm logic using different programming languages, refactoring functional modules into services, adjusting data interaction protocols, and optimizing resource scheduling strategies. Any implementation scheme derived from reasonable modifications to the data processing flow, service call chain, or system architecture layer without departing from the core technology of the present invention should be considered within the protection scope defined by the technical solution of the present invention.
Claims
1. A method for pushing guidance information on fruit tree planting based on mobile terminals, characterized in that, Includes the following steps: S1: Call the mobile terminal to collect a sequence of images of forest fruit leaves including multiple angles and poses, calculate the variance of the brightness value of the central region of each frame in the forest fruit leaf image sequence, and filter valid leaf images from the forest fruit leaf image sequence based on the variance value. The specific steps of S1 are as follows: S11: Call the rear camera of the mobile terminal to continuously capture multiple frames of original leaf images in autofocus mode, and generate the forest fruit leaf image sequence; S12: Using the geometric center of each frame image as the origin, a rectangular area is cropped according to a preset cropping ratio as the central region of interest, and the brightness components of all pixels within the central region of interest are extracted. S13: Calculate the dispersion of the brightness components within the central region of interest using a brightness statistical model, and generate a variance value; The calculation process of the brightness statistical model is as follows: This model is based on the gradient variance calculation logic of the Laplacian operator. First, a... The Laplacian convolution kernel K, which is a second intermediate differential operator containing a center value of -4 and a neighborhood value of 1, is convolved with the brightness matrix to calculate the second derivative of each pixel and generate an edge gradient map. Then, the statistical variance of all pixel values in the edge gradient map is calculated. S14: Obtain the preset minimum sharpness threshold and maximum exposure threshold, and mark the images whose variance values are between the minimum sharpness threshold and the maximum exposure threshold as the effective leaf images; S2: Convert the effective leaf image from the red-green-blue color space to the hue-saturation-brightness color space and separate the brightness channel data. Calculate the texture entropy value of the brightness channel data using the gray-level co-occurrence matrix algorithm, and statistically analyze the arithmetic mean and standard deviation of the pixel gray values of the brightness channel data. S3: Perform morphological segmentation processing on the effective leaf image to extract the pixel set of the leaf vein region and the pixel set of the leaf mesophyll region, calculate the difference between the average gray value of the pixel set of the leaf vein region in the green channel and the average gray value of the pixel set of the leaf mesophyll region in the yellow-green channel, and calculate the slope of the difference value along the growth direction of the main leaf vein. S4: Construct a multidimensional feature vector based on the texture entropy value, the arithmetic mean, standard deviation, difference value, and the slope value of change. Calculate the Euclidean distance between the multidimensional feature vector and the preset standard healthy plant feature vector. Map the Euclidean distance value to the nitrogen deficiency level range to generate fertilization guidance information and push it to the mobile terminal.
2. The method for pushing guidance information on fruit tree planting based on a mobile terminal according to claim 1, characterized in that, The specific steps of S2 are as follows: S21: Obtain the red, green and blue component data of the effective leaf image, map it to the HSV color space through a nonlinear transformation matrix, and extract the V component matrix as the brightness channel data. S22: Set the calculation step size and direction parameters of the gray-level co-occurrence matrix, traverse the brightness channel data to statistically analyze the joint probability distribution of gray levels, and establish the gray-level co-occurrence matrix; S23: Calculate the randomness index of image texture based on the gray-level co-occurrence matrix, and generate texture entropy value; S24: Traverse all pixels of the brightness channel data and calculate the arithmetic mean of the overall brightness and the standard deviation of the brightness distribution using the first-order statistical moment algorithm.
3. The method for pushing guidance information on fruit tree planting based on a mobile terminal according to claim 2, characterized in that, The specific steps of S3 are as follows: S31: Perform Otsu's binarization process on the effective leaf image, combine opening and closing operations to remove noise, and generate an initial binary mask. S32: Use a morphological thinning algorithm to extract the skeleton structure of the initial binary mask as the pixel set of the leaf vein region, and mark the remaining part of the initial binary mask after removing the skeleton structure as the pixel set of the leaf mesophyll region. S33: Extract the average gray value of the pixel set in the leaf vein region in the G channel and the average gray value of the pixel set in the leaf mesophyll region in the yellow-green area obtained by weighted synthesis of the R and G channels, respectively, and calculate the difference between the two to obtain the difference value. S34: Divide the pixel set of the leaf vein region into several continuous micro-segments along the extension direction of the main leaf vein, calculate the gradient of the difference value corresponding to the adjacent micro-segments in turn, and obtain the slope value of the change by linear regression fitting.
4. The method for pushing guidance information on fruit tree planting based on a mobile terminal according to claim 3, characterized in that, The specific steps of S4 are as follows: S41: The texture entropy value, the arithmetic mean, the standard deviation, the difference value and the change slope value are mapped to a unified dimension interval by using the maximum-minimum normalization method, and the multidimensional feature vector is generated by combining them in a preset dimension order. S42: Retrieve the feature vector of the standard healthy plant corresponding to the current fruit variety from the cloud database, calculate the straight-line distance between it and the multi-dimensional feature vector in the vector space, and generate the Euclidean distance value; S43: Compare the Euclidean distance value with multiple preset grading thresholds to determine the nitrogen deficiency level range to which the current plant belongs; S44: Based on the nitrogen deficiency level range, retrieve the corresponding topdressing formula and recommended application rate, generate the fertilization guidance information, and send it to the display interface of the mobile terminal.
5. The method for pushing forestry and fruit planting guidance information based on mobile terminals according to claim 4, characterized in that, The calculation process for the slope value includes: Obtain the first leaf vein in the direction of growth. The difference value corresponding to each micro segment and the relative distance between the micro-segment and the base of the petiole Construct a set of coordinate points; Based on the principle of least squares, the slope value is calculated using the following formula. : ; in, This represents the numerical value of the slope of the change. Represents the total number of micro-segments. Representing the The relative distance between each micro-segment and the base of the petiole The arithmetic mean representing the relative distances of all the micro-segments. Representing the The difference value corresponding to each micro-segment The arithmetic mean of the differences between all the micro-segments is given.
6. The method for pushing guidance information on fruit tree planting based on a mobile terminal according to claim 5, characterized in that, The process of calculating the texture entropy value includes: Obtain the first gray-level co-occurrence matrix. Line number Column element values The element value It is determined by the normalized probability of two gray levels appearing simultaneously under a preset step size and direction; Calculate the texture entropy value using the following formula. : ; in, Represents texture entropy value, This represents the total number of gray levels after quantization of the brightness channel data. Represents the th in the gray-level co-occurrence matrix Line number The element values of the column, This represents a very small positive constant used to avoid overflow in logarithmic operations.
7. The method for pushing forestry and fruit planting guidance information based on a mobile terminal according to claim 6, characterized in that, The mapping process for the nitrogen deficiency level intervals includes: Get the preset first grading threshold Second-level threshold With the third grade threshold And satisfy ; If the Euclidean distance value is less than or equal to If the nitrogen deficiency level range is determined to be in a normal state, no fertilization recommendation will be generated. If the Euclidean distance value is greater than and less than or equal to If the nitrogen deficiency level range is determined to be mild nitrogen deficiency, the fertilization guidance information will be generated. If the Euclidean distance value is greater than and less than or equal to If the nitrogen deficiency level range is determined to be moderate nitrogen deficiency, the fertilization guidance information recommending root application of urea will be generated. If the Euclidean distance value is greater than If so, the nitrogen deficiency level range is determined to be severe nitrogen deficiency.
8. The method for pushing forestry and fruit planting guidance information based on mobile terminals according to claim 7, characterized in that, The process of selecting the valid leaf images includes: Obtain the shooting timestamp and gyroscope attitude angle data for each frame in the image sequence of the fruit leaves; Calculate the reference attitude angle corresponding to the image with the largest variance value, and remove edge view images whose deviation from the reference attitude angle exceeds a preset angle threshold; Among the remaining images, images with variance values within the preset optimal imaging range are selected as the effective leaf images. If the variance values of all images are lower than the minimum sharpness threshold, a retake prompt instruction is generated and pushed to the mobile terminal. The optimal imaging interval is defined as the variance distribution. Segmentation.
9. A mobile-based forestry and fruit planting guidance information push system, characterized in that, The system is used to implement the mobile terminal-based forestry and fruit planting guidance information push method according to any one of claims 1-8, the system comprising: The image acquisition and filtering module is used to call the mobile terminal to acquire a sequence of images of forest fruit leaves including multiple angles and poses, calculate the variance of the brightness value of the central region of each frame in the forest fruit leaf image sequence, and filter the valid leaf images from the forest fruit leaf image sequence based on the variance value. The color texture analysis module is used to convert the effective leaf image from the red-green-blue color space to the hue-saturation-brightness color space and separate the brightness channel data. It calculates the texture entropy value of the brightness channel data through the gray-level co-occurrence matrix algorithm and calculates the arithmetic mean and standard deviation of the pixel gray values of the brightness channel data. The leaf vein morphology feature extraction module is used to perform morphological segmentation processing on the effective leaf image to extract the pixel set of the leaf vein region and the pixel set of the leaf mesophyll region, calculate the difference between the average gray value of the pixel set of the leaf vein region in the green channel and the average gray value of the pixel set of the leaf mesophyll region in the yellow-green channel, and calculate the slope value of the difference value along the growth direction of the main leaf vein. The decision generation and push module is used to construct a multi-dimensional feature vector by using the texture entropy value, the arithmetic mean, the standard deviation, the difference value, and the slope value; calculate the Euclidean distance between the multi-dimensional feature vector and the preset standard healthy plant feature vector; map the Euclidean distance value to the nitrogen deficiency level interval to generate fertilization guidance information; and push it to the mobile terminal.
Citation Information
Patent Citations
Baked tobacco leaf type detection method and system based on machine vision
CN116524224A
Tea color automatic evaluation method and system based on machine vision
CN121207890A