Method and device for monitoring termite killing effect on dams based on image recognition

The method and device enhance termite monitoring on dams by converting individual termite detection to path and hole analysis, offering precise feedback on extermination effectiveness through image recognition, addressing inefficiencies in existing methods.

CN118968422BActive Publication Date: 2024-12-31YANAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411428136.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-14
Publication Date
2024-12-31
Estimated Expiration
2044-10-14

AI Technical Summary

Technical Problem

Existing termite monitoring methods struggle with low efficiency, poor accuracy, and incomplete coverage, especially in large-scale dam environments, and fail to accurately assess the killing effect of extermination measures due to difficulties in wide-area image coverage and identification of stationary termites.

Method used

A method and device using image recognition to monitor termite killing effects by processing dam surface images before and after extermination, converting individual termite monitoring to path and hole detection, calculating average change rates, and generating a killing effect index based on edge point analysis.

Benefits of technology

Improves monitoring accuracy by inferring termite numbers from path and hole activity, provides instant feedback on killing effectiveness, and facilitates timely adjustments to extermination plans.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118968422B_ABST
    Figure CN118968422B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for monitoring the killing effect of termites on dams based on image recognition, and relates to the technical field of termite monitoring. The present invention infers the number of termites by monitoring the changes in the termite activity paths, collects dam surface images before and after taking killing measures, extracts edge points after processing the images, and the edge points reflect the termite activity paths; calculates the average change rate of the termite activity paths before and after killing, and then generates a killing effect index to evaluate the effect of termite killing measures. The present invention uses image processing technology to realize the recognition and change monitoring of termite activity paths, so as to achieve the purpose of accurately evaluating the killing effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of termite monitoring, and in particular to a method and a device for monitoring the killing effect of termites on a dam based on image recognition. Background Art

[0002] The harm of termites to dams has always been a major problem in dam maintenance. Termites' nesting and burrowing activities can cause structural damage to dams and increase the risk of floods. Therefore, termite monitoring and extermination have become an important part of dam maintenance. However, traditional termite monitoring methods mainly rely on manual observation and simple physical capture tools, which have problems such as low efficiency, poor accuracy, and incomplete coverage. It is difficult to effectively monitor termite activities and evaluate the extermination effect on large-scale dams. In recent years, with the development of image recognition technology, its application in termite monitoring has gradually become a new trend. Existing termite monitoring methods based on image processing mostly focus on local area detection of termite activities, which is difficult to accurately reflect the termite activities on the surface of a large range of dams, and thus it is difficult to evaluate the actual effect of termite extermination measures.

[0003] In the prior art, publication number CN118334709A discloses a termite extermination monitoring method and device, which collects images of a target area according to a preset time period to obtain sample image information including sample image frames, extracts a background image, performs frame difference processing on the sample image frame and the background image, and obtains a frame difference image set; performs binarization processing on the frame difference image set to determine a motion contour object list, and based on the sample image information, determines a termite target object list through a preset termite detection model; based on the motion contour object list and the termite target object list, determines a motion termite list and a stationary termite list, updates a termite benchmark reporting object according to the motion termite list and the stationary termite list, and sends the termite benchmark reporting object to a preset device when the preset reporting conditions are met.

[0004] The main problems with the above scheme are: when monitoring and extracting termite images, if the purpose is to accurately monitor individual termites, it is impossible to obtain images with a wide coverage area. If images with a wide coverage area are used, it is difficult to identify tiny individual termites, resulting in insufficient adaptability of the scheme in a wide range of monitoring environments; and the frame difference method is used to identify termites in motion, but the identification of stationary termites is inaccurate, affecting the judgment of the killing effect.

[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention

[0006] The purpose of the present invention is to provide a method and device for monitoring the killing effect of termites on dams based on image recognition, so as to solve the problems raised in the above-mentioned background technology.

[0007] To achieve the above object, the present invention provides the following technical solutions:

[0008] The method for monitoring the killing effect of termites on dams based on image recognition includes the following specific steps:

[0009] Step 1: Before killing termites, collect original images of the dam surface before killing at intervals of 12 to 24 hours, scale the resolution of the original images to 224×224, perform grayscale processing on the original images to generate first recognition images, and arrange the first recognition images in the order of acquisition time to generate a first recognition image set;

[0010] Step 2: Filter the first recognition image using a bilateral filter, count the grayscale histogram consisting of the frequency of occurrence of pixels at each level in the 256 grayscale levels, calculate the inter-class variance of each threshold in the histogram, select the best segmentation threshold by the maximum inter-class variance, use the best segmentation threshold to perform threshold segmentation on the first recognition image after filtering, identify the foreground and background parts, extract the foreground part and reconstruct it to generate the second recognition image;

[0011] Step 3: Set the edge threshold, use the Sobel operator to calculate the horizontal and vertical gradient values ​​of the second recognition image, calculate the gradient amplitude of all pixels through the horizontal and vertical gradient values, if the pixel gradient amplitude is greater than the edge threshold, retain the pixel, otherwise set the pixel to black, extract all the retained pixels to generate the edge points of the second recognition image;

[0012] Step 4: Process each image in the first recognition image set according to the above steps to generate edge points of each image, and generate the average change rate of the termite path before killing according to the number of edge points of the image and the acquisition interval of the original image before killing;

[0013] Step 5: After killing termites, collect original images of the dam surface after killing at the collection time interval before killing, scale the original images after killing to 224×224, and then perform grayscale processing to generate a third recognition image, and arrange the third recognition images in the order of collection time to generate a third recognition image set;

[0014] Step 6: Process the third recognition image according to the steps of processing the first recognition image to generate a fourth recognition image, and generate edge points of the fourth recognition image and an average change rate of termite paths after killing;

[0015] Step 7: Generate a killing effect index based on the change in the average change rate of termite paths after killing relative to the average change rate of termite paths before killing to judge the killing effect.

[0016] Furthermore, the principle for generating the second recognition image is:

[0017] Each threshold in the histogram represents the grayscale value of a pixel point that can be selected for image segmentation. In a grayscale image, the grayscale value ranges from 0 to 255, and the value of the threshold is all integers in the range of 0 to 255;

[0018] The principle for selecting the best segmentation threshold by maximizing the inter-class variance is:

[0019] g(a) 2 =ω a ω′ a (μ a -μ′ a ) 2

[0020] Among them, a represents the segmentation threshold, g(a) represents the inter-class variance when the segmentation threshold is a, ω a It indicates the proportion of the foreground part to the total image when the segmentation threshold is a, μ a Indicates the gray value of the foreground part when the segmentation threshold is a, ω′ a Indicates the proportion of the background part to the total image when the segmentation threshold is a, μ′ a It indicates the gray value of the background part when the segmentation threshold is a;

[0021] When g(a) reaches the maximum value, the corresponding threshold a is the optimal segmentation threshold;

[0022] The first recognition image is segmented using the optimal segmentation threshold, and the segmented foreground portion is extracted as the second recognition image.

[0023] Furthermore, the principle for generating the gradient amplitude of a pixel point is:

[0024] The grayscale value of the pixel point and the grayscale values ​​of the corresponding eight adjacent pixels are multiplied with the horizontal template of the Sobel operator one by one, and all the products are added to obtain the horizontal gradient value of the pixel point; the grayscale value of the pixel point and the grayscale values ​​of the corresponding eight adjacent pixels are multiplied with the vertical template of the Sobel operator one by one, and all the products are added to obtain the vertical gradient value of the pixel point; the horizontal gradient value calculation formula is:

[0025]

[0026] The vertical gradient value calculation formula is:

[0027]

[0028] Wherein, Gx(i, j) represents the horizontal gradient value of the pixel with abscissa i and ordinate j, Gy(i, j) represents the vertical gradient value of the pixel with abscissa i and ordinate j, and X(i, j) represents the grayscale value of the pixel with abscissa i and ordinate j;

[0029] The formula for generating the gradient magnitude is:

[0030]

[0031] Wherein, G(i, j) represents the gradient amplitude of the pixel point with abscissa i and ordinate j.

[0032] Furthermore, the principle for generating the average rate of change of termite paths before killing is:

[0033]

[0034]

[0035] Among them, K m represents the termite path change rate before killing at time m, R m Represents the number of edge points of the image collected at time m, R m-1 represents the number of edge points of the image collected at time m-1, m represents the time when the image was collected before killing, and m=2, 3, ..., M, △t m-1 represents the time interval between time m and time m-1, represents the average change rate of termite paths before killing, and M represents the total number of collection moments before killing.

[0036] Furthermore, the principle for generating the average rate of change of termite paths after killing is:

[0037]

[0038]

[0039] Among them, T n represents the termite path change rate after killing at time n, S n Indicates the number of edge points of the image collected at time n, S n-1 represents the number of edge points of the image collected at time n-1, n represents the time when the image was collected after killing, and n=2, 3, ..., N, △t n-1 represents the time interval between time n and time n-1, represents the average rate of change of termite paths after killing, and N represents the total number of sampling moments after killing.

[0040] Furthermore, the principle for generating the killing effect index is:

[0041]

[0042] Among them, Y represents the killing effect index, represents the average change rate of termite paths before killing, It represents the average rate of change of termite paths after killing;

[0043] When Y>1, termite killing has a positive effect, and the larger the value of Y, the better the killing effect;

[0044] When Y≤1, termite extermination did not achieve positive results.

[0045] The present invention also provides a device for monitoring the killing effect of termites on dams based on image recognition, and the device is used to implement the above-mentioned method for monitoring the killing effect of termites on dams based on image recognition, which specifically includes:

[0046] The data acquisition module is used to collect original images of the dam surface before killing termites at intervals of 12 to 24 hours, scale the resolution of the original images to 224×224, perform grayscale processing on the original images to generate first recognition images, and arrange the first recognition images in the order of acquisition time to generate a first recognition image set;

[0047] An image processing module is used to filter the first recognition image using a bilateral filter, count the grayscale histogram formed by the frequency of occurrence of pixels at each level in 256 grayscale levels, calculate the inter-class variance of each threshold in the histogram, select the best segmentation threshold by the maximum inter-class variance, perform threshold segmentation on the first recognition image after filtering using the best segmentation threshold, identify the foreground part and the background part, extract the foreground part and reconstruct it to generate the second recognition image;

[0048] An edge extraction module is used to set an edge threshold, use the Sobel operator to calculate the horizontal and vertical gradient values ​​of the second recognition image, and calculate the gradient amplitude of all pixels through the horizontal and vertical gradient values. If the pixel gradient amplitude is greater than the edge threshold, the pixel is retained, otherwise the pixel is set to black, and all retained pixels are extracted to generate edge points of the second recognition image;

[0049] A path calculation module, used to process each image in the first recognition image set according to the above module, generate edge points of each image, and generate an average change rate of the termite path before killing according to the number of edge points of the image and the acquisition interval of the original image before killing;

[0050] A comparison image acquisition and processing module is used to collect original images of the dam surface after killing termites according to the acquisition time interval before killing, scale the original images after killing to 224×224, and then perform grayscale processing to generate a third recognition image, and arrange the third recognition images in the order of acquisition time to generate a third recognition image set;

[0051] A comparison image path calculation module is used to process the third recognition image according to the steps of processing the first recognition image to generate a fourth recognition image, and to generate edge points of the fourth recognition image and an average change rate of the termite path after killing;

[0052] The comprehensive judgment module is used to generate a killing effect index to judge the killing effect according to the change of the average change rate of the termite path after the killing relative to the average change rate of the termite path before the killing.

[0053] Compared with the prior art, the present invention has the following beneficial effects:

[0054] The present invention converts monitoring of individual termites into monitoring of paths and holes generated by termite activities, and infers the number of termites based on the paths and holes generated by termite activities, thereby avoiding direct monitoring of tiny individual termites and improving the accuracy of monitoring. After processing the collected images, edge points are extracted, and the number of termite activity paths is determined based on the number of edge points, which can directly reflect the number and complexity of termite activity paths and facilitate the inference of termite numbers.

[0055] The present invention also generates the average change rate of termite paths before and after the killing by counting the number of image edge points before and after the killing measures are taken, and generates a killing effect index by comparing the average change rate of termite paths. The path change is quantitatively analyzed to reduce the misjudgment rate. The killing effect index provides instant feedback on the killing measures, which can quickly determine whether the killing measures are effective, and helps to take corrective measures or adjust the killing plan in time, making the planning and implementation of the killing work more effective and precise. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 This is a schematic diagram of a method flow chart of an embodiment of the present invention;

[0057] Figure 2 Schematic diagram of a device module according to an embodiment of the present invention. DETAILED DESCRIPTION

[0058] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments.

[0059] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0060] Example:

[0061] See also Figure 1 , the present invention provides a technical solution:

[0062] The method for monitoring the killing effect of termites on dams based on image recognition includes the following specific steps:

[0063] Step 1: Before killing termites, collect original images of the dam surface before killing at intervals of 12 to 24 hours, scale the resolution of the original images to 224×224, perform grayscale processing on the original images to generate first recognition images, and arrange the first recognition images in the order of acquisition time to generate a first recognition image set;

[0064] In this embodiment, the purpose of scaling the original image resolution to 224×224 is to reduce computational complexity while retaining sufficient characteristic information to avoid excessive distortion of the image.

[0065] Step 2: Filter the first recognition image using a bilateral filter, count the grayscale histogram consisting of the frequency of occurrence of pixels at each level in the 256 grayscale levels, calculate the inter-class variance of each threshold in the histogram, select the best segmentation threshold by the maximum inter-class variance, use the best segmentation threshold to perform threshold segmentation on the first recognition image after filtering, identify the foreground and background parts, extract the foreground part and reconstruct it to generate the second recognition image;

[0066] In this embodiment, the principle for generating the second recognition image is:

[0067] Each threshold in the histogram represents the grayscale value of a pixel point that can be selected for image segmentation. In a grayscale image, the grayscale value ranges from 0 to 255, and the value of the threshold is all integers in the range of 0 to 255;

[0068] The principle for selecting the best segmentation threshold by maximizing the inter-class variance is:

[0069] g(a) 2 =ω a ω′ a (μ a -μ′ a ) 2

[0070] Among them, a represents the segmentation threshold, g(a) represents the inter-class variance when the segmentation threshold is a, ω a It indicates the proportion of the foreground part to the total image when the segmentation threshold is a, μ a Indicates the gray value of the foreground part when the segmentation threshold is a, ω′ a Indicates the proportion of the background part to the total image when the segmentation threshold is a, μ′ a It indicates the gray value of the background part when the segmentation threshold is a;

[0071] When g(a) reaches the maximum value, the corresponding threshold a is the optimal segmentation threshold;

[0072] The first recognition image is segmented using the optimal segmentation threshold, and the segmented foreground portion is extracted as the second recognition image.

[0073] Step 3: Set the edge threshold, use the Sobel operator to calculate the horizontal and vertical gradient values ​​of the second recognition image, calculate the gradient amplitude of all pixels through the horizontal and vertical gradient values, if the pixel gradient amplitude is greater than the edge threshold, retain the pixel, otherwise set the pixel to black, extract all the retained pixels to generate the edge points of the second recognition image;

[0074] In this embodiment, the principle for generating the gradient amplitude of the pixel point is:

[0075] The grayscale value of the pixel point and the grayscale values ​​of the corresponding eight adjacent pixels are multiplied with the horizontal template of the Sobel operator one by one, and all the products are added to obtain the horizontal gradient value of the pixel point; the grayscale value of the pixel point and the grayscale values ​​of the corresponding eight adjacent pixels are multiplied with the vertical template of the Sobel operator one by one, and all the products are added to obtain the vertical gradient value of the pixel point; the horizontal gradient value calculation formula is:

[0076]

[0077] The vertical gradient value calculation formula is:

[0078]

[0079] Wherein, Gx(i, j) represents the horizontal gradient value of the pixel with abscissa i and ordinate j, Gy(i, j) represents the vertical gradient value of the pixel with abscissa i and ordinate j, and X(i, j) represents the grayscale value of the pixel with abscissa i and ordinate j;

[0080] The formula for generating the gradient magnitude is:

[0081]

[0082] Wherein, G(i, j) represents the gradient amplitude of the pixel point with abscissa i and ordinate j.

[0083] The gradient amplitude of a pixel reflects the grayscale change rate of the image at that pixel. Usually, the gradient amplitude is larger at the edge or contour of the image. Therefore, by calculating the gradient amplitude of the pixel, it is possible to determine which pixels are edge points. The edge points detected in this step are the paths and holes generated by termite activities. When setting the edge threshold, the gradient amplitude of the pixels of the activity path of termites in the same activity environment is analyzed in advance, and the gradient amplitude of the pixels of the activity path is used as the edge threshold to ensure that the detected edges are mainly generated by the termite activity path.

[0084] Step 4: Process each image in the first recognition image set according to the above steps to generate edge points of each image, and generate the average change rate of the termite path before killing according to the number of edge points of the image and the acquisition interval of the original image before killing;

[0085] In this embodiment, the principle for generating the average change rate of termite paths before killing is:

[0086]

[0087]

[0088] Among them, K m represents the termite path change rate before killing at time m, R m Represents the number of edge points of the image collected at time m, R m-1 represents the number of edge points of the image collected at time m-1, m represents the time when the image was collected before killing, and m=2, 3, ..., M, △t m-1 represents the time interval between time m and time m-1, represents the average change rate of termite paths before extermination, and M represents the total number of acquisition moments before extermination. The average change rate of termite paths before extermination reflects the movement of termites on the surface of the dam before extermination measures are taken, which is used to estimate the frequency and range of termite activities. If the average change rate is high, it means that termites are active frequently on the surface of the dam, reflecting that the number of termites is large, the activity is high, and the range is wide. If the average change rate is low, it means that termites are relatively less active on the surface of the dam, reflecting that the number of termites is small and the range of activity is small. The average change rate of termite paths before extermination is proportional to the number of edge points of the images collected at adjacent times, and inversely proportional to the time interval.

[0089] Step 5: After killing termites, collect original images of the dam surface after killing at the collection time interval before killing, scale the original images after killing to 224×224, and then perform grayscale processing to generate a third recognition image, and arrange the third recognition images in the order of collection time to generate a third recognition image set;

[0090] In this embodiment, the image data after killing is collected and calculated according to the same steps as before killing, so that the source, processing flow and feature extraction method of the image data before and after killing are consistent, reducing system errors.

[0091] Step 6: Process the third recognition image according to the steps of processing the first recognition image to generate a fourth recognition image, and generate edge points of the fourth recognition image and an average change rate of termite paths after killing;

[0092] In this embodiment, the principle for generating the average rate of change of termite paths after killing is:

[0093]

[0094]

[0095] Among them, T n represents the termite path change rate after killing at time n, S n Indicates the number of edge points of the image collected at time n, S n-1 represents the number of edge points of the image collected at time n-1, n represents the time when the image was collected after killing, and n=2, 3, ..., N, △t n-1 represents the time interval between time n and time n-1, represents the average rate of change of termite paths after killing, and N represents the total number of sampling moments after killing.

[0096] The average change rate of termite paths after extermination reflects the movement of termites on the surface of the dam after extermination measures are taken, which is used to estimate the frequency and range of termite activities and judge the extermination effect. If the average change rate is high, it means that termites are active frequently on the surface of the dam, reflecting that the number of termites is large, the activity is high, and the range is wide. If the average change rate is low, it means that termites are relatively less active on the surface of the dam, reflecting that the number of termites is small and the activity range is small. The average change rate of termite paths after extermination is proportional to the number of edge points of the images collected at adjacent times, and inversely proportional to the time interval.

[0097] Step 7: Generate a killing effect index based on the change in the average change rate of termite paths after killing relative to the average change rate of termite paths before killing to judge the killing effect.

[0098] In this embodiment, the principle for generating the killing effect index is:

[0099]

[0100] Among them, Y represents the killing effect index, represents the average change rate of termite paths before killing, It represents the average rate of change of termite paths after killing;

[0101] When Y>1, termite killing has a positive effect, and the larger the value of Y, the better the killing effect;

[0102] When Y≤1, termite extermination did not achieve positive results.

[0103] The killing effect index reflects the reduction in the number of termites after termite killing measures are taken, and further reflects the killing effect. The greater the difference in the average change rate of termite paths before and after the killing, the greater the killing effect index; when the killing effect index is greater than 1, it means that the average change rate of termite paths after the killing is less than the average change rate of termite paths before the killing, the termite paths have decreased, and the killing measures have produced positive effects. The larger the killing effect index, the smaller the average change rate of termite paths after the killing, and the better the killing effect; when the killing effect index is less than or equal to 1, it means that the average change rate of termite paths after the killing has not decreased significantly or even increased compared with before the killing, and the killing measures have not achieved any effect.

[0104] See also Figure 2 The present invention also provides a device for monitoring the killing effect of termites on dams based on image recognition, and the device is used to implement the above-mentioned method for monitoring the killing effect of termites on dams based on image recognition, which specifically includes:

[0105] The data acquisition module is used to collect original images of the dam surface before killing termites at intervals of 12 to 24 hours, scale the resolution of the original images to 224×224, perform grayscale processing on the original images to generate first recognition images, and arrange the first recognition images in the order of acquisition time to generate a first recognition image set;

[0106] An image processing module is used to filter the first recognition image using a bilateral filter, count the grayscale histogram formed by the frequency of occurrence of pixels at each level in 256 grayscale levels, calculate the inter-class variance of each threshold in the histogram, select the best segmentation threshold by the maximum inter-class variance, perform threshold segmentation on the first recognition image after filtering using the best segmentation threshold, identify the foreground part and the background part, extract the foreground part and reconstruct it to generate the second recognition image;

[0107] An edge extraction module is used to set an edge threshold, use the Sobel operator to calculate the horizontal and vertical gradient values ​​of the second recognition image, and calculate the gradient amplitude of all pixels through the horizontal and vertical gradient values. If the pixel gradient amplitude is greater than the edge threshold, the pixel is retained, otherwise the pixel is set to black, and all retained pixels are extracted to generate edge points of the second recognition image;

[0108] A path calculation module, used to process each image in the first recognition image set according to the above module, generate edge points of each image, and generate an average change rate of the termite path before killing according to the number of edge points of the image and the acquisition interval of the original image before killing;

[0109] A comparison image acquisition and processing module is used to collect original images of the dam surface after killing termites according to the acquisition time interval before killing, scale the original images after killing to 224×224, and then perform grayscale processing to generate a third recognition image, and arrange the third recognition images in the order of acquisition time to generate a third recognition image set;

[0110] A comparison image path calculation module is used to process the third recognition image according to the steps of processing the first recognition image to generate a fourth recognition image, and to generate edge points of the fourth recognition image and an average change rate of the termite path after killing;

[0111] The comprehensive judgment module is used to generate a killing effect index to judge the killing effect according to the change of the average change rate of the termite path after the killing relative to the average change rate of the termite path before the killing.

[0112] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.

[0113] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. Those skilled in the art may appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software methods depends on the specific application and design constraints of the technical solution.

[0114] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0115] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A method for monitoring the killing effect of termites on dams based on image recognition, characterized in that: The specific steps include: Step 1: Before killing termites, collect original images of the dam surface before killing at intervals of 12 to 24 hours, scale the resolution of the original images to 224×224, perform grayscale processing on the original images to generate first recognition images, and arrange the first recognition images in the order of acquisition time to generate a first recognition image set; Step 2: Filter the first recognition image using a bilateral filter, count the grayscale histogram consisting of the frequency of occurrence of pixels at each level in the 256 grayscale levels, calculate the inter-class variance of each threshold in the histogram, select the best segmentation threshold by the maximum inter-class variance, use the best segmentation threshold to perform threshold segmentation on the first recognition image after filtering, identify the foreground and background parts, extract the foreground part and reconstruct it to generate the second recognition image; Step 3: Set the edge threshold, use the Sobel operator to calculate the horizontal and vertical gradient values ​​of the second recognition image, calculate the gradient amplitude of all pixels through the horizontal and vertical gradient values, if the pixel gradient amplitude is greater than the edge threshold, retain the pixel, otherwise set the pixel to black, extract all the retained pixels to generate the edge points of the second recognition image; Step 4: Process each image in the first recognition image set according to the above steps to generate edge points of each image, and generate the average change rate of the termite path before killing according to the number of edge points of the image and the acquisition interval of the original image before killing; Step 5: After killing termites, collect original images of the dam surface after killing at the collection time interval before killing, scale the original images after killing to 224×224, and then perform grayscale processing to generate a third recognition image, and arrange the third recognition images in the order of collection time to generate a third recognition image set; Step 6: Process the third recognition image according to the steps of processing the first recognition image to generate a fourth recognition image, and generate edge points of the fourth recognition image and an average change rate of termite paths after killing; Step 7: Generate a killing effect index to judge the killing effect according to the change of the average change rate of the termite path after the killing relative to the average change rate of the termite path before the killing; The principle for generating the average rate of change of termite paths before killing is: Among them, K m represents the termite path change rate before killing at time m, R m Represents the number of edge points of the image collected at time m, R m-1 represents the number of edge points of the image collected at time m-1, m represents the time when the image was collected before killing, and m=2, 3, ..., M, △t m-1 represents the time interval between time m and time m-1, represents the average change rate of termite paths before killing, and M represents the total number of collection moments before killing; The principle behind the average rate of change of termite paths after extermination is: Among them, T n represents the termite path change rate after killing at time n, S n Indicates the number of edge points of the image collected at time n, S n-1 represents the number of edge points of the image collected at time n-1, n represents the time when the image was collected after killing, and n=2, 3, ..., N, △t n-1 represents the time interval between time n and time n-1, represents the average rate of change of termite paths after killing, and N represents the total number of collection moments after killing; The principle on which the killing effect index is generated is: Among them, Y represents the killing effect index, represents the average change rate of termite paths before killing, It represents the average rate of change of termite paths after killing; When Y>1, termite killing has a positive effect, and the larger the value of Y, the better the killing effect; When Y≤1, termite extermination did not achieve positive results.

2. The method for monitoring the killing effect of termites on dams based on image recognition according to claim 1, characterized in that: The principle for generating the second recognition image in step 2 is: Each threshold in the histogram represents the grayscale value of a pixel point that can be selected for image segmentation. In a grayscale image, the grayscale value ranges from 0 to 255, and the value of the threshold is all integers in the range of 0 to 255; The principle for selecting the best segmentation threshold by maximizing the inter-class variance is: g(a) 2 =ω a oh' a (m a -m′ a ) 2 Among them, a represents the segmentation threshold, g(a) represents the inter-class variance when the segmentation threshold is a, ω a It indicates the proportion of the foreground part to the total image when the segmentation threshold is a, μ a Indicates the gray value of the foreground part when the segmentation threshold is a, ω′ a Indicates the proportion of the background part to the total image when the segmentation threshold is a, μ′ a It indicates the gray value of the background part when the segmentation threshold is a; When g(a) reaches the maximum value, the corresponding segmentation threshold a is the optimal segmentation threshold; The first recognition image is segmented using the optimal segmentation threshold, and the segmented foreground portion is extracted as the second recognition image.

3. The method for monitoring the killing effect of termites on dams based on image recognition according to claim 1, characterized in that: The principle for generating the gradient amplitude of the pixel point in step 3 is as follows: multiply the grayscale value of the pixel point and the grayscale values ​​of the corresponding eight adjacent pixels by the horizontal template of the Sobel operator one by one, and add all the products to obtain the horizontal gradient value of the pixel point; multiply the grayscale value of the pixel point and the grayscale values ​​of the corresponding eight adjacent pixels by the vertical template of the Sobel operator one by one, and add all the products to obtain the vertical gradient value of the pixel point; the horizontal gradient value calculation formula is: The vertical gradient value calculation formula is: Wherein, Gx(i, j) represents the horizontal gradient value of the pixel with abscissa i and ordinate j, Gy(i, j) represents the vertical gradient value of the pixel with abscissa i and ordinate j, and X(i, j) represents the grayscale value of the pixel with abscissa i and ordinate j; The formula for generating the gradient magnitude is: Wherein, G(i, j) represents the gradient amplitude of the pixel point with abscissa i and ordinate j.

4. The device for monitoring the killing effect of termites on dams based on image recognition is characterized by: The device is used to implement the method for monitoring the killing effect of termites on dams based on image recognition as described in any one of claims 1 to 3, and specifically comprises: The data acquisition module is used to collect original images of the dam surface before killing termites at intervals of 12 to 24 hours, scale the resolution of the original images to 224×224, perform grayscale processing on the original images to generate first recognition images, and arrange the first recognition images in the order of acquisition time to generate a first recognition image set; An image processing module is used to filter the first recognition image using a bilateral filter, count the grayscale histogram formed by the frequency of occurrence of pixels at each level in 256 grayscale levels, calculate the inter-class variance of each threshold in the histogram, select the best segmentation threshold by the maximum inter-class variance, perform threshold segmentation on the first recognition image after filtering using the best segmentation threshold, identify the foreground part and the background part, extract the foreground part and reconstruct it to generate the second recognition image; An edge extraction module is used to set an edge threshold, use the Sobel operator to calculate the horizontal and vertical gradient values ​​of the second recognition image, and calculate the gradient amplitude of all pixels through the horizontal and vertical gradient values. If the pixel gradient amplitude is greater than the edge threshold, the pixel is retained, otherwise the pixel is set to black, and all retained pixels are extracted to generate edge points of the second recognition image; A path calculation module, used to process each image in the first recognition image set according to the above module, generate edge points of each image, and generate an average change rate of the termite path before killing according to the number of edge points of the image and the acquisition interval of the original image before killing; A comparison image acquisition and processing module is used to collect original images of the dam surface after killing termites according to the acquisition time interval before killing, scale the original images after killing to 224×224, and then perform grayscale processing to generate a third recognition image, and arrange the third recognition images in the order of acquisition time to generate a third recognition image set; A comparison image path calculation module is used to process the third recognition image according to the steps of processing the first recognition image to generate a fourth recognition image, and to generate edge points of the fourth recognition image and an average change rate of the termite path after killing; The comprehensive judgment module is used to generate a killing effect index to judge the killing effect according to the change of the average change rate of the termite path after the killing relative to the average change rate of the termite path before the killing.