Counting apparatus, counting method and program
The counting device addresses insect overlap issues by employing two counting processes based on occupancy rate, achieving accurate insect counts even in high-density captures.
Patent Information
- Application Number
- JP2023105065
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-06-27
- Publication Date
- 2025-01-16
Smart Images

Figure 2025005062000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a counting device, a counting method, and a program. [Background technology]
[0002] Patent Document 1 discloses counting the number of insects and discriminating the type of insects based on an image of an adhesive sheet that has captured the insects. Patent Document 1 also discloses that the image of the adhesive sheet is analyzed to extract areas that are discriminated as insects, and the number of insects is counted based on the number of extracted areas. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2012-161269 A Summary of the Invention [Problem to be solved by the invention]
[0004] When the number of insects captured on the sticky sheet increases, the likelihood that the insects will overlap increases. When the insects overlap, counting based on the number of areas identified as insects is likely to produce errors. In particular, when so many insects are captured on the sticky sheet that most of the insects overlap, the counting results based on the number of areas identified as insects become useless.
[0005] An object of the present invention is to appropriately count the number of insects according to the degree of overlap between the insects. [Means for solving the problem]
[0006] Some embodiments of the present invention are a counting device comprising an image acquisition unit that acquires images of captured insects, an occupancy calculation unit that calculates an occupancy ratio that indicates the proportion of the area in the image occupied by the insects, and a counting unit that counts the number of captured insects, wherein the counting unit performs a first counting process to count the number of insects by analyzing the image if the occupancy ratio is lower than a first threshold, and performs a second counting process to count the number of insects based on the occupancy ratio if the occupancy ratio is higher than the first threshold.
[0007] Other features of the present invention will become apparent from the following specification and drawings. Effect of the Invention
[0008] According to some embodiments of the present invention, the number of insects can be appropriately counted depending on the degree to which the insects overlap each other. [Brief description of the drawings]
[0009] [Figure 1] FIG. 1 is an explanatory diagram of an insect trapping device 1. As shown in FIG. [Diagram 2] FIG. 2 is an image of the insect trapping sheet 7 that has trapped an insect. [Diagram 3] FIG. 3 is an explanatory diagram of the binarization process. [Figure 4] FIG. 4 is an explanatory diagram of the labeling process. [Diagram 5] Fig. 5A is an image of the insect trapping sheet 7 that has captured many insects. Fig. 5B is a binary image of Fig. 5A. [Figure 6] FIG. 6 is a graph showing the measurement results of the number of insects caught on the insect-trapping sheet 7 and the proportion (occupancy) of black pixels in the binary image. [Figure 7] Figure 7 is a scatter plot of the number of captured insects and the occupancy rate. [Figure 8] FIG. 8 is an explanatory diagram showing the hardware configuration of the counting device 10. As shown in FIG. [Figure 9] FIG. 9 is a block diagram of the counting device 10. [Figure 10]FIG. 10 is a flow diagram of the first process performed by the counting device 10. [Figure 11] FIG. 11 is a flow diagram of the second process performed by the counting device 10. [Figure 12] FIG. 12 is a flow diagram of the third process performed by the counting device 10. [Figure 13] 13A and 13B show an unprocessed image and a binary image in the case where the occupancy rate R is higher than the first threshold T1 and lower than the second threshold T2. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0010] At least the following aspects will become apparent from the following description and drawings.
[0011] A first aspect of the present invention is a counting device that includes an image acquisition unit that acquires an image of the captured insects, an occupancy calculation unit that calculates an occupancy ratio that indicates the proportion of the area in the image that the insects occupy, and a counting unit that counts the number of captured insects, wherein the counting unit performs a first counting process to count the number of insects by analyzing the image if the occupancy ratio is lower than a first threshold, and performs a second counting process to count the number of insects based on the occupancy ratio if the occupancy ratio is higher than the first threshold. With this counting device, the number of insects can be appropriately counted according to the degree of overlap between the insects by varying the counting process according to the occupancy ratio.
[0012] A counting device according to a second aspect is the counting device according to the first aspect, in which the counting unit performs the second counting process when the occupancy rate is higher than a first threshold and lower than a second threshold, and does not count the number of insects when the occupancy rate is higher than the second threshold. This allows the number of captured insects to be calculated with less error when the occupancy rate is lower than the first threshold, compared to calculating the number of insects based on the occupancy rate. Furthermore, when the occupancy rate is higher than the first threshold and lower than the second threshold, the number of insects can be appropriately counted by utilizing the correlation between the number of captured insects and the occupancy rate, even if the insects overlap each other. Furthermore, when the occupancy rate is higher than the second threshold, outputting a number of captured insects with a large error can be suppressed.
[0013] The counting device according to aspect 3 is the counting device according to aspect 2, further comprising an output unit that outputs the counting result of the counting unit, wherein the output unit outputs the number of insects counted by the counting unit when the occupancy rate is lower than the second threshold value, and outputs a message indicating that the number of insects is abnormal when the occupancy rate is higher than the second threshold value. This makes it possible to output useful information to a user of the counting device while preventing the output of an erroneous number of captured insects.
[0014] The counting device according to aspect 4 is the counting device according to aspect 2 or 3, further comprising an identification unit that identifies the type of insect by analyzing the image, and when the occupancy rate is higher than a first threshold value and lower than the second threshold value, the counting unit calculates the proportion of insects of a specific type among the insects that could be identified by the identification unit based on the occupancy rate, calculates the total number of insects captured based on the proportion of insects of the specific type and the total number, thereby making it possible to determine the number of insects captured of a specific type with little error.
[0015] A fifth aspect is a counting method that acquires an image of the captured insects, calculates an occupancy rate that indicates the proportion of the area in the image that the insects occupy, and counts the number of captured insects, and, when counting the number of captured insects, performs a first counting process that counts the number of insects by analyzing the image if the occupancy rate is lower than a first threshold, and performs a second counting process that counts the number of insects based on the occupancy rate if the occupancy rate is higher than the first threshold. With this counting method, the number of insects can be appropriately counted by varying the counting process depending on the occupancy rate.
[0016] A sixth aspect is a program that causes a computer to realize an image acquisition function for acquiring an image of captured insects, an occupancy calculation function for calculating an occupancy rate indicating the proportion of the area in the image occupied by the insects, and a counting function for counting the number of captured insects, and also realizes as the counting function a first counting processing function for counting the number of insects by analyzing the image if the occupancy rate is lower than a first threshold, and a second counting processing function for counting the number of insects based on the occupancy rate if the occupancy rate is higher than the first threshold. Such a program allows the computer to appropriately count the number of insects by varying the counting processing depending on the occupancy rate.
[0017] ===This embodiment=== <Reference explanation> FIG. 1 is an explanatory diagram of an insect trapping device 1. As shown in FIG.
[0018] The insect trapping device 1 is a device for trapping insects. The insect trapping device 1 has a main body 3 having an opening 3A, and a lamp 5. The lamp 5 is, for example, a black light, and attracts insects. However, the insect trapping device 1 does not necessarily have to include the lamp 5.
[0019] An insect trapping sheet 7 can be attached to the insect trapping device 1. The insect trapping sheet 7 is a sheet that traps insects, and is made of an adhesive sheet. As will be described later, the insect trapping device 1 is not limited to a device that traps insects using the insect trapping sheet 7.
[0020] The insect trapping device 1 is installed, for example, in a food factory, and when the insect trapping sheet 7 is replaced, the insect trapping sheet 7 that has captured the insects (used insect trapping sheet 7) is collected. In order to understand the state of insect occurrence and spread in the area where the insect trapping device 1 is installed, the insects captured by the insect trapping sheet 7 are counted and identified. However, if the insects captured by the insect trapping sheet 7 are counted and identified by human eyes, it takes a lot of work and there is a risk of variation in the counting and identification results. For this reason, the image of the insect trapping sheet 7 is analyzed to automatically count and identify the insects.
[0021] FIG. 2 is an image of the insect trapping sheet 7 that has captured insects. The image of the insect trapping sheet 7 is read by a camera, scanner, or the like. The image (image data) is made up of pixels arranged two-dimensionally. The image (unprocessed image, raw image) shown in FIG. 2 is an RGB color image, and the pixels (pixel data) that make up the image are made up of RGB multi-tone data.
[0022] FIG. 3 is an explanatory diagram of the binarization process. The image on the left side of the figure is the image before the binarization process (pre-processing image, raw image), which is the color image shown in FIG. 2. The image on the right side of the figure is the image after the binarization process, which is a binary image. A binary image is a black and white image, and the pixels that make up a binary image are made up of binary data indicating white or black. Black pixels in a binary image indicate pixels where insects exist. Furthermore, an area in a binary image where black pixels are connected indicates an area where insects exist. Note that the areas of the ruled lines of the insect trapping sheet 7 also become black pixels, but the ruled lines of the insect trapping sheet 7 can be removed from the binary image by pre-processing or post-processing.
[0023] Figure 4 is an explanatory diagram of the labeling process. The labeling process is a process of assigning a label (number) to each connected region (region in a binary image in which black pixels are connected) contained in a binary image. The same label is assigned to pixels that belong to the same connected region, and different labels are assigned to different connected regions. After the labeling process, the number of connected regions contained in the binary image can be counted.
[0024] When there are few captured insects, the possibility that the insects overlap is low, so one connected region in the binary image is considered to indicate an area where one insect exists. For example, in the image shown in Figure 2, the insects hardly overlap each other, and one connected region in the binary image contains one insect. Therefore, when there are few captured insects, the number of connected regions in the binary image corresponds to the number of captured insects. Therefore, in a situation where the insects hardly overlap each other as shown in Figure 2, even if the number of insects is counted based on the number of connected regions in the binary image (the number of areas occupied by insects in the image), the error in the counting result (the number of captured insects) is considered to be small (the error in the counting result is considered to be smaller than that of the counting process that estimates the number of insects based on the occupancy rate R described below). The counting process that counts the number of insects based on the image analysis as described above (counting process that counts the number of areas occupied by insects in the image) is called the "first counting process."
[0025] Fig. 5A is an image of the insect trapping sheet 7 that has captured many insects. Fig. 5B is a binary image of Fig. 5A.
[0026] When many insects are captured, there is a high possibility that the insects overlap each other, and therefore there is a high possibility that two or more insects exist in one connected region of the binary image (the region occupied by the insects in the image). For example, in the case of the image shown in FIG. 5A, many insects overlap each other, and therefore many insects exist in one connected region of the binary image shown in FIG. 5B. Therefore, in a situation where many insects overlap as shown in FIG. 5A, when the number of insects is counted by the first counting process, the error in the counting result (the number of captured insects) becomes large. Furthermore, in the case of the first counting process, the more the number of captured insects increases, the fewer the number of connected regions of the binary image becomes, and the fewer the number of counted insects becomes, and therefore the greater the error becomes. In addition, when the insects overlap each other as shown in FIG. 5A, it becomes difficult to identify the insects by image analysis.
[0027] <Relationship between capture numbers and occupancy rate> Fig. 6 is a graph showing the measurement results of the number of insects caught on the insect-trapping sheet 7 and the proportion (occupancy) of black pixels in a binary image. Fig. 7 is a scatter plot of the number of trapped insects and the occupancy.
[0028] 51 insect trapping sheets 7 were collected by installing the insect trapping device 1 under different conditions and capturing insects, and the number of captured insects was visually counted for each insect trapping sheet 7. In addition, for each insect trapping sheet 7, an image of the adhesive surface was read, and a binary image was obtained by binarizing the image of the insect trapping sheet 7, and the occupancy rate of the black pixel area in the binary image was calculated. The occupancy rate indicates the ratio of black pixels to the number of pixels in a specified area. Note that, since insects exist in the black pixel areas of the binary image, the occupancy rate of the black pixel area in the binary image indicates, in other words, the proportion of the area occupied by insects in the image.
[0029] The horizontal axis of the graph in Fig. 6 indicates the sheet number. The sheet numbers are assigned in descending order of occupancy rate. The vertical axis on the left side of Fig. 6 indicates the number of captured insects (the number of captures). The vertical axis on the right side indicates the occupancy rate. The horizontal axis of Fig. 7 indicates the occupancy rate, and the vertical axis of Fig. 7 indicates the number of captured insects (capture number).
[0030] As shown in Figures 6 and 7, the lower the number of captures, the lower the occupancy rate, and the higher the number of captures, the higher the occupancy rate. In other words, the number of captures and the occupancy rate are correlated. The correlation coefficient between the number of captures and the occupancy rate for sheets 1 to 51 was 0.884. The absolute value of the correlation coefficient is relatively close to 1, which also shows that there is a strong correlation between the number of captures and the occupancy rate.
[0031] The counting device of this embodiment counts the number of captured insects based on the occupancy rate by utilizing the correlation between the number of captured insects and the occupancy rate. This makes it possible to properly count the number of insects even if the insects overlap each other. The counting process that counts the number of captured insects based on the occupancy rate is called the "second counting process." This second counting process will be described later.
[0032] Furthermore, when the occupancy rate is low, it is considered that the insects are less likely to overlap, and when the occupancy rate is high, it is considered that the insects are more likely to overlap. For example, the occupancy rate in the image shown in Fig. 3 is 5%, and the occupancy rate in the image shown in Fig. 5A is 26%. Therefore, the counting device 10 of this embodiment differs in the counting process depending on the occupancy rate in order to appropriately count the number of insects depending on the degree of overlap between the insects. The counting device of this embodiment will be described below.
[0033] <Configuration of counting device 10> Fig. 8 is an explanatory diagram showing the hardware configuration of the counting device 10. Fig. 9 is a block diagram of the counting device 10. The counting system 100 is a system in which an image reading device 9 (such as a camera or scanner) is added to the counting device 10.
[0034] The counting device 10 is a device that counts the number of captured insects. The counting device 10 is composed of one or more computers. When the counting device 10 is composed of multiple computers, multiple functions (for example, the counting unit 23 and the identification unit 24 in FIG. 9) may be realized by dividing each function into separate computers, or the same function may be distributed and processed by multiple computers.
[0035] As shown in FIG. 8, the counting device 10 includes a calculation processing device 11, a storage device 12, a communication device 13, a display device 14, and an input device 15. The calculation processing device 11 is configured with, for example, a CPU or the like. The storage device 12 is configured with, for example, a main storage device such as a RAM, and an auxiliary storage device such as a hard disk drive or SSD. The communication device 13 is configured with, for example, a communication module that performs wired or wireless communication with an external device (such as an image reading device 9). The display device 14 is configured with, for example, a display, and displays (outputs) the counting results and the identification results. The input unit is configured with, for example, a keyboard, a mouse, and the like. The calculation processing device 11 executes a program stored in the storage device 12, thereby realizing the functions of each unit (such as the counting unit 23 and the identification unit 24) of the control unit 20 shown in FIG. 9.
[0036] 9, the counting device 10 includes a control unit 20 and a storage unit 30. The storage unit 30 stores data of the above-mentioned images and binary images.
[0037] The control unit 20 controls the counting device 10. The control unit 20 has an image acquisition unit 21, an occupancy rate calculation unit 22, a counting unit 23, an identification unit 24, and an output unit 25. The image acquisition unit 21 acquires images of captured insects from an image reading device 9 (such as a camera or scanner). The image acquisition unit 21 stores the acquired images in the memory unit 30. The occupancy rate calculation unit 22 calculates the above-mentioned occupancy rate (the ratio of the area occupied by the insects in the image). The counting unit 23 calculates the number of insects. The counting unit 23 of this embodiment calculates the number of insects (estimated number of captured insects) based on the occupancy rate. The identification unit 24 analyzes the image to identify the type of insect. If the counting device 10 does not identify insects, the counting device 10 does not need to be equipped with the identification unit 24. The output unit 25 outputs the counting result of the counting unit 23. For example, the output unit 25 outputs (displays) the counting result of the counting unit 23 on a display or the like, outputs (prints) the counting result of the counting unit 23 using a printer or the like, or outputs (transmits) a signal of the counting result of the counting unit 23. Note that when the counting device 10 identifies the type of insect, the output unit 25 may output the type of insect.
[0038] <Counting device 10 processing (1)> 10 is a flow diagram of the first process performed by the counting device 10. Each process in the diagram is executed by the arithmetic processing device 11 executing a program stored in the storage device 12. (Note that each process in the flow diagram described later is also executed by the arithmetic processing device 11 executing a program stored in the storage device 12.)
[0039] First, the control unit 20 (image acquisition unit 21) acquires an image of a captured insect from the image reading device 9 (such as a camera or scanner) (S101). Here, the image acquisition unit 21 acquires an image of the adhesive surface of the insect trapping sheet 7 read by the image reading device 9.
[0040] Next, the control unit 20 (occupancy calculation unit 22) calculates the occupancy R (the proportion of the area occupied by the insect in the image) (S102). For example, the occupancy calculation unit 22 performs binarization processing on the image to obtain a binary image, and calculates the occupancy R of the area of black pixels in the binary image. However, the method of calculating the occupancy is not limited to this. For example, the occupancy calculation unit 22 may calculate the occupancy R by extracting the area occupied by the insect based on the gradation values of the pixels of the color image, without performing binarization processing, and calculating the proportion of the image that the extracted area occupies.
[0041] Next, the control unit 20 (counting unit 23) compares the occupancy rate R with a predetermined first threshold value T1 (S103).
[0042] If the occupancy rate R is lower than the first threshold T1 (YES in S103), the control unit 20 (counting unit 23) counts the number of insects based on the analysis of the image (S104; first counting process). For example, the counting unit 23 counts the number of insects based on the number of connected areas of the binary image (the number of areas occupied by insects in the image). The binary image at this time may be the binary image used to calculate the occupancy rate R in S102, or may be a binary image obtained by performing a binary process different from the binary process performed in S102 (for example, a binary process with a different binary threshold). In addition, the image analysis in S104 is not limited to using a binary image. For example, the counting unit 23 may extract areas occupied by insects based on the gradation values of pixels of a color image without performing a binary process, and count the number of areas occupied by insects as the number of insects. If the occupancy rate R is lower than the first threshold T1 (YES in S103), the insects are unlikely to overlap with each other, so by performing a first counting process that counts the number of insects by analyzing the image (S104), it is possible to determine the number of captured insects with less error than by using the second counting process (described next; S105) that estimates the number of insects based on the occupancy rate R.
[0043] After the process of S104, the control unit 20 (output unit 25) outputs the number of captured insects calculated in S104 (S105). For example, the output unit 25 displays the number of captured insects on a display (display device 14). In S105, the counting result of the first counting process is output under conditions where the insects hardly overlap, so that the number of captured insects with little error can be output. The output unit 25 may also perform an identification process described below and output the identification result together with the number of captured insects.
[0044] If the occupancy rate R is higher than the first threshold T1 (NO in S103), the control unit 20 (counting unit 23) calculates the estimated number of captured insects C1 based on the occupancy rate R (S106; second counting process). A function for calculating the estimated number of captured insects C1 based on the occupancy rate R is preset in the counting unit 23. For example, as with the capture sheets with sheet numbers 1 to 51 shown in FIG. 6, the occupancy rate and the number of actually captured insects are measured, and the values of a1 and a2 in the linear equation C1=a1R+a2 are determined by the least squares method based on the measurement results, so that the function (C1=a1R+a2) can be set. Note that the function for calculating the number of insects C1 based on the occupancy rate R may be a quadratic equation instead of a linear equation. Also, the function for calculating the number of insects C1 based on the occupancy rate R may be a function determined without using the measurement results or the least squares method. As described above, since the number of captured insects and the occupancy rate R are correlated (see FIG. 6), it is possible to estimate the number of captured insects based on the occupancy rate R.
[0045] The control unit 20 (counting unit 23) performs the second counting process in S106 using the occupancy rate R calculated in S102. This reduces the calculation load of the occupancy rate R used in the second counting process in S106. However, the control unit 20 may recalculate the occupancy rate R when performing the process in S106.
[0046] After the process of S106 (after the calculation of the estimated number of captured insects C1), the control unit 20 (output unit 25) outputs the estimated number of captured insects C1 (S107). For example, the output unit 25 displays the estimated number of captured insects C1 on the display (display device 14). In S107, the counting result obtained by the second counting process under the condition that the insects are overlapping is output, so that the number of captured insects with less error can be output compared to the case where the counting result obtained by the first counting process under this condition is output. Note that instead of outputting a numerical value such as the estimated number of captured insects C1, the output unit 25 may output an evaluation result based on the estimated number of captured insects C1 (for example, an evaluation rank of 1 to 5 that evaluates the risk of insects on a 5-point scale) to the display (display device 14). However, it is preferable to output a numerical value such as the estimated number of captured insects C1 rather than an evaluation rank, because it is easier to grasp the situation of insect occurrence and spread in the installation location of the insect trapping device 1.
[0047] When outputting the estimated capture number C1, the control unit 20 (output unit 25) may also output the error range of the estimated capture number C1. In this case, the error range of the estimated capture number C1 may be determined based on the occupancy rate R (for example, the error range of the estimated capture number C1 may be calculated based on the occupancy rate R such that the higher the occupancy rate R, the wider the error range). In addition, the output unit 25 may perform an identification process described later and output the identification result together with the estimated capture number.
[0048] According to the first process, the counting device 10 performs different counting processes (first counting process in S104, second counting process in S106) according to the occupancy rate R. When the occupancy rate R is lower than the first threshold T1, the insects are less likely to overlap with each other, so the counting device 10 can obtain the number of captured insects with less error by performing the first counting process in S104 (counting process based on image analysis) than the second counting process in S106 (counting process that calculates the number of insects based on the occupancy rate R). On the other hand, when the occupancy rate R is higher than the first threshold T1, the insects are more likely to overlap with each other, so the counting device 10 can obtain the number of captured insects with less error than the first counting process in S104 by performing the second counting process in S106 (counting process that calculates the number of insects based on the occupancy rate R) by utilizing the correlation between the number of captured insects and the occupancy rate. In this way, by performing different counting processes (S104, S106) according to the occupancy rate R, the number of captured insects can be properly counted.
[0049] <Counting device 10 processing (2)> If too many insects are caught, the correlation between the number of captures and the occupancy rate becomes weak. For example, according to the measurement results of the capture sheets Nos. 1 to 51 shown in Figure 6, the correlation coefficient between the number of captures and the occupancy rate for sheets Nos. 1 to 51 was 0.884, while the correlation coefficient between the number of captures and the occupancy rate for sheets Nos. 1 to 21, where the occupancy rate is 10% or more, was 0.774. For this reason, it is thought that the higher the occupancy rate, the greater the error when calculating the estimated number of captures C1 based on the occupancy rate R. On the other hand, if the number of captured insects is too high, it may be more important to know that the occurrence or spread of insects is abnormal than to know the number of captured insects. In such a case, it is more effective to output that the number of captured insects is abnormal than to output the number of captured insects with a large error. Therefore, the counting device 10 may perform a second process which will be described next.
[0050] Fig. 11 is a flow diagram of the second process performed by the counting device 10. The processes of S101 to S107 in the diagram are similar to the processes of S101 to S107 of the second process in Fig. 10. The flow diagram of the second process differs from the first process in that the processes of S201 and S202 are performed.
[0051] When the occupancy rate R is higher than the first threshold T1 (NO in S103), the control unit 20 (counting unit 23) compares the occupancy rate R with a predetermined second threshold T2 (S201). Note that the second threshold T2 is a threshold value that is greater than the first threshold T1.
[0052] If the occupancy rate R is higher than the first threshold T1 (NO in S103) and lower than the second threshold T2 (YES in S201), the counting unit 23 calculates the estimated number of captured insects C1 based on the occupancy rate R (S106; second counting process), and the output unit 25 outputs the estimated number of captured insects C1 as the number of counted insects (S107). Since the occupancy rate R is higher than the first threshold T1 (because there is a high possibility that insects will overlap), it is possible to determine the number of captured insects with a small error by calculating the estimated number of captured insects C1 based on the occupancy rate R. Also, since the occupancy rate R is lower than the second threshold T2, the correlation between the number of captured insects and the occupancy rate is strong, so even if the estimated number of captured insects C1 is calculated based on the occupancy rate R, it is possible to determine the number of captured insects with a small error.
[0053] If the occupancy rate R is higher than the second threshold T1 (NO in S103, NO in S201), counting processing (the first counting processing in S104 or the second counting processing in S106) is not performed by counting unit 23, and control unit 20 (output unit 25) outputs that the number of captured insects is abnormal (S202). For example, instead of displaying the number of captured insects on the display (display device 14), output unit 25 may simply display that the number is "high", or that the number is "abnormal", or may display a warning. This makes it possible to output useful information to the user of counting device 10, while preventing the output of a captured number with many errors.
[0054] According to the second process described above, when the occupancy rate R is lower than the first threshold T1, the insects are unlikely to overlap with each other, so the counting device 10 can obtain the number of captured insects with less error by performing the first counting process S104 (counting process based on image analysis) than the second counting process S106 (counting process that calculates the number of insects based on the occupancy rate R). Also, when the occupancy rate R is higher than the first threshold T1 and lower than the second threshold T2, the insects are likely to overlap with each other, so the counting device 10 can obtain the number of captured insects with less error than the first counting process S104 by performing the second counting process S106 (counting process that calculates the number of insects based on the occupancy rate R) by utilizing the correlation between the number of captured insects and the occupancy rate. Also, when the occupancy rate is higher than the second threshold T2, it is possible to suppress output of a number of captured insects with many errors while outputting useful information to the user of the counting device 10.
[0055] <Counting device 10 processing (3)> The counting device 10 may identify the type of insects captured. Furthermore, when the counting device 10 identifies the insects, it may count the number of insects according to their type.
[0056] FIG. 12 is a flow diagram of the third process performed by the counting device 10.
[0057] First, the control unit 20 acquires an image of the insect trapping sheet 7 (S101) and calculates the occupancy rate R (S102). The processes of S101 and S102 of the third process are similar to the processes of S101 and S102 of the first process in FIG. 10 (or the second process in FIG. 11).
[0058] Next, the control unit 20 (counting unit 23) compares the occupancy rate R with a predetermined first threshold value T1 (S103). If the occupancy rate R is higher than the first threshold value T1 (NO in S103), the control unit 20 (counting unit 23) compares the occupancy rate R with a predetermined second threshold value T2 (S201). The processes of S103 and S201 of the third process are similar to the processes of S103 and S201 of the third process in FIG.
[0059] When the occupancy rate R is lower than the first threshold T1 If the occupancy rate R is lower than the first threshold T1 (YES in S103), the control unit 20 (counting unit 23 and identification unit 24) performs a first counting process to count the number of insects based on analysis of the image, and identifies the type of insect based on analysis of the image (S301).
[0060] In S301, similarly to S104 of the first process (or the second process), the counting unit 23 counts the number of insects based on image analysis, without calculating the estimated captured number C1 based on the occupancy rate R. For example, the counting unit 23 counts the number of insects based on the number of connected regions in a binary image (the number of regions occupied by insects in the image). As already explained, when the occupancy rate R is lower than the first threshold value T1, the insects are unlikely to overlap each other, so by performing the first counting process that counts the number of insects based on image analysis, it is possible to determine the captured number with less error than in the second counting process (S106 described above, S306 described below) that estimates the number of insects based on the occupancy rate R.
[0061] Also, in S301, the identification unit 24 identifies the type of insect based on the analysis of the image. For example, the identification unit 24 extracts image fragments of an area (an area occupied by an insect) corresponding to a connected area of a binary image from the image acquired in S101. Since it is estimated that one insect is depicted in the extracted image fragment, the identification unit 24 identifies the type of insect depicted in each of the extracted image fragments.
[0062] Here, the identification unit 24 identifies the type of insect depicted in the image piece based on the identification model generated by machine learning. The identification model is generated by machine learning using a large number of data in which an image of an insect is associated with the type of insect in the image as teacher data, an image of an insect included in the teacher data as input data, and the type of insect as output data. The method of generating the identification model is not limited to this. For example, the identification model may be generated by machine learning using a large number of data in which the feature amount of an image of an insect is associated with the type of insect in the image as teacher data, the feature amount included in the teacher data as input data, and the type of insect as output data. In this case, the identification unit 24 performs image processing on the image piece to extract the feature amount, and inputs the extracted feature amount into the identification model to identify the type of insect depicted in the image piece. The identification unit 24 is not limited to identifying the type of insect based on an identification model generated by machine learning. For example, a comparison table may be prepared in which the feature amounts of an image of an insect (such as the size of the insect and the ratio of the head to the body) are associated with the type of insect, and the identification unit 24 may identify the type of insect based on the comparison table. In this case, the identification unit 24 performs image processing on the image fragment extracted from the image acquired in S101 to obtain the feature amount, and identifies the type of insect corresponding to the feature amount by comparing it with the comparison table, thereby identifying the type of insect depicted in the image fragment.
[0063] After the processing of S301, the control unit 20 (output unit 25) outputs the number of captured insects and the type of insects (S402). For example, the control unit 20 displays on the display (display device 14) the number of captured insects counted by the counting unit 23 in S301, and also displays the type of insects identified by the identification unit 24 in S302. The output unit 25 may output the number of captured insects for each type of insect. The output unit 25 may also output only a specific type (e.g., the type with the highest number of captures; dominant species) from among the multiple identified types of insects, and display the number of captured insects of that specific type.
[0064] When the occupancy rate R is lower than the first threshold T1 (YES in S203), the insects are unlikely to overlap with each other, so as already explained, it is possible to determine the number of captured insects with a small error. Also, when the occupancy rate R is lower than the first threshold T1 (YES in S203), the insects are unlikely to overlap with each other, so it is highly likely that one insect is captured in the image fragment extracted from the image, and it is possible to identify the type of insect captured in the image fragment with a relatively high degree of accuracy.
[0065] When the occupancy rate R is higher than the first threshold T1 and lower than the second threshold T2 13A and 13B show an unprocessed image and a binary image in which the occupancy rate R is higher than the first threshold T1 and lower than the second threshold T2. In the images shown in FIG. 13A and FIG. 13B, the occupancy rate is 13%.
[0066] In the figure, there is one insect in area A, and the insects do not overlap. On the other hand, in the figure, there are multiple insects overlapping in area B. In this way, when the occupancy rate R is higher than the first threshold T1 and lower than the second threshold T2, there is a mixture of insects that do not overlap and insects that have two or more overlapping insects.
[0067] If the occupancy rate R is higher than the first threshold T1 (NO in S103) and lower than the second threshold T2 (YES in S201), the control unit 20 (identification unit 24) identifies the type of insect based on image analysis (S303). For example, the identification unit 24 extracts image fragments of an area (an area occupied by an insect) corresponding to a connected area of a binary image from the image acquired in S101. The identification unit 24 identifies the type of insect depicted in each of the extracted image fragments. The identification process in S303 is similar to the identification process in S301 described above.
[0068] In the identification process of S303, the identification unit 24 can identify the type of insect when a single insect is shown in the extracted image fragment, such as the image fragment in area A. On the other hand, the identification unit 24 cannot identify the type of insect when overlapping insects are shown in the extracted image fragment, such as the image fragment in area B. For this reason, in the identification process of S303, the identification unit 24 performs an identification process on a plurality of image fragments, and some of which the type of insect has been identified and some of which the type of insect has not been identified.
[0069] Next, the control unit 20 (counting unit 23) counts the identifiable insects by type of insect. In other words, the counting unit 23 counts the number of identifiable image fragments by type of insect, with the identifiable image fragments being the counting targets. For example, in S303, if the identification unit 24 identifies two types of insects, midges and thrips, the number of image fragments identified by the identification unit 24 as midges and the number of image fragments identified by the identification unit 24 as thrips are counted.
[0070] Next, the control unit 20 (counting unit 23) calculates the ratio of each type based on the counting result of S304 (S305). Note that although the number of insects counted in S304 is smaller than the actual number, the ratio calculated in S305 approximates the ratio of each type of captured insect.
[0071] Next, the control unit 20 (counting unit 23) calculates the estimated total capture number C1 based on the occupancy rate R (S306). The process of S306 is the same as the second counting process of S106 in the first process (or the second process). By calculating the estimated total capture number C1 based on the occupancy rate R, it is possible to determine the number (total number) of captured insects with a small error.
[0072] Next, the control unit 20 (counting unit 23) calculates the estimated number of captures for each type based on the ratio calculated in S305 and the estimated total capture number C1 calculated in S306 (S307). For example, if the ratio of chironomids to thrips is calculated to be 2:1 in S305, the estimated number of captured chironomids is calculated as (2 / 3) x C1, and the estimated number of captured thrips is calculated as (1 / 3) x C1. Alternatively, if the ratio of chironomids is calculated to be X% in S305, the estimated number of captured chironomids is calculated as C1 x X x (1 / 100).
[0073] Incidentally, the number of insects counted in S304 will be less than the actual number. However, the ratio calculated in S305 will be approximately the same as the ratio of each type of captured insect. Also, in S306, by calculating the estimated total capture number C1 based on the occupancy rate R, it is possible to determine the number of captured insects (total number) with little error. Therefore, the counting unit 23 can determine the number of captures for each type with little error based on the ratio calculated in S305 and the estimated total capture number calculated in S306.
[0074] After the processing of S307, the control unit 20 (output unit 25) outputs the estimated number of captured insects and the type of insect (S308). For example, the output unit 25 displays chironomids and thrips on the display (display device 14) and displays the estimated number of captured insects for each. The output unit 25 may also output only a specific type of the multiple identified insect types and display the number of captured insects of that specific type. For example, the output unit 25 may display chironomids on the display (display device 14) and the estimated number of captured chironomids, but may not display anything about thrips.
[0075] When the occupancy rate R is higher than the second threshold T2 If the occupancy rate R is higher than the second threshold T1 (NO in S103, NO in S201), the counting process (S301, S303 to 307) is not performed by the counting unit 23, and the control unit 20 (output unit 25) outputs that the number of captured insects is abnormal (S202). Note that the process of S202 in the third process is similar to the process of S202 in the second process in FIG.
[0076] ·Small summary According to the above third process, when the occupancy rate R is lower than the first threshold T1, the number of captured insects of each type (or the number of captured insects of a specific type) can be calculated with less error than when the number of insects is calculated based on the occupancy rate R. Furthermore, when the occupancy rate R is higher than the first threshold T1 and lower than the second threshold T2, the number of captured insects of each type (or the number of captured insects of a specific type) can be appropriately counted even if the insects overlap, by utilizing the fact that the number of captured insects and the occupancy rate are correlated. Furthermore, when the occupancy rate is higher than the second threshold T2, it is possible to suppress the output of a number of captured insects with many errors while outputting useful information to the user of the counting device 10.
[0077] <About the insect trap sheet> In the above description, the insect trapping sheet is composed of an adhesive sheet, and the control unit 20 (image acquisition unit 21) acquires images of insects trapped on the adhesive sheet. However, the insect trapping sheet is not limited to an adhesive sheet, and may be one that captures insects using a fixing method other than adhesion. Furthermore, the image acquired by the control unit 20 (image acquisition unit 21) does not have to be an image of an insect fixed to the insect trapping sheet. For example, an image reading device 9 may be provided inside the insect trapping device 1, and the control unit 20 (image acquisition unit 21) may acquire images of insects that are not fixed inside the case of the insect trapping device 1 or on the tray.
[0078] ===Other===
[0079] The above-described embodiment is for the purpose of facilitating understanding of the present invention, and is not intended to limit the present invention. The present invention may be modified or improved without departing from the spirit thereof, and it goes without saying that the present invention includes equivalents thereof. [Explanation of symbols]
[0080] 1 insect trap, 3 main body, 3A opening, 5 lamp, 7 insect trap sheet, 9 image reader, 10 Counting device, 11 Processing device, 12 storage device, 13 communication device, 14 Display device, 15 Input device, 20 control unit, 21 image acquisition unit, 22 Share Calculation Department, 23 Counting Department, 24 Identification unit, 25 Output unit, 30 memory unit, 100 counting system
Claims
1. an image acquisition unit for acquiring an image of the captured insect; an occupancy ratio calculation unit that calculates an occupancy ratio indicating a ratio of an area occupied by insects in the image; A counting unit that counts the number of captured insects; Equipped with The counting unit is If the occupancy rate is lower than a first threshold, a first counting process is performed to count the number of insects by analyzing the image; A counting device characterized in that, when the occupancy rate is higher than a first threshold, a second counting process is performed to count the number of insects based on the occupancy rate.
2. 2. The counting device according to claim 1, The counting unit is When the occupancy rate is higher than a first threshold value and lower than a second threshold value, the second counting process is performed; A counting device characterized in that, when the occupancy rate is higher than the second threshold, the number of insects is not counted.
3. 3. The counting device according to claim 2, An output unit that outputs the counting result of the counting unit, The output unit is When the occupancy rate is lower than the second threshold, the counting unit outputs the number of insects counted; A counting device characterized in that, when the occupancy rate is higher than the second threshold value, an output is output indicating that the number of insects is abnormal.
4. 4. The counting device according to claim 2 or 3, An identification unit that identifies the type of insect by analyzing the image, When the occupancy rate is higher than a first threshold value and the occupancy rate is lower than the second threshold value, the counting unit: Calculating the proportion of insects of a particular type among the insects that were identified by the identification unit; Calculating the total number of captured insects based on the occupancy rate; A counting device that calculates the number of insects of a specific type based on the proportion of insects of the specific type and the total number.
5. Obtaining images of captured insects; Calculating an occupancy rate indicating a proportion of an area of the image that is occupied by the insect; and Counting the number of insects caught In addition, When counting the number of captured insects, If the occupancy rate is lower than a first threshold, a first counting process is performed to count the number of insects by analyzing the image; A counting method comprising: when the occupancy rate is higher than a first threshold, performing a second counting process to count the number of insects based on the occupancy rate.
6. On the computer, An image capture function to capture images of captured insects; an occupancy ratio calculation function for calculating an occupancy ratio indicating a ratio of an area occupied by insects in the image; A counting function that counts the number of captured insects In addition to achieving this, The counting function is a first counting processing function for counting the number of insects by analyzing the image when the occupancy rate is lower than a first threshold; a second counting processing function of counting the number of insects based on the occupancy rate when the occupancy rate is higher than a first threshold value; A program to achieve this.
Citation Information
Patent Citations
Insect image processing apparatus, image processing method, image processing program, and computer-readable storage medium
JP2012161269A
