A method for detecting tree bark-boring pests based on X-rays
Through X-ray-based detection methods, the density and thickness differences between trees and pests are used, combined with image processing technology, the problem of difficulty in accurately detecting pests under the bark of trees in the prior art is solved, and efficient and accurate pest detection effect is achieved.
Patent Information
- Application Number
- CN202211410044.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-10
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2042-11-10
AI Technical Summary
The prior art is difficult to accurately and efficiently detect pests under the bark of trees. Conventional methods such as ultrasonic detection methods and electromagnetic wave detection methods are not accurate and cannot detect specific types of pests.
Using X-ray-based detection method, through the X-ray imaging detection system, the density and thickness of the phloem and pests of the tree are different, and the image contrast is enhanced through image processing technology to clarify the location of the pests.
It has achieved accurate and efficient discovery of the location of pest activities under the bark without damaging the growth of the tree trunk, which improves the accuracy of detection of single plants, and does not require a large amount of manpower and material resources, and has good development prospects.
Smart Images

Figure CN115728326B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of non-destructive detection, and in particular relates to a method for detecting subbark boring pests of trees based on X-rays. Background Art
[0002] Boring pests are mainly represented by Cerambycidae, Curculionidae, Boreridae, Ceratidae, Pteridae and Caryophyllaceae. Due to their wide range of hosts, they can cause serious damage to a variety of economic tree species such as garden trees and fruit trees. Boring pests have chewing mouthparts. The larvae will bore under the phloem of the bark to feed and survive. At the same time, they will form dense tunnels on the trees, destroying the meristem and conductive tissues of the trees, blocking the transportation of nutrients and water of the host trees, causing the affected trees to wither or even die, causing serious damage to the forestry environment and the growth of fruit trees. Therefore, the detection and prevention of boring pests is particularly important. However, since boring pests are generally hidden deep in the phloem of the tree body and are highly concealed, it is difficult to detect the pests accurately and efficiently using conventional methods.
[0003] In the past, ultrasonic detection and electromagnetic wave detection were mainly used to detect pests in trees. The ultrasonic detection method mainly uses an ultrasonic detector to listen to the ultrasonic signals generated by the movements of pests. These sounds are generally generated when pests eat, move, or give warning signals. These signals can be used to detect borer pests under the bark. The electromagnetic wave detection method is based on the difference in the absorption and reflection of near-infrared electromagnetic waves by the trees being tested. When trees are invaded by trunk-boring pests, their absorption or reflection of near-infrared light is different from that of trees that are not infested. Based on this, it is possible to detect whether there are pests under the bark of the trees. However, the accuracy of these two methods for detecting borer pests is not high, and it is easy to miss or misdetect the infested trees. In addition, these two methods cannot detect the specific types of pests, which has great limitations in practical applications.
[0004] X-rays have been widely used in industrial nondestructive testing to detect materials and objects. X-rays have strong penetrating power. At the same time, when X-rays pass through objects, due to differences in factors such as the internal density and thickness of the objects, the X-rays will be absorbed to varying degrees. The intensity of the X-rays passing through the object will also change accordingly. The X-ray intensity distribution of the part of the object that passes through will carry internal information of the object. By using X-ray imaging devices to collect this information, an image of the internal information of the object can be obtained. Therefore, X-rays are a relatively good means of nondestructive testing of wood. However, there are few reports on the use of X-rays to detect borer pests in forests.
[0005] In addition, the use of X-ray technology to detect borer pests in trees without damage needs to be used in the field. Due to the lack of power support, it is impossible to use a large high-power X-ray source device. For feasibility requirements, only a smaller low-power X-ray source can be used, so the voltage and current of the X-ray source generated are low. At the same time, because the thickness and density of tree bark and pests are very small, the voltage and current of the X-rays required for detection are low, which will result in the obtained X-ray grayscale image with low contrast, making it difficult for researchers to accurately distinguish the location of the pests. Summary of the invention
[0006] The main purpose of the present invention is to overcome the deficiencies in the prior art and to provide a method for detecting subbark boring pests of trees based on X-rays. By utilizing the differences in density and thickness of the phloem of trees and the pests, it is possible to distinguish whether there are pests inside the tree, thereby being able to accurately monitor the boring and harmful behavior of pests inside the tree.
[0007] In order to achieve the above-mentioned invention object, the technical solution adopted by the present invention is:
[0008] A method for detecting subbark boring pests of trees based on X-rays, comprising the following steps:
[0009] S1. Install the X-ray imaging detection system: install the X-ray source in front of the tree to be tested and aim the X-ray source at the epidermis of the tree to be tested, install the X-ray detector behind the tree to be tested and make the X-ray source and the X-ray detector be in the same straight line, adjust the distance between the X-ray source, the tree to be tested and the X-ray detector, and then connect the X-ray source and the X-ray detector to the computer with a signal line;
[0010] S2. Get image:
[0011] S2-1. After confirming that there is no one around the X-ray source, the X-ray source is turned on by remote control of the computer, and the voltage and current of the X-ray source are gradually increased. The X-ray voltage is 20KV to 65KV, and the current is 0.1mA to 0.3mA;
[0012] S2-2, turn on the image acquisition function of the X-ray detector, configure various parameters of the detector, and perform preliminary gain correction on the image;
[0013] S2-3, the X-ray detector acquires an image, and the location where the gray value is obviously different from the surrounding gray value is the location where the pest is suspected to exist, and the computer saves the X-ray image acquired at this location;
[0014] S2-4, adjusting the positions of the X-ray source and the X-ray detector, and repeating the above step S2-3 to detect other parts of the tree to be tested;
[0015] S3. Image processing:
[0016] S3-1. Calculate the gamma correction value: Use the cv::mean function to find the grayscale average H of the input image. The value range of H is [0,1]. The gamma correction value is:
[0017]
[0018] S3-2, Grayscale normalization: Use the lut function in OpenCV to normalize the grayscale values in the range of [0,255] of the original image so that the grayscale values are close to 0-1;
[0019] S3-3, Grayscale gamma correction: Use the pow function in opencv to determine the grayscale value after gamma correction to enhance the contrast of the image;
[0020] S4. Image analysis: After irradiating different parts of the tree to be tested, the obtained X-ray images are processed and analyzed, and the parts with different grayscale values are marked. Then, based on the actual situation of the tree, the parts of the tree that are eroded by boring pests are found, and the boring behavior of the pests in the tree is detected.
[0021] Furthermore, the X-ray source is a Moxtek MAGPRO X-ray source, and the X-ray detector is a CCD type X-ray detector.
[0022] Furthermore, in step S3-1, when H=0.5, it is the center of the image grayscale histogram.
[0023] Compared with the prior art, the present invention has the following beneficial effects:
[0024] The present invention utilizes X-ray technology to scan trees suspected of being infested by boring pests. It can accurately and efficiently find the location of pest activity under the bark without damaging the growth of the tree trunk, thereby improving the accuracy of single tree detection. It does not require a large amount of manpower and material resources, is efficient and practical, and has a good development prospect. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 This is a schematic diagram of the monitoring principle of the present invention from a top view;
[0026] Figure 2 is the gamma curve graph;
[0027] Figure 3 is the original X-ray image;
[0028] Figure 4 This is the X-ray image after gamma correction.
[0029] In the figure, 1 is an X-ray source, 2 is a detection X-ray, 3 is the epidermis of a tree, 4 is the wood of a tree, 5 is an X-ray detector, and 6 is a borer. DETAILED DESCRIPTION
[0030] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0031] The basic principle of the present invention is as follows: the X-ray source emits continuous spectrum X-rays. Due to the different attenuation coefficients (i.e., the absorption coefficient of the material to X-rays) when penetrating trees and borers, and the different thicknesses of the rays penetrating inside the tested trees, the intensity of the transmitted X-rays will be different. This difference is recorded by the X-ray detector behind the tree, and is reflected in the grayscale difference of the image on the X-ray image. After the subsequent image processing, the wood and phloem of the tree and the tested pests can be clearly distinguished, thereby detecting the feeding behavior of the borers inside the tree. The principle is as follows: Figure 1 shown.
[0032] The expression of X-ray energy attenuation law is: I = I E e -ux ;like Figure 1 As shown, let the average attenuation coefficient of X-rays in tree bark be u1, and the average attenuation coefficient in pests be u2, where I E is the initial intensity of the incident X-ray;
[0033] The intensity of the transmitted rays of the bark of the tree is I t for:
[0034] Intensity of transmitted rays of borer pests I o for:
[0035] The intensity difference ΔI between the transmitted rays of the tree bark and the borer pests is: ΔI = I o -I t .
[0036] The intensity difference ΔI of the X-rays can be detected and recorded by the X-ray detector 5 behind the tree, which is reflected in the X-ray image as the grayscale difference between the bark part and the pest part of the tree. After subsequent image processing, the bark, wood and pests of the tree can be clearly distinguished, thereby detecting the boring behavior of pests under the bark.
[0037] This example selects a tree eaten by longhorn beetle larvae. A method for detecting subbark boring pests of trees based on X-rays includes the following steps:
[0038] S1, such as Figure 1As shown, an X-ray imaging detection system is installed: for the convenience of field use, the selected X-ray source 1 is a Moxtek MAGPRO X-ray source, and the X-ray detector 5 is a CCD type X-ray detector. The X-ray source 1 is installed in front of the tree to be tested, and the X-ray source 1 is aligned with the epidermis of the tree to be tested. The X-ray detector 5 is installed behind the tree to be tested, and the X-ray source and the X-ray detector are in the same straight line. The distance between the X-ray source 1, the tree to be tested and the X-ray detector 5 is adjusted to keep the three in the same straight line, and then the X-ray source 1 and the X-ray detector 5 are connected to the computer with a signal line.
[0039] S2. Get image:
[0040] S2-1, after confirming that there is no one around the X-ray source 1, the X-ray source 1 is turned on by remote control of the computer, and the voltage and current of the X-ray source 1 are gradually increased. Considering that X-rays may cause certain damage to trees, the X-ray voltage during monitoring is 60KV and the current is 0.2mA;
[0041] S2-2, turning on the image acquisition function of the X-ray detector 5, configuring various parameters of the detector, and performing preliminary gain correction on the image;
[0042] S2-3, the X-ray detector 5 acquires an image. Since the density of pests is greater than that of trees, the grayscale value of the pest part will be greater than that of the tree part in the X-ray image. The part with a grayscale value obviously different from the surrounding grayscale value is the part where the pest is suspected to exist. The acquired X-ray image is as follows: Figure 3 As shown, it can be observed that the grayscale value of the image in the box area is obviously different from the grayscale value of other surrounding parts. It is judged that this area may be the area where the longhorn beetle larvae exist. The computer saves the X-ray image obtained at this position for subsequent processing;
[0043] S2-4, adjust the positions of the X-ray source 1 and the X-ray detector 5, and repeat the above step S2-3 to detect other parts of the tree to be tested.
[0044] S3. Image processing:
[0045] Since this detection method is to be implemented in the field, it is impossible to use large X-ray source equipment, so a small X-ray source is used; and because the bark thickness of the tree is very thin, the X-ray voltage and current used are relatively small, which will reduce the contrast between the bark part of the tree and the pest part in the X-ray image, which is not conducive to observation and discrimination, so the collected image needs to be further processed, mainly to enhance the contrast of the grayscale image, that is, to perform gamma correction on the image to enhance the contrast of the image. After image processing, the grayscale value difference between the bark part of the tree and the pest part can be observed intuitively.
[0046] S3-1. Calculate the gamma correction value: Use the cv::mean function to find the grayscale average H of the input image. The value range of H is [0,1]. When H=0.5, it is the center of the image grayscale histogram. The gamma correction value is:
[0047]
[0048] S3-2, Grayscale normalization: Use the lut function in OpenCV to normalize the grayscale values in the range of [0,255] of the original image so that the grayscale values are close to 0-1;
[0049] S3-3. Grayscale gamma correction: Use the pow function in opencv to determine the grayscale value after gamma correction to enhance the contrast of the image. The processed image is as follows Figure 4 shown.
[0050] This step uses gamma transformation to process the image. Its main function is to correct the image and correct the parts of the grayscale image that are too high or too low, thereby enhancing the contrast of the image. The transformation formula is to multiply each pixel value on the original image. The formula is as follows: s = cr γ , r∈[0,1], where r is the input grayscale and s is the output grayscale; the gamma transform's correction effect on the image is actually achieved by enhancing the details of low grayscale or high grayscale. The gamma curve is as follows Figure 2 As shown in the figure, it can be intuitively understood from this curve that when the gamma value is less than 1, the areas with lower grayscale in the image will be stretched, and the areas with higher grayscale will be compressed; when the gamma value is greater than 1, the areas with higher grayscale in the image will be stretched, and the areas with lower grayscale will be compressed. The γ value is divided by 1. The smaller the value, the stronger the expansion effect on the low grayscale part of the image, and the larger the value, the smaller the expansion effect on the high grayscale part of the image. By assigning different γ values, the details of the low grayscale or high grayscale parts in the grayscale image can be enhanced, thereby enhancing the contrast of the entire image.
[0051] S4, image analysis: After irradiating different parts of the tree to be tested, the X-ray images obtained by processing and analyzing are marked with different grayscale values, and then the parts of the tree that are eroded by boring pests are found in combination with the actual situation of the tree, thereby detecting the eating behavior of the pests in the tree. In this embodiment, it is found that the grayscale value of the box area is different from that of the surrounding part, and its morphology is very similar to that of the longhorn beetle larvae. It can be judged that it is the location where the longhorn beetle larvae exist, thereby monitoring the eating behavior of the longhorn beetle larvae in the tree, and the difference in grayscale values can also distinguish the xylem and phloem of the tree.
[0052] In conclusion, this example demonstrates that the method of using X-ray technology to monitor pests in trees is feasible.
[0053] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for detecting subbark boring pests of trees based on X-rays, characterized in that: The following steps are involved: S1. Install the X-ray imaging detection system: install the X-ray source in front of the tree to be tested and aim the X-ray source at the epidermis of the tree to be tested, install the X-ray detector behind the tree to be tested and make the X-ray source and the X-ray detector be in the same straight line, adjust the distance between the X-ray source, the tree to be tested and the X-ray detector, and then connect the X-ray source and the X-ray detector to the computer with a signal line; S2. Get image: S2-1. After confirming that there is no one around the X-ray source, turn on the X-ray source through computer remote control, and gradually increase the voltage and current of the X-ray source. The X-ray voltage is 20KV~65KV, and the current is 0.1mA~0.3mA; S2-2, turn on the image acquisition function of the X-ray detector, configure various parameters of the detector, and perform preliminary gain correction on the image; S2-3, the X-ray detector acquires an image, and the part where the gray value is obviously different from the surrounding gray value is the part where the pest is suspected to exist, and the computer saves the X-ray image acquired at this part; S2-4, adjusting the positions of the X-ray source and the X-ray detector, and repeating the above step S2-3 to detect other parts of the tree to be tested; S3. Image processing: S3-1. Calculate the gamma correction value: Use the cv::mean function to find the grayscale average H of the input image. The value range of H is [0,1]. The gamma correction value is: ; S3-2, Grayscale normalization: Use the lut function in OpenCV to normalize the grayscale values in the range of [0,255] of the original image so that the grayscale values are close to 0~1; S3-3, Grayscale gamma correction: Use the pow function in opencv to determine the grayscale value after gamma correction to enhance the contrast of the image; The transformation formula is to perform a product operation on each pixel value in the original image. The formula is as follows: s=cr γ ,r ∈[0,1], where r is the input grayscale, s is the output grayscale; c is a constant, with a value of 1; S4. Image analysis: After irradiating different parts of the tree to be tested, the obtained X-ray images are processed and analyzed, and the parts with different grayscale values are marked. Then, based on the actual situation of the tree, the parts of the tree that are eroded by boring pests are found, and the boring behavior of the pests in the tree is detected.
2. A method for detecting tree bark-boring pests based on X-rays according to claim 1, characterized in that: The X-ray source is a Moxtek MAGPRO X-ray source, and the X-ray detector is a CCD type X-ray detector.
3. The method for detecting tree bark-boring pests based on X-rays according to claim 1, characterized in that: In step S3-1, when H=0.5, it is the center of the image grayscale histogram.