Image processing method, system and device for intelligently luring pests
By pre-processing, binarization and water droplet area adjustment methods for images in intelligent sexually induced pest technology, the problems of water accumulation and non-targeted pest interference are solved, and higher pest recognition accuracy and image quality are achieved.
Patent Information
- Application Number
- CN202510409409.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-04-02
AI Technical Summary
In intelligent pest induced technology, sticky insect plates are prone to water droplets and may adsorb non-targeted pests, resulting in reduced accuracy of pest recognition.
Through image processing methods, including pre-treatment, binarization, dark and bright surface recognition and adjustment of water drop areas, non-targeted pest areas are removed, and fine adjustments are made to ensure the accuracy of image analysis.
Effectively remove non-targeted pest areas, improve the recognition accuracy of targeted pests, eliminate the highlight abruptness of the water droplets covered area, and improve the overall visual effect and color consistency of the image.
Smart Images

Figure CN119919436A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an image processing method, system and device for intelligent pest trapping. Background Art
[0002] In the agricultural field, traditional pest control methods rely on chemical pesticides. Although it can effectively manage pests to a certain extent, it also brings environmental problems such as pesticide residues, soil and water pollution, and damage to non-target organisms. In contrast, smart sex lure technology utilizes the natural tropism of pests and traps pests through sex pheromones, significantly reducing the use of chemical pesticides. Given that pests have unique responses to specific sex pheromones, smart sex lure technology can accurately target a certain type of pest for prevention and control, thereby reducing the impact on non-target organisms and protecting the natural enemies of pests. This technology not only reduces the number of pests, but also promotes biodiversity in farmland ecosystems, enhances the self-regulation and stability of the system, and is an important symbol of the development of intelligent agriculture, leading agricultural production to a smarter and more precise direction.
[0003] The data collected by smart devices through intelligent sex attractant technology not only directly serves the current pest management, but also provides valuable data support for future agricultural production planning, crop variety selection and planting pattern optimization, improving the efficiency and benefits of the entire agricultural production chain. However, there are also some challenges in the implementation of intelligent sex attractant technology. For example, other non-target pests may be attracted to the sticky insect board, interfering with the identification and analysis of the pests. In addition, under rainy conditions, water droplets on the sticky insect board will cover the pests, significantly reducing the accuracy of identifying targeted pests. Summary of the invention
[0004] In view of the shortcomings of the prior art, the present invention provides an intelligent image processing method, system and device for attracting pests.
[0005] In order to solve the above technical problems, the present invention is solved by the following technical solutions: An intelligent pest-luring image processing method comprises the following steps: Acquire an original pest image, perform preprocessing on the original pest image, and obtain a plurality of pest images including a plurality of sub-regions, wherein the original pest image at least includes a pest region and a water drop region, and the preprocessing at least includes dimensionality reduction, padding, and cropping; Binarization is performed on each pest image containing multiple sub-regions to obtain a binary image, and it is determined whether there is a non-targeted pest region. If so, the non-targeted pest region is removed to obtain a first targeted pest image; Based on the first targeted pest image, a plurality of edge contour pixel point sets are obtained, and based on the brightness distribution of the pixels in each edge contour pixel point set, the dark side area and the bright side area of the water drop area are identified to obtain the dark side area pixel point set and the bright side area pixel point set of the water drop area; Based on the dark area pixel set, the nearest background pixel point of the non-water drop area is obtained, and the pixel points in the dark area pixel set are adjusted based on the nearest background pixel point to obtain a first targeted pest image after the dark area is processed; The edge pixel points of the bright surface area are determined based on the set of pixel points in the bright surface area, the baseline is determined by pairwise edge pixel points, and the pixel points on the baseline are linearly interpolated to obtain a first targeted pest image after bright surface area processing, wherein the first targeted pest image after dark surface area processing and bright surface area processing is the final targeted pest image.
[0006] As an implementable method, preprocessing the original pest image to obtain multiple pest images containing multiple sub-regions includes the following steps: Based on the original pest image, a set of pixel grayscale values of the original pest image is obtained; Performing dimension reduction and rounding processing on the grayscale value of each pixel in the pixel grayscale value set to obtain a pixel grayscale value set after dimension reduction; Traverse the pixel points in the grayscale value set of the pixel points after dimensionality reduction, copy the pixel points with equal grayscale values to the newly created image, and obtain multiple separated images with different grayscale values; Extract the contour information of each separated image to form a contour set, and obtain the area of each contour, and remove the corresponding contours in the contour set whose contour area is less than a preset contour area threshold to obtain a new contour set; Perform hole identification on each contour in the new contour set to form a hole set, obtain the area of each hole, and fill the holes in the hole set whose area is smaller than a preset contour area threshold to form a first contour set; Mapping the first contour in the first contour set onto the original pest image, and cutting out the first contour area to obtain a plurality of pest images including a plurality of sub-areas; The dimension reduction and rounding process are expressed as follows:
[0007] in, Represents the gray value of the pixel in the gray value set of the pixel after dimensionality reduction, Represents the coordinate data of the pixel point. Indicates the preset grayscale value width, Represents the gray value of a pixel in a pixel gray value set. Represents the floor function.
[0008] As an implementable method, binarizing each pest image containing multiple sub-regions to obtain a binary image includes the following steps: Based on each pest image containing multiple sub-regions, a pixel value set of each sub-region is obtained, and then a pixel value threshold of each sub-region is obtained; Based on the pixel value threshold of each sub-region, each sub-region is binarized to obtain multiple binarized region images; Fusing multiple binary region images to obtain a binary image; The pixel value threshold of each sub-region is expressed as follows:
[0009] in, Indicates The pixel value threshold of the sub-region is Indicates The mean pixel value of the sub-regions, , Indicates The standard deviation of the pixel values in each sub-region is , Indicates The total number of pixels in each sub-region, Indicates The sub-region The pixel value of a pixel, Indicates the number of sub-regions, Indicates the number of pixels.
[0010] As an implementable method, the determining whether there is a non-targeted pest area, and if so, removing the non-targeted pest area to obtain a first targeted pest image, comprises the following steps: Extract the contour information of the binary image, form a binary contour set, and obtain the area of each binary contour; If the binarized contour area is smaller than the contour of the preset target pest area threshold, the corresponding contour area is filled based on the background color of the original pest image to remove the non-target pest area and obtain the first targeted pest image.
[0011] As an implementable method, based on the first targeted pest image, a plurality of edge contour pixel point sets are obtained, and based on the brightness distribution of the pixels in each edge contour pixel point set, the dark side area and the bright side area of the water drop area are identified to obtain the dark side area pixel point set and the bright side area pixel point set of the water drop area, including the following steps: Performing image enhancement processing on the first targeted pest image to obtain a second targeted pest image, wherein the image enhancement processing includes at least one or more of contrast enhancement, highlight area enhancement, and dark area darkening; Performing median filtering on the second targeted pest image to obtain a third targeted pest image; Performing edge detection on the third targeted pest image to obtain a background pixel point set and a plurality of edge contour pixel point sets; The brightness values of all pixels in the background pixel set are averaged to obtain the background brightness value; Based on the brightness value distribution of the pixel points in each edge contour pixel point set, a plurality of edge contour average brightness values are obtained; If the average brightness value of the edge contour is greater than the background brightness value, the corresponding edge contour pixel point set is the bright area pixel point set, and the other edge contour pixel point sets are the dark area pixel point sets.
[0012] As an implementation method, the method of obtaining the nearest background pixel point of the non-water droplet area based on the dark area pixel point set, adjusting the pixel points in the dark area pixel point set based on the nearest background pixel point, and obtaining a first targeted pest image after the dark area is processed includes the following steps: Based on the dark area pixel set, the nearest background pixel of each pixel is obtained; Obtaining the RGB value of each pixel in the first targeted pest image, obtaining the brightness value, saturation value and hue value of the corresponding pixel in the HSV space, and then obtaining a first HSV component set; Extract the brightness value and saturation value of the nearest background pixel in the first HSV component set to obtain the brightness value and saturation value of the nearest background pixel of each pixel; Based on the brightness value and saturation value of the nearest background pixel of each pixel, the hue value, saturation value and brightness value of the pixel in the first HSV component set are adjusted to obtain a second HSV component set; Based on the hue value, saturation value and brightness value of each pixel in the second HSV component set, the RGB value of the corresponding pixel is obtained, and then the second RGB set is obtained, and then the first targeted pest image after dark area processing is obtained.
[0013] As an implementation method, the brightness value, saturation value and hue value of the pixel points of the first HSV component set are respectively expressed as follows:
[0014]
[0015]
[0016] The hue value, saturation value and brightness value of the pixel points of the second HSV component set are respectively expressed as follows:
[0017] in, Represents the coordinate data of the pixel point. , and Respectively represent the brightness value, saturation value and hue value of the pixel points of the first HSV component set, , and Respectively represent the R channel intensity value, G channel intensity value and B channel intensity value of the pixel point of the first RGB set, , and Respectively represent the hue value, saturation value and brightness value of the pixel point of the second HSV component set, and Respectively represent the saturation value and brightness value of the nearest background pixel, and Both represent adjustment factors.
[0018] As an implementable method, obtaining the nearest background pixel of each pixel based on the dark area pixel set includes the following steps: Taking a pixel point in the dark area pixel point set as a central pixel point, obtaining all pixel points within a preset neighborhood range of the central pixel point, and obtaining a first neighborhood pixel point set; Eliminate the pixels belonging to the dark area pixel set or the bright area pixel set in the first neighborhood pixel set to obtain a second neighborhood pixel set; Initialize the distance value between the central pixel and the background pixels of the central pixel to a preset distance threshold; Obtain the Euclidean distance between the central pixel and each pixel in the second neighborhood pixel set, and then obtain the minimum Euclidean distance; If the minimum Euclidean distance is less than the preset distance threshold, the pixel corresponding to the minimum Euclidean distance is the nearest background pixel of the center pixel; The central pixel is removed from the dark area pixel set, and the dark area pixel set is updated, and the nearest background pixel of each pixel in the dark area pixel set is obtained iteratively.
[0019] As an implementable method, the edge pixel points of the bright surface area are determined based on the bright surface area pixel point set, the baseline is determined by pairwise edge pixel points, and the pixel points on the baseline are linearly interpolated to obtain the first targeted pest image after bright surface area processing, including the following steps: Based on the bright surface area pixel point set, the edge of each bright surface area is extracted to obtain multiple bright surface area edge pixel point sets; The pixel point with the smallest horizontal coordinate value in the target bright surface area edge pixel point set is obtained as the first end pixel point; Based on the target bright surface area edge pixel point set, a pixel point having the same horizontal coordinate value as the first end pixel point is obtained as the second end pixel point, and a line connecting the first end pixel point and the second end pixel point is the baseline of the target bright surface area, thereby obtaining a first baseline pixel point set; Based on the RGB value of the first end pixel point and the RGB value of the second end pixel point, linear interpolation adjustment is performed on the RGB values of the pixel points in the first baseline pixel point set to obtain a second baseline pixel point set; The pixel points in the edge pixel point set of each bright surface area are traversed, and the pixel points in each bright surface area are adjusted based on the baseline to obtain a first targeted pest image after the bright surface area is processed.
[0020] As an implementable embodiment, the R channel intensity value, the G channel intensity value and the B channel intensity value of the pixel point in the second baseline pixel point set are respectively expressed as follows:
[0021] in, , and They respectively represent the R channel intensity value, G channel intensity value and B channel intensity value of the pixel points in the second baseline pixel point set, , and Respectively represent the R channel intensity value, G channel intensity value and B channel intensity value of the first end pixel point, , and Respectively represent the R channel intensity value, G channel intensity value and B channel intensity value of the second end pixel point, Indicates the first pixel point on the baseline in the direction from the first end pixel point to the second end pixel point. pixels, Indicates the number of pixels on the baseline except the first end pixel and the second end pixel. , Indicates the horizontal coordinate value of the second end pixel, Indicates the horizontal coordinate value of the first end pixel, Indicates rounding down.
[0022] An intelligent pest-luring image processing system comprises a preprocessing module, a binarization module, a water drop bright side and dark side acquisition module, a water drop dark side adjustment module and a water drop bright side adjustment module; The preprocessing module obtains an original pest image, preprocesses the original pest image, and obtains a plurality of pest images containing a plurality of sub-regions, wherein the original pest image at least includes a pest region and a water drop region, and the preprocessing at least includes dimensionality reduction, padding, and cropping; The binarization module performs binarization processing on each pest image containing multiple sub-regions to obtain a binarized image, determines whether there is a non-targeted pest region, and if so, removes the non-targeted pest region to obtain a first targeted pest image; The water drop bright and dark side acquisition module obtains a plurality of edge contour pixel point sets based on the first targeted pest image, identifies the dark side area and the bright side area of the water drop area based on the brightness distribution of the pixels in each edge contour pixel point set, and obtains the dark side area pixel point set and the bright side area pixel point set of the water drop area; The water drop dark side adjustment module obtains the nearest background pixel point of the non-water drop area from the dark side area pixel point set, and adjusts the pixel points in the dark side area pixel point set based on the nearest background pixel point to obtain a first targeted pest image after the dark side area is processed; The water drop bright surface adjustment module determines the edge pixel points of the bright surface area based on the bright surface area pixel point set, determines the baseline through the edge pixel points in pairs, and performs linear interpolation adjustment on the pixel points on the baseline to obtain the first targeted pest image after the bright surface area processing, wherein the first targeted pest image after the dark surface area processing and the bright surface area processing is the final targeted pest image.
[0023] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following method is implemented: Acquire an original pest image, perform preprocessing on the original pest image, and obtain a plurality of pest images including a plurality of sub-regions, wherein the original pest image at least includes a pest region and a water drop region, and the preprocessing at least includes dimensionality reduction, padding, and cropping; Binarization is performed on each pest image containing multiple sub-regions to obtain a binary image, and it is determined whether there is a non-targeted pest region. If so, the non-targeted pest region is removed to obtain a first targeted pest image; Based on the first targeted pest image, a plurality of edge contour pixel point sets are obtained, and based on the brightness distribution of the pixels in each edge contour pixel point set, the dark side area and the bright side area of the water drop area are identified to obtain the dark side area pixel point set and the bright side area pixel point set of the water drop area; Based on the dark area pixel set, the nearest background pixel point of the non-water drop area is obtained, and the pixel points in the dark area pixel set are adjusted based on the nearest background pixel point to obtain a first targeted pest image after the dark area is processed; The edge pixel points of the bright surface area are determined based on the set of pixel points in the bright surface area, the baseline is determined by pairwise edge pixel points, and the pixel points on the baseline are linearly interpolated to obtain a first targeted pest image after bright surface area processing, wherein the first targeted pest image after dark surface area processing and bright surface area processing is the final targeted pest image.
[0024] An intelligent image processing device for attracting pests includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the following method is implemented: Acquire an original pest image, perform preprocessing on the original pest image, and obtain a plurality of pest images including a plurality of sub-regions, wherein the original pest image at least includes a pest region and a water drop region, and the preprocessing at least includes dimensionality reduction, padding, and cropping; Binarization is performed on each pest image containing multiple sub-regions to obtain a binary image, and it is determined whether there is a non-targeted pest region. If so, the non-targeted pest region is removed to obtain a first targeted pest image; Based on the first targeted pest image, a plurality of edge contour pixel point sets are obtained, and based on the brightness distribution of the pixels in each edge contour pixel point set, the dark side area and the bright side area of the water drop area are identified to obtain the dark side area pixel point set and the bright side area pixel point set of the water drop area; Based on the dark area pixel set, the nearest background pixel point of the non-water drop area is obtained, and the pixel points in the dark area pixel set are adjusted based on the nearest background pixel point to obtain a first targeted pest image after the dark area is processed; The edge pixel points of the bright surface area are determined based on the set of pixel points in the bright surface area, the baseline is determined by pairwise edge pixel points, and the pixel points on the baseline are linearly interpolated to obtain a first targeted pest image after bright surface area processing, wherein the first targeted pest image after dark surface area processing and bright surface area processing is the final targeted pest image.
[0025] The present invention has significant technical effects due to the adoption of the above technical solutions: in view of the problem that water droplets are easily accumulated on the sticky insect board in rainy weather and non-target pests may be mixed into the original image during the intelligent trapping of pests, the present invention innovatively proposes a solution. For the existence of non-target pests, the present invention can automatically identify and remove these non-target areas to ensure the accuracy of image analysis. In view of the problem of image brightness difference caused by uneven distribution of light sources, traditional binarization methods often cause information loss. The present invention adopts an adaptive regional binarization technology to independently perform binarization processing on each area in the image, effectively retaining key information. For the area covered by water droplets, a set of sophisticated image adjustment strategies is proposed. For the dark area of the water droplets, the present invention makes adjustments based on the nearest background pixel point to ensure that the pixels in the dark area gradually approach the surrounding normal background in saturation and brightness while maintaining the hue unchanged, thereby achieving a natural transition. As for the bright area of water droplets, the present invention uses the baseline determined by the edge pixel points of the bright area, and adjusts the pixel points on the baseline based on the baseline by linear interpolation, and then adjusts all bright areas. This can give the bright area reasonable color information, so that it blends perfectly with the background, eliminates the highlight abrupt area, and greatly improves the overall visual effect and color consistency of the image. Therefore, the present invention can not only effectively restore the area covered by water droplets in the original pest image, but also provide a basis for the subsequent improvement of the recognition and analysis accuracy of targeted pests, and provide strong technical support for the practical application of intelligent trapping technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0027] Figure 1 It is a schematic flow diagram of the method of the present invention; Figure 2 is an original pest image in the embodiment of the present invention; Figure 3 is the final targeted pest image in the embodiment of the present invention; Figure 4 It is an overall schematic diagram of the system of the present invention. DETAILED DESCRIPTION
[0028] The present invention is further described in detail below in conjunction with the embodiments, which are explanations of the present invention but are not limited to the following embodiments. In the absence of conflict, the features in the following embodiments can be combined with each other.
[0029] Embodiment 1: An image processing method for intelligently attracting pests, such as Figure 1 As shown, the following steps are included: S100: obtaining an original pest image, preprocessing the original pest image to obtain a plurality of pest images including a plurality of sub-regions, wherein the original pest image at least includes a pest region and a water drop region, and the preprocessing at least includes dimensionality reduction, padding and cropping; S200: performing binarization processing on each pest image including a plurality of sub-regions to obtain a binarized image, determining whether there is a non-targeted pest region, and if so, removing the non-targeted pest region to obtain a first targeted pest image; S300: Based on the first targeted pest image, a plurality of edge contour pixel point sets are obtained, and based on the brightness distribution of the pixels in each edge contour pixel point set, a dark surface area and a bright surface area of the water drop area are identified to obtain a dark surface area pixel point set and a bright surface area pixel point set of the water drop area; S400: obtaining the nearest background pixel point of the non-water droplet area from the dark area pixel point set, and adjusting the pixel points in the dark area pixel point set based on the nearest background pixel point to obtain a first targeted pest image after the dark area is processed; S500: Determine edge pixel points of the bright surface area based on the set of pixel points of the bright surface area, determine a baseline through pairwise edge pixel points, and perform linear interpolation adjustment on the pixel points on the baseline to obtain a first targeted pest image after bright surface area processing, wherein the first targeted pest image after dark surface area processing and bright surface area processing is the final targeted pest image.
[0030] In the present invention, the targeted pests are the pests that need to be studied in this application, and the non-targeted pests are the pests that do not meet the requirements.
[0031] In S100, an original pest image is obtained, and the original pest image is preprocessed to obtain a plurality of pest images including a plurality of sub-regions, wherein the original pest image at least includes a pest region and a water drop region, and the preprocessing at least includes dimensionality reduction, padding and cropping, including the following steps: S110: Obtaining the original pest image on the sticky insect board containing sex pheromone, such as Figure 2 As shown, the original pest image includes targeted pests and water droplets, and may include targeted pests. The original pest image is collected by an intelligent sex-luring device.
[0032] S120, based on the original pest image, obtaining a pixel gray value set of the original pest image, wherein the pixel gray value set of the original pest image includes coordinate data of all pixels in the original pest image and gray values of corresponding pixels.
[0033] S130: Performing dimension reduction and rounding processing on the grayscale value of each pixel in the pixel grayscale value set to obtain a pixel grayscale value set after dimension reduction.
[0034] In this step, the original pest image is subjected to a dimensionality reduction process based on a fixed width, because the depth of the original pest image collected is 256, which means that its grayscale value range is 0-255, with a total of 256 levels. In many practical application scenarios, in order to obtain high-quality images, the grayscale division of the original pest image is relatively fine, but such a fine grayscale division will introduce unnecessary complexity, and the difference between adjacent grayscale values has little effect on subsequent processing (such as contour extraction, binarization decision, etc.). Dimensionality reduction can simplify the data structure of the image while retaining the overall grayscale hierarchy characteristics of the image. Dimensionality reduction and rounding processing is to integrate and round the grayscale interval of the original pest image according to a fixed width, as shown below:
[0035] in, Represents the gray value of the pixel in the gray value set of the pixel after dimensionality reduction, Represents the coordinate data of the pixel point. Indicates the preset grayscale value width, Represents the gray value of a pixel in a pixel gray value set. represents the floor function, Can ensure Mapped to corresponding rounded values in the interval.
[0036] S140: traverse the pixel points in the pixel gray value set after dimensionality reduction, copy the pixel points with equal gray value to the newly created image, and obtain multiple separated images with different gray value.
[0037] In this step, the grayscale value set is obtained based only on the grayscale values of the pixels in the grayscale value set after dimensionality reduction. Then the number of elements in the grayscale value set is limited, and the grayscale value set is ( is the number of different grayscale values). First create A blank background image, this The grayscale values of the blank background image do not belong to the grayscale value set. The pixel points in the grayscale value set of the pixel point after dimensionality reduction are traversed, and the pixel points with equal grayscale values are copied to the same newly created blank background image. The grayscale values of the pixel points with corresponding coordinates in the corresponding blank background image are adjusted to the grayscale values of the pixel points in the grayscale value set of the pixel point after dimensionality reduction, so as to obtain For a single separated image, the gray values of the pixels in the image (ignoring the blank background image) are the same.
[0038] S150: extracting contour information of each separated image to form a contour set, and obtaining the area of each contour, and removing corresponding contours in the contour set whose contour area is smaller than a preset contour area threshold to obtain a new contour set.
[0039] In this step, a preset contour area threshold is obtained, including the following steps: (1) Construct a pre-trained model of insect body area. The pre-trained model of insect body area can be constructed by a deep learning model, and the prediction of insect body area is used as a regression task. Since the image size is pixels, the input layer is designed to accept (width high The input of the image is the color channel. According to the complexity of the pest features and the image resolution, the appropriate number and size of convolution kernels are selected. Multiple convolution kernels of different sizes can be used to capture features of different scales, and the number of neurons in the fully connected layer is designed according to the task requirements.
[0040] (2) Obtain images containing insect bodies, process and annotate the images, and obtain an image sample set; (3) The insect body area pre-training model is trained using the image sample set to obtain an insect body area model. The insect body area model can detect the location of the pest and calculate the area of its bounding box, which is the insect body area. (4) inferring the non-targeted pest image through the insect body area model to obtain the non-targeted pest area, wherein the non-targeted pests include non-targeted pests whose insect body area is significantly larger than that of the targeted pests and non-targeted pests whose insect body area is significantly smaller than that of the targeted pests; (5) Based on the non-targeted pest area, obtain the preset contour area threshold , which is expressed as follows:
[0041] in, Represents the preset contour area threshold, represents the non-target pest area, represents the total number of non-target pests, Represents the number of non-target pests.
[0042] S160: Perform hole identification on each contour in the new contour set to form a hole set, obtain the area of each hole, and fill the holes in the hole set whose area is smaller than a preset contour area threshold to form a first contour set.
[0043] In this step, the background color of the corresponding separated image can be filled. The filling methods include one or more of fixed value filling, interpolation filling, morphological filling and contour-based filling. After the hole filling, the originally empty area will be filled with the corresponding pixel value, making the image more visually complete and coherent.
[0044] S170: Mapping the first contour in the first contour set onto the original pest image, and cutting out the first contour region to obtain a plurality of pest images including a plurality of sub-regions.
[0045] In S200, each pest image including a plurality of sub-regions is binarized to obtain a binarized image, and it is determined whether there is a non-targeted pest region. If so, the non-targeted pest region is removed to obtain a first targeted pest image, including the following steps: S210: Based on each pest image containing multiple sub-regions, a pixel value set of each sub-region is obtained, and then a pixel value threshold of each sub-region is obtained. The pixel value threshold of each sub-region is expressed as follows:
[0046] in, Indicates The pixel value threshold of the sub-region, Indicates The mean pixel value of the sub-regions, , Indicates The standard deviation of the pixel values in each sub-region is , Indicates The total number of pixels in each sub-region, Indicates The sub-region The pixel value of a pixel, Indicates the number of sub-regions, Indicates the number of pixels.
[0047] S220: Based on the pixel value threshold of each sub-region, binarization processing is performed on each sub-region to obtain a plurality of binarized region images.
[0048] In this step, each pest image containing multiple sub-regions is binarized based on different pixel value thresholds, so that the sub-regions in each image are clearly distinguished from their background colors, thereby improving the quality of regional fusion, extraction, and integration in subsequent images.
[0049] S230: Fusing multiple binary region images to obtain a binary image.
[0050] In this step, the fusion method can be achieved through simple pixel coverage (placed correspondingly according to coordinates), and finally a complete binary image is obtained after adaptive region binarization.
[0051] S240: Determine whether there is a non-targeted pest area. If so, remove the non-targeted pest area to obtain a first targeted pest image, including the following steps: (1) Extract the contour information of the binary image, form a binary contour set, and obtain the area of each binary contour; (2) If the binarized contour area is smaller than the contour of the preset target pest area threshold, the corresponding contour area is filled based on the background color of the original pest image to remove the non-target pest area and obtain the first targeted pest image. The preset target pest area threshold can be set to 1 / 5 of the preset contour area threshold.
[0052] Due to the influence of uneven distribution of light sources, when the image acquisition device acquires the sticky insect board image, the brightness distribution of the original pest image obtained is uneven. Directly using the traditional binarization method will lose a lot of information. The present invention independently performs binarization processing on each area, which is a new adaptive area binarization method.
[0053] In S300, based on the first targeted pest image, a plurality of edge contour pixel point sets are obtained, and based on the brightness distribution of the pixels in each edge contour pixel point set, the dark side area and the bright side area of the water drop area are identified to obtain the dark side area pixel point set and the bright side area pixel point set of the water drop area, including the following steps: S310: performing contrast enhancement, highlight area enhancement, and dark area darkening processing on the first targeted pest image, thereby enhancing edge information of dark surface edges and bright surface edges in the first targeted pest image, and obtaining a second targeted pest image.
[0054] S320: Perform median filtering on the second targeted pest image to obtain a third targeted pest image.
[0055] S340: Using the Canny edge detection operator, edge detection is performed on the third targeted pest image to obtain a background pixel point set and a plurality of edge contour pixel point sets.
[0056] S350: averaging the brightness values of all pixels in the background pixel set to obtain a background brightness value; and obtaining a plurality of edge contour average brightness values based on the brightness value distribution of the pixels in each edge contour pixel set.
[0057] S360: If the average brightness value of the edge contour is greater than the background brightness value, the corresponding edge contour pixel point set is the bright area pixel point set, and the other edge contour pixel point sets are the dark area pixel point sets.
[0058] In this step, the bright area of the water droplets is white due to the specular reflection of the image, which is displayed as a highlight. Due to the light transmittance of water and other reasons, the brightness of the dark area is lower than that of the background, but the color is the original color. Therefore, the bright area and dark area of the water droplets can be distinguished based on the brightness value, thereby obtaining a set of dark area pixel points. And the pixel set of the bright area .
[0059] In S400, the nearest background pixel point of the non-water droplet area is obtained based on the dark area pixel point set, and the pixel points in the dark area pixel point set are adjusted based on the nearest background pixel point to obtain a first targeted pest image after the dark area is processed, including the following steps: S410: Based on the dark area pixel set, the nearest background pixel of each pixel is obtained, which specifically includes: (1) Take the pixel in the dark area pixel set as the center pixel , get the center pixel All pixel points within the neighborhood range are obtained to obtain a first neighborhood pixel point set; (2) Eliminate the pixels in the first neighborhood pixel set that belong to the dark area pixel set or the bright area pixel set, thereby eliminating the pixels in the water drop area (dark area and bright area) to obtain the second neighborhood pixel set; (3) Initializing the nearest background pixel of the central pixel to a null value, and initializing the distance value between the central pixel and the background pixel of the central pixel to a preset distance threshold. The preset distance threshold may be a relatively large number, such as the length of the image diagonal, so as to ensure that it can be updated in the initial state; (4) Obtain the Euclidean distance between the central pixel and each pixel in the second neighborhood pixel set, and then obtain the minimum Euclidean distance; (5) If the minimum Euclidean distance is less than the preset distance threshold, the pixel corresponding to the minimum Euclidean distance is the nearest background pixel of the center pixel; (6) If the nearest background pixel of the central pixel is not a null value, the central pixel is removed from the dark area pixel set, and the dark area pixel set is updated, and the nearest background pixel of each pixel in the dark area pixel set is obtained iteratively.
[0060] S420: Obtain the RGB value of each pixel in the first targeted pest image to obtain a first RGB set.
[0061] S430: Based on the RGB value of each pixel in the first RGB set, the brightness value (Value), saturation value (Saturation) and hue value (Hue) of the corresponding pixel are obtained, and then the first HSV component set is obtained. The conversion from RGB color space to HSV can avoid the mutual interference of R, G and B channels when the image is adjusted in RGB space. Among them, the brightness value, saturation value and hue value of the pixel of the first HSV component set are respectively expressed as follows:
[0062]
[0063]
[0064] in, Represents the coordinate data of the pixel point. , and Respectively represent the brightness value, saturation value and hue value of the pixel points of the first HSV component set, , and Respectively represent the R channel intensity value, G channel intensity value and B channel intensity value of the pixel point of the first RGB set.
[0065] S440: Extract the brightness value and saturation value of the nearest background pixel in the first HSV component set to obtain the brightness value of the nearest background pixel for each pixel. and saturation value .
[0066] S450: Based on the brightness value and saturation value of the nearest background pixel of each pixel, the hue value, saturation value and brightness value of the pixel in the first HSV component set are adjusted to obtain a second HSV component set, wherein the hue value, saturation value and brightness value of the pixel in the second HSV component set are respectively expressed as follows:
[0067] in, , and Respectively represent the hue value, saturation value and brightness value of the pixel point of the second HSV component set, and Respectively represent the saturation value and brightness value of the nearest background pixel, and All represent adjustment coefficients. The range of the R channel intensity value, the G channel intensity value, and the B channel intensity value is , The value range is , and The range is .
[0068] S460: Based on the hue value, saturation value and brightness value of each pixel in the second HSV component set, the RGB value of the corresponding pixel is obtained, and then a second RGB set is obtained, and then the first targeted pest image after dark area processing is obtained.
[0069] Through this processing method, the saturation and brightness values of the pixels in the dark area of the water droplets remain close to the surrounding normal background while the hue value remains unchanged.
[0070] In step S500, edge pixels of the bright area are determined based on the bright area pixel set, a baseline is determined by pairwise edge pixels, and linear interpolation adjustment is performed on the pixels on the baseline to obtain a first targeted pest image after bright area processing, wherein the first targeted pest image after dark area processing and bright area processing is the final targeted pest image, including the following steps: S510: extracting the edge of each bright surface area based on the bright surface area pixel point set to obtain a plurality of bright surface area edge pixel point sets.
[0071] S520: Obtaining a pixel point with the smallest horizontal coordinate value in the target bright surface area edge pixel point set as the first end pixel point, that is, the leftmost pixel point in the horizontal direction of the target bright surface area.
[0072] S530: Taking the horizontal direction as the baseline, based on the target bright surface area edge pixel point set, the pixel point with the same horizontal coordinate value as the first end pixel point is the second end pixel point, and the line connecting the first end pixel point and the second end pixel point is the baseline of the target bright surface area, thereby obtaining the first baseline pixel point set.
[0073] S540: Based on the RGB value of the first end pixel point and the RGB value of the second end pixel point, the RGB value of the pixel point in the first baseline pixel point set is linearly interpolated to obtain a second baseline pixel point set. The R channel intensity value, the G channel intensity value, and the B channel intensity value of the pixel point in the second baseline pixel point set are respectively expressed as follows:
[0074] in, , and They respectively represent the R channel intensity value, G channel intensity value and B channel intensity value of the pixel points in the second baseline pixel point set, , and Respectively represent the R channel intensity value, G channel intensity value and B channel intensity value of the first end pixel point, , and Respectively represent the R channel intensity value, G channel intensity value and B channel intensity value of the second end pixel point, Indicates the first pixel point on the baseline in the direction from the first end pixel point to the second end pixel point. pixels, Indicates the number of pixels on the baseline except the first end pixel and the second end pixel. , Indicates the horizontal coordinate value of the second end pixel, Indicates the horizontal coordinate value of the first end pixel, Indicates rounding down.
[0075] S550: traverse the pixel points in the edge pixel point set of each bright surface area, adjust the pixel points in each bright surface area based on the baseline, and obtain a first targeted pest image after the bright surface area is processed.
[0076] like Figure 3 As shown in the figure, the first target pest image after dark area processing and bright area processing is the final target pest image. Through this processing, the bright surface of the water droplets can be given reasonable color information, making the transition with the surrounding background more natural, eliminating the abrupt white highlight area, improving the overall visual effect and color consistency of the image, and facilitating the subsequent accurate recognition and analysis of targets (such as insects, etc.) in the sticky insect board image.
[0077] Embodiment 2: An intelligent image processing system for attracting pests, such as Figure 4 As shown, it includes a pre-processing module, a binarization module, a water drop bright side and dark side acquisition module, a water drop dark side adjustment module and a water drop bright side adjustment module; The preprocessing module obtains an original pest image, preprocesses the original pest image, and obtains a plurality of pest images containing a plurality of sub-regions, wherein the original pest image at least includes a pest region and a water drop region, and the preprocessing at least includes dimensionality reduction, padding, and cropping; The binarization module performs binarization processing on each pest image containing multiple sub-regions to obtain a binarized image, determines whether there is a non-targeted pest region, and if so, removes the non-targeted pest region to obtain a first targeted pest image; The water drop bright and dark side acquisition module obtains a plurality of edge contour pixel point sets based on the first targeted pest image, identifies the dark side area and the bright side area of the water drop area based on the brightness distribution of the pixels in each edge contour pixel point set, and obtains the dark side area pixel point set and the bright side area pixel point set of the water drop area; The water drop dark side adjustment module obtains the nearest background pixel point of the non-water drop area from the dark side area pixel point set, and adjusts the pixel points in the dark side area pixel point set based on the nearest background pixel point to obtain a first targeted pest image after the dark side area is processed; The water drop bright surface adjustment module determines the edge pixel points of the bright surface area based on the bright surface area pixel point set, determines the baseline through the edge pixel points in pairs, and performs linear interpolation adjustment on the pixel points on the baseline to obtain the first targeted pest image after the bright surface area processing, wherein the first targeted pest image after the dark surface area processing and the bright surface area processing is the final targeted pest image.
[0078] Various changes and modifications can be made without departing from the spirit and scope of the present invention, and all equivalent technical solutions also belong to the scope of the present invention.
[0079] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0080] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0081] The present invention is described with reference to the flowcharts and / or block diagrams of the method, terminal device (system), and computer program product according to the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0082] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0083] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0084] It should be noted that: The "one embodiment" or "embodiment" mentioned in the specification means that the specific features, structures or characteristics described in conjunction with the embodiment are included in at least one embodiment of the present invention. Therefore, the phrases "one embodiment" or "embodiment" appearing in various places throughout the specification do not necessarily refer to the same embodiment.
[0085] In addition, it should be noted that the shapes and names of the parts and components of the specific embodiments described in this specification may be different. Any equivalent or simple changes made based on the structure, features and principles described in the patent concept of the present invention are included in the protection scope of the patent of the present invention. The technicians in the technical field of the present invention can make various modifications or supplements to the specific embodiments described or replace them in a similar manner, as long as they do not deviate from the structure of the present invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.
Claims
1. An intelligent image processing method for attracting pests, characterized in that: The following steps are involved: Acquire an original pest image, perform preprocessing on the original pest image, and obtain a plurality of pest images including a plurality of sub-regions, wherein the original pest image at least includes a pest region and a water drop region, and the preprocessing at least includes dimensionality reduction, padding, and cropping; Binarization is performed on each pest image containing multiple sub-regions to obtain a binary image, and it is determined whether there is a non-targeted pest region. If so, the non-targeted pest region is removed to obtain a first targeted pest image; Based on the first targeted pest image, a plurality of edge contour pixel point sets are obtained, and based on the brightness distribution of the pixels in each edge contour pixel point set, the dark side area and the bright side area of the water drop area are identified to obtain the dark side area pixel point set and the bright side area pixel point set of the water drop area; Based on the dark area pixel set, the nearest background pixel point of the non-water drop area is obtained, and the pixel points in the dark area pixel set are adjusted based on the nearest background pixel point to obtain a first targeted pest image after the dark area is processed; The edge pixel points of the bright surface area are determined based on the set of pixel points in the bright surface area, the baseline is determined by pairwise edge pixel points, and the pixel points on the baseline are linearly interpolated to obtain a first targeted pest image after bright surface area processing, wherein the first targeted pest image after dark surface area processing and bright surface area processing is the final targeted pest image.
2. The image processing method for intelligent pest trapping according to claim 1, characterized in that: The method of preprocessing the original pest image to obtain a plurality of pest images containing a plurality of sub-regions comprises the following steps: Based on the original pest image, a set of pixel grayscale values of the original pest image is obtained; Performing dimension reduction and rounding processing on the grayscale value of each pixel in the pixel grayscale value set to obtain a pixel grayscale value set after dimension reduction; Traverse the pixel points in the grayscale value set of the pixel points after dimensionality reduction, copy the pixel points with equal grayscale values to the newly created image, and obtain multiple separated images with different grayscale values; Extract the contour information of each separated image to form a contour set, and obtain the area of each contour, and remove the corresponding contours in the contour set whose contour area is less than a preset contour area threshold to obtain a new contour set; Perform hole identification on each contour in the new contour set to form a hole set, obtain the area of each hole, and fill the holes in the hole set whose area is smaller than a preset contour area threshold to form a first contour set; Mapping the first contour in the first contour set onto the original pest image, and cutting out the first contour area to obtain a plurality of pest images including a plurality of sub-areas; The dimension reduction and rounding process are expressed as follows: in, Represents the gray value of the pixel in the gray value set of the pixel after dimensionality reduction, Represents the coordinate data of the pixel point. Indicates the preset grayscale value width, Represents the gray value of a pixel in a pixel gray value set. Represents the floor function.
3. The image processing method for intelligent pest trapping according to claim 1, characterized in that: The method of performing binarization processing on each pest image containing multiple sub-regions to obtain a binarized image comprises the following steps: Based on each pest image containing multiple sub-regions, a pixel value set of each sub-region is obtained, and then a pixel value threshold of each sub-region is obtained; Based on the pixel value threshold of each sub-region, each sub-region is binarized to obtain multiple binarized region images; Fusing multiple binary region images to obtain a binary image; The pixel value threshold of each sub-region is expressed as follows: in, Indicates The pixel value threshold of the sub-region, Indicates The mean pixel value of the sub-regions, , Indicates The standard deviation of the pixel values in each sub-region is , Indicates The total number of pixels in each sub-region, Indicates The sub-region The pixel value of a pixel, Indicates the number of sub-regions, Indicates the number of pixels.
4. The image processing method for intelligent pest trapping according to claim 1, characterized in that: The method of determining whether there is a non-targeted pest area, and if so, removing the non-targeted pest area to obtain a first targeted pest image, comprises the following steps: Extract the contour information of the binary image, form a binary contour set, and obtain the area of each binary contour; If the binarized contour area is smaller than the contour of the preset target pest area threshold, the corresponding contour area is filled based on the background color of the original pest image to remove the non-target pest area and obtain the first targeted pest image.
5. The image processing method for intelligent pest trapping according to claim 1, characterized in that: The method of obtaining a plurality of edge contour pixel point sets based on the first targeted pest image, identifying the dark side area and the bright side area of the water drop area based on the brightness distribution of the pixels in each edge contour pixel point set, and obtaining the dark side area pixel point set and the bright side area pixel point set of the water drop area includes the following steps: Performing image enhancement processing on the first targeted pest image to obtain a second targeted pest image, wherein the image enhancement processing includes at least one or more of contrast enhancement, highlight area enhancement, and dark area darkening; Performing median filtering on the second targeted pest image to obtain a third targeted pest image; Performing edge detection on the third targeted pest image to obtain a background pixel point set and a plurality of edge contour pixel point sets; The brightness values of all pixels in the background pixel set are averaged to obtain the background brightness value; Based on the brightness value distribution of the pixel points in each edge contour pixel point set, a plurality of edge contour average brightness values are obtained; If the average brightness value of the edge contour is greater than the background brightness value, the corresponding edge contour pixel point set is the bright area pixel point set, and the other edge contour pixel point sets are the dark area pixel point sets.
6. The image processing method of intelligent pest trapping according to claim 1, characterized in that: The method of obtaining the nearest background pixel point of the non-water droplet area based on the dark area pixel point set, adjusting the pixel points in the dark area pixel point set based on the nearest background pixel point, and obtaining a first targeted pest image after the dark area is processed includes the following steps: Based on the dark area pixel set, the nearest background pixel of each pixel is obtained; Obtaining the RGB value of each pixel in the first targeted pest image, obtaining the brightness value, saturation value and hue value of the corresponding pixel in the HSV space, and then obtaining a first HSV component set; Extract the brightness value and saturation value of the nearest background pixel in the first HSV component set to obtain the brightness value and saturation value of the nearest background pixel of each pixel; Based on the brightness value and saturation value of the nearest background pixel of each pixel, the hue value, saturation value and brightness value of the pixel in the first HSV component set are adjusted to obtain a second HSV component set; Based on the hue value, saturation value and brightness value of each pixel in the second HSV component set, the RGB value of the corresponding pixel is obtained, and then the second RGB set is obtained, and then the first targeted pest image after dark area processing is obtained.
7. The image processing method of intelligent pest trapping according to claim 6, characterized in that: The brightness value, saturation value and hue value of the pixel points of the first HSV component set are respectively expressed as follows: The hue value, saturation value and brightness value of the pixel points of the second HSV component set are respectively expressed as follows: in, Represents the coordinate data of the pixel point. , and Respectively represent the brightness value, saturation value and hue value of the pixel points of the first HSV component set, , and Respectively represent the R channel intensity value, G channel intensity value and B channel intensity value of the pixel point of the first RGB set, , and Respectively represent the hue value, saturation value and brightness value of the pixel point of the second HSV component set, and Respectively represent the saturation value and brightness value of the nearest background pixel, and Both represent adjustment factors.
8. The image processing method of intelligent pest trapping according to claim 6, characterized in that: The method of obtaining the nearest background pixel of each pixel based on the dark area pixel set comprises the following steps: Taking a pixel point in the dark area pixel point set as a central pixel point, obtaining all pixel points within a preset neighborhood range of the central pixel point, and obtaining a first neighborhood pixel point set; Eliminate the pixels belonging to the dark area pixel set or the bright area pixel set in the first neighborhood pixel set to obtain a second neighborhood pixel set; Initialize the distance value between the central pixel and the background pixels of the central pixel to a preset distance threshold; Obtain the Euclidean distance between the central pixel and each pixel in the second neighborhood pixel set, and then obtain the minimum Euclidean distance; If the minimum Euclidean distance is less than the preset distance threshold, the pixel corresponding to the minimum Euclidean distance is the nearest background pixel of the center pixel; The central pixel is removed from the dark area pixel set, and the dark area pixel set is updated, and the nearest background pixel of each pixel in the dark area pixel set is obtained iteratively.
9. The image processing method for intelligent pest trapping according to claim 1, characterized in that: The method of determining edge pixel points of the bright surface area based on the bright surface area pixel point set, determining a baseline through two edge pixel points, and performing linear interpolation adjustment on the pixel points on the baseline to obtain a first targeted pest image after bright surface area processing includes the following steps: Based on the bright surface area pixel point set, the edge of each bright surface area is extracted to obtain multiple bright surface area edge pixel point sets; The pixel point with the smallest horizontal coordinate value in the target bright surface area edge pixel point set is obtained as the first end pixel point; Based on the target bright surface area edge pixel point set, a pixel point having the same horizontal coordinate value as the first end pixel point is obtained as the second end pixel point, and a line connecting the first end pixel point and the second end pixel point is the baseline of the target bright surface area, thereby obtaining a first baseline pixel point set; Based on the RGB value of the first end pixel point and the RGB value of the second end pixel point, linear interpolation adjustment is performed on the RGB values of the pixel points in the first baseline pixel point set to obtain a second baseline pixel point set; The pixel points in the edge pixel point set of each bright surface area are traversed, and the pixel points in each bright surface area are adjusted based on the baseline to obtain a first targeted pest image after the bright surface area is processed.
10. The image processing method of intelligent pest trapping according to claim 9, characterized in that: The R channel intensity value, the G channel intensity value, and the B channel intensity value of the pixel point in the second baseline pixel point set are respectively expressed as follows: in, , and They respectively represent the R channel intensity value, G channel intensity value and B channel intensity value of the pixel points in the second baseline pixel point set, , and Respectively represent the R channel intensity value, G channel intensity value and B channel intensity value of the first end pixel point, , and Respectively represent the R channel intensity value, G channel intensity value and B channel intensity value of the second end pixel point, Indicates the first pixel point on the baseline in the direction from the first end pixel point to the second end pixel point. pixels, Indicates the number of pixels on the baseline except the first end pixel and the second end pixel. , Indicates the horizontal coordinate value of the second end pixel, Indicates the horizontal coordinate value of the first end pixel, Indicates rounding down.
11. An intelligent pest-luring image processing system, characterized in that: It includes a pre-processing module, a binarization module, a water drop bright side and dark side acquisition module, a water drop dark side adjustment module and a water drop bright side adjustment module; The preprocessing module obtains an original pest image, preprocesses the original pest image, and obtains a plurality of pest images containing a plurality of sub-regions, wherein the original pest image at least includes a pest region and a water drop region, and the preprocessing at least includes dimensionality reduction, padding, and cropping; The binarization module performs binarization processing on each pest image containing multiple sub-regions to obtain a binarized image, determines whether there is a non-targeted pest region, and if so, removes the non-targeted pest region to obtain a first targeted pest image; The water drop bright and dark side acquisition module obtains a plurality of edge contour pixel point sets based on the first targeted pest image, identifies the dark side area and the bright side area of the water drop area based on the brightness distribution of the pixels in each edge contour pixel point set, and obtains the dark side area pixel point set and the bright side area pixel point set of the water drop area; The water drop dark side adjustment module obtains the nearest background pixel point of the non-water drop area from the dark side area pixel point set, and adjusts the pixel points in the dark side area pixel point set based on the nearest background pixel point to obtain a first targeted pest image after the dark side area is processed; The water drop bright surface adjustment module determines the edge pixel points of the bright surface area based on the bright surface area pixel point set, determines the baseline through the edge pixel points in pairs, and performs linear interpolation adjustment on the pixel points on the baseline to obtain the first targeted pest image after the bright surface area processing, wherein the first targeted pest image after the dark surface area processing and the bright surface area processing is the final targeted pest image.
12. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
13. An intelligent image processing device for attracting pests, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Method for identifying and counting farmland pests based on colors and models
CN102930249A
Color and feature-based pest identifying and counting method
CN106373136A
Targeted pesticide spraying method based on convolutional neural network
CN108734277A
Color image preprocessing method for identifying and counting rice diseases and insect pests
CN109872301A
Grain surface pest quantity determination method and device, electronic equipment and storage medium
CN113222894A