Disclosure of Invention
In order to solve the technical problem, embodiments of the present invention provide a method and a system for counting the number of animals, and a storage medium.
According to an aspect of an embodiment of the present invention, there is provided a method for counting the number of animals, the method including:
dividing the area to be tested to obtain n areas to be tested;
respectively acquiring the remote sensing image of each to-be-detected film area at preset time intervals;
comparing the remote sensing image of the kth to-be-measured area at the first moment with the remote sensing image of the kth to-be-measured area at the second moment to obtain a kth difference image, and repeating the steps until an mth difference image is obtained;
analyzing each difference image respectively to obtain the variation quantity of the animals in the area to be detected;
determining the target number of the animals according to the change number and the obtained initial number;
the first time and the second time are adjacent times, n is an integer larger than 1, and k is larger than 0 and is not less than m and not more than n.
The embodiment provides that: the method comprises the following steps of dividing a region to be measured into a plurality of regions to be measured, taking a preset time interval as a unit, obtaining a remote sensing image of each region to be measured, comparing the remote sensing image of the region A to be measured at the previous moment with the remote sensing image of the region A to be measured at the current moment to obtain a difference image, analogizing the difference images, analyzing each difference image after obtaining a plurality of difference images to obtain the change number of animals in the region to be measured, and determining the target number according to the change number and the initial number, so that on one hand, the technical scheme that manpower and material resources are consumed when statistics is carried out in a manual mode in the prior art is avoided, and the technical effects of saving cost and improving efficiency are achieved; on the other hand, the technical defect that the counting result is not accurate due to the fact that the counting is easily influenced by human factors when the quantity counting is carried out in the prior art is avoided, and the accuracy of the quantity counting of the animals is achieved.
Further, the dividing the region to be measured to obtain n regions to be measured specifically includes:
calling a preset historical database;
identifying the area to be detected according to the distribution information of the animals in the historical database in the area to be detected to obtain a plurality of identifications;
and dividing the area to be tested according to the distribution information and each identifier to obtain n areas to be tested.
The embodiment provides that: the divided chip region to be tested is obtained according to the historical data, and the technical effect of 'adjusting to local conditions' is achieved.
Further, the dividing the area to be measured according to the distribution information and each identifier specifically includes:
distributing a weight coefficient to each identifier according to the distribution information;
dividing the region to be measured according to each weight coefficient and each preset dividing coefficient;
wherein one of the weight coefficients corresponds to one of the division coefficients.
Through the technical scheme for dividing the area to be measured by combining the distribution weight coefficient and the division coefficient, the historical data are fully combined, and the technical effect of accurately dividing the area to be measured is achieved.
Further, the step of comparing the remote sensing image of the kth to-be-measured block at the first moment with the remote sensing image of the kth to-be-measured block at the second moment to obtain a kth difference image specifically includes:
respectively acquiring a first orthographic projection area and a second orthographic projection area;
comparing the first orthographic projection area with the second orthographic projection area to obtain the kth difference image;
the first orthographic projection area is the orthographic projection area of the animal in the remote sensing image of the kth to-be-measured area at the first moment, and the second orthographic projection area is the orthographic projection area of the animal in the remote sensing image of the kth to-be-measured area at the second moment.
The technical aspect of obtaining the difference image by comparing the obtained first orthographic projection area with the obtained second orthographic projection area provided by the embodiment realizes the technical effect of efficiently and quickly obtaining the difference image, thereby ensuring the accuracy and the high efficiency of animal quantity statistics.
Further, the first orthographic projection area S is obtained according to equation 1, equation 1:
wherein σ is a preset correction coefficient, l is the length of an animal in the remote sensing image of the kth to-be-measured block at the first moment, w is the width of the animal in the remote sensing image of the kth to-be-measured block at the first moment, r is the brightness value of the animal in the remote sensing image of the kth to-be-measured block at the first moment, and r is a preset correction coefficientiAnd the brightness value of the background of the remote sensing image of the kth to-be-measured area at the first moment is obtained.
The correction parameters can be set according to specific conditions.
Through the technical scheme that the first orthographic projection area is determined according to the formula 1 provided by the embodiment, the influence of environmental factors on the quantity statistics is fully considered, so that the accuracy of the first orthographic projection area is realized, and the accuracy of the animal quantity statistics is realized.
According to another aspect of the embodiments of the present invention, there is provided a computer-readable storage medium including instructions which, when executed on a computer, cause the computer to perform the method as described above.
According to another aspect of an embodiment of the present invention, there is provided a system for counting the number of animals, the system including: a dividing module, an obtaining module, a comparing module, an analyzing module and a determining module, wherein,
the dividing module is configured to: dividing the area to be tested to obtain n areas to be tested;
the acquisition module is configured to: respectively acquiring the remote sensing image of each to-be-detected film area at preset time intervals;
the comparison module is used for: comparing the remote sensing image of the kth to-be-measured area at the first moment with the remote sensing image of the kth to-be-measured area at the second moment to obtain a kth difference image, and repeating the steps until an mth difference image is obtained;
the analysis module is configured to: analyzing each difference image respectively to obtain the variation quantity of the animals in the area to be detected;
the determination module is to: determining the target number of the animals according to the change number and the obtained initial number;
the first time and the second time are adjacent times, n is an integer larger than 1, and k is larger than 0 and is not less than m and not more than n.
Through the technical scheme provided by the embodiment, on one hand, the technical defect that manpower and material resources are consumed in the prior art when statistics is performed in a manual mode is avoided, and the technical effects of saving cost and improving efficiency are achieved; on the other hand, the technical defect that the counting result is not accurate due to the fact that the counting is easily influenced by human factors when the quantity counting is carried out in the prior art is avoided, and the accuracy of the quantity counting of the animals is achieved.
Further, the dividing module is specifically configured to:
calling a preset historical database;
identifying the area to be detected according to the distribution information of the animals in the historical database in the area to be detected to obtain a plurality of identifications;
and dividing the area to be tested according to the distribution information and each identifier to obtain n areas to be tested.
The embodiment provides that: the divided chip region to be tested is obtained according to the historical data, and the technical effect of 'adjusting to local conditions' is achieved.
Further, the dividing module is specifically configured to:
distributing a weight coefficient to each identifier according to the distribution information;
dividing the region to be measured according to each weight coefficient and each preset dividing coefficient;
wherein one of the weight coefficients corresponds to one of the division coefficients.
Through the technical scheme for dividing the area to be measured by combining the distribution weight coefficient and the division coefficient, the historical data are fully combined, and the technical effect of accurately dividing the area to be measured is achieved.
Further, the comparison module is specifically configured to:
respectively acquiring a first orthographic projection area and a second orthographic projection area;
comparing the first orthographic projection area with the second orthographic projection area to obtain the kth difference image;
the first orthographic projection area is the orthographic projection area of the animal in the remote sensing image of the kth to-be-measured area at the first moment, and the second orthographic projection area is the orthographic projection area of the animal in the remote sensing image of the kth to-be-measured area at the second moment.
The technical aspect of obtaining the difference image by comparing the obtained first orthographic projection area with the obtained second orthographic projection area provided by the embodiment realizes the technical effect of efficiently and quickly obtaining the difference image, thereby ensuring the accuracy and the high efficiency of animal quantity statistics.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular system structures, interfaces, techniques, etc. in order to provide a thorough understanding of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
The embodiment of the invention provides a method and a system for counting the number of animals and a storage medium.
According to one aspect of an embodiment of the present invention, there is provided a method for counting the number of animals.
The first embodiment:
referring to fig. 1, fig. 1 is a schematic flow chart of a method for counting animal numbers according to an embodiment of the present invention.
As shown in fig. 1, the method includes:
s100: and dividing the area to be tested to obtain n areas to be tested.
The area in which the animal moves is called the area to be tested. It can be understood that the animals in the area to be measured cannot be distributed orderly, the number of the animals in a certain area can be more, the number of the animals in a certain area can be less, and the distribution of the animals in different areas can be obviously different along with the change of factors such as temperature, humidity and the like.
Therefore, in this embodiment, the region to be measured is divided into a plurality of regions to be measured. The number of the areas to be tested can be set according to specific conditions. When the area of the region to be measured is larger, the number of the corresponding regions to be measured can be correspondingly set to be larger.
Of course, even when the area of the region to be measured is small, since a large number of animals remain in a certain region, the initial animal count number is not complete in the conventional work experience. Therefore, the region to be measured can also be divided into a larger number of regions to be measured.
In summary, when the region to be tested is divided, detailed analysis can be performed according to actual conditions, so as to obtain a plurality of regions to be tested.
S200: and respectively acquiring the remote sensing image of each to-be-detected film area at preset time intervals.
Due to the back and forth movement of the animal, at time a, animal B is in area C to be tested, and at time a, animal B is in area C to be tested. Therefore, in this embodiment, the remote sensing image of each region to be measured is acquired at preset time intervals. Specifically, the method comprises the following steps:
and acquiring the remote sensing image of each area to be measured every other hour.
S300: and comparing the remote sensing image of the kth to-be-measured area at the first moment with the remote sensing image of the kth to-be-measured area at the second moment to obtain a kth difference image, and repeating the steps until an mth difference image is obtained.
The detailed description will be given by taking the area a to be tested as an example:
and acquiring a remote sensing image b of the to-be-measured area A at 12 points, acquiring a remote sensing image c of the to-be-measured area A again after 1 hour, namely at 13 points, and comparing the remote sensing image b with the remote sensing image c to obtain a difference image d.
S400: and analyzing each difference image respectively to obtain the change number of the animals in the area to be detected.
S500: and determining the target number of the animals according to the variable number and the obtained initial number.
Wherein the first time and the second time are adjacent times, n is an integer greater than 1, and k is greater than 0 and less than or equal to m and less than or equal to n.
It will be appreciated that the number of animals can be derived from the varying number of animals by simple calculation. Specifically, the method comprises the following steps:
the number of initial animals is A, the number of variation of animals is B, and A + B is the target number of statistical animals.
The embodiment provides that: the method comprises the following steps of dividing a region to be measured into a plurality of regions to be measured, taking a preset time interval as a unit, obtaining a remote sensing image of each region to be measured, comparing the remote sensing image of the region A to be measured at the previous moment with the remote sensing image of the region A to be measured at the current moment to obtain a difference image, analogizing the difference images, analyzing each difference image after obtaining a plurality of difference images to obtain the change number of animals in the region to be measured, and determining the target number according to the change number and the initial number, so that on one hand, the technical scheme that manpower and material resources are consumed when statistics is carried out in a manual mode in the prior art is avoided, and the technical effects of saving cost and improving efficiency are achieved; on the other hand, the technical defect that the counting result is not accurate due to the fact that the counting is easily influenced by human factors when the quantity counting is carried out in the prior art is avoided, and the accuracy of the quantity counting of the animals is achieved.
Second embodiment:
the present embodiment is based on the first embodiment. In this embodiment, S100 specifically includes:
and calling a preset historical database.
And after the statistics of the target number of the animals is completed every time, recording the statistical data into a pre-constructed historical database.
And identifying the area to be detected according to the distribution information of the animals in the area to be detected in the historical database to obtain a plurality of identifications.
And identifying the area to be detected based on the historical database.
And dividing the area to be tested according to the distribution information and each identifier to obtain n areas to be tested.
The embodiment provides that: the divided chip region to be tested is obtained according to the historical data, and the technical effect of 'adjusting to local conditions' is achieved.
The third embodiment:
the present embodiment is based on the second embodiment. In this embodiment, dividing the region to be measured according to the distribution information and each identifier specifically includes:
and respectively distributing a weight coefficient to each identifier according to the distribution information.
Specifically, it can be seen from the distribution information that the animals corresponding to the identifier a are relatively concentrated, and the animals corresponding to the identifier B are relatively sparse, so that the weight coefficient corresponding to the identifier a is greater than the weight coefficient corresponding to the identifier B.
And dividing the area to be measured according to each weight coefficient and each preset dividing coefficient.
Wherein one weight coefficient corresponds to one partition coefficient.
Through the technical scheme for dividing the area to be measured by combining the distribution weight coefficient and the division coefficient, the historical data are fully combined, and the technical effect of accurately dividing the area to be measured is achieved.
The fourth embodiment:
the present embodiment is based on any one of the first to third embodiments. In this embodiment, S300 specifically includes:
respectively acquiring a first orthographic projection area and a second orthographic projection area;
comparing the first orthographic projection area with the second orthographic projection area to obtain a kth difference image;
the first orthographic projection area is the orthographic projection area of the animal in the remote sensing image of the kth to-be-measured area at the first moment, and the second orthographic projection area is the orthographic projection area of the animal in the remote sensing image of the kth to-be-measured area at the second moment.
The technical aspect of obtaining the difference image by comparing the obtained first orthographic projection area with the obtained second orthographic projection area provided by the embodiment realizes the technical effect of efficiently and quickly obtaining the difference image, thereby ensuring the accuracy and the high efficiency of animal quantity statistics.
Fifth embodiment:
the present embodiment is based on the fourth embodiment. In this embodiment, the first orthographic projection area S is obtained according to equation 1, equation 1:
wherein, σ is a preset correction coefficient, l is the length of the animal in the remote sensing image of the kth to-be-measured block at the first moment, w is the width of the animal in the remote sensing image of the kth to-be-measured block at the first moment, r is the brightness value of the animal in the remote sensing image of the kth to-be-measured block at the first moment, and r is the preset correction coefficientiThe brightness value of the background of the remote sensing image of the kth to-be-measured area at the first moment is obtained.
Through the technical scheme that the first orthographic projection area is determined according to the formula 1 provided by the embodiment, the influence of environmental factors on the quantity statistics is fully considered, so that the accuracy of the first orthographic projection area is realized, and the accuracy of the animal quantity statistics is realized.
According to another aspect of the embodiments of the present invention, there is provided a computer-readable storage medium including instructions which, when executed on a computer, cause the computer to perform the method according to any of the embodiments.
According to another aspect of the embodiments of the present invention, there is provided a system for counting the number of animals corresponding to the above method.
Referring to fig. 2, fig. 2 is a schematic structural diagram of an animal quantity counting system according to an embodiment of the present invention.
As shown in fig. 2, the system includes: a dividing module, an obtaining module, a comparing module, an analyzing module and a determining module, wherein,
the dividing module is used for: dividing the area to be tested to obtain n areas to be tested;
the acquisition module is used for: respectively acquiring the remote sensing image of each to-be-detected area at preset time intervals;
the comparison module is used for: comparing the remote sensing image of the kth to-be-measured area at the first moment with the remote sensing image of the kth to-be-measured area at the second moment to obtain a kth difference image, and repeating the steps until an mth difference image is obtained;
the analysis module is used for: analyzing each difference image respectively to obtain the variation quantity of animals in the area to be detected;
the determination module is to: determining the target number of the animals according to the variable number and the obtained initial number;
wherein the first time and the second time are adjacent times, n is an integer greater than 1, and k is greater than 0 and less than or equal to m and less than or equal to n.
Through the technical scheme provided by the embodiment, on one hand, the technical defect that manpower and material resources are consumed in the prior art when statistics is performed in a manual mode is avoided, and the technical effects of saving cost and improving efficiency are achieved; on the other hand, the technical defect that the counting result is not accurate due to the fact that the counting is easily influenced by human factors when the quantity counting is carried out in the prior art is avoided, and the accuracy of the quantity counting of the animals is achieved.
In a possible implementation technical solution, the dividing module is specifically configured to:
calling a preset historical database;
according to the distribution information of animals in the to-be-detected area in the historical database, marking the to-be-detected area to obtain a plurality of marks;
and dividing the area to be tested according to the distribution information and each identifier to obtain n areas to be tested.
The embodiment provides that: the divided chip region to be tested is obtained according to the historical data, and the technical effect of 'adjusting to local conditions' is achieved.
In a possible implementation technical solution, the dividing module is specifically configured to:
respectively distributing a weight coefficient for each identifier according to the distribution information;
dividing the area to be measured according to each weight coefficient and each preset division coefficient;
wherein one weight coefficient corresponds to one partition coefficient.
Through the technical scheme for dividing the area to be measured by combining the distribution weight coefficient and the division coefficient, the historical data are fully combined, and the technical effect of accurately dividing the area to be measured is achieved.
In a possible implementation technical solution, the comparison module is specifically configured to:
respectively acquiring a first orthographic projection area and a second orthographic projection area;
comparing the first orthographic projection area with the second orthographic projection area to obtain a kth difference image;
the first orthographic projection area is the orthographic projection area of the animal in the remote sensing image of the kth to-be-measured area at the first moment, and the second orthographic projection area is the orthographic projection area of the animal in the remote sensing image of the kth to-be-measured area at the second moment.
The technical aspect of obtaining the difference image by comparing the obtained first orthographic projection area with the obtained second orthographic projection area provided by the embodiment realizes the technical effect of efficiently and quickly obtaining the difference image, thereby ensuring the accuracy and the high efficiency of animal quantity statistics.
The reader should understand that in the description of this specification, reference to the description of the terms "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should also be understood that, in the embodiments of the present invention, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
While the invention has been described with reference to specific embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.