A pet behavior recognition and detection system
Through image processing and audio analysis technology, the eating status and behavioral status of pets are identified, and the problem of low accuracy of pet behavior recognition in the prior art is solved, and the high accuracy and reliability of intelligent pet monitoring are achieved.
Patent Information
- Application Number
- CN202411305059.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2044-09-19
AI Technical Summary
The prior art cannot effectively identify the pet's eating status, resulting in low accuracy in pet behavior recognition.
The image data acquisition module is used to obtain the grayscale image of the camera image, and the gradient analysis and edge detection are performed through the feature extraction module. The contour extraction module analyzes the contour centroid and area. The position analysis module judges the pet's position status, the behavior recognition module recognizes the pet's behavior status, and combines the audio analysis module to evaluate the abnormality of pet's call.
It realizes comprehensive and accurate identification of pet behavior, can identify the pet's location and behavioral status, and discover abnormal situations through sound analysis, improving the accuracy and reliability of pet intelligent monitoring.
Smart Images

Figure CN119091512B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and particularly to a pet behavior recognition and detection system. Background Art
[0002] The pet feeding behavior is one of the important indicators of the pet's health status. Traditional pet feeding behavior monitoring methods mostly rely on manual observation, which is not only inefficient but also difficult to achieve all-weather monitoring.
[0003] Chinese Patent Publication No. CN109757395A discloses a pet behavior detection and monitoring system and method. The system includes a video acquisition unit, a target recognition and feature extraction unit, a behavior analysis unit, a storage unit, a control processing unit, an alarm unit, an audio unit, a communication unit, and a mobile phone. The video acquisition unit is connected to the target recognition and feature extraction unit, and the target recognition and feature extraction unit is connected to the behavior analysis unit; the video acquisition unit, the target recognition and feature extraction unit, and the behavior analysis unit are respectively connected to the storage unit; the behavior analysis unit is respectively connected to the storage unit, the alarm unit, and the audio unit through the control processing unit, and the control processing unit is connected to the mobile phone through the communication unit; when the system is in use, it can monitor the behavior of the pet and identify and analyze its behavior; if the pet shows an alarm behavior, it will alarm the owner through the mobile phone, and the owner can issue commands to the pet through the communication unit; thus, it can be seen that this solution cannot achieve accurate recognition of the pet's feeding state, and there is a problem of low accuracy in pet behavior recognition. Summary of the Invention
[0004] The purpose of the present invention is to provide a pet behavior recognition and detection system to solve at least one of the problems existing in the prior art.
[0005] To achieve the above purpose, the present invention adopts the following technical solutions:
[0006] An image data acquisition module for acquiring a grayscale image of a camera image;
[0007] A feature extraction module for constructing the gradient magnitude of the pixel points of the grayscale image of the camera image, extracting preselected edge pixel points according to the construction result of the pixel point gradient direction, and also for extracting edge pixel points according to the gradient magnitude of the preselected edge pixel points, and forming a preselected contour according to the edge pixel points;
[0008] A contour extraction module for analyzing the centroid of the preselected contour, judging the pet candidate contour and the feeder candidate contour according to the analysis result, and also for extracting the pet contour and the feeder contour according to the area and aspect ratio of the pet candidate contour and the feeder candidate contour;
[0009] A position analysis module is used to construct the centroid of the pet's contour and the centroid of the feeder's contour, and analyze the position state of the pet according to the construction result;
[0010] A behavior recognition module is used to recognize the behavior state of the pet according to the analysis result of the pet's position state within the monitoring period;
[0011] An audio analysis module is used to evaluate the abnormality of the audio according to the average barking volume and average barking frequency of the pet within the monitoring period.
[0012] Furthermore, the feature extraction module is provided with an edge detection unit, a first feature extraction unit and a second feature extraction unit; the edge detection unit is used to construct the gradient amplitude of the pixel point according to the gradient in the horizontal direction and the gradient in the vertical direction of the pixel point, and set: C(x,y)=(Tix 2 +Tiy 2 ) 1 / 2 ;
[0013] The edge detection unit constructs the gradient direction of the pixel point according to the gradient in the horizontal direction and the gradient in the vertical direction of the pixel point, and sets:
[0014] θ(x,y)=arctan(Tiy / Tix), where Tix is the gradient of I(x,y) in the horizontal direction in the grayscale image, I(x,y) is the pixel point with abscissa x and ordinate y in the grayscale image, Tiy is the gradient of I(x,y) in the vertical direction in the grayscale image, C(x,y) is the gradient amplitude of I(x,y) in the grayscale image, and θ(x,y) is the gradient direction of I(x,y) in the grayscale image.
[0015] Furthermore, the first feature extraction unit extracts preselected edge pixels according to the construction result of the pixel point gradient direction, where:
[0016] When a1≤θ(x,y)<a2, if C(x,y)>C(x - 1,y) and C(x,y)>C(x + 1,y), the first feature extraction unit determines that I(x,y) is a preselected edge pixel; if C(x,y)≤C(x - 1,y) or C(x,y)≤C(x + 1,y), the first feature extraction unit determines that I(x,y) is a non-edge pixel;
[0017] When a2 ≤ θ(x, y) < a3, if C(x, y) > C(x - 1, y + 1) and C(x, y) > C(x + 1, y - 1), the first feature extraction unit determines that I(x, y) is a preselected edge pixel point; if C(x, y) ≤ C(x - 1, y + 1) or C(x, y) ≤ C(x + 1, y - 1), the first feature extraction unit determines that I(x, y) is a non-edge pixel point.
[0018] When a3 ≤ θ(x, y) < a4, if C(x, y) > C(x, y - 1) and C(x, y) > C(x, y + 1), the first feature extraction unit determines that I(x, y) is a preselected edge pixel point; if C(x, y) ≤ C(x, y - 1) or C(x, y) ≤ C(x, y + 1), the first feature extraction unit determines that I(x, y) is a non-edge pixel point.
[0019] When a4 ≤ θ(x, y) ≤ a5, if C(x, y) > C(x + 1, y + 1) and C(x, y) > C(x - 1, y - 1), the first feature extraction unit determines that I(x, y) is a preselected edge pixel point; if C(x, y) ≤ C(x + 1, y + 1) or C(x, y) ≤ C(x - 1, y - 1), the first feature extraction unit determines that I(x, y) is a non-edge pixel point.
[0020] The first feature extraction unit records the preselected edge pixel point as YX(x, y), and records the gradient magnitude of the preselected edge pixel point as YXC(x, y).
[0021] Wherein, a1 is the first preset angle, a2 is the second preset angle, a3 is the third preset angle, a4 is the fourth preset angle, and a5 is the fifth preset angle.
[0022] Furthermore, the second feature extraction unit compares the gradient magnitude of the preselected edge pixel point with each preset gradient magnitude to extract edge pixel points, where:
[0023] If YXC(x, y) ≤ T1, the second feature extraction unit determines that YX(x, y) is a non-edge pixel point; if YXC(x, y) ≥ T2, the second feature extraction unit determines that YX(x, y) is an edge pixel point; when T1 < YXC(x, y) < T2, the second feature extraction unit determines that YX(x, y) is a weak edge pixel point. If YXC(x - 1, y) or YXC(x + 1, y) or YXC(x, y - 1) or YXC(x, y + 1) or YXC(x - 1, y + 1) or YXC(x - 1, y - 1) or YXC(x + 1, y - 1) or YXC(x + 1, y + 1) is an edge point, the second feature extraction unit determines that this weak edge point is an edge pixel point; otherwise, the second feature extraction unit determines that this weak edge pixel point is a non-edge pixel point. The second feature extraction unit connects adjacent edge pixel points to form a continuous edge line as a preliminary contour.
[0024] Further, the contour extraction module is provided with a centroid analysis unit and a contour extraction unit; the centroid analysis unit analyzes the centroid of each preliminary contour, and sets the centroid of the i-th preliminary contour as Zi, and sets:
[0025] , where xni is the abscissa of the ni-th edge pixel point of the i-th preliminary contour, yni is the ordinate of the ni-th edge pixel point of the i-th preliminary contour, and Ni is the number of edge pixel points of the i-th preliminary contour;
[0026] If , the centroid analysis unit determines that the i-th preliminary contour is a candidate contour of a pet; if , the centroid analysis unit determines that the i-th preliminary contour is a candidate contour of a feeder; if and , the centroid analysis unit determines that the i-th preliminary contour is an invalid contour, D1 is a first preset area, and D2 is a second preset area;
[0027] The contour extraction unit compares the areas of the candidate pet contours with the preset areas to screen the pet contours. If sk < s1 or sk > s2, the contour extraction unit determines that the k-th candidate pet contour is an invalid contour. If s1 ≤ Sk ≤ s2 and bk < b1, the contour extraction unit determines that the k-th candidate pet contour is an invalid contour. If s1 ≤ Sk ≤ s2 or bk > b2, the contour extraction unit determines that the k-th candidate pet contour is an invalid contour. If s1 ≤ Sk ≤ s2 or b1 ≤ bk ≤ b2, the contour extraction unit determines that the k-th candidate pet contour is a preselected pet contour. When the number of preselected pet contours mc = 1, the contour extraction unit determines that this preselected pet contour is the pet contour. When mc > 1, the contour extraction unit constructs the recommendation coefficients for the preselected pet contours. The contour extraction unit sets the recommendation coefficient of the yc-th preselected pet contour as Wyc, and sets:
[0028] Wyc = - {|SWyc - (s1 + s2) / 2| / [(s1 + s2) / 2] + |bWyc - (b1 + b2) / 2| / [(b1 + b2) / 2]};
[0029] Where sk is the area of the k-th candidate pet contour, s1 is the preset minimum pet area, s2 is the preset maximum pet area, bk is the aspect ratio of the k-th candidate pet contour, b1 is the preset minimum pet aspect ratio, b2 is the preset maximum pet aspect ratio, SWyc is the area of the yc-th preselected pet contour, and bWyc is the aspect ratio of the yc-th preselected pet contour;
[0030] The contour extraction unit sorts the recommendation coefficients of the preselected pet contours and takes the preselected pet contour with the largest recommendation coefficient as the pet contour;
[0031] The contour extraction unit extracts the feeder contour.
[0032] Further, the position analysis module calculates the distance J between the centroid of the pet contour and the centroid of the feeder contour, and sets:
[0033] , CWx is the abscissa of the centroid of the pet contour, CWy is the ordinate of the centroid of the pet contour, WFx is the abscissa of the feeder contour, and WFy is the ordinate of the feeder contour;
[0034] When J ≤ j0, the position analysis module determines that the pet is at the feeding distance. When J > j0, the position analysis module determines that the pet is not at the feeding distance, and j0 is the preset distance.
[0035] Further, the behavior recognition module identifies the behavior state of the pet according to the analysis result of the pet position state within the monitoring period, where:
[0036] If \(t1 / t0\leq\alpha\), the behavior recognition module determines that the pet is not in the "wanting to eat" state in the current monitoring period. If \(t1 / t0 > \alpha\), the behavior recognition module determines that the pet is in the "wanting to eat" state in the current monitoring period, where \(\alpha\) is a preset state coefficient.
[0037] Further, the volume analysis module is provided with a volume analysis unit, a frequency analysis unit, an audio analysis unit, and a noise analysis unit; the volume analysis unit is used to compare the average barking volume \(p0\) of the pet in the monitoring period with the preset volume \(p1\) to construct a volume coefficient.
[0038] The frequency analysis unit compares the average barking frequency \(u0\) of the pet in the monitoring period with the preset frequency \(u1\) to construct a frequency coefficient.
[0039] Further, the audio analysis unit constructs an audio coefficient YP of the pet's barking according to the construction results of the volume coefficient and the frequency coefficient in the monitoring period, and sets \(YP = E1\times\) volume coefficient \(+ E2\times\) frequency coefficient, where \(E1\) is the volume weight and \(E2\) is the frequency weight.
[0040] The audio analysis unit compares the audio coefficient YP with the preset audio coefficient YP0 to evaluate the abnormality of the pet's barking audio in the monitoring period, and adjusts the pet state recognition process according to the evaluation result, where:
[0041] If \(YP\leq YP0\), the audio analysis unit determines that the audio of the pet's barking in the current monitoring period is normal and does not make adjustments. If \(YP > YP0\), the audio analysis unit determines that the audio of the pet's barking in the current monitoring period is abnormal, and adjusts the pet state recognition process, and sets the adjusted preset state coefficient to \(\alpha'\).
[0042] Further, the noise analysis unit compares the average ambient noise \(zb\) obtained in the monitoring period with the preset ambient noise \(zb0\) to optimize the adjustment process of the pet state recognition process. If \(zb\leq zb0\), the noise analysis unit determines that the ambient noise in the current monitoring period is normal and does not make optimizations. If \(zb > zb0\), the noise analysis unit determines that the ambient noise in the current monitoring period is abnormal, and optimizes the adjustment process of the pet state recognition process, and sets the optimized preset volume to \(p1'\).
[0043] The beneficial effects of the present invention are as follows:
[0044] The image data acquisition module acquires grayscale images, providing basic data for subsequent processing. The feature extraction module extracts image edge and contour features through gradient analysis, effectively identifying key information in the images. The contour extraction module analyzes features such as contour centroid and area, accurately extracting the contours of the pet and the feeder. The position analysis module calculates the relative position between the pet and the feeder, determining whether the pet is within the feeding range. The behavior recognition module, based on the position analysis results, determines whether the pet is in the "wanting to eat" state. The audio analysis module analyzes the volume and frequency of the pet's barking, evaluates abnormal situations, and optimizes the behavior recognition results. Each module works in series, from image acquisition, feature extraction to behavior analysis, and combined with audio information, achieving comprehensive and accurate pet behavior recognition. The system can not only identify the position and behavior state of the pet, but also discover abnormal situations through sound analysis, providing comprehensive guardianship for pet owners. At the same time, the system takes into account the influence of environmental noise, further improving the accuracy and reliability of recognition. This multi-modal and multi-level analysis method greatly improves the accuracy and practicality of pet behavior recognition, providing strong support for pet intelligent guardianship. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0046] Figure 1 It is a schematic structural diagram of the pet behavior recognition and detection system for this embodiment.
[0047] Figure 2 It is a schematic structural diagram of the feature extraction module for this embodiment.
[0048] Figure 3 It is a schematic structural diagram of the contour extraction module for this embodiment.
[0049] Figure 4 It is a schematic structural diagram of the audio analysis module for this embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0050] In order to more clearly illustrate the present invention, the following further describes the present invention in conjunction with preferred embodiments and drawings. Similar components in the drawings are denoted by the same reference numerals. Those skilled in the art should understand that the following specific description is illustrative rather than restrictive, and should not be used to limit the protection scope of the present invention.
[0051] It should be noted that although terms such as first, second, and third may be used in the embodiments of the present application for description, these descriptions should not be limited to these terms. These terms are only used to distinguish the descriptions. For example, without departing from the scope of the embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first.
[0052] Please refer to Figure 1 as shown, which is a schematic structural diagram of the pet behavior recognition and detection system of this embodiment. The system includes
[0053] an image data acquisition module for acquiring a grayscale image of a camera image; defining the camera image as an image of the area near the feeder captured by the imaging device. In this embodiment, the imaging device is not specifically limited, and those skilled in the art can freely set it. Among them, the imaging device can be set as a camera sensor; in this embodiment, the acquisition method of the grayscale image of the camera image is not specifically limited, and those skilled in the art can freely set it as long as the acquisition requirements of the grayscale image of the camera image are met. Among them, the camera image can be acquired by the camera sensor, and the grayscale image can be acquired by OpenCV in Python;
[0054] a contour extraction module for constructing the gradient magnitude of the pixel points of the grayscale image of the camera image, extracting preselected edge pixel points according to the construction result of the pixel point gradient direction, and also for extracting edge pixel points according to the gradient magnitude of the preselected edge pixel points and forming a preselected contour according to the edge pixel points. The contour extraction module is connected to the image data acquisition module.
[0055] Please refer to Figure 2 as shown, the contour extraction module includes an edge detection unit, which is used to construct the gradient magnitude of the pixel points according to the gradient of the pixel points in the horizontal direction and the gradient in the vertical direction to obtain the direction information of each edge, so as to improve the accuracy of feature extraction;
[0056] The construction process of the gradient magnitude of the pixel points is as follows:
[0057] C(x,y)=(Tix 2 +Tiy 2 ) 1 / 2 ;
[0058] The edge detection unit constructs the gradient direction of the pixel points according to the gradient of the pixel points in the horizontal direction and the gradient in the vertical direction, and sets:
[0059] θ(x, y) = arctan(Tiy / Tix), where Tix is the gradient of I(x, y) in the horizontal direction in the grayscale image, I(x, y) is the pixel at the abscissa x and ordinate y in the grayscale image, Tiy is the gradient of I(x, y) in the vertical direction in the grayscale image, C(x, y) is the gradient magnitude of I(x, y) in the grayscale image, and θ(x, y) is the gradient direction of I(x, y) in the grayscale image; the edge detection unit can significantly improve the accuracy and efficiency of image analysis through effective gradient calculation and edge detection, providing a reliable basis for subsequent image processing.
[0060] Specifically, the edge detection unit establishes a plane rectangular coordinate system with the lower left corner pixel of the camera image grayscale image as the origin, the upward direction as the positive y-axis, and the rightward direction as the positive x-axis, and represents the positions of each pixel with the coordinates of the pixel; in this embodiment, the method for obtaining the gradient of the pixel in the horizontal direction and the gradient in the vertical direction is not specifically limited, and those skilled in the art can freely set it as long as the requirements for obtaining the gradient of the pixel are met. Among them, the gradient of the pixel can be obtained by applying a 3x3 convolution kernel through the Sobel edge detection algorithm.
[0061] Please continue to refer to Figure 2 As shown, the feature extraction module further includes a first feature extraction unit. The first feature extraction unit extracts preselected edge pixels according to the construction result of the pixel gradient direction to accurately identify the preselected edge pixels. The first feature extraction unit is connected to the edge detection unit;
[0062] The extraction process of the preselected edge pixels is as follows:
[0063] When a1 ≤ θ(x, y) < a2, if C(x, y) > C(x - 1, y) and C(x, y) > C(x + 1, y), the first feature extraction unit determines that I(x, y) is a preselected edge pixel. If C(x, y) ≤ C(x - 1, y) or C(x, y) ≤ C(x + 1, y), the first feature extraction unit determines that I(x, y) is a non-edge pixel;
[0064] When a2 ≤ θ(x, y) < a3, if C(x, y) > C(x - 1, y + 1) and C(x, y) > C(x + 1, y - 1), the first feature extraction unit determines that I(x, y) is a preselected edge pixel. If C(x, y) ≤ C(x - 1, y + 1) or C(x, y) ≤ C(x + 1, y - 1), the first feature extraction unit determines that I(x, y) is a non-edge pixel;
[0065] When \(a3\leq\theta(x,y)\lt a4\), if \(C(x,y)\gt C(x,y - 1)\) and \(C(x,y)\gt C(x,y + 1)\), the first feature extraction unit determines that \(I(x,y)\) is a pre - selected edge pixel point. If \(C(x,y)\leq C(x,y - 1)\) or \(C(x,y)\leq C(x,y + 1)\), the first feature extraction unit determines that \(I(x,y)\) is a non - edge pixel point;
[0066] When \(a4\leq\theta(x,y)\leq a5\), if \(C(x,y)\gt C(x + 1,y + 1)\) and \(C(x,y)\gt C(x - 1,y - 1)\), the first feature extraction unit determines that \(I(x,y)\) is a pre - selected edge pixel point. If \(C(x,y)\leq C(x + 1,y + 1)\) or \(C(x,y)\leq C(x - 1,y - 1)\), the first feature extraction unit determines that \(I(x,y)\) is a non - edge pixel point;
[0067] The first feature extraction unit records the pre - selected edge pixel point as \(YX(x,y)\) and records the gradient magnitude of the pre - selected edge pixel point as \(YXC(x,y)\);
[0068] Where \(a1\) is the first preset angle, \(a2\) is the second preset angle, \(a3\) is the third preset angle, \(a4\) is the fourth preset angle, and \(a5\) is the fifth preset angle. The first feature extraction unit improves the detection accuracy through comprehensive judgment of the gradient direction and magnitude, enhances the resistance to noise, and improves the efficiency of subsequent image processing and analysis.
[0069] Specifically, in this embodiment, the values of each preset angle are not specifically limited, and those skilled in the art can freely set them as long as the setting requirements of each preset angle are met. Among them, the best value of \(a1\) is \(0^{\circ}\), the best value of \(a2\) is \(22.5^{\circ}\), the best value of \(a3\) is \(67.5^{\circ}\), the best value of \(a4\) is \(112.5^{\circ}\), and the best value of \(a5\) is \(157.5^{\circ}\).
[0070] Please continue to refer to Figure 2 As shown, the feature extraction module further includes a second feature extraction unit, which is used to compare the gradient magnitude of the pre - selected edge pixel point with each preset gradient magnitude to extract the edge pixel point, improving the accuracy and precision of edge detection. The second feature extraction unit is connected to the first feature extraction unit;
[0071] The process of extracting edge pixel points is as follows:
[0072] When \(YXC(x,y)\leq T1\), the second feature extraction unit determines that \(YX(x,y)\) is a non - edge pixel point;
[0073] When \(YXC(x,y)\geq T2\), the second feature extraction unit determines that \(YX(x,y)\) is an edge pixel point;
[0074] When T1 < YXC(x, y) < T2, the second feature extraction unit determines that YX(x, y) is a weak edge pixel point. If YXC(x - 1, y) or YXC(x + 1, y) or YXC(x, y - 1) or YXC(x, y + 1) or YXC(x - 1, y + 1) or YXC(x - 1, y - 1) or YXC(x + 1, y - 1) or YXC(x + 1, y + 1) is an edge point, the second feature extraction unit determines that this weak edge point is an edge pixel point; otherwise, the second feature extraction unit determines that this weak edge pixel point is a non-edge pixel point.
[0075] Wherein, T1 is a preset minimum gradient amplitude, and T2 is a preset maximum gradient.
[0076] The second feature extraction unit connects adjacent edge pixel points to form a continuous edge line as a preliminary contour; the second feature extraction unit sets the upper and lower limits of the gradient amplitude to effectively distinguish edge pixel points, weak edge pixel points, and non-edge pixel points, thereby improving the accuracy and precision of edge detection.
[0077] Specifically, in this embodiment, the values of T1 and T2 are not specifically limited, and those skilled in the art can freely set them as long as the value requirements of T1 and T2 are met. Among them, the optimal value of T1 is 0.2 × Tmax, and the optimal value of T2 is 0.5 × Tmax. Tmax is the maximum value of the gradient amplitude of pixel points, which can be obtained by sorting the gradient amplitudes of each pixel point through the bubble sort method.
[0078] Please continue to refer to Figure 1 As shown, the system further includes a contour extraction module, which is used to analyze the centroid of the preliminary contour, judge the candidate pet contour and the candidate feeder contour according to the analysis result, and is also used to extract the pet contour and the feeder contour according to the area and aspect ratio of the candidate pet contour and the candidate feeder contour. The contour extraction module is connected to the feature extraction module.
[0079] Please refer to Figure 3 As shown, the contour extraction module includes a centroid analysis unit, which is used to analyze the centroid of each preliminary contour, judge the candidate pet contour and the candidate feeder contour according to the analysis result, so as to effectively filter out the contours that do not conform to the shape or position of the target object and make the recognition of invalid contours more accurate.
[0080] The centroid analysis process of the preliminary contour is as follows:
[0081] Set the centroid of the i-th preliminary contour as Zi, and set:
[0082] , where xni is the abscissa of the ni-th edge pixel of the i-th preselected contour, yni is the ordinate of the ni-th edge pixel of the i-th preselected contour, and Ni is the number of edge pixels of the i-th preselected contour;
[0083] The judgment process of the pet candidate contour and the feeder candidate contour is as follows:
[0084] If , the centroid analysis unit determines that the i-th preselected contour is a pet candidate contour; if , the centroid analysis unit determines that the i-th preselected contour is a feeder candidate contour; if and , the centroid analysis unit determines that the i-th preselected contour is an invalid contour, D1 is the first preset area, and D2 is the second preset area; through an efficient contour centroid calculation and classification mechanism, the centroid analysis unit can quickly and accurately identify the target object while reducing the false detection rate and calculation complexity, improving the efficiency of image processing.
[0085] Specifically, in this embodiment, the setting of the preset area is not specifically limited, and those skilled in the art can set it freely as long as the setting requirements of the preset area are met. Among them, the first preset area is the area where the pet eats, and the second preset area is the area of the feeder. For example, D1 = {(x, y)|0.4X ≤ x ≤ 0.6X, 0.4Y ≤ y ≤ 0.6Y} and D2 = {(x, y)|0.72X ≤ x ≤ 0.8X, 0.45Y ≤ y ≤ 0.53Y} can be set, where X is the length of the grayscale image of the camera image and Y is the width of the grayscale image of the camera image.
[0086] Please continue to refer to Figure 3 As shown, the contour extraction module further includes a contour extraction unit, which is used to obtain the areas and aspect ratios of the pet candidate contour and the feeder candidate contour, and extract the pet contour and the feeder contour to effectively screen out valid contours that meet specific criteria. The aspect ratio is the aspect ratio of the minimum bounding rectangle of the pet candidate contour and the feeder candidate contour. The contour extraction unit is connected to the centroid analysis unit;
[0087] The extraction process of the pet contour and the feeder contour is as follows:
[0088] The contour extraction unit compares the areas of the candidate pet contours with the preset areas to screen the pet contours. If sk < s1 or sk > s2, the contour extraction unit determines that the k-th candidate pet contour is an invalid contour. If s1 ≤ Sk ≤ s2 and bk < b1, the contour extraction unit determines that the k-th candidate pet contour is an invalid contour. If s1 ≤ Sk ≤ s2 or bk > b2, the contour extraction unit determines that the k-th candidate pet contour is an invalid contour. If s1 ≤ Sk ≤ s2 or b1 ≤ bk ≤ b2, the contour extraction unit determines that the k-th candidate pet contour is a preselected pet contour. When the number of preselected pet contours mc = 1, the contour extraction unit determines that the preselected pet contour is a pet contour. When mc > 1, the contour extraction unit constructs the recommendation coefficients for each preselected pet contour. The contour extraction unit sets the recommendation coefficient of the yc-th preselected pet contour as Wyc, and sets:
[0089] Wyc = - {|SWyc - (s1 + s2) / 2| / [(s1 + s2) / 2] + |bWyc - (b1 + b2) / 2| / [(b1 + b2) / 2]};
[0090] Where sk is the area of the k-th candidate pet contour, s1 is the preset minimum pet area, s2 is the preset maximum pet area, bk is the aspect ratio of the k-th candidate pet contour, b1 is the preset minimum pet aspect ratio, b2 is the preset maximum pet aspect ratio, SWyc is the area of the yc-th preselected pet contour, and bWyc is the aspect ratio of the yc-th preselected pet contour;
[0091] The contour extraction unit sorts the recommendation coefficients of each preselected pet contour and takes the preselected pet contour with the largest recommendation coefficient as the pet contour;
[0092] The contour extraction unit extracts the feeder contour. In this embodiment, the process of extracting the feeder contour is the same as that of the pet contour, and this embodiment will not be elaborated. The contour extraction unit can effectively reduce the false detection and missed detection situations and improve the overall detection accuracy by setting the threshold conditions of the area and aspect ratio.
[0093] Specifically, in this embodiment, the method for obtaining the area and aspect ratio of the pet's candidate contour and the feeder's candidate contour is not specifically limited. Those skilled in the art can set it freely, and only need to meet the requirements for obtaining the area and aspect ratio of the pet's candidate contour and the feeder's candidate contour, wherein the aspect ratio can be obtained by using the OpenCV function cv2.minAreaRect(), and the area can be obtained by using the OpenCV function cv2.contourArea(); in this embodiment, the value of the screening threshold is not specifically limited. Those skilled in the art can set it freely, and only need to meet the value requirements of each screening threshold, wherein, when the pet is a small pet, the best value of s1 is 1000 pixels, the best value of s2 is 5000 pixels, the best value of b1 is 1.5, and the best value of b2 is 2; when extracting the feeder contour, the best value of the minimum area threshold is 1000 pixels, the best value of the maximum area threshold is 3000 pixels, the best value of the minimum aspect ratio threshold is 1, and the best value of the maximum aspect ratio threshold is 1.5.
[0094] Please continue reading Figure 1 As shown, the system further includes a position analysis module for constructing the pet contour centroid and the feeder contour centroid, and analyzing the position state of the pet according to the construction result, and the position analysis module is connected to the contour extraction module; the position analysis module constructs the pet contour centroid CW (CWx, CWy) and the feeder contour centroid WF (WFx, WFy), CWx is the horizontal coordinate of the pet contour centroid, CWy is the vertical coordinate of the pet contour centroid, WFx is the horizontal coordinate of the feeder contour, and WFy is the vertical coordinate of the feeder contour; the method for constructing the pet contour centroid and the feeder contour centroid in this embodiment is the same as the method for constructing the pre-selected contour, and this embodiment will not be repeated;
[0095] The position analysis module calculates the distance J between the pet's contour centroid and the feeder's contour centroid, and sets:
[0096] ;
[0097] When J≤j0, the position analysis module determines that the pet is at the feeding distance; when J>j0, the position analysis module determines that the pet is not at the feeding distance, and j0 is a preset distance; the position analysis module improves the accuracy of the pet's position status determination through a reasonable center of mass calculation and distance determination mechanism, thereby improving the accuracy of the pet's status recognition.
[0098] Specifically, this embodiment does not impose any specific limitation on the setting of the preset distance, and those skilled in the art can freely set it as long as the setting requirements of the preset distance are met, wherein the best value of j0 is 80 pixels.
[0099] Please continue to refer to Figure 1 As shown, the system further includes a behavior recognition module, which is used to recognize the behavior state of the pet according to the analysis result of the pet position state within the monitoring period. The behavior recognition module is connected to the position analysis module;
[0100] The process of recognizing the behavior state of the pet is as follows:
[0101] If t1 / t0 ≤ α, the behavior recognition module determines that the pet is not in the "wanting to eat" state in the current monitoring period. If t1 / t0 > α, the behavior recognition module determines that the pet is in the "wanting to eat" state in the current monitoring period;
[0102] The behavior recognition module outputs the pet behavior state to the user; t1 is the duration of the pet being within the feeding distance in the monitoring period, t0 is the duration of the monitoring period, and α is a preset state coefficient; the behavior recognition module can accurately determine whether the pet is in the "wanting to eat" state according to the pet's activity in the monitoring period, so as to optimize the feeding timing. Secondly, through the set monitoring coefficient α, the system can flexibly adapt to the behavior habits of different pets.
[0103] Specifically, in this embodiment, the setting of the monitoring period is not specifically limited, and those skilled in the art can freely set it as long as the setting requirements of the monitoring period are met. Among them, the monitoring period can be set to 2 min, 3 min, etc.; in this embodiment, the setting of the preset state coefficient is not specifically limited, and those skilled in the art can freely set it as long as the setting requirements of the preset state coefficient are met. Among them, the best value of α is 0.78.
[0104] Please continue to refer to Figure 1 As shown, the system further includes an audio analysis module, which is used to obtain the average barking volume and average barking frequency of the pet within the monitoring period, and evaluate the abnormality of the audio according to the average barking volume and average barking frequency of the pet within the monitoring period. The audio analysis module is connected to the behavior recognition module.
[0105] Specifically, in this embodiment, the acquisition method of the average barking volume and average barking frequency of the pet within the monitoring period is not specifically limited, and those skilled in the art can freely set it as long as the acquisition requirements of the average barking volume and average barking frequency of the pet within the monitoring period are met. Among them, the average ambient noise can be obtained through a sound sensor.
[0106] Please refer to Figure 4 As shown, the audio recognition module includes a volume analysis unit, which compares the average barking volume p0 of the pet within the monitoring period with the preset volume p1 to construct a volume coefficient for effectively monitoring the pet's emotional state;
[0107] The construction process of the volume coefficient is as follows:
[0108] The volume analysis unit compares the average barking volume p0 of the pet within the monitoring period with the preset volume p1 to construct the volume coefficient. If p0 ≤ p1, the volume analysis unit determines that the pet's barking volume is normal and sets the volume coefficient to YL1, where YL1 = 0. If p0 > p1, the volume analysis unit determines that the pet's barking volume is abnormal and sets the volume coefficient to YL2, where YL2 = ln[(p0 - p1) / (p0 + p1)+1]; by comparing the average value of the pet's barking volume with the preset value, the volume analysis unit can accurately determine whether the pet's barking is normal, thereby effectively monitoring the pet's emotional state. When abnormal volume is detected, the system will generate a corresponding volume coefficient to provide feedback for pet behavior recognition, improving the accuracy of pet behavior recognition.
[0109] Specifically, in this embodiment, the setting of the preset volume is not specifically limited, and those skilled in the art can freely set it as long as the setting requirements of the preset volume are met. Among them, when the pet is a small dog, the optimal value of p1 is 70 decibels.
[0110] Please continue to refer to Figure 4 As shown, the audio analysis module further includes a frequency analysis unit, which is used to compare the average barking frequency u0 of the pet within the monitoring period with the preset frequency u1 to construct the frequency coefficient, so as to effectively determine whether the frequency of the pet's barking is normal. The frequency analysis unit is connected to the volume analysis unit;
[0111] The construction process of the frequency coefficient is as follows:
[0112] The frequency analysis unit compares the average barking frequency u0 of the pet within the monitoring period with the preset frequency u1 to construct the frequency coefficient. If u0 ≤ u1, the frequency analysis unit determines that the pet's barking frequency is normal and sets the frequency coefficient to PL1, where PL1 = 0. If u0 > u1, the frequency analysis unit determines that the pet's barking frequency is abnormal and sets the frequency coefficient to PL2, where PL2 = (u0 - u1) / (u0 + u1); when monitoring the frequency of the pet's barking, by comparing with the preset frequency, the frequency analysis unit can effectively determine whether the frequency of the pet's barking is normal to provide feedback for pet behavior recognition, improving the accuracy of pet behavior recognition.
[0113] Specifically, in this embodiment, the setting of the preset frequency is not specifically limited, and those skilled in the art can freely set it as long as the setting requirements of the preset frequency are met. Among them, when the pet is a small dog, the optimal value of u1 is 400 hertz.
[0114] Please continue to refer toFigure 4 As shown, the audio analysis module further includes an audio analysis unit, which is used to construct the audio coefficient YP of the pet's barking according to the construction results of the volume coefficient and the frequency coefficient within the monitoring period, and adjust the pet state recognition process to improve the accuracy of pet behavior analysis. The audio analysis unit is connected to the volume analysis unit;
[0115] The adjustment process of the pet state recognition process is as follows:
[0116] The audio analysis unit constructs the audio coefficient YP of the pet's barking according to the construction results of the volume coefficient and the frequency coefficient within the monitoring period, and sets YP = E1×volume coefficient + E2×frequency coefficient, where E1 is the volume weight, E2 is the frequency weight, E1 + E2 = 1, and E1 < E2;
[0117] The audio analysis unit compares the audio coefficient YP with the preset audio coefficient YP0 to evaluate the abnormality of the pet's barking audio within the monitoring period, and adjusts the pet state recognition process according to the evaluation result, where:
[0118] If YP ≤ YP0, the audio analysis unit determines that the audio of the pet's barking in the current monitoring period is normal and does not make adjustments. If YP > YP0, the audio analysis unit determines that the audio of the pet's barking in the current monitoring period is abnormal and adjusts the pet state recognition process, and sets the adjusted preset state coefficient to α’, and sets:
[0119] α’ = α×[1 - e (YP-YP0)-1 ) / (e - 1)], where e is the natural logarithm; the audio analysis unit synthesizes the volume coefficient and the frequency coefficient to construct the audio coefficient of the pet's barking, and evaluates the abnormality of the pet's barking through comparison with the preset audio coefficient, so as to be able to adjust the pet state recognition process in real time, make the system more intelligent, and improve the accuracy of pet behavior analysis.
[0120] Specifically, in this embodiment, the settings of each weight and the preset audio coefficient are not specifically limited, and those skilled in the art can freely set them as long as the settings of each weight and the preset audio coefficient meet the requirements. Among them, the best value of E1 is 0.4, the best value of E2 is 0.6, and the best value of YP0 is 0.15.
[0121] Please continue to refer to Figure 4 As shown, the audio analysis module further includes a noise analysis unit, which is used to compare the average environmental noise zb obtained within the monitoring period with the preset environmental noise zb0 to optimize the adjustment process of the pet state recognition process, so as to optimize the pet state recognition process. The noise analysis unit is connected to the audio analysis unit;
[0122] The noise analysis unit compares the average ambient noise zb obtained within the monitoring period with the preset ambient noise zb0 to optimize the adjustment process of the pet state recognition process. If zb ≤ zb0, the noise analysis unit determines that the ambient noise in the current monitoring period is normal and does not perform optimization. If zb > zb0, the noise analysis unit determines that the ambient noise in the current monitoring period is abnormal and optimizes the adjustment process of the pet state recognition process, and sets the optimized preset volume to p1', where:
[0123] p1' = p1 × {1 + exp[(lg(zb - zb0) / (zb + zb0)]}; The noise analysis unit optimizes the pet state recognition process by comparing the monitored ambient noise with the preset ambient noise, reduces the interference of environmental factors on pet audio, and improves the accuracy of pet behavior recognition.
[0124] Specifically, in this embodiment, the method for obtaining the average ambient noise is not specifically limited, and those skilled in the art can freely set it as long as the requirements for obtaining the average ambient noise are met. Among them, the average ambient noise can be obtained through a sound sensor; in this embodiment, the value of the preset ambient noise is not specifically limited, and those skilled in the art can freely set it as long as the requirements for the value of the preset ambient noise are met. Among them, the optimal value of zb0 is 45 decibels.
[0125] Specifically, the pet behavior recognition and detection system described in this embodiment is applied to the recognition of the pet's eating state. By extracting multi-dimensional features from the grayscale images collected by the camera, and analyzing the positions of the pet and the feeder according to the extracted features, combined with the position state analysis results and the monitoring period, the behavior state of the pet is recognized. The audio analysis module evaluates the volume and frequency of the pet's barking, and adjusts the behavior recognition process according to the results; realizing the intelligent and accurate recognition of pet behavior, and improving the efficiency and accuracy of pet behavior detection.
[0126] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, rather than limitations on the implementation manners of the present invention. For those of ordinary skill in the art, other different forms of changes or variations can be made based on the above description. It is impossible to list all the implementation manners here. Any obvious changes or variations derived from the technical solutions of the present invention still fall within the protection scope of the present invention.
Claims
1. A pet behavior recognition and detection system, characterized in that: include, An image data acquisition module, used to acquire a grayscale image of a camera image; A feature extraction module, used to construct the gradient amplitude of the grayscale image pixel points of the camera image, extract the pre-selected edge pixel points according to the construction result of the pixel gradient direction, extract the edge pixel points according to the gradient amplitude of the pre-selected edge pixel points, and form a pre-selected contour according to the edge pixel points; A contour extraction module, for analyzing the centroid of the pre-selected contours, and judging the pet contours and the feeder contours according to the analysis results, and for extracting the pet contours and the feeder contours according to the areas and aspect ratios of the pet contours and the feeder contours; A position analysis module is used to construct the centroid of the pet's outline and the centroid of the feeder's outline, and analyze the pet's position status based on the construction results; A behavior recognition module is used to recognize the behavior state of the pet based on the analysis results of the pet's position state during the monitoring period; An audio analysis module is used to evaluate the abnormality of the audio according to the average volume and frequency of the pet's calls during the monitoring period; The behavior recognition module recognizes the behavior state of the pet according to the analysis result of the pet's position state during the monitoring period, wherein: If t1 / t0≤α, the behavior recognition module determines that the pet is not in the "want to eat" state during the current monitoring period; if t1 / t0>α, the behavior recognition module determines that the pet is in the "want to eat" state during the current monitoring period, t1 is the length of time the pet is at the eating distance during the monitoring period, t0 is the length of the monitoring period, and α is the preset state coefficient; The audio analysis module is provided with a volume analysis unit, a frequency analysis unit, an audio analysis unit and a noise analysis unit; the volume analysis unit is used to compare the average call volume p0 of the pet during the monitoring period with the preset volume p1 to construct a volume coefficient; the construction process of the volume coefficient is as follows: The volume analysis unit compares the average call volume p0 of the pet during the monitoring period with the preset volume p1 to construct a volume coefficient. If p0≤p1, the volume analysis unit determines that the pet's call volume is normal, and sets the volume coefficient to YL1, setting YL1=0. If p0>p1, the volume analysis unit determines that the pet's call volume is abnormal, and sets the volume coefficient to YL2, setting YL2=ln[(p0-p1) / (p0+p1)+1]; The frequency analysis unit compares the pet's average call frequency u0 during the monitoring period with the preset frequency u1 to construct a frequency coefficient; the construction process of the frequency coefficient is as follows: The frequency analysis unit compares the pet's average call frequency u0 during the monitoring period with the preset frequency u1 to construct a frequency coefficient. If u0≤u1, the frequency analysis unit determines that the pet's call frequency is normal, and sets the frequency coefficient to PL1, setting PL1=0. If u0>u1, the frequency analysis unit determines that the pet's call frequency is abnormal, and sets the frequency coefficient to PL2, setting PL2=(u0-u1) / (u0+u1); The audio analysis unit constructs the audio coefficient YP of the pet's call according to the construction results of the volume coefficient and the frequency coefficient in the monitoring period, and sets YP=E1×volume coefficient+E2×frequency coefficient, where E1 is the volume weight and E2 is the frequency weight; The audio analysis unit compares the audio coefficient YP with the preset audio coefficient YP0 to evaluate the abnormality of the pet's call audio during the monitoring period, and adjusts the pet status recognition process according to the evaluation result, wherein: If YP≤YP0, the audio analysis unit determines that the audio of the pet's call in the current monitoring period is normal and does not make any adjustments. If YP>YP0, the audio analysis unit determines that the audio of the pet's call in the current monitoring period is abnormal and adjusts the recognition process of the pet's state, and sets the adjusted preset state coefficient to α', setting: α'=α×[1-e(YP-YP0)-1) / (e-1)], where e is the natural logarithm; The noise analysis unit compares the average ambient noise zb obtained during the monitoring period with the preset ambient noise zb0 to optimize the adjustment process of the pet status recognition process. If zb≤zb0, the noise analysis unit determines that the ambient noise in the current monitoring period is normal and does not perform optimization. If zb>zb0, the noise analysis unit determines that the ambient noise in the current monitoring period is abnormal and optimizes the adjustment process of the pet status recognition process, and sets the optimized preset volume to p1': p1'=p1×{1+exp[(lg(zb-zb0) / (zb+zb0)]}.
2. The pet behavior recognition and detection system according to claim 1, characterized in that: The feature extraction module is provided with an edge detection unit, a first feature extraction unit and a second feature extraction unit; the edge detection unit is used to construct the gradient amplitude of the pixel point according to the gradient of the pixel point in the horizontal direction and the gradient in the vertical direction, and set: C(x, y) = (Tix 2 +Tiy 2 ) 1 / 2 ; The edge detection unit constructs the gradient direction of the pixel point according to the gradient of the pixel point in the horizontal direction and the gradient of the pixel point in the vertical direction, and sets: θ(x,y)=arctan(Tiy / Tix), Tix is the horizontal gradient of I(x,y) in the grayscale image, I(x,y) is the pixel with abscissa x and ordinate y in the grayscale image, Tiy is the vertical gradient of I(x,y) in the grayscale image, C(x,y) is the gradient amplitude of I(x,y) in the grayscale image, and θ(x,y) is the gradient direction of I(x,y) in the grayscale image.
3. The pet behavior recognition and detection system according to claim 2, characterized in that: The first feature extraction unit extracts pre-selected edge pixels according to the construction result of the pixel gradient direction, wherein: When a1≤θ(x,y)<a2, if C(x,y)>C(x-1,y) and C(x,y)>C(x+1,y), the first feature extraction unit determines I(x,y) as a pre-selected edge pixel point, and if C(x,y)≤C(x-1,y) or C(x,y)≤C(x+1,y), the first feature extraction unit determines I(x,y) as a non-edge pixel point; When a2≤θ(x,y)<a3, if C(x,y)>C(x-1,y+1) and C(x,y)>C(x+1,y-1), the first feature extraction unit determines I(x,y) as a pre-selected edge pixel point, and if C(x,y)≤C(x-1,y+1) or C(x,y)≤C(x+1,y-1), the first feature extraction unit determines I(x,y) as a non-edge pixel point; When a3≤θ(x,y)<a4, if C(x,y)>C(x,y-1) and C(x,y)>C(x,y+1), the first feature extraction unit determines I(x,y) as a pre-selected edge pixel point, and if C(x,y)≤C(x,y-1) or C(x,y)≤C(x,y+1), the first feature extraction unit determines I(x,y) as a non-edge pixel point; When a4≤θ(x,y)≤a5, if C(x,y)>C(x+1,y+1) and C(x,y)>C(x-1,y-1), the first feature extraction unit determines I(x,y) as a pre-selected edge pixel point; if C(x,y)≤C(x+1,y+1) or C(x,y)≤C(x-1,y-1), the first feature extraction unit determines I(x,y) as a non-edge pixel point; The first feature extraction unit records the pre-selected edge pixel point as YX(x, y), and records the gradient amplitude of the pre-selected edge pixel point as YXC(x, y); Among them, a1 is the first preset angle, a2 is the second preset angle, a3 is the third preset angle, a4 is the fourth preset angle, and a5 is the fifth preset angle.
4. The pet behavior recognition and detection system according to claim 3, characterized in that: The second feature extraction unit compares the gradient amplitude of the preselected edge pixel points with each preset gradient amplitude to extract the edge pixel points, wherein: If YXC(x,y)≤T1, the second feature extraction unit determines that YX(x,y) is a non-edge pixel; if YXC(x,y)≥T2, the second feature extraction unit determines that YX(x,y) is an edge pixel; when T1<YXC(x,y)<T2, the second feature extraction unit determines that YX(x,y) is a weak edge pixel. If YXC(x-1,y) or YXC(x+1,y) or YXC(x,y-1) or YXC(x,y+1) or YXC(x-1,y+1) or YXC(x-1,y-1) or YXC(x+1,y-1) or YXC(x+1,y-1) or YXC(x+1,y+1) is an edge point, and the second feature extraction unit determines that the weak edge pixel point is an edge pixel point. Otherwise, the second feature extraction unit determines that the weak edge pixel point is a non-edge pixel point. The second feature extraction unit connects adjacent edge pixels to form a continuous edge line as a pre-selected contour.
5. The pet behavior recognition and detection system according to claim 4, characterized in that: The contour extraction module is provided with a centroid analysis unit and a contour extraction unit; the centroid analysis unit analyzes the centroid of each pre-selected contour, and sets the centroid of the i-th pre-selected contour as Zi, and sets: , xni is the horizontal coordinate of the ni-th edge pixel point of the ith pre-selected contour, yni is the vertical coordinate of the ni-th edge pixel point of the ith pre-selected contour, and Ni is the number of edge pixels of the ith pre-selected contour; like , the centroid analysis unit determines that the i-th pre-selected contour is the pet candidate contour; if , the centroid analysis unit determines that the i-th pre-selected contour is the feeder candidate contour; if and , the centroid analysis unit determines that the i-th preselected contour is an invalid contour, D1 is the first preset area, and D2 is the second preset area; The contour extraction unit compares the area of each pet's to-be-selected contour with each preset area to screen each pet's contour. If sk<s1 or sk>s2, the contour extraction unit determines that the kth pet's to-be-selected contour is an invalid contour. If s1≤Sk≤s2 and bk<b1, the contour extraction unit determines that the kth pet's to-be-selected contour is an invalid contour. If s1≤Sk≤s2 or bk>b2, the contour extraction unit determines that the kth pet's to-be-selected contour is an invalid contour. If s1≤Sk≤s2 or b1≤bk≤b2, the contour extraction unit determines that the kth pet's to-be-selected contour is a pre-selected pet contour. When the number of pre-selected pet contours mc=1, the contour extraction unit determines that the pre-selected pet contour is a pet contour. When mc>1, the contour extraction unit constructs a recommendation coefficient for each pre-selected pet contour. The contour extraction unit sets the recommendation coefficient of the ycth pre-selected pet contour to Wyc, and sets: Wyc=-{|SWyc-(s1+s2) / 2| / [(s1+s2) / 2]+|bWyc-(b1+b2) / 2| / [b1+b2) / 2]}; Wherein, sk is the area of the kth pet to be selected, s1 is the preset minimum pet area, s2 is the preset maximum pet area, bk is the aspect ratio of the kth pet to be selected, b1 is the preset minimum pet aspect ratio, b2 is the preset maximum pet aspect ratio, SWyc is the area of the ycth pre-selected pet outline, and bWyc is the aspect ratio of the ycth pre-selected pet outline; The profile extraction unit sorts the recommendation coefficients of the pre-selected pet profiles and uses the pre-selected pet profile with the largest recommendation coefficient as the pet profile; The contour extraction unit extracts the contour of the feeder.
6. The pet behavior recognition and detection system according to claim 5, characterized in that: The position analysis module calculates the distance J between the pet's contour centroid and the feeder's contour centroid, and sets: , CWx is the horizontal coordinate of the centroid of the pet's outline, CWy is the vertical coordinate of the centroid of the pet's outline, WFx is the horizontal coordinate of the feeder's outline, and WFy is the vertical coordinate of the feeder's outline; When J≤j0, the position analysis module determines that the pet is at the feeding distance, and when J>j0, the position analysis module determines that the pet is not at the feeding distance, and j0 is a preset distance.
Citation Information
Patent Citations
Monitoring system and method for pet behavior detection
CN109757395A
Rapid building extraction method from high-resolution remote sensing image
CN105719306A
Pig individual recognition and water drinking behavior analysis method based on machine vision
CN106778784A
Pig weight measurement and water drinking behavior recognition system and method based on binocular vision
CN111161214A
Self-adaptive poultry feeding method based on artificial intelligence and growth cycle analysis
CN114155377A