CN117953223B - Animal intelligent detection method and system based on infrared image processing - Google Patents
Animal intelligent detection method and system based on infrared image processing Download PDFInfo
- Publication number
- CN117953223B CN117953223B CN202410346142.7A CN202410346142A CN117953223B CN 117953223 B CN117953223 B CN 117953223B CN 202410346142 A CN202410346142 A CN 202410346142A CN 117953223 B CN117953223 B CN 117953223B
- Authority
- CN
- China
- Prior art keywords
- infrared
- sliding
- animal
- gray level
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 241001465754 Metazoa Species 0.000 title claims abstract description 230
- 238000012545 processing Methods 0.000 title claims abstract description 28
- 238000001514 detection method Methods 0.000 title claims abstract description 20
- 230000011218 segmentation Effects 0.000 claims abstract description 90
- 238000000034 method Methods 0.000 claims description 32
- 238000005192 partition Methods 0.000 claims description 9
- 230000008569 process Effects 0.000 claims description 9
- 238000004590 computer program Methods 0.000 claims description 6
- 230000003044 adaptive effect Effects 0.000 claims description 5
- 230000006870 function Effects 0.000 claims description 3
- 230000000694 effects Effects 0.000 description 5
- 238000012544 monitoring process Methods 0.000 description 3
- 230000005855 radiation Effects 0.000 description 3
- 230000006399 behavior Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000001931 thermography Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/26—Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
- G06V10/267—Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/50—Extraction of image or video features by performing operations within image blocks; by using histograms, e.g. histogram of oriented gradients [HoG]; by summing image-intensity values; Projection analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/764—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
- G06V10/765—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects using rules for classification or partitioning the feature space
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02A—TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
- Y02A40/00—Adaptation technologies in agriculture, forestry, livestock or agroalimentary production
- Y02A40/70—Adaptation technologies in agriculture, forestry, livestock or agroalimentary production in livestock or poultry
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Human Computer Interaction (AREA)
- Computing Systems (AREA)
- Databases & Information Systems (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Image Analysis (AREA)
Abstract
The invention relates to the technical field of image processing, in particular to an animal intelligent detection method and system based on infrared image processing, comprising the following steps: collecting infrared animal images; acquiring a gray level histogram of the infrared animal graph to obtain a plurality of gray levels of the infrared animal graph; obtaining the possible degree that each gray level of the infrared animal image is a target gray level, and further obtaining the target gray level and a target pixel point in the infrared animal image; acquiring each target area of the infrared animal image according to the target pixel points in the infrared animal image, and further obtaining a segmentation threshold; acquiring a plurality of segmentation areas of the infrared animal image according to the segmentation threshold; acquiring a step length coefficient of each sliding of each divided area of the infrared animal image, further acquiring a sliding step length of each divided area of the infrared animal image when each sliding occurs, and dividing each divided area by combining with a self-adaptive dividing algorithm to acquire an animal area; the animal area obtained by the invention is more complete.
Description
Technical Field
The invention relates to the technical field of image processing, in particular to an animal intelligent detection method and system based on infrared image processing.
Background
For ecological research and protection work of wild animals, understanding of animal distribution, activity and behavior is important, and traditional animal monitoring methods such as manual observation and trap cameras have limitations such as high labor cost and poor real-time performance. The intelligent detection method based on infrared image processing can realize automatic monitoring and identification of animals, so that the monitoring efficiency and the automatic processing of data are improved. When the animal is monitored by the infrared image, the animal in the infrared image needs to be accurately segmented, and then the segmented region is identified, so that the animal type is obtained.
When the animal area in the infrared animal image is segmented according to a threshold segmentation algorithm, segmentation threshold selection influences the segmentation effect.
Disclosure of Invention
In order to solve the problems, the invention provides an animal intelligent detection method and system based on infrared image processing.
The invention relates to an animal intelligent detection method based on infrared image processing, which adopts the following technical scheme:
The embodiment of the invention provides an animal intelligent detection method based on infrared image processing, which comprises the following steps of:
collecting infrared animal images;
Acquiring a gray level histogram of the infrared animal image to obtain a plurality of gray levels of the infrared animal image; according to the number of pixel points corresponding to each gray level of the infrared animal image, obtaining the possible degree that each gray level is a target gray level; acquiring a target gray level according to the possible degree that each gray level of the infrared animal image is the target gray level, and acquiring a target pixel point in the infrared animal image according to the target gray level;
Acquiring each target area of the infrared animal image according to the target pixel points in the infrared animal image; obtaining a segmentation threshold according to gray features of each target area of the infrared animal image; acquiring a plurality of segmentation areas of the infrared animal image according to the segmentation threshold;
acquiring a step length coefficient of each sliding of each divided area of the infrared animal image according to the gray level distribution and the gradient distribution in the divided area; acquiring the sliding step length of each divided area of the infrared animal image when each divided area slides according to the step length coefficient of each divided area of the infrared animal image when each divided area slides;
And dividing each divided region according to the sliding step length of each divided region of the infrared animal image when sliding each time and combining an adaptive dividing algorithm to obtain animal regions.
Preferably, the obtaining the possible degree of each gray level as the target gray level includes the following specific steps:
In the method, in the process of the invention, First/>, representing infrared animal imagesThe individual gray levels are the possible degrees of the target gray level; /(I)First/>, representing infrared animal imagesThe number of pixels corresponding to the gray level in the infrared animal image; /(I)Representing the total number of pixels of the infrared animal image; /(I)Representing gray level serial numbers corresponding to gray levels with the largest number of pixel points in the infrared animal image; /(I)First/>, representing infrared animal imagesGray level sequence numbers for the individual gray levels; /(I)An exponential function that is based on a natural constant; /(I)Representing absolute value symbols.
Preferably, the method for obtaining the target gray level according to the possible degree that each gray level of the infrared animal image is the target gray level includes the following specific steps:
Presetting a degree threshold, and when the possible degree that any gray level of the infrared animal image is a target gray level is greater than the degree threshold, obtaining all target gray levels by taking the gray level as the target gray level;
when the gray level of any pixel point in the infrared animal image is equal to any target gray level, the pixel point is the target pixel point in the infrared image, and all target pixel points in the infrared animal image are obtained.
Preferably, the step of acquiring each target area of the infrared animal image according to the target pixel point in the infrared animal image includes the following specific steps:
and presetting a growth threshold value, and carrying out region growth by taking each target pixel point in the infrared animal image as a seed point to obtain each target region of the infrared animal image.
Preferably, the step of acquiring the segmentation threshold according to the gray scale characteristics of each target region of the infrared animal image includes the following specific steps:
In the method, in the process of the invention, Representing a segmentation threshold; /(I)Represents the/>The number of pixels of the target area; /(I)Represents the/>The average value of the distances between every two pixel points in each target area; /(I)Represents the/>Average gray value of all pixel points in each target area,/>Representing the number of target areas.
Preferably, the method for acquiring a plurality of segmented regions of the infrared animal image according to the segmentation threshold comprises the following specific steps:
And dividing the infrared animal image according to the dividing threshold, and marking the region formed by the pixel points with gray values smaller than the dividing threshold as the dividing region of the infrared animal image to obtain a plurality of dividing regions of the infrared animal image.
Preferably, the step length coefficient of each sliding of each divided area of the infrared animal image is obtained according to the gray level distribution and the gradient distribution in the divided area, and the specific steps are as follows:
The size of the preset sliding window is Presetting the size of a search window as/>The search window is positioned at the left side of the sliding window and is connected with the sliding window;
Any divided area of the infrared animal image is recorded as a current divided area, a sliding window is started from the upper left of the current divided area, and the initial step length is taken as the direction from left to right and from top to bottom Sliding the current segmentation area;
In the method, in the process of the invention, Represents the current segmentation region/>Step length coefficient of the secondary sliding; /(I)Represents the/>, in the current partitionThe average gray value of the pixel points in the sliding window during secondary sliding; /(I)Represents the current segmentation region/>Searching the average gray value of the pixel points in the window during secondary sliding; /(I)Representing the average gray value of the pixel points in the current partition area; /(I)Represents the current segmentation region/>Second/>, in search window at time of slidingGradient amplitude of each pixel,/>Represents the current segmentation region/>Gradient amplitude of a central pixel point in a search window during secondary sliding; /(I)Represents the current segmentation region/>Sliding window on secondary slidingGradient magnitude of each pixel point; /(I)Represents the current segmentation region/>Gradient amplitude of a central pixel point in the sliding window during secondary sliding; /(I)Represents the current segmentation region/>The average gradient amplitude of the pixel points in the sliding window during secondary sliding; /(I)Representing absolute value symbols; /(I)Represents a natural constant; /(I)Representing the side lengths of the sliding window and the search window.
Preferably, the step length of each sliding of each divided area of the infrared animal image is obtained according to the step length coefficient of each sliding of each divided area of the infrared animal image, and the method comprises the following specific steps:
Preset degree threshold If the current segmentation region is/>The step size coefficient of the secondary sliding is larger than or equal to the degree threshold/>When the current segmentation region is/>The sliding step length in the secondary sliding is/>If the current segmentation region is/>The step size coefficient of the secondary sliding is smaller than the degree threshold/>When the current segmentation region is/>The sliding step length in the secondary sliding is/>,/>Representing the side length of the sliding window, the sliding step length of each sliding of each divided area of the infrared animal image is acquired.
Preferably, the method for dividing each divided region according to the sliding step length of each divided region of the infrared animal image in combination with the adaptive dividing algorithm to obtain the animal region comprises the following specific steps:
Based on the sliding step length of each divided area of the infrared animal image when each divided area slides, sliding each divided area by using a sliding window, dividing pixel points in the sliding window according to a self-adaptive threshold dividing algorithm, and taking the pixel points larger than the dividing threshold as the pixel points of the animal area to obtain the animal area in the infrared animal image.
The invention also provides an animal intelligent detection system based on infrared image processing, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes any one of the steps of the animal intelligent detection method based on infrared image processing when executing the computer program.
The technical scheme of the invention has the beneficial effects that: the invention collects infrared animal images; obtaining the possible degree that each gray level of the infrared animal image is a target gray level, further obtaining the target gray level, and obtaining target pixel points in the infrared animal image according to the target gray level, further obtaining each target area of the infrared animal image; according to the gray level characteristics of each target area of the infrared animal image, a segmentation threshold value is obtained to segment the infrared animal image to obtain each segmentation area, and the obtained segmentation threshold value is close to the gray level distribution of the animal area, so that the accuracy of the obtained segmentation areas is higher for the animal area; obtaining a step length coefficient of each sliding of each divided area of the infrared animal image according to the relation between gray level distribution and gradient distribution of pixel points in the sliding window and the searching window; acquiring the sliding step length of each divided area of the infrared animal image when each divided area slides according to the step length coefficient of each divided area of the infrared animal image when each divided area slides; and dividing each divided region according to the sliding step length of each divided region of the infrared animal image when sliding each time and combining an adaptive dividing algorithm, so that each divided region is more complete, and the animal region can be accurately divided.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of steps of an intelligent animal detection method based on infrared image processing;
Fig. 2 is a schematic sliding diagram of a sliding window and a search window.
Detailed Description
In order to further describe the technical means and effects adopted by the invention to achieve the preset aim, the following is a detailed description of specific implementation, structure, characteristics and effects of the animal intelligent detection method based on infrared image processing according to the invention with reference to the accompanying drawings and the preferred embodiment. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The following specifically describes a specific scheme of the animal intelligent detection method based on infrared image processing.
Referring to fig. 1, a flowchart of steps of an intelligent animal detection method based on infrared image processing according to an embodiment of the invention is shown, and the method includes the following steps:
s001, collecting infrared animal images.
In the embodiment of the invention, an infrared thermal imaging camera is used for shooting a photo of an animal moving at night and is recorded as an animal image, in order to facilitate subsequent analysis, firstly, gaussian filtering is used for denoising the animal image so as to eliminate most of noise in the infrared image, and the animal image after denoising is recorded as an infrared animal image.
Thus, an infrared animal image is obtained.
S002, acquiring each gray level of the infrared animal image, and acquiring the possible degree of each gray level as a target gray level; and acquiring the target gray level according to the possibility that each gray level is the target gray level, and further obtaining a target pixel point in the infrared animal image.
It should be noted that the present invention aims to divide an animal region from an obtained infrared animal image, identify the type of an animal according to the divided animal region, and analyze the animal region, and select a division threshold directly affects the accuracy of dividing the animal region.
It should be further noted that, the background area in the infrared animal image, such as trees, grasslands, etc., is an area with smaller heat radiation, and the animal has higher heat emissivity, the animal area is a larger heat radiation area, so the difference between the gray level of the background area and the gray level of the animal area in the infrared animal image is larger than the area of the animal area in the infrared animal image, so the number of pixels of the background area is larger than the number of pixels of the animal area, and the gray level with the largest number of pixels must be the pixels of the background area, so in the embodiment of the invention, for any gray level in the infrared animal image, the smaller the number of corresponding pixels in the infrared animal image is, and the larger the difference between the gray level and the gray level with the largest number of pixels in the infrared animal image is, which means that the corresponding pixels in the infrared animal image are more likely to be the pixels of the animal area, so the gray level is more likely to be the target gray level.
In the embodiment of the invention, a gray level histogram of an infrared animal image is obtained, each gray level of the infrared animal image is obtained, and the possible degree that each gray level of the infrared animal image is a target gray level is obtained:
In the method, in the process of the invention, First/>, representing infrared animal imagesThe individual gray levels are the possible degrees of the target gray level; /(I)First/>, representing infrared animal imagesThe number of pixels corresponding to the gray level in the infrared animal image; /(I)Representing the total number of pixel points in the infrared animal image; /(I)Representing the gray level with the largest number of pixel points in the infrared animal image; /(I)First/>, representing infrared animal imagesGray levels; /(I)An exponential function that is based on a natural constant; /(I)Representing absolute value symbols; /(I)Represents the/>The larger the ratio of the number of the corresponding pixels of the gray level in the infrared animal image to the total number of the pixels in the infrared animal image, the more the ratio, the description of the/>The greater the number of pixels for each gray level, and therefore the/>The more likely the individual gray levels are the gray levels of the background area; Representing gray level and/>, with the greatest number of pixels in an infrared animal image The larger the difference between the gray levels, the more/>, the descriptionThe more likely the corresponding pixel of the individual gray levels in the infrared image is the pixel of the animal region, therefore the/>The greater the likelihood that the individual gray levels are the target gray levels.
Similarly, each gray level of the infrared animal image is acquired to the extent possible for the target gray level.
Preset degree thresholdWhen the possible degree that any gray level in the infrared animal image is the target gray level is greater than the degree threshold, the gray level is considered to be the target gray level, and all the target gray levels are obtained; in the embodiment of the invention, the threshold value/>, of the degree is presetIn other embodiments, the practitioner may set/>, depending on the particular implementationIs a value of (2).
When the gray level of any pixel point in the infrared animal image is equal to any target gray level, the pixel point is the target pixel point in the infrared image, and all the target pixel points in the infrared animal image are obtained in the same way.
And obtaining the target gray level according to the possible degree that each gray level in the infrared animal image is the target gray level, and further obtaining the target pixel point in the infrared animal image.
S003, acquiring each target area of the infrared animal image according to the target pixel point in the infrared animal image; obtaining a segmentation threshold according to the gray level distribution of each target area of the infrared animal image; and dividing the infrared animal image according to the dividing threshold value to obtain each dividing region.
It should be noted that, in step S002, the target pixel points in the infrared animal image are obtained, and the gray values between the target pixel points are inconsistent and distributed in multiple regions of the infrared image, so that region growth needs to be performed according to the obtained target pixel points, and each target region is obtained, and the target region represents a region more likely to be an animal region, so that the segmentation threshold value is conveniently obtained according to the gray distribution of each target region.
In the embodiment of the invention, each target area of the infrared animal image is acquired: presetting a growth thresholdEach target pixel point in the infrared animal image is used as a seed point for region growth, so that each target region of the infrared animal image is obtained, and in the embodiment of the invention, a growth threshold/>In other embodiments, the practitioner may set/>, depending on the particular implementationIs a value of (2).
It should be noted that, all the target areas are obtained, that is, the known target areas are more likely to be the areas of the animal areas, so that the average value of the gray average values of all the target areas is used as the segmentation to segment, but the target areas may have the influence of noise points, and because the number of the pixels of the animal areas is more and the distribution is more concentrated, when the number of the pixels of any one of the target areas is more and the distribution is more concentrated, the target area is more likely to be the animal area, so that the gray average value of the target area should be focused more to obtain a more accurate segmentation threshold, and therefore, in the embodiment of the invention, the weight of each target area is obtained according to the feature that the number of the pixels of each target area is more and the distribution is more concentrated, so as to calculate the segmentation threshold.
Note that, the segmentation threshold value is acquired:
In the method, in the process of the invention, Representing a segmentation threshold; /(I)Represents the/>The number of pixels of the target area; /(I)Represents the/>The average value of the distances between every two pixel points in each target area; /(I)Represents the/>Average gray value of all pixel points in each target area,/>Representing the number of target areas; when/>The more the number of pixels of the target area, and the/>The smaller the average value of the distances between every two pixel points in each target area, the description of the/>The number of pixel points in each target area is large and the distribution is concentrated, so that the first/>The individual regions are more likely to be animal regions and therefore should be more focused on the/>, when acquiring segmentation thresholdsAverage gray value of each target area.
And dividing the infrared animal image according to the dividing threshold value, and marking the region formed by the pixel points with gray values smaller than the dividing threshold value as the dividing region of the infrared animal image, so as to obtain a plurality of dividing regions in the infrared animal image.
Obtaining each target area of the infrared animal image according to the target pixel points in the infrared animal image; obtaining a segmentation threshold according to the gray level distribution of each target area of the infrared animal image; and dividing the infrared animal image according to the dividing threshold value to obtain each dividing region of the infrared animal image.
S004, obtaining the step length coefficient of each sliding of each divided area, and further obtaining the sliding step length of the sliding window when each divided area slides each time.
It should be noted that, since the amounts of heat radiation are different in each part of the animal, the gray values of each part of the animal have a slight difference in the infrared animal image, so when the infrared animal image is segmented according to the segmentation threshold, different parts of the animal may be segmented, so that the obtained animal area is incomplete, and therefore, in the embodiment of the present invention, each segmented area obtained in step S003 needs to be segmented again, so that the segmented animal area is more complete.
It should be noted that, according to the self-adaptive threshold segmentation algorithm, each segmentation area is traversed by setting the sliding window, and the gray average value in the sliding window is used as the segmentation threshold to segment the pixel points in the sliding window, but the sliding step length of the sliding window can affect the segmentation effect and the segmentation speed, and because the sliding window needs to be segmented to enable the segmented animal area to be more complete when the sliding window is positioned at the boundary of the segmentation area, the sliding window does not need to be segmented when the sliding window is positioned in the segmentation area, therefore, when the gradient amplitude of the pixel points in the sliding window is larger, the sliding window is possibly positioned at the edge of the segmentation area, and the sliding step length of the sliding window is supposed to be smaller at the moment, otherwise, the sliding step length of the sliding window is larger; then, a search window with the same size is preset at the front end of the sliding window, if the gray level distribution and the gradient distribution of the pixel points in the sliding window are similar to those of the pixel points in the search window, the sliding window and the search window are more likely to be positioned in the partition area at the same time, the sliding step length of the sliding window is set larger, otherwise, the sliding step length is set smaller, and therefore, in the embodiment of the invention, the step length coefficient of each sliding of the partition area is obtained by combining the characteristics, and the step length of each sliding is convenient to obtain according to the step length coefficient of each sliding later.
In the embodiment of the invention, the size of the preset sliding window isPresetting the size of the search window asThe search window is located at the left side of the sliding window and is connected with the search window, see fig. 2, and in the embodiment of the present invention, the side length/>, of the sliding window and the search window is presetIn other embodiments, the practitioner may set/>, depending on the particular implementationIs of a size of (a) and (b).
Any divided area of the infrared animal image is marked as a current divided area, namely, the leftmost uppermost pixel point of the current divided area is taken as the leftmost uppermost pixel point in the sliding window from the upper left of the current divided area, the starting position of the sliding window is obtained, the situation that the sliding window and the searching window exceed the boundary of the infrared animal image possibly occurs, the part exceeding the boundary is filled through secondary linear interpolation, and the situation that the sliding window and the searching window exceed the current divided area does not influence subsequent processing, so special processing is not carried out; the sliding window is set to be in the initial step length from left to right and from top to bottomSliding the current segmentation area to obtain a step length coefficient of each sliding of the current segmentation area:
In the method, in the process of the invention, Represents the current segmentation region/>Step length coefficient of the secondary sliding; /(I)Represents the/>, in the current partitionThe average gray value of the pixel points in the sliding window during secondary sliding; /(I)Represents the current segmentation region/>Searching the average gray value of the pixel points in the window during secondary sliding; /(I)Representing the average gray value of the pixel points in the current partition area; /(I)Represents the current segmentation region/>When the difference between the average gray values of the search window and the pixel points in the sliding window is smaller, the current segmentation area/>, is describedThe gray level distribution in the search window and the sliding window is similar when sliding for the second time, so the current segmentation area is the/>The sliding step length of the sliding window is larger when sliding for the second time, namely the current segmentation area is the/>The step length coefficient of the secondary sliding is larger; /(I)Represents the current segmentation region/>Second/>, in search window at time of slidingGradient amplitude of each pixel,/>Represents the current segmentation region/>Gradient amplitude of a central pixel point in a search window during secondary sliding; /(I)Represents the current segmentation region/>Sliding window on secondary slidingGradient magnitude of each pixel point; /(I)Represents the current segmentation region/>Gradient amplitude of a central pixel point in the sliding window during secondary sliding; /(I)Represents the current segmentation region/>The sum of gradient differences between all pixel points in the search window and the central pixel point in the secondary sliding; /(I)Represents the current segmentation region/>The sum of gradient differences between all pixel points in the sliding window and the central pixel point during secondary sliding; /(I)Representing the current partition areaThe smaller the ratio of the gradient difference between the pixel points in the search window and the sliding window is, the gradient distribution in the search window and the sliding window is similar, so that the/>, of the current segmentation area is obtainedThe sliding step length of the sliding window is smaller when sliding for the second time, namely the current segmentation area is the first/>The step length coefficient of the secondary sliding is smaller; /(I)Represents the current segmentation region/>The larger the value of the average gradient amplitude of the pixel points in the sliding window is, which indicates that the texture change degree of the pixel points in the sliding window is larger, the sliding window is more likely to be positioned at the edge of the current segmentation area, and smaller sliding step length is needed to keep more details.
Obtain the current segmentation areaStep size coefficient of secondary sliding, preset degree threshold/>If the current segmentation region is/>The step size coefficient of the secondary sliding is larger than or equal to the degree threshold/>When the current segmentation region is the/>The sliding step at the time of the secondary sliding is set to/>If the current segmentation region is/>The step size coefficient of the secondary sliding is smaller than the degree threshold/>When the current segmentation region is the/>The sliding step length in the secondary sliding is/>Wherein/>Representing the side length of the sliding window.
The preset sliding window traverses each divided area in a sliding mode, the step length coefficient of each divided area in each sliding mode is obtained, and then the sliding step length of each divided area in each sliding mode is obtained.
S005, dividing each divided area according to the sliding step length of each divided area when sliding each time, and obtaining the animal area.
In the embodiment of the invention, based on the sliding step length of a sliding window when each divided area slides each time, the sliding window is used for sliding each divided area, the pixel points in the sliding window are divided by using a self-adaptive threshold dividing algorithm, and the pixel points larger than the dividing threshold are taken as the pixel points of the animal area, so that the animal area in the infrared animal image is obtained; each segmentation area is more complete, and a complete animal area is obtained, and it should be noted that the adaptive threshold segmentation is performed in the prior art, and the invention is not repeated.
The embodiment of the invention also provides an animal intelligent detection system based on infrared image processing, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes the steps of any one animal intelligent detection method based on infrared image processing when executing the computer program.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the invention, but any modifications, equivalent substitutions, improvements, etc. within the principles of the present invention should be included in the scope of the present invention.
Claims (6)
1. An animal intelligent detection method based on infrared image processing is characterized by comprising the following steps:
collecting infrared animal images;
Acquiring a gray level histogram of the infrared animal image to obtain a plurality of gray levels of the infrared animal image; according to the number of pixel points corresponding to each gray level of the infrared animal image, obtaining the possible degree that each gray level is a target gray level; acquiring a target gray level according to the possible degree that each gray level of the infrared animal image is the target gray level, and acquiring a target pixel point in the infrared animal image according to the target gray level;
Acquiring each target area of the infrared animal image according to the target pixel points in the infrared animal image; obtaining a segmentation threshold according to gray features of each target area of the infrared animal image; acquiring a plurality of segmentation areas of the infrared animal image according to the segmentation threshold;
acquiring a step length coefficient of each sliding of each divided area of the infrared animal image according to the gray level distribution and the gradient distribution in the divided area; acquiring the sliding step length of each divided area of the infrared animal image when each divided area slides according to the step length coefficient of each divided area of the infrared animal image when each divided area slides;
dividing each divided region according to the sliding step length of each divided region of the infrared animal image when sliding each time and combining with the self-adaptive dividing algorithm to obtain animal regions;
according to the target pixel points in the infrared animal image, each target area of the infrared animal image is acquired, and the method comprises the following specific steps:
presetting a growth threshold value, and taking each target pixel point in the infrared animal image as a seed point to perform region growth to obtain each target region of the infrared animal image;
The method for acquiring the segmentation threshold according to the gray scale characteristics of each target area of the infrared animal image comprises the following specific steps:
In the method, in the process of the invention, Representing a segmentation threshold; /(I)Represents the/>The number of pixels of the target area; /(I)Represents the/>The average value of the distances between every two pixel points in each target area; /(I)Represents the/>The average gray value of all pixels in the target area,Representing the number of target areas;
the method for acquiring a plurality of segmentation areas of the infrared animal image according to the segmentation threshold comprises the following specific steps:
Dividing the infrared animal image according to the dividing threshold, and marking the region formed by the pixel points with gray values smaller than the dividing threshold as the dividing region of the infrared animal image to obtain a plurality of dividing regions of the infrared animal image;
According to the gray level distribution and gradient distribution in the divided areas, the step length coefficient of each sliding of each divided area of the infrared animal image is obtained, and the method comprises the following specific steps:
The size of the preset sliding window is Presetting the size of a search window as/>The search window is positioned at the left side of the sliding window and is connected with the sliding window;
Any divided area of the infrared animal image is recorded as a current divided area, a sliding window is started from the upper left of the current divided area, and the initial step length is taken as the direction from left to right and from top to bottom Sliding the current segmentation area;
In the method, in the process of the invention, Represents the current segmentation region/>Step length coefficient of the secondary sliding; /(I)Represents the/>, in the current partitionThe average gray value of the pixel points in the sliding window during secondary sliding; /(I)Represents the current segmentation region/>Searching the average gray value of the pixel points in the window during secondary sliding; /(I)Representing the average gray value of the pixel points in the current partition area; /(I)Represents the current segmentation region/>Second/>, in search window at time of slidingGradient amplitude of each pixel,/>Represents the current segmentation region/>Gradient amplitude of a central pixel point in a search window during secondary sliding; /(I)Represents the current segmentation region/>Sliding window on secondary slidingGradient magnitude of each pixel point; /(I)Represents the current segmentation region/>Gradient amplitude of a central pixel point in the sliding window during secondary sliding; /(I)Represents the current segmentation region/>The average gradient amplitude of the pixel points in the sliding window during secondary sliding; /(I)Representing absolute value symbols; /(I)Represents a natural constant; /(I)Representing the side lengths of the sliding window and the search window.
2. The method for intelligent detection of animals based on infrared image processing according to claim 1, wherein the step of obtaining the possible degree of each gray level as the target gray level comprises the following specific steps:
In the method, in the process of the invention, First/>, representing infrared animal imagesThe individual gray levels are the possible degrees of the target gray level; /(I)First/>, representing infrared animal imagesThe number of pixels corresponding to the gray level in the infrared animal image; /(I)Representing the total number of pixels of the infrared animal image; /(I)Representing gray level serial numbers corresponding to gray levels with the largest number of pixel points in the infrared animal image; /(I)First/>, representing infrared animal imagesGray level sequence numbers for the individual gray levels; /(I)An exponential function that is based on a natural constant; /(I)Representing absolute value symbols.
3. The method for intelligently detecting animals based on infrared image processing according to claim 1, wherein the steps of obtaining a target gray level according to the possibility that each gray level of the infrared animal image is the target gray level and obtaining a target pixel point in the infrared animal image according to the target gray level comprise the following specific steps:
Presetting a degree threshold, and when the possible degree that any gray level of the infrared animal image is a target gray level is greater than the degree threshold, obtaining all target gray levels by taking the gray level as the target gray level;
when the gray level of any pixel point in the infrared animal image is equal to any target gray level, the pixel point is the target pixel point in the infrared image, and all target pixel points in the infrared animal image are obtained.
4. The method for intelligently detecting animals based on infrared image processing according to claim 1, wherein the step length of each sliding of each divided area of the infrared animal image is obtained according to the step length coefficient of each sliding of each divided area of the infrared animal image, comprising the following specific steps:
Preset degree threshold If the current segmentation region is/>The step size coefficient of the secondary sliding is larger than or equal to the degree threshold/>When the current segmentation region is/>The sliding step length in the secondary sliding is/>If the current segmentation region is/>The step size coefficient of the secondary sliding is smaller than the degree threshold/>When the current segmentation region is/>The sliding step length in the secondary sliding is/>,/>Representing the side length of the sliding window, the sliding step length of each sliding of each divided area of the infrared animal image is acquired.
5. The method for intelligently detecting animals based on infrared image processing according to claim 1, wherein the steps of dividing each divided area according to the sliding step length of each divided area of the infrared animal image in combination with the adaptive dividing algorithm to obtain the animal area comprises the following specific steps:
Based on the sliding step length of each divided area of the infrared animal image when each divided area slides, sliding each divided area by using a sliding window, dividing pixel points in the sliding window according to a self-adaptive threshold dividing algorithm, and taking the pixel points larger than the dividing threshold as the pixel points of the animal area to obtain the animal area in the infrared animal image.
6. An infrared image processing based intelligent animal detection system comprising a memory, a processor and a computer program stored in the memory and running on the processor, characterized in that the processor, when executing the computer program, realizes the steps of an infrared image processing based intelligent animal detection method according to any one of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410346142.7A CN117953223B (en) | 2024-03-26 | 2024-03-26 | Animal intelligent detection method and system based on infrared image processing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410346142.7A CN117953223B (en) | 2024-03-26 | 2024-03-26 | Animal intelligent detection method and system based on infrared image processing |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117953223A CN117953223A (en) | 2024-04-30 |
CN117953223B true CN117953223B (en) | 2024-06-11 |
Family
ID=90799817
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410346142.7A Active CN117953223B (en) | 2024-03-26 | 2024-03-26 | Animal intelligent detection method and system based on infrared image processing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117953223B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101261736A (en) * | 2008-04-10 | 2008-09-10 | 西北工业大学 | Multi-source image moving target collaborative detection method |
CN103870834A (en) * | 2014-04-03 | 2014-06-18 | 张琰 | Method for searching for sliding window based on layered segmentation |
CN104658004A (en) * | 2013-11-20 | 2015-05-27 | 南京中观软件技术有限公司 | Video image-based air refueling auxiliary cohesion method |
CN109145032A (en) * | 2018-08-27 | 2019-01-04 | 北京奥金达农业科技发展有限公司 | A kind of bee raising intelligent monitoring method and system |
CN114429479A (en) * | 2021-12-13 | 2022-05-03 | 杭州领见数字农业科技有限公司 | Remote sensing image segmentation method and device based on image segmentation network |
CN116723793A (en) * | 2021-01-13 | 2023-09-08 | 豪夫迈·罗氏有限公司 | Automatic physiological and pathological assessment based on speech analysis |
-
2024
- 2024-03-26 CN CN202410346142.7A patent/CN117953223B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101261736A (en) * | 2008-04-10 | 2008-09-10 | 西北工业大学 | Multi-source image moving target collaborative detection method |
CN104658004A (en) * | 2013-11-20 | 2015-05-27 | 南京中观软件技术有限公司 | Video image-based air refueling auxiliary cohesion method |
CN103870834A (en) * | 2014-04-03 | 2014-06-18 | 张琰 | Method for searching for sliding window based on layered segmentation |
CN109145032A (en) * | 2018-08-27 | 2019-01-04 | 北京奥金达农业科技发展有限公司 | A kind of bee raising intelligent monitoring method and system |
CN116723793A (en) * | 2021-01-13 | 2023-09-08 | 豪夫迈·罗氏有限公司 | Automatic physiological and pathological assessment based on speech analysis |
CN114429479A (en) * | 2021-12-13 | 2022-05-03 | 杭州领见数字农业科技有限公司 | Remote sensing image segmentation method and device based on image segmentation network |
Non-Patent Citations (1)
Title |
---|
基于灰度梯度图像分割的单木树冠提取研究;冯静静 等;北京林业大学学报;20170331;第39卷(第3期);第16-23页 * |
Also Published As
Publication number | Publication date |
---|---|
CN117953223A (en) | 2024-04-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109447945B (en) | Quick counting method for basic wheat seedlings based on machine vision and graphic processing | |
CN102663397B (en) | Automatic detection method of wheat seedling emergence | |
CN110223349A (en) | A kind of picking independent positioning method | |
Linker | Machine learning based analysis of night-time images for yield prediction in apple orchard | |
CN113269809B (en) | Multi-feature fusion related filtering target tracking method and computer equipment | |
CN109903282B (en) | Cell counting method, system, device and storage medium | |
CN108550162A (en) | A kind of object detecting method based on deeply study | |
Nagar et al. | Pest detection on leaf using image processing | |
CN118115502B (en) | Sewage discharge monitoring method and system based on image features | |
Wang et al. | Using an improved YOLOv4 deep learning network for accurate detection of whitefly and thrips on sticky trap images | |
CN116258968B (en) | Method and system for managing fruit diseases and insects | |
CN117456523A (en) | Crop type identification methods, devices, electronic equipment and media | |
CN117953223B (en) | Animal intelligent detection method and system based on infrared image processing | |
CN116091781A (en) | Data processing method and device for image recognition | |
CN118568419B (en) | Internet of things data optimization processing method and system based on deepwater net cage | |
CN109448024B (en) | Visual tracking method and system for constructing constraint correlation filter by using depth data | |
CN113204990B (en) | Machine learning method and device based on intelligent fishing rod | |
CN110060294A (en) | A kind of yield assessment method of fruit tree crop | |
CN111931789B (en) | Linear crop row extraction method suitable for different illumination, crop density and growth backgrounds | |
CN116052141B (en) | Method, device, equipment and medium for identifying crop growth period | |
CN118154435A (en) | Multi-band image fusion method based on diffusion model | |
CN114821138B (en) | A small target detection method in infrared night vision scenes | |
Peng et al. | Detecting coffee (Coffea arabica L.) sequential flowering events based on image segmentation | |
CN109472771A (en) | Detection method, device and the detection device of maize male ears | |
CN115620196A (en) | Key frame extraction method, article identification method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |