CN109389139A - A kind of locust method of counting and device - Google Patents

A kind of locust method of counting and device Download PDF

Info

Publication number
CN109389139A
CN109389139A CN201710686810.0A CN201710686810A CN109389139A CN 109389139 A CN109389139 A CN 109389139A CN 201710686810 A CN201710686810 A CN 201710686810A CN 109389139 A CN109389139 A CN 109389139A
Authority
CN
China
Prior art keywords
locust
area
region
image
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710686810.0A
Other languages
Chinese (zh)
Inventor
李林
彭帆
顾进锋
陆书涵
刘晓雪
柏雪松
郑海宁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Agricultural University
Original Assignee
China Agricultural University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Agricultural University filed Critical China Agricultural University
Priority to CN201710686810.0A priority Critical patent/CN109389139A/en
Publication of CN109389139A publication Critical patent/CN109389139A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

The present invention provides a kind of locust method of counting and device, the method comprise the steps that S1, clusters locust image using Meanshift algorithm, carries out binary conversion treatment to the locust image after cluster, obtains the target connected region in the locust image;S2 judges that each target connected region is monomer region or adhesion region, is split to the adhesion region;The number of the monomer region is added with the areal after the adhesion region segmentation, obtains the number of locust in the locust image by S3.The present invention has the automatic counting for realizing locust, and the beneficial effect that the accuracy counted is high.

Description

Locust counting method and device
Technical Field
The invention relates to the field of image processing application, in particular to a locust counting method and device.
Background
The locust is a worldwide pest, 16 provincial and urban areas are involved in the locusta migratoria generation area of China at present, nearly 200 counties are reached, wherein the number of the counties is 100, and the generation area of the locusta migratoria in summer and autumn reaches 2500-3000 ten thousand mu; the acridid occurring area relates to more than 20 provinces, reaches nearly 500 counties, and is over 2 hundred million acres in 200 counties in severe occurring areas. In recent years, the occurrence frequency of locusts is increased, and the harm degree is increased.
Aiming at different degrees of locust plague, locust control stations need to mobilize locust control resources of different levels, and if excessive resources are mobilized, resource waste is caused. Therefore, it is important to improve the accuracy of estimation of the degree of locust plague. Estimation of the degree of locust plague is generally performed by locust density. In the traditional method, the number of the locusts needs to be manually acquired, the density of the locusts is acquired according to the number of the locusts, and the efficiency is very low. At present, some methods acquire the number of locusts through a locust image, but only simply use an algorithm to segment the locust image, count the locusts according to the segmented number, and the accuracy of the counting result is low.
Disclosure of Invention
In order to overcome the problems of low efficiency and accuracy of locust counting or at least partially solve the problems, the invention provides a locust counting method and a device.
According to a first aspect of the present invention, there is provided a locust counting method comprising:
s1, clustering the locust images by using a Meanshift algorithm, and carrying out binarization processing on the clustered locust images to obtain each target communication area in the locust images;
s2, judging whether each target connected area is a monomer area or an adhesion area, and dividing the adhesion area;
and S3, adding the number of the monomer areas and the number of the areas obtained by dividing the adhesion areas to obtain the number of the locust in the locust image.
Specifically, before the step S1, the method further includes:
acquiring an original locust image by using an image acquisition device loaded with a filter plate;
and preprocessing the original locust image by using a median filtering algorithm.
Specifically, the step S1 of performing binarization processing on the clustered locust image to obtain each target connected region in the locust image specifically includes:
converting the clustered locust image into a gray image, and acquiring a histogram of the gray image;
selecting a gray value of a valley bottom position between two peaks of the histogram as a gray threshold value, and carrying out thresholding processing on the gray image according to the gray threshold value;
and acquiring each target connected region in the locust image according to the thresholding result.
Specifically, the steps S1 and S2 further include:
and carrying out corrosion or expansion treatment on each target communication area.
Specifically, the step of determining whether each target connected region is a monomer region or a blocking region in step S2 specifically includes:
acquiring the shape factor of each target communication region according to the area and the perimeter of each target communication region;
acquiring a shape factor threshold according to the shape factor of each target connected region;
and judging whether each target communication area is a monomer area or an adhesion area according to the shape factor threshold and a preset area threshold.
Specifically, the shape factor SF of each target connected region is obtained by the following formula:
wherein A represents the area of the target connected region and C represents the perimeter of the target connected region.
Specifically, the step of determining whether each target connected region is a monomer region or a bonded region according to the shape factor threshold and a preset area threshold specifically includes:
when the shape factor of the target connected region is larger than the shape factor threshold value and the area of the target connected region is smaller than the preset area threshold value, the target connected region is a single region;
and when the shape factor of the target connected region is smaller than or equal to the shape factor threshold and the area of the target connected region is larger than or equal to the preset area threshold, the target connected region is an adhesion region.
Specifically, the step of dividing the adhesion area in step S2 specifically includes:
s21, for each sticky area, selecting a pixel from the sticky area as a seed pixel, and taking the seed as a new area;
s22, calculating gray level difference values between the seed pixel and the neighborhoods of the seed pixel, and merging the neighborhoods corresponding to the gray level difference values smaller than a preset difference threshold value into a new region where the selected seed pixel is located as the seed pixel;
s23, iteratively executing the step S22 until, for each seed pixel, the gray difference value between the seed pixel and each neighborhood of the seed pixel is greater than or equal to the preset difference threshold value;
s24, for the remaining pixels in the blocking region, steps S21-S23 are iteratively performed until each pixel in the blocking region is divided into a new region.
According to a second aspect of the present invention, there is provided a locust counting apparatus comprising:
the acquisition unit is used for clustering the locust images by using a Meanshift algorithm, carrying out binarization processing on the clustered locust images and acquiring each target communication area in the locust images;
the dividing unit is used for judging whether each target communicating area is a monomer area or an adhesion area and dividing each adhesion area;
and the counting unit is used for adding the number of the monomer areas and the number of the areas obtained after the adhesion areas are divided to obtain the number of the locusts in the locust image.
According to a third aspect of the invention, there is provided a non-transitory computer readable storage medium storing a computer program of the method as described above.
The invention provides a locust counting method and a device, the method clusters locust through a Meanshift algorithm, binarizes the clustered locust to obtain target connected regions, divides the adhesion regions by judging whether each target connected region is a monomer region or an adhesion region, adds the numbers of the monomer regions and the divided regions of each adhesion region to obtain the number of the locust in a locust image, thereby realizing automatic counting of the locust and having high counting accuracy. The counting result of the locust can be used for estimating the density of the locust, so that the severity of the locust plague can be detected, and help is provided for prevention and treatment of the locust.
Drawings
FIG. 1 is a schematic overall flow chart of a locust counting method provided in an embodiment of the present invention;
FIG. 2 is a schematic view of the overall structure of a locust counting apparatus according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a locust counting apparatus provided in the embodiment of the present invention.
Detailed Description
The following detailed description of embodiments of the present invention is provided in connection with the accompanying drawings and examples. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
In one embodiment of the present invention, a locust counting method is provided, and fig. 1 is a schematic flow chart of the whole locust counting method provided in the embodiment of the present invention. In general, the method comprises: s1, clustering the locust images by using a Meanshift algorithm, and carrying out binarization processing on the clustered locust images to obtain each target communication area in the locust images; s2, judging whether each target connected area is a monomer area or an adhesion area, and dividing the adhesion area; and S3, adding the number of the monomer areas and the number of the areas obtained by dividing the adhesion areas to obtain the number of the locust in the locust image.
Specifically, in S1, the Meanshift algorithm is an iterative algorithm, that is, the mean shift value of the current point is calculated first, and then the mean shift value is used as a new starting point to continue moving until a preset constraint condition is satisfied. Clustering the locust images by using the Meanshift algorithm, and combining pixels with similar colors and distances in the locust images into one region, so as to divide the locust images into a plurality of connected regions. And carrying out binarization processing on the clustered locust image, namely converting the locust image into two characteristics of black and white, wherein one characteristic is a background, the other characteristic is a target, so that the target and the background in the locust image are distinguished, and a communication area corresponding to the target is used as a target communication area. The target is locust. And S2, judging whether each target communication area is a single area or an adhesion area, wherein the single area contains a single locust, and the adhesion area contains a plurality of locusts. And dividing the adhesion area, and dividing each adhesion area into a plurality of areas, wherein each divided area contains a single locust. The blocking region may be segmented using a region growing algorithm, but the embodiment is not limited to such a segmentation algorithm. And S3, adding the number of the monomer areas and the number of the areas obtained by dividing each adhesion area, wherein the total sum is the number of the locust in the locust image. The monomer area and the divided areas of the adhesion areas can be marked, and the number of the marks is counted to be the number of the locusts in the locust image.
The locust is clustered through a Meanshift algorithm, the clustered locust is subjected to binarization, so that a target communication area is obtained, each target communication area is judged to be a monomer area or an adhesion area, the adhesion areas are divided, the number of the monomer areas and the number of the areas divided by the adhesion areas are added, the number of the locust in a locust image is obtained, the automatic counting of the locust is achieved, and the counting accuracy is high. The counting result of the locust can be used for estimating the density of the locust, so that the severity of the locust plague can be detected, and help is provided for prevention and treatment of the locust.
On the basis of the foregoing embodiment, in this embodiment, before the step S1, the method further includes: acquiring an original locust image by using an image acquisition device loaded with a filter plate; and preprocessing the original locust image by using a median filtering algorithm.
Specifically, the original locust image can be obtained in the field or in an experimental environment. When acquiring under an experimental environment, the experimental material is prepared, the experimental environment is configured, parameters of the image acquisition apparatus are set, for example, the exposure time of the image acquisition apparatus is 30s, the aperture is adjusted to the maximum, and the like. The image capturing device may be a camera, a mobile phone, a camera, etc., but the embodiment is not limited to these image capturing devices. The image acquisition device is loaded with filters, the filters of the appropriate band being selected so that the difference between the background and the target is as large as possible, for example filters of 763nm band. The original locust image obtained through the filter plate is a single-band image, due to the fact that illumination is uneven, the gray value of a background boundary in the original locust image is close to the gray value of a locust target area, and the effect of subsequent processing is affected, before the original locust image is processed, median filtering is conducted on the gray image of the original locust image, local gray noise is suppressed, the accuracy of image segmentation is improved, and therefore the accuracy of locust counting is improved.
On the basis of any one of the foregoing embodiments, in this embodiment, the step of performing binarization processing on the clustered locust image in step S1 to obtain each target connected region in the locust image specifically includes: converting the clustered locust image into a gray image, and acquiring a histogram of the gray image; selecting a gray value of a valley bottom position between two peaks of the histogram as a gray threshold value, and carrying out thresholding processing on the gray image according to the gray threshold value; and acquiring each target connected region in the locust image according to the thresholding result.
Specifically, the locust image obtained by the filter plate is a waveband image, the clustered locust image is also a waveband image, the clustered locust image is converted into a gray image, and a histogram of the gray image is obtained. And selecting the gray value of the valley bottom position between the two peaks of the histogram as a gray threshold value. Carrying out threshold processing on the clustered locust image according to the gray threshold, wherein the threshold processing function is as follows:
wherein (x, y) is the position of each pixel in the grayscale image, g (x, y) is the grayscale value after thresholding of each pixel in the grayscale image, f (x, y) is the grayscale value of each pixel in the grayscale image, and T is the grayscale threshold. And distinguishing the foreground and the target in the gray image according to the thresholding result so as to obtain a target connected region in the locust image.
The embodiment acquires the target communication region in the locust image by carrying out binarization processing on the clustered locust image, thereby accurately distinguishing the foreground and the target in the locust image and improving the accuracy of locust counting.
On the basis of any of the above embodiments, in this embodiment, the step between S1 and S2 further includes: and carrying out corrosion or expansion treatment on each target communication area.
Specifically, by carrying out corrosion or expansion treatment on the target connected region, fine noise on an image can be eliminated, the image boundary is smoothed, and the target connected region in the locust image is obtained more accurately, so that the accuracy of locust counting is improved.
On the basis of any of the foregoing embodiments, the step of determining whether each target connected region is a monomer region or a bonded region in step S2 in this embodiment specifically includes: acquiring the shape factor of each target communication region according to the area and the perimeter of each target communication region; acquiring a shape factor threshold according to the shape factor of each target connected region; and judging whether each target communication area is a monomer area or an adhesion area according to the shape factor threshold and a preset area threshold.
Specifically, the area and the perimeter of each target connected region are obtained, and the shape factor of each target connected region is obtained according to the area and the perimeter of each target connected region, wherein the shape factor is used for describing the shape of each target connected region. And acquiring a shape factor threshold value according to the difference between the shape factors of the monomer area and the adhesion area. The shape factor threshold is used to compare with the shape factor of each connected region to distinguish between a monomer region and an adhesion region. The preset area threshold is preset and is used for comparing the preset area threshold with the area of each communication area so as to distinguish the monomer area from the adhesion area. And judging whether each target communication area is a monomer area or an adhesion area according to the shape factor threshold and the preset area threshold.
In the embodiment, the shape factor threshold and the preset area threshold are used for judging whether each target communication area is a monomer area or an adhesion area, so that the monomer area and the adhesion area are accurately distinguished, and the accuracy of locust counting is improved.
On the basis of the above embodiment, the shape factor SF of each target connected component in this embodiment is obtained by the following formula:
wherein A represents the area of the target connected region and C represents the perimeter of the target connected region.
On the basis of the foregoing embodiment, in this embodiment, the step of determining whether each target connected region is a monomer region or a bonded region according to the shape factor threshold and the preset area threshold specifically includes: when the shape factor of the target connected region is larger than the shape factor threshold value and the area of the target connected region is smaller than the preset area threshold value, the target connected region is a single region; and when the shape factor of the target connected region is smaller than or equal to the shape factor threshold and the area of the target connected region is larger than or equal to the preset area threshold, the target connected region is an adhesion region.
On the basis of the foregoing embodiment, in this embodiment, the step of dividing the adhesion area in step S2 specifically includes: the step of dividing the adhesion area in step S2 specifically includes: s21, for each sticky area, selecting a pixel from the sticky area as a seed pixel, and taking the seed as a new area; s22, calculating gray level difference values between the seed pixel and the neighborhoods of the seed pixel, and merging the neighborhoods corresponding to the gray level difference values smaller than a preset difference threshold value into a new region where the selected seed pixel is located as the seed pixel; s23, iteratively executing the step S22 until, for each seed pixel, the gray difference value between the seed pixel and each neighborhood of the seed pixel is greater than or equal to the preset difference threshold value; s24, for the remaining pixels in the blocking region, steps S21-S23 are iteratively performed until each pixel in the blocking region is divided into a new region.
Specifically, after judging whether each target connected region is a monomer region or a bonding region, the bonding region in the judgment result is divided. In this embodiment, a region growing algorithm is used for segmentation. Specifically, for each stuck region, one pixel is selected from the stuck region as a seed pixel. And taking the seed pixel as a new area. And calculating the gray level difference value between the seed pixel and each neighborhood of the seed pixel, and merging the neighborhood corresponding to the gray level difference value smaller than a preset difference threshold value into the new region as the seed pixel. The neighborhood of the seed pixel may be a four neighborhood or an eight neighborhood. The preset difference threshold is preset and is used for comparing with each gray difference value to obtain a new seed pixel. And iteratively executing the step of obtaining the seed pixels according to the gray difference value until the gray difference value between each seed pixel and each neighborhood of the seed pixel is greater than or equal to the preset difference threshold value for each seed pixel. And acquiring a new seed pixel in each iteration, and stopping the iteration until the new seed pixel is not acquired any more. Thereby merging the pixels with similar characteristics and close distance with the selected seed pixel into the area where the selected seed pixel is located. The above operations of selecting seeds and merging are continued for the remaining pixels in the stuck region until all the seeds are divided into new regions. And taking the selected seeds as different new regions, wherein the times of selecting the seeds are the number of the segmented regions.
In the embodiment, the adhesion area in the judgment result is divided by using the area growing algorithm, the divided area contains a single target, and the locust is counted according to the divided result, so that the accuracy of the technology is improved.
In another embodiment of the present invention, a locust counting device is provided, and fig. 2 is a schematic view of an overall structure of the locust counting device provided in the embodiment of the present invention. In general, the apparatus comprises an acquisition unit 1, a segmentation unit 2 and a counting unit 3, wherein:
the acquisition unit 1 is used for clustering locust images by using a Meanshift algorithm, carrying out binarization processing on the clustered locust images and acquiring each target communication area in the locust images; the dividing unit 2 is configured to determine whether each target connected region is a monomer region or an adhesion region, and divide each adhesion region; the counting unit 3 is used for adding the number of the monomer areas and the number of the areas obtained after the adhesion areas are divided, and obtaining the number of the locust in the locust image.
Specifically, the Meanshift algorithm is an iterative algorithm, that is, the mean shift value of the current point is calculated first, and then the mean shift value is used as a new starting point to move continuously until a preset constraint condition is met. The acquisition unit 1 uses the Meanshift algorithm to cluster locust images, and combines pixels with similar colors and distances in the locust images into one region, so that the locust images are divided into a plurality of connected regions. The obtaining unit 1 performs binarization processing on the clustered locust images, namely, the locust images are converted into two characteristics of black and white, wherein one characteristic is a background, the other characteristic is a target, so that the target and the background in the locust images are distinguished, and a communication area corresponding to the target is used as a target communication area. The target is locust. The dividing unit 2 judges whether each target communicating area is a monomer area or an adhesion area, the monomer area contains a single locust, and the adhesion area contains a plurality of locusts. The dividing unit 2 divides the adhesion area, and divides each adhesion area into a plurality of areas, wherein each divided area contains a single locust. The blocking region may be segmented using a region growing algorithm, but the embodiment is not limited to such a segmentation algorithm. The counting unit 3 adds the number of the monomer areas and the number of the areas obtained by dividing each adhesion area, and the total sum is the number of the locust in the locust image. The monomer area and the divided areas of the adhesion areas can be marked, and the number of the marks is counted to be the number of the locusts in the locust image.
The locust is clustered through a Meanshift algorithm, the clustered locust is subjected to binarization, so that a target communication area is obtained, each target communication area is judged to be a monomer area or an adhesion area, the adhesion areas are divided, the number of the monomer areas and the number of the areas divided by the adhesion areas are added, the number of the locust in a locust image is obtained, the automatic counting of the locust is achieved, and the counting accuracy is high.
On the basis of the above embodiment, the apparatus in this embodiment further includes a preprocessing unit, configured to acquire an original locust image using an image acquisition device loaded with a filter; and preprocessing the original locust image by using a median filtering algorithm.
On the basis of the foregoing embodiment, in this embodiment, the obtaining unit is specifically configured to: converting the clustered locust image into a gray image, and acquiring a histogram of the gray image; selecting a gray value of a valley bottom position between two peaks of the histogram as a gray threshold value, and carrying out thresholding processing on the gray image according to the gray threshold value; and acquiring a target connected region in the locust image according to the thresholding result.
On the basis of the above embodiment, the apparatus in this embodiment further includes an optimization unit, configured to perform erosion or expansion treatment on the target connected region.
On the basis of the foregoing embodiment, in this embodiment, the dividing unit is specifically configured to: acquiring the shape factor of each target communication region according to the area and the perimeter of each target communication region; acquiring a shape factor threshold according to the shape factor of each target connected region; and judging whether each target communication area is a monomer area or an adhesion area according to the shape factor threshold and a preset area threshold.
On the basis of the above embodiment, the shape factor SF of each target connected component in this embodiment is obtained by the following formula:
wherein A represents the area of the target connected region and C represents the perimeter of the target connected region.
On the basis of the foregoing embodiment, in this embodiment, the dividing unit is further specifically configured to: when the shape factor of the target connected region is larger than the shape factor threshold value and the area of the target connected region is smaller than the preset area threshold value, the target connected region is a single region; and when the shape factor of the target connected region is smaller than or equal to the shape factor threshold and the area of the target connected region is larger than or equal to the preset area threshold, the target connected region is an adhesion region.
On the basis of the foregoing embodiment, in this embodiment, the dividing unit is specifically configured to: the step of dividing the adhesion area in step S2 specifically includes: for each adhesion area, selecting a pixel from the adhesion area as a seed pixel, and taking the seed as a new area; calculating gray level difference values between the seed pixel and each neighborhood of the seed pixel, and merging the neighborhood corresponding to the gray level difference value smaller than a preset difference value threshold value into a new region where the selected seed pixel is located as the seed pixel; iteratively executing the step of combining according to the gray difference until, for each seed pixel, the gray difference between the seed pixel and each neighborhood of the seed pixel is greater than or equal to the preset difference threshold; and for the remaining pixels in the adhesion area, iteratively selecting seeds and combining according to the gray difference until each pixel in the adhesion area is divided into a new area.
The present embodiment provides a locust counting apparatus, and fig. 3 is a schematic structural diagram of the locust counting apparatus provided in the embodiment of the present invention, the apparatus includes: at least one processor 31, at least one memory 32, and a bus 33; wherein,
the processor 31 and the memory 32 complete mutual communication through the bus 33;
the memory 32 stores program instructions executable by the processor 31, and the processor calls the program instructions to execute the methods provided by the method embodiments, for example, the method includes: s1, clustering the locust images by using a Meanshift algorithm, and carrying out binarization processing on the clustered locust images to obtain each target communication area in the locust images; s2, judging whether each target connected area is a monomer area or an adhesion area, and dividing the adhesion area; and S3, adding the number of the monomer areas and the number of the areas obtained by dividing the adhesion areas to obtain the number of the locust in the locust image.
The present embodiments provide a non-transitory computer-readable storage medium storing computer instructions that cause the computer to perform the methods provided by the above method embodiments, for example, including: s1, clustering the locust images by using a Meanshift algorithm, and carrying out binarization processing on the clustered locust images to obtain each target communication area in the locust images; s2, judging whether each target connected area is a monomer area or an adhesion area, and dividing the adhesion area; and S3, adding the number of the monomer areas and the number of the areas obtained by dividing the adhesion areas to obtain the number of the locust in the locust image.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The locust counting apparatus embodiments described above are merely illustrative, wherein the units illustrated as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, i.e. may be located in one place, or may also be distributed over a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, the method of the present application is only a preferred embodiment and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A locust counting method, comprising:
s1, clustering the locust images by using a Meanshift algorithm, and carrying out binarization processing on the clustered locust images to obtain each target communication area in the locust images;
s2, judging whether each target connected area is a monomer area or an adhesion area, and dividing the adhesion area;
and S3, adding the number of the monomer areas and the number of the areas obtained by dividing the adhesion areas to obtain the number of the locust in the locust image.
2. The locust counting method according to claim 1, further comprising before said step S1:
acquiring an original locust image by using an image acquisition device loaded with a filter plate;
and preprocessing the original locust image by using a median filtering algorithm.
3. The locust counting method according to claim 1 or 2, wherein the step of binarizing the clustered locust images in step S1 to obtain each target connected region in the locust images specifically comprises:
converting the clustered locust image into a gray image, and acquiring a histogram of the gray image;
selecting a gray value of a valley bottom position between two peaks of the histogram as a gray threshold value, and carrying out thresholding processing on the gray image according to the gray threshold value;
and acquiring each target connected region in the locust image according to the thresholding result.
4. The locust counting method according to claim 1 or 2, further comprising between the steps S1 and S2:
and carrying out corrosion or expansion treatment on each target communication area.
5. The locust counting method according to claim 1 or 2, wherein the step of determining whether each target connected area is a monomer area or an adhesion area in step S2 specifically comprises:
acquiring the shape factor of each target communication region according to the area and the perimeter of each target communication region;
acquiring a shape factor threshold according to the shape factor of each target connected region;
and judging whether each target communication area is a monomer area or an adhesion area according to the shape factor threshold and a preset area threshold.
6. The locust counting method of claim 5, wherein the shape factor SF of each target connectivity domain is obtained by:
wherein A represents the area of the target connected region and C represents the perimeter of the target connected region.
7. The locust counting method according to claim 5, wherein the step of determining whether each target connected area is a monomer area or an adhesion area according to the shape factor threshold and a preset area threshold specifically comprises:
when the shape factor of the target connected region is larger than the shape factor threshold value and the area of the target connected region is smaller than the preset area threshold value, the target connected region is a single region;
and when the shape factor of the target connected region is smaller than or equal to the shape factor threshold and the area of the target connected region is larger than or equal to the preset area threshold, the target connected region is an adhesion region.
8. The locust counting method according to claim 1 or 2, wherein the step of dividing the adherent region in step S2 specifically comprises:
s21, for each sticky area, selecting a pixel from the sticky area as a seed pixel, and taking the seed as a new area;
s22, calculating gray level difference values between the seed pixel and the neighborhoods of the seed pixel, and merging the neighborhoods corresponding to the gray level difference values smaller than a preset difference threshold value into a new region where the selected seed pixel is located as the seed pixel;
s23, iteratively executing the step S22 until, for each seed pixel, the gray difference value between the seed pixel and each neighborhood of the seed pixel is greater than or equal to the preset difference threshold value;
s24, for the remaining pixels in the blocking region, steps S21-S23 are iteratively performed until each pixel in the blocking region is divided into a new region.
9. A locust counting device, comprising:
the acquisition unit is used for clustering locust images by using a Meanshift algorithm, carrying out binarization processing on the clustered locust images and acquiring a target communication area in the locust images;
the dividing unit is used for judging whether each target communicating area is a monomer area or an adhesion area and dividing each adhesion area;
and the counting unit is used for adding the number of the monomer areas and the number of the areas obtained after the adhesion areas are divided to obtain the number of the locusts in the locust image.
10. A non-transitory computer-readable storage medium storing computer instructions that cause a computer to perform the method of any one of claims 1 to 8.
CN201710686810.0A 2017-08-11 2017-08-11 A kind of locust method of counting and device Pending CN109389139A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710686810.0A CN109389139A (en) 2017-08-11 2017-08-11 A kind of locust method of counting and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710686810.0A CN109389139A (en) 2017-08-11 2017-08-11 A kind of locust method of counting and device

Publications (1)

Publication Number Publication Date
CN109389139A true CN109389139A (en) 2019-02-26

Family

ID=65413948

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710686810.0A Pending CN109389139A (en) 2017-08-11 2017-08-11 A kind of locust method of counting and device

Country Status (1)

Country Link
CN (1) CN109389139A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111178354A (en) * 2019-12-23 2020-05-19 深圳市铁汉生态环境股份有限公司 Mangrove pest monitoring method and system
CN111209824A (en) * 2019-12-30 2020-05-29 江苏省血吸虫病防治研究所 Method for monitoring ampullaria gigas by using unmanned aerial vehicle
CN111696127A (en) * 2020-06-02 2020-09-22 中国联合网络通信集团有限公司 Locust plague analysis and early warning system and method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101777124A (en) * 2010-01-29 2010-07-14 北京新岸线网络技术有限公司 Method for extracting video text message and device thereof
JP2011212307A (en) * 2010-03-31 2011-10-27 Shiseido Co Ltd Cosmetic-applied skin evaluation device, cosmetic-applied skin evaluation method, and cosmetic-applied skin evaluation program
CN104484877A (en) * 2014-12-12 2015-04-01 山东大学 AML cell segmentation method based on Meanshift cluster and morphological operations
CN105095958A (en) * 2014-05-12 2015-11-25 浙江理工大学 Cocoon counting method
CN106447672A (en) * 2016-09-14 2017-02-22 燕山大学 Identifying and counting method for intersecting and shielded fish

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101777124A (en) * 2010-01-29 2010-07-14 北京新岸线网络技术有限公司 Method for extracting video text message and device thereof
JP2011212307A (en) * 2010-03-31 2011-10-27 Shiseido Co Ltd Cosmetic-applied skin evaluation device, cosmetic-applied skin evaluation method, and cosmetic-applied skin evaluation program
CN105095958A (en) * 2014-05-12 2015-11-25 浙江理工大学 Cocoon counting method
CN104484877A (en) * 2014-12-12 2015-04-01 山东大学 AML cell segmentation method based on Meanshift cluster and morphological operations
CN106447672A (en) * 2016-09-14 2017-02-22 燕山大学 Identifying and counting method for intersecting and shielded fish

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
BYOUYO: "灰度图像二值化阈值选取常用方法", 《HTTPS://WENKU.BAIDU.COM/VIEW/52C113650B1C59EEF8C7B4F6.HTML?SXTS=1583830390201》 *
SUMMER_ZJU: "图像处理算法—区域生长法", 《HTTPS://BLOG.CSDN.NET/XIAQUNFENG123/ARTICLE/DETAILS/16971913》 *
李文勇 等: "基于形状因子和分割点定位的粘连害虫图像分割方法", 《农业工程学报》 *
高宏伟 等: "《电子制造装备技术》", 30 September 2015 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111178354A (en) * 2019-12-23 2020-05-19 深圳市铁汉生态环境股份有限公司 Mangrove pest monitoring method and system
CN111178354B (en) * 2019-12-23 2024-02-27 中节能铁汉生态环境股份有限公司 Mangrove pest monitoring method and system
CN111209824A (en) * 2019-12-30 2020-05-29 江苏省血吸虫病防治研究所 Method for monitoring ampullaria gigas by using unmanned aerial vehicle
CN111696127A (en) * 2020-06-02 2020-09-22 中国联合网络通信集团有限公司 Locust plague analysis and early warning system and method

Similar Documents

Publication Publication Date Title
JP6507846B2 (en) Image noise removing method and image noise removing apparatus
Toh et al. Cluster-based adaptive fuzzy switching median filter for universal impulse noise reduction
CN107169979A (en) A kind of method for detecting image edge of improvement Canny operators
US20120224789A1 (en) Noise suppression in low light images
CN109389139A (en) A kind of locust method of counting and device
CN104504662A (en) Homomorphic filtering based image processing method and system
KR101537295B1 (en) Component filtering for low-light noise reduction
CN104075965A (en) Method for measuring granularity of microscopic image particles segmented on basis of watershed
CN104915940A (en) Alignment-based image denoising method and system
Balovsyak et al. Automatic determination of the gaussian noise level on digital images by high-pass filtering for regions of interest
Li et al. A salt & pepper noise filter based on local and global image information
CN104715221A (en) Decoding method and system for ultra-low-contrast two-dimension code
CN113689396A (en) Cell fluorescence image thresholding method, system, terminal and storage medium
CN109636822B (en) Improved Canny self-adaptive edge extraction method based on newly-constructed membership function
CN109785356A (en) A kind of background modeling method of video image
CN104952071A (en) Maximum between-cluster variance image segmentation algorithm based on GLSC (gray-level spatial correlation)
CN111754413A (en) Image processing method, device, equipment and storage medium
Deepika et al. Extraction of river from satellite images
CN110378907B (en) Method for processing image in intelligent refrigerator, computer equipment and storage medium
KR101372507B1 (en) Apparatus and method for enhancing image using back-light region detection based variable block
KR101179500B1 (en) Adaptive noise reduction method and device
CN114596210A (en) Noise estimation method, device, terminal equipment and computer readable storage medium
CN112967321A (en) Moving object detection method and device, terminal equipment and storage medium
CN114845041B (en) Focusing method and device for nanoparticle imaging and storage medium
CN110782405B (en) Point target and dark spot image background balancing method based on gradient identification

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190226