Method and device for determining analysis result

Through the processing of image data frames, the light-transmitting part and droplet area of ​​the plant are identified, and the light-transmitting ratio and droplet coverage ratio are calculated, which solves the problem that ordinary users have difficulty in performing plant growth analysis, and realizes convenient and intuitive display and evaluation of analysis results.

CN119850520APending Publication Date: 2025-04-18CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411629922.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

In the prior art, the measurement of plant growth-related parameters depends on professional equipment, the operation is complex and the threshold is high, making it difficult for ordinary users to conduct convenient measurement and analysis in daily environments.

Method used

By obtaining image data frames, identifying the outline of the light-transmitting part and the droplet area of ​​the plant, calculating the light-transmitting ratio and droplet coverage, and then determining the analysis results and displaying them to the user.

Benefits of technology

It realizes intuitive analysis and understanding of the plant growth status without complex equipment operation and professional knowledge, lowers the user threshold, and more accurately evaluates the plant growth status through specific numerical indicators.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119850520A_ABST
    Figure CN119850520A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of IT and software development, and discloses an analysis result determination method and device, and the method comprises the steps: obtaining an image data frame; according to the image data frame, determining a contour pattern of a light-transmitting part of the plant in the image data frame and a fog drop area on the plant; determining the number of first pixel points of the contour pattern of the light-transmitting part of the plant according to the contour pattern of the light-transmitting part of the plant; determining the number of second pixel points of the fogdrop area on the plant according to the fogdrop area on the plant; and determining an analysis result according to the number of the first pixel points and the number of the second pixel points, and displaying the analysis result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of IT and software development, and in particular to a method and device for determining an analysis result. Background Art

[0002] The measurement of plant growth-related parameters mainly relies on professional equipment such as spectrometers, leaf area meters, and moisture sensors. These devices can provide high-precision, multi-parameter measurement data. However, these professional equipment are not only expensive, but also complicated to operate, requiring a certain level of technical skills and expertise. For ordinary users, the use threshold of these devices is high, and it is difficult to perform convenient measurements and analysis in daily environments. In addition, even if the measurement data is obtained, ordinary users often find it difficult to intuitively understand the meaning of these data, and it is even more difficult to conduct effective analysis and application. Summary of the invention

[0003] In view of this, the present invention provides a method and device for determining an analysis result.

[0004] In a first aspect, the present invention provides a method for determining an analysis result, and the method is applied to a user's terminal device, wherein the method comprises: acquiring an image data frame; determining, based on the image data frame, a contour graphic of a light-transmitting portion of a plant and a mist droplet area on the plant; based on the contour graphic of the light-transmitting portion of the plant, determining a first number of pixel points of the contour graphic of the light-transmitting portion of the plant; based on the mist droplet area on the plant, determining a second number of pixel points of the mist droplet area on the plant; determining an analysis result based on the first number of pixel points and the second number of pixel points, and displaying the analysis result.

[0005] The method for determining the analysis result provided in the present embodiment accurately identifies the outline of the light-transmitting part and the droplet area of ​​the plant through the acquired image data frame, and then determines the analysis result according to the first number of pixel points of the outline graphic of the light-transmitting part of the plant and the second number of pixel points of the droplet area on the plant, and presents the analysis result directly to the user, that is, the acquired image data frame is processed by the user's terminal device without the need for complicated equipment operation and professional knowledge, and the analysis result is determined according to the first number of pixel points of the outline graphic of the light-transmitting part of the plant and the second number of pixel points of the droplet area on the plant, and the analysis result is directly presented to the user, which can be more intuitive and easier to be understood and applied by ordinary users.

[0006] In one possible implementation, an analysis result is determined based on the first number of pixels and the second number of pixels, including: determining the light transmittance ratio of the outline graphic of the light-transmitting part of the plant based on the ratio between the first number of pixels and the third number of pixels of the image data frame; determining the droplet coverage ratio based on the ratio between the second number of pixels and the third number of pixels of the image data frame; and determining the analysis result based on the light transmittance ratio and the droplet coverage ratio.

[0007] The method for determining the analysis results provided in this embodiment can convert the plant growth status that is originally difficult to quantify into a specific numerical index by calculating the light transmittance ratio and the droplet coverage ratio, and more accurately evaluate the growth status of the plant. In addition, the light transmittance ratio and the droplet coverage ratio are two intuitive and easy-to-understand indicators. Users can quickly understand the light transmittance and droplet distribution of the plant through these two indicators.

[0008] In one possible implementation, before acquiring the image data frame, the method also includes: when acquiring the video image, acquiring the capture time; based on the capture time, traversing the video sequence of the video image, and determining the key frame closest to the capture time; determining the pixel data corresponding to the key frame; converting the pixel array of the pixel data corresponding to the key frame into an image file; and determining the image data frame corresponding to the image file based on the image file.

[0009] The method for determining the analysis result provided in this embodiment can quickly locate the key frame closest to the interception time by directly obtaining the interception time and traversing the video sequence, thereby avoiding the tedious process of frame-by-frame processing. In addition, the key frame has complete image information, thereby avoiding image distortion or information loss caused by image compression or encoding problems.

[0010] In one possible implementation, an analysis result is determined based on the transmittance ratio and the droplet coverage ratio, including: comparing the transmittance ratio with a preset transmittance ratio to generate a first comparison result; comparing the droplet coverage ratio with a preset droplet coverage ratio to generate a second comparison result; and determining the analysis result based on the first comparison result and the second comparison result.

[0011] The method for determining the analysis results provided in this embodiment can accurately identify problems with the light-transmitting part or the droplet distribution through the first comparison result and the second comparison result, so that the user can make corresponding decisions based on the analysis results determined by the first comparison result and the second comparison result.

[0012] In one possible implementation, the contour graphic of the light-transmitting part of the plant in the image data frame is determined based on the image data frame, including: performing grayscale processing on the image data frame to obtain a first target image frame; wherein the first target image frame is a grayscale image frame; performing Gaussian filtering on the first target image frame to obtain a second target image frame; performing threshold operation on the second target image frame to obtain a first target binary image; and determining the contour graphic of the light-transmitting part of the plant in the first target binary image.

[0013] The method for determining the analysis result provided in this embodiment performs grayscale processing on the image data frame, removes the color information from the obtained first target image frame, retains only the brightness information, and performs Gaussian filtering on the grayscale image, which can effectively reduce the noise and detail interference in the image. Then, through threshold operation processing, the pixels in the image can be divided into two categories: transparent parts and non-transparent parts. This makes the outline of the transparent part more obvious and easy to identify in the binary image.

[0014] In one possible implementation, determining the fog droplet area on the plant based on the image data frame includes: determining a histogram of a second target image frame; wherein the histogram indicates the number of pixels of different gray levels in the second target image frame; segmenting the second target image frame according to a plurality of preset thresholds to obtain a pending area and other areas; determining a square difference between the pending area and other areas; determining a target square difference with the smallest value from a plurality of square differences; segmenting the second target image frame according to the target square difference to obtain a second target binary image; and determining the fog droplet area on the plant in the second target binary image.

[0015] The method for determining the analysis result provided in this embodiment can clearly display the distribution of the number of pixels of different gray levels in the image by determining the histogram of the second target image frame. In addition, by using multiple preset thresholds to segment the second target image frame, multiple pending areas and other areas can be obtained. By comparing the results of segmentation with different thresholds, the segmentation result closest to the real droplet area can be selected, thereby improving accuracy.

[0016] In a second aspect, the present invention provides a device for determining an analysis result, the device comprising: an acquisition module for acquiring an image data frame; a first determination module for determining, based on the image data frame, a contour graphic of a light-transmitting portion of a plant and a mist droplet area on the plant; a second determination module for determining, based on the contour graphic of the light-transmitting portion of the plant, a first number of pixel points of the contour graphic of the light-transmitting portion of the plant; a third determination module for determining, based on the mist droplet area on the plant, a second number of pixel points of the mist droplet area on the plant; and a fourth determination module for determining the analysis result based on the first number of pixel points and the second number of pixel points.

[0017] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method for determining the analysis results of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0018] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for determining the analysis results of the first aspect or any corresponding embodiment thereof.

[0019] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the method for determining the analysis result of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0021] Figure 1 is a flow chart of a method for determining an analysis result according to an embodiment of the present invention;

[0022] Figure 2 is a flow chart of another method for determining an analysis result according to an embodiment of the present invention;

[0023] Figure 3 is a flow chart of another method for determining an analysis result according to an embodiment of the present invention;

[0024] Figure 4 is a flow chart of a method for determining another analysis result according to an embodiment of the present invention;

[0025] Figure 5 is a schematic diagram of a main interface according to an embodiment of the present invention;

[0026] Figure 6 is a structural block diagram of a device for determining an analysis result according to an embodiment of the present invention;

[0027] Figure 7 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0029] According to an embodiment of the present invention, an embodiment of a method for determining an analysis result is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0030] In this embodiment, a method for determining an analysis result is provided, which can be used in a mobile terminal, such as a mobile phone, a tablet computer, etc. Figure 1 is a flow chart of a method for determining an analysis result according to an embodiment of the present invention, such as Figure 1 As shown, the process includes the following steps:

[0031] Step S101, obtaining an image data frame.

[0032] The image data frame is used to represent a single image of a plant and its environment captured by a camera or other image acquisition device. The image data frame can be a static picture or a frame in a video stream, etc., which is not specifically limited here.

[0033] In a possible implementation, the user may use the camera of the mobile terminal to obtain the image data frames by timing capture, trigger capture, manual capture, etc.

[0034] In a possible implementation, when the image data frame is a frame in a video stream, before the image data frame, the method further includes:

[0035] Step a1, when acquiring a video image, acquiring the capture time.

[0036] A video image can represent a continuous sequence of images captured by a camera or other video acquisition device. A capture time can represent a time stamp for selecting a specific time point from a video stream for image capture. Specifically, during the video stream playback or processing, a time point is determined as the moment of image capture.

[0037] Step a2, traversing the video sequence of the video image according to the capture time, and determining the key frame closest to the capture time.

[0038] A video sequence can represent a collection of consecutive frames in a video image, which constitutes a complete video. A key frame can represent a frame with some importance or special properties in a video sequence, such as scene changes, action changes, etc. In video compression and editing, key frames are used to represent the main content of the video. Specifically, the key frame closest to the capture time is found in the video sequence.

[0039] In a possible implementation, the video sequence may be traversed frame by frame, and the difference between the timestamp of each frame and the capture time may be compared; the key frame may also be quickly located using a video index or metadata.

[0040] In a possible implementation, if there are multiple key frames closest to the capture time in the video sequence, the key frame before the capture time may be used as the closest key frame.

[0041] Step a3, determining the pixel data corresponding to the key frame.

[0042] Pixel data is used to represent the numerical information of the basic unit (pixel) that constitutes the image, including color, brightness, etc. Pixel data is extracted from the key frame, including the color, brightness, etc. of each pixel. For example: Use the OpenCV library to read the pixel data of the key frame.

[0043] Step a4, converting the pixel array of the pixel data corresponding to the key frame into an image file.

[0044] The pixel array may be an array formed by arranging the numerical information of all pixels in the image in a certain order. The image file may represent the pixel array being saved in a file format recognizable by a computer, such as JPEG, PNG, etc. Specifically, the pixel array is saved as an image file.

[0045] Step a5, determining the image data frame corresponding to the image file according to the image file.

[0046] Confirm that the converted image file is the required image data frame.

[0047] As an example, a user selects a surveillance video stream and captures an image at a certain moment. First, the user selects a time point as the capture time through the interface. Then, the system traverses the video sequence and finds the key frame closest to the capture time. Next, the system extracts the pixel data of the key frame and saves it as an image file in JPEG format. Finally, the system confirms that the image file is the required image data frame and displays it to the user or performs subsequent processing.

[0048] Step S102, determining the outline of the light-transmitting part of the plant and the mist droplet area on the plant in the image data frame according to the image data frame.

[0049] The light-transmitting contours represent the shapes of the silhouettes that contrast with the surrounding background due to the light being able to penetrate certain parts of the plant (such as the spaces between leaves). These silhouettes are brighter because the light can directly hit the image acquisition device. The fog droplet areas represent the areas on the image where the light is scattered or reflected in these areas due to fog droplets attached to the plant surface (such as leaves), resulting in specific areas on the image that are usually darker or different in color from the surrounding environment.

[0050] Specifically, image processing techniques (such as edge detection, threshold segmentation, etc.) can be used to identify the outline of the transparent part and the fog droplet area in the image, and a neural network model can also be used to identify the outline of the transparent part and the fog droplet area in the image, etc., which are not specifically limited here. For example: the outline of the transparent part is identified using the Canny edge detection algorithm, and the fog droplet area is identified using the Otsu threshold segmentation method.

[0051] Step S103, determining the number of first pixel points of the outline graphic of the light-transmitting part of the plant according to the outline graphic of the light-transmitting part of the plant.

[0052] The image is composed of many tiny points (pixels), each of which has a specific color and brightness. The number of first pixel points refers to the number of pixels that constitute the outline of the light-transmitting part. Specifically, the number of first pixel points of the outline of the light-transmitting part of the plant can be obtained by counting the pixels of the outline of the light-transmitting part of the plant.

[0053] As an example, for the image after grayscale processing, Gaussian filtering is performed to eliminate image noise, reduce the impact of noise on digital images, and optimize the binary image, thereby improving the image quality and the efficiency of the subsequent statistical area algorithm. The data obtained after Gaussian filtering is binarized, and a threshold operation is performed on the single-channel array, that is, the filtered grayscale image, to obtain a binary image. Part of the noise will be further filtered out during the threshold operation, and adjusting the parameters can further optimize the image quality. For the obtained binary image, the number of pixels is counted instead of directly calculating the area, and the number of the first pixel points of the contour figure of the light-transmitting part of the plant is counted.

[0054] Step S104, determining the number of second pixel points in the mist droplet area on the plant according to the mist droplet area on the plant.

[0055] The second number of pixels refers to the number of pixels constituting the mist drop region. Specifically, each pixel constituting the mist drop region on the plant can be counted to obtain the second number of pixels in the mist drop region.

[0056] As an example, Getter and Setter methods are provided for the processing module to call. The processing module includes graying, image filtering, image segmentation and contour extraction. The URI obtained from the image cropping module in the processing module is converted into a Bitmap, and then converted into the Mat class of OpenCV for image processing and calculation. The calculation result is returned to the view in the form of a Bitmap. The morphological processing of the fog liquid part requires obtaining the structural element and opening operation respectively. The structural element uses an elliptical structural element with a size of 5x5 pixels, which is mainly used to remove noise. Image segmentation uses the Otsu automatic threshold method, and the threshold can also be set manually. The segmentation result needs to be binarized to extract the droplet area. The boundary tracking algorithm is used to extract the droplet area. After extracting the area, the number of second pixels in the droplet area needs to be calculated.

[0057] Step S105, determining an analysis result according to the first number of pixels and the second number of pixels, and displaying the analysis result.

[0058] The number of first pixel points and the number of second pixel points are analyzed respectively, and the analysis result corresponding to the contour graphic of the light-transmitting part of the plant can be obtained through the first number of pixel points, and the analysis result corresponding to the droplet area can be obtained through the second number of pixel points. Then, the overall analysis result is obtained based on the analysis result corresponding to the contour graphic of the light-transmitting part of the plant and the analysis result corresponding to the droplet area, and the overall analysis result is displayed to the user.

[0059] As an example, the camera captures an image of a tomato plant every 5 minutes. Through image processing technology, the outline of the transparent part of the image and the droplet area are identified. It is calculated that the outline of the transparent part has 1,000 pixels, while the droplet area has 200 pixels. Based on this information, the analysis shows that the spray coverage of the plant is low (because the droplet area is relatively small), so a warning message is displayed, prompting the staff that they may need to increase the spray frequency or check whether the spray system is working properly.

[0060] The method for determining the analysis result provided in the present embodiment accurately identifies the outline of the light-transmitting part and the droplet area of ​​the plant through the acquired image data frame, and then determines the analysis result according to the first number of pixel points of the outline graphic of the light-transmitting part of the plant and the second number of pixel points of the droplet area on the plant, and presents the analysis result directly to the user, that is, the acquired image data frame is processed by the user's terminal device without the need for complicated equipment operation and professional knowledge, and the analysis result is determined according to the first number of pixel points of the outline graphic of the light-transmitting part of the plant and the second number of pixel points of the droplet area on the plant, and the analysis result is directly presented to the user, which can be more intuitive and easier to be understood and applied by ordinary users.

[0061] In this embodiment, a method for determining an analysis result is provided, which can be used in the above-mentioned mobile terminal, such as a mobile phone, a tablet computer, etc. Figure 2 is a flow chart of a method for determining an analysis result according to an embodiment of the present invention, such as Figure 2 As shown, the process includes the following steps:

[0062] Step S201, obtain an image data frame. For details, see Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0063] Step S202: determining the outline of the light-transmitting part of the plant and the mist droplet area on the plant in the image data frame according to the image data frame.

[0064] Specifically, the above step S202 includes:

[0065] Step S2021, grayscale processing is performed on the image data frame to obtain a first target image frame; wherein the first target image frame is a grayscale image frame.

[0066] Grayscale processing may represent a process of converting a color image into a grayscale image, in which each pixel has only a brightness value and no color information. The first target image frame may represent a grayscale image frame obtained after grayscale processing.

[0067] As an example, convert a color image to a grayscale image. Perform a weighted sum of the RGB values ​​of each pixel to get a grayscale value. This can be calculated using the following formula:

[0068] Gray=0.299×R+0.587×G+0.114×B; where R, G, and B are the pixel values ​​of the red, green, and blue channels, respectively.

[0069] Step S2022: Perform Gaussian filtering on the first target image frame to obtain a second target image frame.

[0070] The second target image frame may represent a smoothed image frame obtained after Gaussian filtering. Specifically, a Gaussian filter is applied to the grayscale image frame to reduce noise and smooth the image.

[0071] As an example, a Gaussian filter function in an image processing library, such as cv2.GaussianBlur(src, ksize, sigmaX) of OpenCV, can be used. Specifically, the weight of the filter is multiplied by the pixel value at the corresponding position in the image, and the result is added to obtain a new pixel value. The second target image frame is formed by the new pixel value.

[0072] Step S2023, performing a threshold operation on the second target image frame to obtain the first target binary image.

[0073] The threshold operation can represent the process of binarizing the pixel values ​​in the second target image frame according to the threshold. If the pixel value is greater than or equal to the threshold, the pixel is set to white (or a specific color); if the pixel value is less than the threshold, the pixel is set to black (or another specific color). Specifically, according to the set threshold, the smoothed image frame is converted into a binary image.

[0074] As an example, a color image data frame is obtained, and the color image is gray-processed using the OpenCV library to obtain a gray-scale image frame. Then, a Gaussian filter is applied to the gray-scale image frame for smoothing to reduce noise. Finally, a threshold is applied to the smoothed image frame to obtain a binary image; wherein the binary image is the first target binary image mentioned above.

[0075] Step S2024, determining the contour graphic of the light-transmitting part of the plant in the first target binary image.

[0076] Identify and extract the outer contour of the transparent part of the plant in the binary image. Specifically, use an edge detection algorithm (such as the Canny edge detector) to identify the edges in the image. These edges usually correspond to the transition area between the transparent part and the background.

[0077] Step S2025, determining a histogram of the second target image frame; wherein the histogram indicates the number of pixels of different gray levels in the second target image frame.

[0078] A histogram can show the number of pixels at different gray levels (or colors) in an image. For a grayscale image, the horizontal axis of the histogram represents the gray level, and the vertical axis represents the number of pixels at that gray level. Specifically, the number of pixels at each gray level in the image is calculated and a histogram is plotted.

[0079] Step S2026, segmenting the second target image frame according to a plurality of preset thresholds to obtain pending areas and other areas.

[0080] The preset threshold is one or more grayscale values ​​set before image processing to segment the image into different regions. The selection of these thresholds can be based on specific features or targets of the image. The pending region can represent the area that needs further analysis or confirmation after the image is segmented according to the preset threshold, and the other region can represent the image portion other than the pending region. Specifically, for each preset threshold, the pixels in the image with grayscale values ​​lower than the threshold are classified as the pending region, and the rest are classified as the other regions.

[0081] As an example, multiple preset thresholds are set according to the characteristics of the image and the segmentation requirements. These thresholds can be fixed values ​​or dynamically calculated based on a certain algorithm. These thresholds are stored in a list or array. For each preset threshold, each pixel of the image is traversed, and the grayscale value (or color value) of each pixel is compared with the current threshold. If the pixel value is greater than or equal to the current threshold, it is classified as part of the pending area. If the pixel value is less than the current threshold, it is classified as other areas according to the previous segmentation results (if any), or it is retained as unclassified for subsequent processing. For all pixels classified as pending areas, merge processing is performed to form one or more complete pending areas. For pixels in other areas, merge processing is also performed to form complete non-pending areas, and different colors or labels are used to mark the pending areas and other areas.

[0082] Step S2027, determining the square difference between the undetermined area and other areas.

[0083] The square difference can be used to measure the difference between two regions. Specifically, the difference in grayscale value between the region to be determined and the other region is calculated and squared.

[0084] As an example, an image is segmented into a pending area and other areas, and then the average values ​​of the grayscale values ​​of all pixels in the two areas are calculated respectively, and then the difference between the two average values ​​is calculated, and finally the square of the difference is calculated.

[0085] Step S2028: determining a target square difference with a minimum value from the multiple square differences.

[0086] Step S2029, segmenting the second target image frame according to the target square difference to obtain a second target binary image.

[0087] The second target binary image can represent the conversion of the second target image frame into an image with only two pixel values ​​(usually 0 and 1) according to the optimal segmentation threshold, so as to simplify subsequent analysis and processing. Specifically, the target square difference with the smallest data is determined among all the square differences, and then the second target image frame is segmented using the threshold corresponding to the target square difference to obtain the second target binary image.

[0088] As an example, the difference image is binarized according to the target squared difference. The result is a binary image where areas with pixel values ​​close to the target grayscale value are set to white (255), while areas with larger differences are set to black (0).

[0089] Step S2030, determining the mist droplet area on the plant in the second target binary image.

[0090] In the second target binary image, the fog droplet region is identified through morphological operations (such as dilation and erosion) and connected domain analysis.

[0091] As an example, an image frame containing plants and fog droplets uses OpenCV's calcHist function to calculate the grayscale histogram of the image. Assuming that three thresholds are preset (such as 50, 100, and 150), use OpenCV's threshold function to segment the image to obtain three pending areas and other areas. For each pending area and other area obtained by each threshold segmentation, calculate the square difference between them. Compare the three square differences and find the smallest one (assuming it is the square difference corresponding to the threshold of 100). Use the threshold of 100 to segment the image and obtain a binary image. In the binary image, use OpenCV's findContours function to find the connected area representing the fog droplets.

[0092] Step S203, according to the outline of the light-transmitting part of the plant, determine the number of first pixel points of the outline of the light-transmitting part of the plant. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.

[0093] Step S204, according to the mist drop area on the plant, determine the number of second pixel points in the mist drop area on the plant. Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.

[0094] Step S205: Determine the analysis result according to the first number of pixels and the second number of pixels, and display the analysis result. Figure 1 Step S105 of the illustrated embodiment will not be described in detail here.

[0095] The method for determining the analysis result provided in this embodiment performs grayscale processing on the image data frame, removes the color information from the obtained first target image frame, retains only the brightness information, and performs Gaussian filtering on the grayscale image, which can effectively reduce the noise and detail interference in the image. Then, through threshold operation processing, the pixels in the image can be divided into two categories: transparent parts and non-transparent parts. This makes the outline of the transparent part more obvious and easy to identify in the binary image.

[0096] Moreover, by determining the histogram of the second target image frame, the distribution of the number of pixels of different gray levels in the image can be clearly displayed. Moreover, by using multiple preset thresholds to segment the second target image frame, multiple pending areas and other areas can be obtained. By comparing the results of segmentation with different thresholds, the segmentation result closest to the real droplet area can be selected, thereby improving the accuracy.

[0097] In this embodiment, a method for determining an analysis result is provided, which can be used in the above-mentioned mobile terminal, such as a mobile phone, a tablet computer, etc. Figure 3 is a flow chart of a method for determining an analysis result according to an embodiment of the present invention, such as Figure 3 As shown, the process includes the following steps:

[0098] Step S301, obtain an image data frame. Figure 2 Step S201 of the illustrated embodiment will not be described in detail here.

[0099] Step S302: Determine the outline of the light-transmitting part of the plant and the mist droplet area on the plant in the image data frame according to the image data frame. Figure 2 Step S202 of the illustrated embodiment will not be described in detail here.

[0100] Step S303, according to the outline of the light-transmitting part of the plant, determine the number of first pixel points of the outline of the light-transmitting part of the plant. Figure 2 Step S203 of the illustrated embodiment will not be described in detail here.

[0101] Step S304, according to the mist drop area on the plant, determine the number of second pixel points in the mist drop area on the plant. Figure 2 Step S204 of the illustrated embodiment will not be described in detail here.

[0102] Step S305, determining an analysis result according to the first number of pixels and the second number of pixels, and displaying the analysis result.

[0103] Specifically, the above step S305 includes:

[0104] Step S3051, determining the light transmittance ratio of the outline graphic of the light-transmitting part of the plant according to the ratio between the first number of pixel points and the third number of pixel points of the image data frame.

[0105] The ratio of the number of the first pixel points to the number of the third pixel points is calculated to obtain the light transmittance ratio.

[0106] As an example, the ratio is directly calculated using the division operation in the programming language.

[0107] As an example, if the image is in color, it may be necessary to first convert the image into a grayscale image, then identify the number of first pixels in the translucent part, and then calculate the ratio of the first pixel number to the third pixel number to obtain the transmittance ratio.

[0108] As an example, the transmittance ratio can be calculated using the regional statistics function in the image processing library.

[0109] Step S3052: Determine the droplet coverage rate according to the ratio between the second number of pixel points and the third number of pixel points in the image data frame.

[0110] The droplet coverage rate can be the ratio of the droplet coverage area to the entire image or analysis area, reflecting the distribution of the droplets on the plant. Specifically, the ratio of the second pixel number to the third pixel number is calculated to obtain the droplet coverage rate.

[0111] As an example, the ratio is calculated using the division operation in a programming language.

[0112] As an example, the droplet area can be extracted using functions such as threshold segmentation and morphological operations in the image processing library.

[0113] Step S3053, determining the analysis result according to the light transmittance ratio and the droplet coverage ratio.

[0114] The analysis results can indicate conclusions based on light transmittance and droplet coverage, which may include information such as plant health status, spray effect evaluation, irrigation efficiency analysis, etc.

[0115] As an example, first, identify the part of the leaf in the image that is not covered by droplets (translucent part), and calculate the number of pixels in this part (the first number of pixels). Then, calculate the number of pixels in the entire image data frame (the third number of pixels). Finally, divide the first number of pixels by the third number of pixels to obtain the light transmittance ratio. Identify the part covered by droplets in the image, and calculate the number of pixels in this part (the second number of pixels). Similarly, calculate the number of pixels in the entire image data frame (the third number of pixels). Divide the second number of pixels by the third number of pixels to obtain the droplet coverage ratio. Assume that the set light transmittance ratio threshold is 0.7 and the droplet coverage ratio threshold is 0.3. If the calculated light transmittance ratio is lower than 0.7 and the droplet coverage ratio is higher than 0.3, the analysis result of "the plant leaves are overly covered by droplets, affecting light transmittance" may be obtained. On the contrary, if the light transmittance ratio is high and the droplet coverage ratio is low, the analysis result may be "the plant leaves are in good health and the spray effect is moderate".

[0116] Specifically, the above step S3053 includes:

[0117] Step b1, comparing the light transmittance ratio with a preset light transmittance ratio to generate a first comparison result.

[0118] The first comparison result may be a result obtained by comparing the actually calculated transmittance ratio with the preset transmittance ratio, and may specifically represent whether a Boolean value or a degree of difference is satisfied.

[0119] Step b2, comparing the droplet coverage with a preset droplet coverage to generate a second comparison result.

[0120] The second comparison result may be a result obtained by comparing the actually calculated droplet coverage with the preset droplet coverage, and may specifically indicate whether a Boolean value or a degree of difference is satisfied.

[0121] Step b3, determining the analysis result according to the first comparison result and the second comparison result.

[0122] As an example, step b1: compare the actual light transmittance ratio (such as 0.65) with the preset light transmittance ratio (such as 0.70). Assuming that a threshold is set to allow the actual light transmittance ratio to fluctuate within the range of ±0.05 of the preset value, then 0.65 is within this range, so the first comparison result is True (satisfies the condition). Step b2: Compare the actual droplet coverage (such as 0.35) with the preset droplet coverage (such as 0.30). Similarly, a threshold is set to allow the actual droplet coverage to fluctuate within the range of ±0.05 of the preset value. However, 0.35 is beyond this range, so the second comparison result is False (does not meet the condition). Step b3: Combining the first comparison result and the second comparison result, a comprehensive analysis result can be obtained. For example, it can be said: "The light transmittance performance of the plant leaves is basically in line with expectations (because the first comparison result is True), but the droplet coverage is slightly higher than expected (because the second comparison result is False), and it may be necessary to pay attention to adjusting the spray amount or spray frequency."

[0123] The method for determining the analysis results provided in this embodiment can convert the plant growth status that is originally difficult to quantify into a specific numerical index by calculating the light transmittance ratio and the droplet coverage ratio, and more accurately evaluate the growth status of the plant. In addition, the light transmittance ratio and the droplet coverage ratio are two intuitive and easy-to-understand indicators. Users can quickly understand the light transmittance and droplet distribution of the plant through these two indicators.

[0124] Further, through the first comparison result and the second comparison result, problems with the light-transmitting part or the droplet distribution can be accurately identified, so that the user can make corresponding decisions based on the analysis results determined by the first comparison result and the second comparison result.

[0125] In a possible implementation, this embodiment provides an Android-based plant image analysis system. During the test, the Android system configuration is as follows: processor: Dimensity 1000+ octa-core, running memory 8GB, Android version 11. Under this configuration, the system can run stably and smoothly.

[0126] Preprocessing method related parameters: The preprocessing uses the cvtColor function with the COLOR_BGR2GRAY parameter. The formula for determining the grayscale value is as follows:

[0127] Gray=R*0.299·+·G*0.587·+·B*0.114; wherein R, G, and B are pixel values ​​of red, green, and blue channels, respectively.

[0128] For videos, the interval for capturing pictures is 1s or 0.5s, and the getFrameAtTime() function is used with the parameter set to OPTION_CLOSEST.

[0129] Image processing related parameters: Use the GaussianBlur() method with a kernel size of 3×3. The parameters for determining the outline of the light-transmitting part of the plant in the image data frame can be determined using the following formula:

[0130] Among them, u is the horizontal coordinate of the center point, v is the vertical coordinate of the center point, and σ is the standard deviation, which is used to describe the width of the Gaussian filter or the degree of image noise.

[0131] The threshold() function needs to be called for the binarization method, and the parameters THRESH_BINARY|THRESH_TRIANGLE are applied. The following formula can be used:

[0132] Among them, src(x,y) is the brightness value of the pixel of the original image at the coordinate (x,y), T(x,y) is the brightness threshold at the coordinate (x,y), and maxValue is the maximum brightness.

[0133] Calculate data: Introduce an array of MatOfPoint type to count all contours of the transparent part. Use findContours to find all contours, and use drawContours to mark the contour positions. Use S to represent the area ratio. The following formula can be used:

[0134] Among them, Area is the outline of the light-transmitting part of the plant in the image data frame (the number of pixels in the outline of the light-transmitting part of the plant can be used), and totalArea is the area of ​​the image data frame (the total number of pixels in the image data frame can be used).

[0135] Please refer to Figure 4 and Figure 5In a possible implementation, in response to a user's selection operation on the main interface, the computer device can determine a current picture acquisition operation, a historical picture acquisition operation, or a video acquisition operation from the main interface in response to the user's selection operation on the main interface; wherein each operation corresponds to an interface option. The current picture acquisition operation corresponds to a photo option, the historical picture acquisition operation corresponds to an album option, and the video acquisition operation corresponds to a video option.

[0136] When the current picture acquisition operation is determined from the main interface, the plant is photographed and saved, the image data frame corresponding to the plant is collected, the image data frame is cropped, and the analysis result is determined.

[0137] When the historical image acquisition operation is determined from the main interface, the target image is determined from the historical atlas, and the image data frame corresponding to the plant is collected, the image data frame is cropped, and the analysis result is determined.

[0138] When the video acquisition operation is determined from the main interface, the plant is photographed, the video stream corresponding to the plant is collected, and the image data frame is determined from the video stream, and the analysis result is determined based on the image data frame.

[0139] As an example, a callback interface is set up in the backend design to feedback whether an error occurs during the path search data stream parsing of the image. The final absolute path of the generated image is obtained through the getAppExternalStoragePath() function. If the app is installed in the cache directory, it is necessary to call getCacheDir() to obtain the cache path and use getAbsolutePath() to obtain the absolute path to obtain the path of the image.

[0140] As an example, based on the OpenCV library, with the Uri and bitmap of the picture resources, the images stored in the system can be analyzed and calculated. The attached SQLite is the database that comes with the Android Studio development integrated tool. It is an open source, very lightweight relational database. It is very small and fully functional. It does not require a server and does not require configuration. It can be used as a database for mobile applications.

[0141] In this embodiment, a device for determining the analysis result is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0142] This embodiment provides a device for determining an analysis result, such as Figure 6 As shown, it includes: an acquisition module 601, used to acquire an image data frame; a first determination module 602, used to determine the contour graphic of the light-transmitting part of the plant and the droplet area on the plant in the image data frame according to the image data frame; a second determination module 603, used to determine the first pixel number of the contour graphic of the light-transmitting part of the plant according to the contour graphic of the light-transmitting part of the plant; a third determination module 604, used to determine the second pixel number of the droplet area on the plant according to the droplet area on the plant; a fourth determination module 605, used to determine the analysis result according to the first pixel number and the second pixel number.

[0143] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0144] The device for determining the analysis results in this embodiment is presented in the form of a functional unit, where the functional unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0145] The embodiment of the present invention also provides a computer device having the above Figure 6 The analysis results are determined by the device shown.

[0146] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 7 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.

[0147] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0148] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0149] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0150] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0151] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0152] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0153] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0154] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for determining an analysis result, characterized in that: The method is applied to a terminal device of a user, and the method comprises: Get image data frame; Determine, according to the image data frame, the outline of the light-transmitting part of the plant and the mist droplet area on the plant in the image data frame; Determining the number of first pixel points of the outline graphic of the light-transmitting part of the plant according to the outline graphic of the light-transmitting part of the plant; Determining the number of second pixel points in the mist droplet area on the plant according to the mist droplet area on the plant; An analysis result is determined according to the first number of pixels and the second number of pixels, and the analysis result is displayed.

2. The method for determining the analysis result according to claim 1, characterized in that: The determining of the analysis result according to the first number of pixels and the second number of pixels includes: Determining a light transmittance ratio of a contour graphic of a light-transmitting part of the plant according to a ratio between the first number of pixels and the third number of pixels of the image data frame; Determining a droplet coverage rate according to a ratio between the second number of pixels and the third number of pixels in the image data frame; An analysis result is determined according to the light transmittance ratio and the fog droplet coverage ratio.

3. The method for determining the analysis result according to claim 1, characterized in that: Before acquiring the image data frame, the method further includes: When acquiring a video image, obtaining the capture time; According to the interception time, traverse the video sequence of the video image to determine the key frame closest to the interception time; Determining pixel data corresponding to the key frame; Convert the pixel array of pixel data corresponding to the key frame into an image file; An image data frame corresponding to the image file is determined according to the image file.

4. The method for determining the analysis result according to claim 2, characterized in that: Determining analysis results according to the light transmittance ratio and the fog droplet coverage ratio includes: Comparing the light transmittance ratio with a preset light transmittance ratio to generate a first comparison result; Comparing the droplet coverage rate with a preset droplet coverage rate to generate a second comparison result; An analysis result is determined according to the first comparison result and the second comparison result.

5. The method for determining the analysis result according to claim 1, characterized in that: Determining the contour graphic of the light-transmitting part of the plant in the image data frame according to the image data frame includes: Performing grayscale processing on the image data frame to obtain a first target image frame; wherein the first target image frame is a grayscale image frame; Performing Gaussian filtering on the first target image frame to obtain a second target image frame; Performing a threshold operation on the second target image frame to obtain a first target binary image; The contour pattern of the light-transmitting part of the plant is determined in the first target binary image.

6. The method for determining the analysis result according to claim 5, characterized in that: Determining the mist droplet area on the plant according to the image data frame includes: Determining a histogram of the second target image frame; wherein the histogram indicates the number of pixels of different gray levels in the second target image frame; Segmenting the second target image frame according to a plurality of preset thresholds to obtain pending areas and other areas; Determine the squared difference between the undetermined area and the other areas; Determine a target square difference with the smallest value from the plurality of square differences; Segmenting the second target image frame according to the target square difference to obtain a second target binary image; The droplet area on the plant is determined in the second target binary image.

7. A device for determining an analysis result, characterized in that: The device is applied to a user's terminal device, and the device includes: An acquisition module, used for acquiring image data frames; A first determination module is used to determine the outline of the light-transmitting part of the plant and the mist droplet area on the plant in the image data frame according to the image data frame; A second determining module is used to determine the number of first pixel points of the outline graphic of the light-transmitting part of the plant according to the outline graphic of the light-transmitting part of the plant; A third determination module is used to determine the number of second pixel points in the mist droplet area on the plant according to the mist droplet area on the plant; The fourth determination module is used to determine the analysis result according to the first number of pixel points and the second number of pixel points.

8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for determining the analysis result according to any one of claims 1 to 6 by executing the computer instructions.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for determining the analysis result according to any one of claims 1 to 6.

10. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the method for determining the analysis result according to any one of claims 1 to 6.