Intelligent counting method and device for shrimp seed
Through the intelligent counting method combined with digital camera and flow sensor, image processing and machine learning technology are used to solve the problem of low accuracy and time-consuming shrimp seed counting, achieving efficient and accurate shrimp seed counting, reducing manual counting cost and damage risk.
Patent Information
- Application Number
- CN202010781403.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-06
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2040-08-06
AI Technical Summary
In the prior art, there are problems of low accuracy, time-consuming and high cost. Especially due to the small individual specifications and large quantity, artificial naked eye counting is not only time-consuming and low accuracy, but also commonly used random sampling methods. It will cause huge seedling damage and quantity errors.
Using an intelligent counting method combined with digital camera and flow sensor, images are collected through the flow of shrimp seeds in transparent round tubes, RGB histogram analysis, binarization processing and filtering operations are performed, profile features are extracted, and classification is performed using the support vector machine model. and counting, combined with mechanical automation technology, achieve damage-free and efficient counting.
The accuracy and efficiency of shrimp seedling counting is significantly improved, the average time is reduced by more than 10 times, the accuracy rate reaches 98.47%, and it is not damaged, making it convenient and fast to collect and ship.
Smart Images

Figure CN111862246B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of aquatic product breeding, and in particular to an intelligent counting method and device for shrimp seedlings, which can avoid damage to shrimp seedlings and improve efficiency and accuracy. Background Art
[0002] The scale of shrimp farming (Chinese shrimp, giant tiger shrimp, Japanese shrimp, whiteleg shrimp, etc.) is huge, and accurate counting of shrimp seedlings is very important. Since live baits such as large worms with similar appearance characteristics to seedlings are commonly used in the cultivation process of shrimp seedlings, physical counting devices such as sound waves and infrared triggers are difficult to distinguish, so the current commonly used method is manual counting with the naked eye. However, the individual size of shrimp seedlings is small (about 1 cm) and the number is large (tens of thousands to hundreds of thousands, as many as hundreds of millions). Manual counting one by one with the naked eye is not only time-consuming and costly, but also has low accuracy. For this reason, the existing manual counting with the naked eye adopts random sampling counting: one is the weight method, that is, weighing the total weight of shrimp seedlings, and then randomly taking samples to calculate the number of shrimp seedlings per unit weight to find the total number; the other is the volume method, that is, calculating the total water body of shrimp seedlings, and then randomly taking samples to calculate the number of shrimp seedlings per unit water body to find the total number. Regardless of which random sampling and counting method is used, not only will there be varying degrees of damage to the seedlings, but the error in the sample size will be multiplied, resulting in huge differences in the total number, and the problem of low counting accuracy cannot be solved. Summary of the invention
[0003] In order to solve the above technical problems existing in the prior art, the present invention provides an intelligent counting method and device for shrimp seedlings, which can avoid damage to shrimp seedlings and improve efficiency and accuracy.
[0004] The technical solution of the present invention is: a method for intelligent counting of shrimp seedlings, characterized by following the following steps in sequence:
[0005] Step 1: Mix the shrimp seed to be tested with water of volume C cubic centimeters;
[0006] Step 2: driving the water containing the shrimp seedlings to be tested to pass through the transparent circular tube located below the digital camera at a flow rate, the digital camera collects a digital image at intervals of B frames, and intercepts a transparent circular tube area Q with a length of M pixels at a fixed position on the digital image;
[0007] B=A*t rounded up to an integer, t=L / S, L=M / P, S= ;
[0008] A is the acquisition rate of the digital camera, in frames per second;
[0009] The t is the time it takes for the shrimp seed to flow through the transparent circular tube corresponding to the area Q, in seconds;
[0010] L is the actual length of the transparent tube corresponding to the area Q, in centimeters;
[0011] S is the distance that the shrimp seedlings flow through the transparent tube per second, in centimeters per second;
[0012] P is the ratio of the length pixel of the transparent tube on the digital image to the actual length of the corresponding transparent tube, unit: pixel / cm;
[0013] V is the flow rate of water containing shrimp seedlings, unit: cubic centimeter / second;
[0014] Said is the radius of the transparent tube, in centimeters;
[0015] Step 3: Perform histogram analysis and binarization processing on the three color channels of RGB to obtain a binary image;
[0016] Step 4: Use a circular filter kernel of 9 to 12 pixels to perform a candle operation on the binary image, and then use a circular filter kernel of 7 to 9 pixels to perform a dilation operation to obtain a binary analysis image suitable for recognition and parameter extraction;
[0017] Step 5: Extract each white contour in the binary analysis image and calculate the contour area, and determine whether the contour area is less than the threshold. If yes, delete it; if not, calculate the following contour features except the contour area: centroid coordinates, proportion of contour area to boundary area, and contour diameter;
[0018] Step 6: Use the classification parameters obtained in the training phase to classify, count and display the obtained contour features;
[0019] The classification parameters are constructed in the following steps:
[0020] Step 6.1: Obtain a set of contour features for each contour according to steps 1, 2, 3, and 4 in sequence, and manually judge whether the target contour contains shrimp fry. If yes, mark the set of contour features as a positive sample; if not, mark the set of contour features as a negative sample, and then obtain a positive sample set and a negative sample set each containing 2000 to 4000 samples;
[0021] Step 6.2 establishes an attribute data table based on each set of contour features in the positive sample set and the negative sample set;
[0022] Step 6.3 supports the phasor machine algorithm model to learn with the data in the attribute data table, thereby obtaining support vector model parameters and selecting threshold parameters, and configuring the support vector machine model parameters and threshold parameters as classification parameters;
[0023] Step 7. Determine whether the count of the current frame of digital image is equal to the count of the previous frame of digital image. If yes, go to step 8. If not, repeat steps 2 to 7.
[0024] Step 8. Determine whether the counts of consecutive C×A / (V×B) digital images are equal. If yes, the counting ends. If no, repeat steps 2 to 7.
[0025] The invention discloses a device for intelligently counting prawn seedlings, comprising a support, a box body disposed on the support, a water inlet and a water outlet disposed at the bottom of the box body, the water inlet and the water outlet being connected to a transparent round tube disposed horizontally below the box body through a first vertical tube and a second vertical tube respectively, a digital camera, a lighting strip and a light-transmitting plate being disposed above the transparent round tube in order from top to bottom, a flow sensor being disposed in the transparent round tube, a pump body, a seedling mixing chamber and a seedling collecting chamber being disposed in the box body, the pump body outlet and the water outlet being both communicated with the seedling mixing chamber, a stirring blade driven by a motor being disposed in the seedling mixing chamber, the seedling collecting chamber being communicated with the water inlet, the digital camera and the flow sensor being both connected to a single-chip microcomputer.
[0026] The present invention combines computer intelligence technology with mechanical automation technology, which can effectively improve the efficiency and accuracy of shrimp seed counting; the shrimp seed with water can be counted without damage; the shrimp seed collected in the seed collection room can be directly packaged and shipped for sale, which is convenient and fast; the device used has a simple structure and is easy to operate. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a digital image collected by the embodiment of the present invention.
[0028] Figure 2 yes Figure 1 Schematic diagram of a digital image region Q captured.
[0029] Figure 3 yes Figure 2 Schematic diagram of histogram analysis.
[0030] Figure 4 yes Figure 2 A binary image of .
[0031] Figure 5 yes Figure 4 Binary analysis image.
[0032] Figure 6 This is an image showing the total number of shrimp seedlings according to an embodiment of the present invention.
[0033] Figure 7 It is a schematic diagram of the structure of the device used in the embodiment of the present invention.
[0034] Figure 8 It is a schematic diagram of the structure inside the box of the device used in the embodiment of the present invention.
[0035] Fig. 9 It is a circuit principle block diagram of an embodiment of the present invention. DETAILED DESCRIPTION
[0036] The device used in the embodiment of the present invention is as follows Figure 7 , 8 , 9, with a support 1, a box 2 is placed on the support 1, a water inlet 3 and a water outlet 4 are provided at the bottom of the box 2, the water inlet 3 and the water outlet 4 are connected to a transparent round tube 6 horizontally placed below the box 2 through a first vertical tube 5-1 and a second vertical tube 5-2 respectively, and a digital camera 7, a lighting strip 8 and a light-transmitting plate 9 are arranged from top to bottom above the transparent round tube 6, and a plurality of LED lights are evenly distributed on the lighting strip 8. A flow sensor 10 is arranged in the transparent round tube 6, a pump body 11 (pipeline pump), a seedling mixing chamber 12 and a seedling collecting chamber 13 are arranged in the box 2, and the seedling collecting chamber 13 has a plurality of hydrophobic holes smaller than the shrimp seedlings and is movably connected to the water inlet 3 (such as plugging, etc.). The outlet of the pump body 11 and the water body outlet 4 are both connected to the seedling mixing chamber 12, and the seedling mixing chamber 12 has a stirring blade 14 driven by a motor. The seedling collecting chamber 13 is connected to the water body inlet 3, and the digital camera 7 and the flow sensor 10 are both connected to the single-chip computer 15.
[0037] When measuring, first place the water without the shrimp seedlings to be tested in the box 2, start the pump 11, motor, flow sensor 10 and digital camera 7, adjust the light environment required for image recognition through the light-transmitting plate 9, and adjust the pump 11 and motor to control the water flow without damaging the shrimp seedlings. When the water flow reaches the set value and is stable, measure in the following steps:
[0038] Step 1: The shrimp seedlings to be tested with water can be mixed with the water in the box 2, so that the volume of the water in the box 2 is C cubic centimeters, that is, the shrimp seedlings to be tested are mixed with the water with a volume of C cubic centimeters;
[0039] Step 2: Drive the water containing the shrimp seed to be tested to flow through the transparent round tube 6 located below the digital camera 7: The water containing the shrimp seed is pumped into the seed mixing chamber 12 by the pump body 11, and the shrimp seed is dispersed and mixed by the stirring blades 14 to prevent the shrimp seed from agglomerating and affecting identification. After that, the mixed shrimp seed water passes through the water outlet 4, the second vertical pipe 5-2, the transparent round tube 6, the first vertical pipe 5-1, and the water inlet 3 in sequence into the seed collection chamber 13. The water entering the seed collection chamber 13 participates in the circulation through the hydrophobic holes, and the shrimp seed is retained in the seed collection chamber 13.
[0040] The digital camera captures a digital image at intervals of B frames (e.g. Figure 1As shown in Figure 2), a transparent circular tube region Q with a length of M pixels is intercepted at a fixed position on the digital image (as shown in Figure 2). Figure 2 The area within the box shown);
[0041] B=A*t rounded up to an integer, t=L / S, L=M / P, S= ;
[0042] A is the acquisition rate of the digital camera, in frames per second, generally 30 frames per second;
[0043] The t is the time it takes for the shrimp seed to flow through the transparent circular tube corresponding to the area Q, in seconds;
[0044] L is the actual length of the transparent tube corresponding to the area Q, in centimeters;
[0045] S is the distance that the shrimp seedlings flow through the transparent tube per second, in centimeters per second;
[0046] P is the ratio of the length pixel of the transparent tube on the digital image to the actual length of the corresponding transparent tube, unit: pixel / cm;
[0047] V is the flow rate of water containing shrimp seedlings, unit: cubic centimeter / second;
[0048] Said is the radius of the transparent tube, in centimeters;
[0049] In order to make the calculation result more accurate, the interval frame number B' of the image can be calculated according to the set M' and rounded up, and the length pixel M of the intercepted area Q can be reversely deduced, and M can be adjusted to obtain an integer B, and then the detection count can be performed.
[0050] Since the shrimp seedlings will flow through area Q after t seconds, the shrimp seedlings in the two data frames collected by the digital camera at an interval of B frames must not be repeated, which can ensure the accuracy of fluid detection of shrimp seedlings and reduce the occupancy of multiple frame images on the microcontroller memory, reduce the load, and reduce the amount of calculation.
[0051] Step 3: Perform histogram analysis and binarization on the three color channels of the digital image to obtain a binary image. The results of the histogram analysis and the binary image are as follows: Figure 3 , 4 As shown, Figure 3 From left to right in the middle are R, G, B;
[0052] Step 4: Use a 9-12 pixel circular filter kernel to perform a candle operation on the binary image, and then use a 7-9 pixel circular filter kernel to perform a dilation operation to obtain a binary analysis image suitable for recognition and parameter extraction (such as Figure 5 shown);
[0053] Step 5: Extract each white contour in the binary analysis image and calculate the contour area to determine whether the contour area is less than a threshold (such as 70,000 pixels). If yes, delete it; otherwise, calculate the following contour features except the contour area: centroid coordinates, proportion of contour area to boundary area, and contour diameter;
[0054] Step 6: Use the classification parameters obtained in the training phase to classify, count and display the obtained contour features. The displayed numbers can be located on the current frame image (such as Figure 6 shown);
[0055] The classification parameters are constructed in the following steps:
[0056] Step 6.1: Obtain a set of contour features for each contour according to steps 1, 2, 3, and 4 in sequence, and manually judge whether the target contour contains shrimp fry. If yes, mark the set of contour features as a positive sample; if not, mark the set of contour features as a negative sample, and then obtain a positive sample set and a negative sample set each containing 2000 to 4000 samples;
[0057] Step 6.2: Establish the attribute data table shown in Table 1 based on each set of contour features (contour area, centroid coordinates, proportion of contour area to boundary area, and contour diameter) in the positive sample set and the negative sample set; Cx y Indicates the yth attribute value of the xth shrimp seedling, such as C2 1 The first attribute value (contour area) of the second shrimp fry is represented by the judgment values of 1 (positive sample) and 0 (negative sample), and its attribute data table can be obtained (as shown in Table 1):
[0058] Table 1
[0059]
[0060] Step 6.3: The support vector machine (SVM) algorithm model is learned with the data in the attribute data table, thereby obtaining support vector model parameters and selecting threshold parameters, and configuring the support vector machine model parameters and threshold parameters as classification parameters;
[0061] Step 7. Determine whether the count of the current frame of digital image is equal to the count of the previous frame of digital image (not increased). If yes, go to step 8. If no, repeat steps 2 to 7.
[0062] Step 8. Determine whether the counts of consecutive C×A / (V×B) digital images are equal. If yes, the counting ends. If no, repeat steps 2 to 7.
[0063] The C×A / (V×B) digital images are digital images extracted by circulating a water body with a volume of C cubic centimeters. If the count does not increase after continuously passing through C×A / (V×B) digital images, it means that all the shrimp seedlings to be tested in the box 2 have been counted and placed in the seedling collection chamber 13.
[0064] After the counting is completed, the pump body 11, the motor and the digital camera 7 are turned off, the seed collecting chamber 13 is separated from the water inlet 3 and removed, and the seedlings in the seed collecting chamber 13 are filtered out using a gauze, packaged and shipped.
[0065] experiment:
[0066] Chinese shrimp seedlings with a body length of about 1 cm were selected as experimental objects, and professionals were organized to accurately measure 500 shrimp seedlings as one experimental group through professional equipment such as magnifying glasses and microscopes, with a total of 300 experimental groups. Among them, 150 groups were counted using the method and device of the present invention, and the remaining 150 groups were counted manually using the traditional weight method, and the efficiency and accuracy of the present invention and traditional manual counting were compared. Excluding special cases such as large-scale death and disintegration of shrimp seedlings and accidental loss, a total of 236 groups of valid data were obtained, and the average time consumption and average accuracy results were: the average counting time of the present invention was 58 seconds, and the accuracy rate was 98.47%; the average manual counting time was 10 minutes and 23 seconds, and the accuracy rate was 97.8%. The experimental results show that the accuracy of counting using the present invention is slightly higher than that of traditional manual counting, and the work efficiency is improved by more than 10 times.
Claims
1. A method for intelligent counting of shrimp seedlings, characterized in that Follow the steps below: Step 1: Mix the shrimp seed to be tested with water of volume C cubic centimeters; Step 2: driving the water containing the shrimp seedlings to be tested to pass through the transparent circular tube located below the digital camera at a flow rate, the digital camera collects a digital image at intervals of B frames, and intercepts a transparent circular tube area Q with a length of M pixels at a fixed position on the digital image; B=A*t rounded up to an integer, t=L / S, L=M / P, S= ; A is the acquisition rate of the digital camera, in frames per second; The t is the time it takes for the shrimp seed to flow through the transparent circular tube corresponding to the area Q, in seconds; L is the actual length of the transparent tube corresponding to the area Q, in centimeters; S is the distance that the shrimp seedlings flow through the transparent tube per second, in centimeters per second; P is the ratio of the length pixel of the transparent tube on the digital image to the actual length of the corresponding transparent tube, unit: pixel / cm; V is the flow rate of water containing shrimp seedlings, unit: cubic centimeter / second; The r is the radius of the transparent tube, in centimeters; Step 3: Perform histogram analysis and binarization processing on the three color channels of RGB to obtain a binary image; Step 4: Use a circular filter kernel of 9 to 12 pixels to perform a candle operation on the binary image, and then use a circular filter kernel of 7 to 9 pixels to perform a dilation operation to obtain a binary analysis image suitable for recognition and parameter extraction; Step 5: Extract each white contour in the binary analysis image and calculate the contour area, and determine whether the contour area is less than the threshold. If yes, delete it; if not, calculate the following contour features except the contour area: centroid coordinates, proportion of contour area to boundary area, and contour diameter; Step 6: Use the classification parameters obtained in the training phase to classify, count and display the obtained contour features; The classification parameters are constructed in the following steps: Step 6.1: Obtain a set of contour features for each contour according to steps 1, 2, 3, and 4 in sequence, and manually judge whether the target contour contains shrimp fry. If yes, mark the set of contour features as a positive sample; if not, mark the set of contour features as a negative sample, and then obtain a positive sample set and a negative sample set each containing 2000 to 4000 samples; Step 6.2 establishes an attribute data table based on each set of contour features in the positive sample set and the negative sample set; Step 6.3: The support vector machine algorithm model is learned with the data in the attribute data table, thereby obtaining the support vector machine model parameters and selecting the threshold parameters, and configuring the support vector machine model parameters and the threshold parameters as classification parameters; Step 7. Determine whether the count of the current frame of digital image is equal to the count of the previous frame of digital image. If yes, go to step 8. If not, repeat steps 2 to 7. Step 8. Determine whether the counts of consecutive C×A / (V×B) digital images are equal. If yes, the counting ends. If no, repeat steps 2 to 7.
2. A device for intelligently counting shrimp seedlings as claimed in claim 1, which performs the method as claimed in claim 1, characterized in that: A support (1) is provided, a box (2) is placed on the support (1), a water inlet (3) and a water outlet (4) are provided at the bottom of the box (2), the water inlet (3) and the water outlet (4) are connected to a transparent round tube (6) placed horizontally below the box (2) through a first vertical tube (5-1) and a second vertical tube (5-2), respectively, a digital camera (7), a lighting strip (8) and a light-transmitting plate (9) are provided above the transparent round tube (6) from top to bottom, and a A flow sensor (10) is provided in the box body (2) with a pump body (11), a seedling mixing chamber (12) and a seedling collecting chamber (13); the outlet of the pump body (11) and the water body outlet (4) are both connected to the seedling mixing chamber (12); a stirring blade (14) driven by a motor is provided in the seedling mixing chamber (12); the seedling collecting chamber (13) is connected to the water body inlet (3); and the digital camera (7) and the flow sensor (10) are both connected to a single chip computer (15).
