Litchi production situation data analysis method and system based on big data
Through the analysis method of lychee production situation data based on big data, the abnormal detection is performed using the tone curve feature values of the leaf image, which solves the problem of early identification of lychee pests and diseases, and achieves the effect of timely discovering pests and diseases and improving identification accuracy.
Patent Information
- Application Number
- CN202510130071.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-05
- Publication Date
- 2025-05-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the early stages of lychee pests, the dividing line between the lesion and the healthy part on the leaf image of the plant is not obvious, and the color changes in gradual shape, resulting in the inability to identify the lesion in time and accurately, affecting the timely prevention and control of pests and diseases of lychee trees.
Using the lychee production trend data analysis method based on big data, we obtain the leaf image of the lychee plant, extract the central axis, perform spatial conversion to obtain the hsv color space image, construct multiple sampling lines, calculate the extreme value and inflection points of the tone curve, calculate the characteristic values of the sampling line and auxiliary line, and perform abnormal detection to judge the growth trend of the lychee.
By calculating the characteristic values of the sampling lines and auxiliary lines and performing abnormal detection, we can timely detect pests and diseases, improve the accuracy of pest identification, reduce the calculation workload, and improve work efficiency.
Smart Images

Figure CN119992335A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data analysis, and in particular to a litchi production situation data analysis method and system based on big data. Background Art
[0002] Pests and diseases have a great impact on agriculture and forestry. As one of the important economic fruit trees in my country, litchi trees are planted in a large area in my country. In addition, due to the growth characteristics of litchi, litchi pests and diseases have a long disease cycle and are difficult to prevent and control, which is an important factor affecting litchi production and quality. Many pests and diseases manifest as leaf lesions in the early stages, such as yellowing of leaves and spots on leaves. By analyzing the leaves, pests and diseases can be discovered earlier so that prevention and control measures can be taken to avoid greater losses in litchi production.
[0003] A Chinese patent application document with publication number CN114612858A discloses a litchi growth environment data monitoring device, including a monitoring interval division module, which delineates sampling areas and enters growth environment data obtained in different time periods and behavior periods in each sampling area into a growth data acquisition module; an environmental data acquisition module, which obtains real-time growth environment data of litchi growth, and calls a standard growth environment database to screen out invalid growth environment data; a growth environment matching module, which uses valid growth environment data as input to execute a simulated growth and development model.
[0004] In the early stages of litchi pests and diseases, the boundary between the diseased and healthy parts of the plant leaves is not obvious, and the color changes in a gradient. When monitoring the growth environment of litchi, it is impossible to accurately identify the diseased parts in a timely manner, which is not conducive to the timely prevention and control of litchi tree pests and diseases. Summary of the invention
[0005] In order to timely discover diseases and pests of litchi and improve the accuracy of disease and pest identification, the present invention provides a litchi production situation data analysis method and system based on big data.
[0006] In a first aspect, the present invention provides a method for analyzing litchi production situation data based on big data, which adopts the following technical scheme: Obtain a leaf image of a litchi plant, extract the central axis of the leaf image, perform spatial conversion on the leaf image to obtain an HSV color space image, and construct multiple sampling lines along the extension direction of the central axis; In the hsv color space image, get the hue value of each pixel in each sampling line; A coordinate system is constructed with the position of the pixel point corresponding to the sampling line as the horizontal coordinate and the hue value as the vertical coordinate, and the hue value of the sampling line is mapped into the coordinate system to obtain the hue curve of each sampling line; the extreme value points and inflection points in the hue curve are calculated, and the pixel points between the inflection point and the extreme value point are regarded as the pathological pixel points, and the rest are normal pixel points; the characteristic value of each sampling line is calculated; Add multiple auxiliary lines between two adjacent sampling lines, and calculate the characteristic values of the auxiliary lines; perform anomaly detection on the obtained characteristic values of the sampling lines and the auxiliary lines, and when the detection results have abnormal characteristic values, it indicates that the litchi production situation is poor; The expression of the eigenvalue is:
[0007] In the formula, For the The characteristic values of the sampling lines, For the The average value of the tone value in the normal area of the tone curve of the sampling line, For the The tone curve of the sampling line The hue value corresponding to the extreme point is For the The horizontal distance between the jth extreme point and the adjacent inflection point on the tone curve of the sampling line, For the The total length of the sample lines.
[0008] The effect is that by calculating the characteristic values of the sampling line and the auxiliary line, the characteristic values are detected for anomalies, so as to judge the growth trend of litchi and discover pests and diseases in time. The accuracy of pest and disease identification is improved by constructing auxiliary lines.
[0009] Preferably, the analysis method further comprises: The DTW algorithm is used to match the tone curves of two adjacent sampling lines. The shortest path is obtained according to the cumulative distance matrix in the DTW algorithm, and the point pairs corresponding to the inflection points in the shortest path are used as the matching point pairs of the two tone curves.
[0010] Preferably, the number of auxiliary lines added between two adjacent sampling lines is:
[0011] In the formula, Indicates The sampling line and The number of second sampling lines added between the sampling lines, Indicates The characteristic values of the sampling lines, Indicates The characteristic values of the sampling lines, is the maximum value of the cosine value of the angle between the vector formed by mapping the matching point pairs of the two tone curves to the sampling line and the central axis, n is the adjustment coefficient, and L is the number of pixels between two adjacent sampling lines.
[0012] The effect is that by calculating the number of auxiliary lines that need to be added, the calculation workload can be reduced and the work efficiency can be improved while ensuring the calculation results.
[0013] Preferably, the tone curve is processed using a simple translation algorithm to obtain a smoothed tone curve.
[0014] The effect is that the tone curve is smoothed, making it easier to analyze the tone curve.
[0015] Preferably, the method for extracting the central axis of the leaf image is: converting the leaf image into a binary image, and extracting the central axis in the binary image using a skeleton extraction algorithm.
[0016] Preferably, the method for performing anomaly detection on the characteristic values of the sampling lines and the auxiliary lines is: sorting the obtained multiple characteristic values according to the position order of the sampling lines and the auxiliary lines, and then performing anomaly detection using the triple standard deviation or the quartile diagram method.
[0017] The effect is that by performing abnormal analysis on the characteristic values, the production situation of litchi can be judged, which facilitates the management of litchi.
[0018] Preferably, the method for constructing a plurality of sampling lines along the extension direction of the central axis is: constructing the sampling lines at equal intervals along the extension direction of the central axis, and the sampling lines and the central axis are perpendicular to each other.
[0019] The effect is that by constructing a sampling line, it is easy to analyze the production status of the leaves and to detect pests and diseases in a timely manner.
[0020] In a second aspect, the present invention provides a litchi production situation data analysis system based on big data, which adopts the following technical solutions: A litchi production situation data analysis system based on big data comprises a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the litchi production situation data analysis method based on big data is implemented.
[0021] The beneficial effect is: the above-mentioned litchi production situation data analysis method based on big data is generated into a computer program and stored in a memory so as to be loaded and executed by a processor, thereby making a system based on the memory and the processor for easy use.
[0022] The present invention has the following technical effects: 1. By calculating the characteristic values of the sampling line and the auxiliary line, the characteristic values are detected for abnormality, so as to judge the growth trend of litchi and discover pests and diseases in time. The accuracy of pest and disease identification is improved by constructing auxiliary lines.
[0023] 2. By calculating the number of auxiliary lines that need to be added between two adjacent sampling lines, the calculation workload can be reduced and work efficiency can be improved while ensuring the calculation results. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-restrictive manner, and the same or corresponding reference numerals represent the same or corresponding parts.
[0025] Figure 1 It is a method flow chart of the litchi production situation data analysis method based on big data of the present invention.
[0026] Figure 2 It is a structural block diagram of the litchi production situation data analysis system based on big data of the present invention. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are 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.
[0028] It should be understood that when the terms "first", "second", etc. are used in the claims, descriptions, and drawings of the present invention, they are only used to distinguish different objects, rather than to describe a specific order. The terms "include" and "comprise" used in the description and claims of the present invention indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their collections.
[0029] The embodiment of the present invention discloses a method for analyzing litchi production situation data based on big data, referring to Figure 1 , including the following steps, as follows: S1: Obtain a leaf image of a litchi plant, extract the central axis of the leaf image, perform spatial transformation on the leaf image to obtain an HSV color space image, and construct multiple sampling lines along the extension direction of the central axis.
[0030] Obtain the leaf image of the litchi plant, which is an RGB color space image, convert the leaf image into a binary image, and use the skeleton extraction algorithm to extract the central axis in the binary image, so as to further obtain the central axis of the leaf image. Convert the RGB color space image to obtain the corresponding HSV color space image, and construct multiple sampling lines at equal intervals along the extension direction of the central axis, and the sampling lines are perpendicular to the central axis.
[0031] S2: In the HSV color space image, obtain the hue value of each pixel in each sampling line, construct a coordinate system with the position of the pixel corresponding to the sampling line as the horizontal coordinate and the hue value as the vertical coordinate, and map the hue value of the sampling line into the coordinate system to obtain the hue curve of each sampling line.
[0032] When judging whether litchi plants have diseases and insect pests, color features are usually used to distinguish them. When yellow areas and brown spots appear on the leaves, it is determined that the leaves of the plant have diseases and insect pests. The yellow areas and spotted areas are regarded as diseased areas, and the remaining areas are regarded as normal areas. It can be understood that in the HSV color space image, the hue value of the diseased area is different from the hue value of the normal area, so the hue value in the HSV color space image is analyzed. In the HSV color space image, a sampling line corresponds to multiple pixels, and each pixel corresponds to a hue value. The position and hue of the pixel point are mapped to the coordinate system to obtain the hue curve of the sampling line. The hue curve is processed using a simple translation algorithm to obtain a smoothed hue curve.
[0033] S3: Calculate the extreme point and the inflection point in the tone curve, and take the pixel points between the inflection point and the extreme point as the pathological pixel points, and the rest as normal pixel points.
[0034] Calculate the first-order derivative and second-order derivative of each point on the tone curve, and take the point where the first-order derivative is zero as the extreme point, and the point where the second-order derivative is zero as the inflection point. The hue at the extreme point is greatly different from the hue at the rest of the positions, so the extreme point is the lesion point; in the leaf image, the color changes gradually, and at the inflection point, the concavity of the color change begins to change, so the pixel points between the inflection point and the extreme point are taken as lesion pixels. Exemplarily, in the tone curve, the nth pixel point is the extreme point, the mth pixel point is the inflection point, the pixels in the interval (n, m) are taken as lesion pixels, and the rest of the pixels are normal pixels. Similarly, on the corresponding sampling line, the pixels in the interval (n, m) are lesion pixels, and the rest of the pixels are normal pixels. For the entire leaf, the lesion area is composed of multiple lesion pixels.
[0035] S4: Calculate the characteristic value of each sampling line.
[0036] The expression of the eigenvalue is:
[0037] In the formula, For the The average value of the tone value in the normal area of the tone curve of the sampling line, For the The tone curve of the sampling line The hue value corresponding to the extreme point is For the The horizontal distance between the jth extreme point and the adjacent inflection point on the tone curve of the sampling line, For the The total length of the sample lines.
[0038] in, It indicates the degree of deviation of the chromaticity of the diseased pixel from the chromaticity of the normal pixel. The greater the deviation, the more obvious the color characteristics of the diseased pixel, the greater the probability of the litchi plant developing a disease, and the larger the characteristic value. The ratio of the length of the lesion pixel to the total length of the corresponding sampling line. The larger the ratio of the lesion pixel, the higher the possibility that the lesion area is larger, and the larger the eigenvalue. The eigenvalue sequence is constructed using the obtained multiple eigenvalues.
[0039] S5: Add multiple auxiliary lines between two adjacent sampling lines and calculate the characteristic values of the auxiliary lines.
[0040] Multiple sampling lines are evenly constructed, and there is a gap between two adjacent sampling lines. Some spots and yellow areas may appear in the gap area, resulting in missed detection. Therefore, it is necessary to add new sampling lines in the gap between the sampling lines according to the characteristic values of the sampling lines. The added new sampling lines are used as auxiliary lines, and the characteristic values of the auxiliary lines are calculated. The calculation method of the characteristic values of the auxiliary lines is the same as that of the sampling lines.
[0041] The DTW algorithm is used to match the tone curves of two adjacent sampling lines. The shortest path is obtained according to the cumulative distance matrix in the DTW algorithm, and the point pairs corresponding to the inflection points in the shortest path are used as the matching point pairs of the two tone curves. The DTW algorithm is a prior art, and the specific process is not repeated here. Then the number of auxiliary lines that need to be added between the two adjacent sampling lines is calculated.
[0042] The calculation method for the number of auxiliary lines added between two adjacent sampling lines is:
[0043] In the formula, Indicates The sampling line and The number of second sampling lines added between the sampling lines, Indicates The characteristic values of the sampling lines, Indicates The characteristic values of the sampling lines, is the maximum value of the cosine value of the angle between the vector formed by mapping the matching point pairs of the two tone curves to the sampling line and the central axis, n is the adjustment coefficient, and L is the number of pixels between two adjacent sampling lines.
[0044] For example, point A on the first tone curve and point a on the second tone curve form a matching point pair Aa, find the corresponding point A on one of the corresponding first sampling lines, find the corresponding point a on the other sampling line, connect point A and point a to construct a vector , there is an angle between the vector and the central axis of the blade, and the cosine value of this angle is It should be noted that if point A on the first tone curve and point a and point b on the second tone curve form a matching point pair Aa and Ab, then the vectors are calculated respectively. , The cosine of the angle with the central axis.
[0045] in, Indicates the lower limit of the characteristic value of the two adjacent sampling lines. The larger it is, the larger the characteristic value of the two adjacent sampling lines is, the greater the probability that there are diseased pixels in the interval between them is, and more auxiliary lines need to be added. It is the maximum value of the cosine value of the angle between the vector formed by mapping the matching point pairs of the two tone curves to the sampling lines and the central axis. The larger the value, the greater the offset of the characteristic value between the two consecutive sampling lines, indicating that there is a large change in the characteristic values of the two sampling lines, and thus more auxiliary lines need to be added as an auxiliary judgment of litchi branch and leaf diseases.
[0046] L is the number of pixels between two sampling lines, which is the upper limit of the sampling lines that can be added. n is the adjustment coefficient, which is manually set according to the actual situation. For example, n is 0.5.
[0047] The above formula can accurately calculate the number of auxiliary lines that need to be added between two adjacent sampling lines. Compared with the analysis method that only analyzes the sampling lines, it can reduce the calculation workload and improve work efficiency while ensuring the calculation results. For example, the number of sampling lines is 100, among which 20 auxiliary lines are added between the fifth sampling line and the sixth sampling line for targeted auxiliary analysis. A total of 120 lines of data need to be analyzed, which improves the accuracy of the analysis results compared to directly constructing 120 sampling lines. Similarly, if only sampling lines are constructed to achieve the effect corresponding to 100 sampling lines and 20 auxiliary lines, the number of sampling lines that need to be constructed is much greater than 120. Therefore, the auxiliary lines are used to assist in the analysis of leaf diseases and pests, which has higher accuracy and work efficiency.
[0048] S6: Perform anomaly detection on the obtained characteristic values of the sampling line and the auxiliary line. When the detection result has abnormal characteristic values, it indicates that the litchi production situation is poor.
[0049] The obtained characteristic values of the sampling lines and the auxiliary lines are arranged in the order of the positions of the sampling lines and the auxiliary lines to obtain the final characteristic value sequence, and then the abnormality detection is performed using the triple standard deviation or quartile method. When there are abnormal characteristic values in the test results, it indicates that the litchi production situation is poor, there are pests and diseases, and treatment is needed. On the contrary, it indicates that the litchi production situation is good.
[0050] Combination Figure 2 As shown, an embodiment of the present invention also discloses a litchi production situation data analysis system based on big data, including a processor and a memory, the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a litchi production situation data analysis method based on big data according to the present invention is implemented.
[0051] The above system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, and their configuration and functions are known in the art, so they will not be described in detail here.
[0052] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus or device. For example, a computer-readable storage medium may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high bandwidth memory HBM (High Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc., or any other medium that can be used to store the required information and can be accessed by an application, a module or both. Any such computer storage medium may be part of a device or accessible or connectable to a device.
[0053] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
[0054] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A litchi production situation data analysis method based on big data, characterized in that: Includes steps: Obtain a leaf image of a litchi plant, extract the central axis of the leaf image, perform spatial conversion on the leaf image to obtain an HSV color space image, and construct multiple sampling lines along the extension direction of the central axis; In the hsv color space image, get the hue value of each pixel in each sampling line; A coordinate system is constructed with the position of the pixel point corresponding to the sampling line as the horizontal coordinate and the hue value as the vertical coordinate, and the hue value of the sampling line is mapped into the coordinate system to obtain the hue curve of each sampling line; the extreme value points and inflection points in the hue curve are calculated, and the pixel points between the inflection point and the extreme value point are regarded as the pathological pixel points, and the rest are normal pixel points; the characteristic value of each sampling line is calculated; Add multiple auxiliary lines between two adjacent sampling lines and calculate the characteristic values of the auxiliary lines; The obtained characteristic values of the sampling line and the auxiliary line are subjected to abnormal detection. When the detection result has abnormal characteristic values, it indicates that the litchi production situation is poor. The expression of the eigenvalue is: In the formula, For the The characteristic values of the sampling lines, For the The average value of the tone value in the normal area of the tone curve of the sampling line, For the The tone curve of the sampling line The hue value corresponding to the extreme point is For the The horizontal distance between the jth extreme point and the adjacent inflection point on the tone curve of the sampling line, For the The total length of the sample lines.
2. The litchi production situation data analysis method based on big data according to claim 1, characterized in that, The analysis methods also include: The DTW algorithm is used to match the tone curves of two adjacent sampling lines. The shortest path is obtained according to the cumulative distance matrix in the DTW algorithm, and the point pairs corresponding to the inflection points in the shortest path are used as the matching point pairs of the two tone curves.
3. The litchi production situation data analysis method based on big data according to claim 2, characterized in that, The number of auxiliary lines added between two adjacent sampling lines is: In the formula, Indicates The sampling line and The number of second sampling lines added between the sampling lines, Indicates The characteristic values of the sampling lines, Indicates The characteristic values of the sampling lines, is the maximum value of the cosine value of the angle between the vector formed by mapping the matching point pairs of the two tone curves to the sampling line and the central axis, n is the adjustment coefficient, and L is the number of pixels between two adjacent sampling lines.
4. The litchi production situation data analysis method based on big data according to claim 1, characterized in that, The tone curve is processed using a simple translation algorithm to obtain a smoothed tone curve.
5. The litchi production situation data analysis method based on big data according to claim 1, characterized in that, The method for extracting the central axis of the leaf image is: converting the leaf image into a binary image, and using a skeleton extraction algorithm to extract the central axis in the binary image.
6. The litchi production situation data analysis method based on big data according to claim 1, characterized in that, The method for performing anomaly detection on the characteristic values of the sampling lines and the auxiliary lines is: sorting the obtained multiple characteristic values according to the position order of the sampling lines and the auxiliary lines, and then performing anomaly detection using the triple standard deviation or the quartile map method.
7. The method for analyzing litchi production situation data based on big data according to claim 1, characterized in that: The method for constructing multiple sampling lines along the extension direction of the central axis is: constructing sampling lines at equal intervals along the extension direction of the central axis, and the sampling lines are perpendicular to the central axis.
8. The litchi production situation data analysis system based on big data is characterized by: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the litchi production situation data analysis method based on big data according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Litchi growth environment data monitoring device and analysis method
CN114612858A