Pet dog interaction method and device based on light spot projection and storage medium
By conducting thermal imaging analysis and body posture assessment on pet dogs, matching entertainment strategies and performing light spot zoning processing, the problem of low intelligence and incomplete coverage of light spot projection in the existing technology has been solved, and intelligent light spot projection and projection in pet dog activity areas have been realized. Optimization of location.
Patent Information
- Application Number
- CN202411352148.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-09-26
AI Technical Summary
In the prior art, spot projection is used for pet dogs to interact with low intelligence, poor coverage of active areas, and unreasonable projection position distribution, resulting in pet dogs no longer interested in spot projection.
By obtaining the thermal imaging picture of the pet dog, temperature threshold segmentation and area growth are performed to determine the pet dog's body type and current activity status, match the entertainment strategy, and evenly process the light spot partitioning of the active area to determine the light spot projection strategy.
It improves the intelligence of the interaction between light spot projection and pet dogs, realizes flexible deployment and intelligent projection of light spot projection in pet dog activity areas, improves the distribution of projection positions, and enhances pet dogs' interest in light spot projection.
Smart Images

Figure CN119338836A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a pet-dog interaction method, device and storage medium based on light spot projection. Background Art
[0002] With the improvement of people's living standards and the rise of pet culture, pet dogs have become an indispensable member of many families. Due to the accelerated pace of modern life, owners cannot often accompany their pet dogs due to travel, business trips, illness, etc. Keeping pet dogs in the house for a long time can easily cause physical and psychological discomfort to pet dogs and affect their health. Therefore, in the process of raising pet dogs, it is necessary to provide pet dogs with suitable entertainment and interactive activities.
[0003] With the continuous change of pet dog entertainment interaction, the problem of pet interaction when the owner is not around the pet dog is solved by controlling the light spot projection to attract and guide the pet to perform entertainment activities. The pet interaction method of light spot projection has the advantages of low cost, multiple functions and the ability to realize pet interaction at any time.
[0004] In the prior art, spot projection is applied to the field of pet interaction as a way to provide different entertainment methods for pets. However, the spot projection in the prior art usually needs to be started or controlled manually, and the intelligence level is very low; and it cannot fully cover the pet's activity area. Due to the relatively single projection position, the pet may no longer be interested in the spot projection after a long time. Summary of the invention
[0005] The embodiments of the present application provide a pet dog interaction method, device and storage medium based on light spot projection, which solve the technical problems in the prior art of low intelligence level of pet dog light spot projection interaction, poor coverage of activity area and unreasonable distribution of projection positions.
[0006] In a first aspect, an embodiment of the present application provides a pet dog interaction method based on light spot projection, characterized in that the method includes: obtaining a thermal imaging picture of the pet dog, and performing temperature threshold segmentation on the thermal imaging picture to obtain a pet dog foreground binary image; performing regional growth on the pet dog foreground binary image to obtain a pet dog calculation binary image; based on the pet dog calculation binary image, determining the pet dog's body type through an external matrix method; evaluating the pet dog's body type for sleep conditions to determine the pet dog's current activity status; determining the pet dog's entertainment strategy based on the pet dog's current activity status by matching the pet dog's activity relationships; based on the pet dog's entertainment strategy, performing light spot partitioning and uniform processing on the pet dog's activity area to determine the light spot projection strategy.
[0007] In one implementation of the present application, temperature threshold segmentation is performed on the thermal imaging image to obtain a pet dog foreground binary image, specifically including: obtaining segmentation temperature reference data, and averaging the segmentation temperature reference data to determine the temperature segmentation threshold; wherein the segmentation temperature reference data includes: ambient temperature data, pet neck temperature data; based on the temperature segmentation threshold, threshold segmentation is performed on the thermal imaging image to obtain a pet dog foreground binary image.
[0008] In one implementation of the present application, region growing is performed on a pet dog foreground binary image to obtain a pet dog computational binary image, specifically comprising: determining marking parameters based on the pet dog foreground binary image; wherein the marking parameters include at least: an image to be marked; sequentially scanning the image to be marked to determine region growing seeds; after the sequential scanning is completed, determining the marking matrix and the number of connected areas based on the region growing seeds to obtain a pet dog computational binary image.
[0009] In one implementation of the present application, a binary image is calculated based on the pet dog, and the pet dog's body type is determined through an external matrix method, specifically including: calculating a binary image based on the pet dog to determine an external matrix; obtaining a starting point cluster, and according to the starting point cluster, obtaining the minimum external area of the external matrix through matrix rotation; labeling the pet dog's body behavior, and setting a pet dog's body sample set according to the pet dog's body behavior; according to the minimum external area and the pet's body sample set, determining the pet dog's body type through a preset pet dog body analysis model.
[0010] In one implementation of the present application, a sleeping condition assessment is performed on the body type of a pet dog to determine the current activity state of the pet dog, specifically including: judging whether the body type of the pet dog conforms to a preset sleeping posture to determine the first current state of the pet dog; wherein the body types of the pet dog include: prone, side-lying, curled-up, sitting, and standing; when the first current state is a prone sleeping state, determining the second current state of the pet dog by a preset average comparison method; and determining the current activity state of the pet dog based on the current second state.
[0011] In one implementation of the present application, a pet dog entertainment strategy is determined according to the current activity state of the pet dog by matching the activity relationship of the pet dog, specifically including: determining the physical state of the pet dog based on the current activity state of the pet dog; and determining the pet dog entertainment strategy by matching through a preset entertainment method query table according to the physical state.
[0012] In one implementation of the present application, based on the pet dog entertainment strategy, the pet dog's activity area is evenly partitioned into light spots to determine the light spot projection strategy, which specifically includes: obtaining the pet dog's activity map and evenly dividing the activity map to obtain a projection distribution area group; obtaining the pet dog's real-time position data, and determining the pet dog's dynamic distribution point in the projection distribution area group based on the real-time position data; setting the area in the projection distribution area group corresponding to the dynamic distribution point that meets the preset quantity conditions as the light spot projection target point; according to the light spot projection target point, determining the light spot projection strategy by determining the light spot path and the light spot speed.
[0013] In one implementation of the present application, after determining the light spot projection strategy according to the light spot projection target point by determining the light spot path and the light spot speed, the method also includes: executing the light spot projection strategy and monitoring the state changes of the pet dog; executing the pet dog life coping strategy according to the state changes and the preset environmental threshold; wherein the pet dog life coping strategy includes: music playing strategy, feeding strategy, and environmental temperature adjustment strategy.
[0014] In a second aspect, an embodiment of the present application also provides a pet dog interactive device based on light spot projection, characterized in that the device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can: obtain a thermal imaging picture of the pet dog, and perform temperature threshold segmentation on the thermal imaging picture to obtain a pet dog foreground binary image; perform regional growth on the pet dog foreground binary image to obtain a pet dog calculated binary image; based on the pet dog calculated binary image, determine the pet dog's body type through an external matrix method; perform a sleep condition assessment on the pet dog's body type to determine the pet dog's current activity state; according to the pet dog's current activity state, determine the pet dog's entertainment strategy by matching the pet dog's activity relationship; based on the pet dog's entertainment strategy, perform light spot partitioning and uniform processing on the pet dog's activity area to determine the light spot projection strategy.
[0015] In a third aspect, an embodiment of the present application further provides a non-volatile computer storage medium for pet dog interaction based on light spot projection, storing computer executable instructions, characterized in that the computer executable instructions are set to: obtain a thermal imaging picture of the pet dog, and perform temperature threshold segmentation on the thermal imaging picture to obtain a pet dog foreground binary image; perform regional growth on the pet dog foreground binary image to obtain a pet dog calculation binary image; based on the pet dog calculation binary image, determine the pet dog's body type through an external matrix method; evaluate the pet dog's body type for sleep conditions to determine the pet dog's current activity status; according to the pet dog's current activity status, determine the pet dog's entertainment strategy by matching the pet dog's activity relationship; based on the pet dog's entertainment strategy, perform light spot partitioning and uniform processing on the pet dog's activity area to determine the light spot projection strategy.
[0016] The embodiments of the present application provide a pet dog interaction method, device and storage medium based on spot projection, which solves the technical problems of low intelligence level of pet dog spot projection interaction, poor coverage of activity area and unreasonable distribution of projection positions in the prior art by matching interaction strategies and formulating corresponding spot projection strategies according to the pet dog's body posture, improves the intelligence level of interaction between spot projection and pet dogs, realizes flexible deployment and intelligent projection of spot projection in the pet dog's activity area and improves the distribution of projection positions. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 A flow chart of a pet-dog interaction method based on light spot projection provided in an embodiment of the present application;
[0019] Figure 2 A pet dog body feature map based on spot projection provided in an embodiment of the present application;
[0020] Figure 3 A schematic diagram of a pyramid grid map based on spot projection provided in an embodiment of the present application;
[0021] Figure 4 A schematic diagram of the internal structure of a pet dog interactive device based on spot projection provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0023] The embodiments of the present application provide a pet dog interaction method, device and storage medium based on spot projection, which solves the technical problems of low intelligence level of pet dog spot projection interaction, poor coverage of activity area and unreasonable distribution of projection positions in the prior art by matching interaction strategies and formulating corresponding spot projection strategies according to the pet dog's body posture, improves the intelligence level of interaction between spot projection and pet dogs, realizes flexible deployment and intelligent projection of spot projection in the pet dog's activity area and improves the distribution of projection positions.
[0024] The technical solution proposed in the embodiments of the present application is described in detail below with reference to the accompanying drawings.
[0025] Figure 1 This is a flow chart of a pet-dog interaction method based on spot projection provided in an embodiment of the present application. Figure 1 As shown, a pet-dog interaction method based on spot projection provided in an embodiment of the present application specifically includes the following steps:
[0026] Step 101: obtain a thermal imaging picture of a pet dog, and perform temperature threshold segmentation on the thermal imaging picture to obtain a foreground binary image of the pet dog.
[0027] Specifically, it includes: obtaining segmentation temperature reference data, and averaging the segmentation temperature reference data to determine the temperature segmentation threshold; wherein the segmentation temperature reference data includes: ambient temperature data, pet neck temperature data; based on the temperature segmentation threshold, threshold segmenting is performed on the thermal imaging image to obtain a pet dog foreground binary image.
[0028] The present application performs threshold segmentation on thermal imaging images of pet dogs to obtain a pet dog foreground binary image, thereby realizing feature analysis of infrared imaging of pet dogs and enhancing the infrared imaging recognition accuracy of pet dogs in the environment.
[0029] In the examples of the present application, a detailed explanation is given by the following Example 1.
[0030] Example 1: The smart collar collects physiological information such as heart rate, blood oxygen, blood pressure, and body temperature of a pet dog; the Bluetooth module built into the smart collar transmits the relevant information to the embedded control mainboard.
[0031] The thermal image of the pet dog's room is collected by a thermal imager installed in the pet dog's room, and the thermal image is transmitted to the embedded control mainboard through a network cable and a switching box.
[0032] The thermal imaging image f is preprocessed and the noise in the thermal imaging image is removed using median filtering to obtain a smoothed thermal imaging image f med , expressed by the following formula (1).
[0033] f med (x, y)=med{(xm, yn), (m, n∈W)} (1);
[0034] Among them, x and y are image coordinates, W is the filter window, and m and n are the coordinate indexes within the filter window.
[0035] The temperature information collected by the pet dog's smart collar is extracted through the embedded control mainboard as the pet dog's temperature reference value. The indoor temperature of the pet dog's house is collected by the indoor temperature sensor. When the indoor temperature of the house and the temperature of the pet dog's neck are known, the average value of the house temperature and the pet dog's neck temperature is taken as the segmentation threshold p of the binary image. thr , extract the pet dog foreground binary image f in the thermal image pet The extraction method is represented by the following formulas (2) and (3).
[0036] f pet (x, y) = 0, f pet =(x, y)≤p thr (2);
[0037] f pet (x, y) = 1, f pet =(x,y)>p thr (3).
[0038] Step 102: performing region growing on the pet dog foreground binary image to obtain a pet dog calculation binary image.
[0039] Specifically, it includes: determining marking parameters based on the pet dog foreground binary image; wherein the marking parameters at least include: the image to be marked; sequentially scanning the image to be marked to determine the region growth seeds; after the sequential scanning is completed, according to the region growth seeds, by determining the marking matrix and the number of connected areas, a binary image of the pet dog is obtained.
[0040] The present application performs region growth on a pet dog foreground binary image to obtain a pet dog calculation binary image, thereby extracting features of the pet dog and obtaining the current physical condition of the pet dog.
[0041] In the examples of the present application, detailed explanation is given by the following Example 2.
[0042] Example 2: Perform an opening operation on the pet dog foreground binary image to remove isolated foregrounds and smooth the foreground edges. Then, use the region growing method to remove holes inside the foreground to obtain an image. The algorithm of the region growing method is as follows:
[0043] The first step is to input the image bitmap to be labeled, initialize a label matrix labelmap of the same size as the input image, a queue queue and a label count labelIndex;
[0044] The second step is to scan the bitmap from left to right and from top to bottom. When an unmarked foreground pixel p is scanned, labelIndex is increased by 1, and p is marked in labelmap (the value of the corresponding point is assigned to labelIndex). At the same time, the eight neighborhood points of p are scanned. If there are unmarked foreground pixels, they are marked in labelmap and put into queue as seeds for region growing.
[0045] Step 3: When the queue is not empty, take a growth seed point p1 from the queue, scan the eight neighborhood points of p1, and if there are unlabeled foreground pixels, mark them in the labelmap and put them into the queue;
[0046] Repeat step 3 until the queue is empty and a connected area is marked;
[0047] Go to the second step until the entire image is scanned, and obtain the label matrix labelmap and the number of connected areas labelIndex.
[0048] Through the above method, the pet dog is determined to calculate the binary image f pet_rg .
[0049] Step 103: Calculate a binary image based on the pet dog and determine the body type of the pet dog by using an external matrix method.
[0050] Specifically, it includes: calculating a binary image based on the pet dog to determine the circumscribed matrix; obtaining a starting point cluster, and according to the starting point cluster, obtaining the minimum circumscribed area of the circumscribed matrix through matrix rotation; labeling the pet dog's body behavior, and setting a pet body sample set according to the pet dog's body behavior; according to the minimum circumscribed area and the pet body sample set, determining the pet dog's body type through a preset pet dog body analysis model.
[0051] The present application uses an external matrix method to calculate a binary image of a pet dog to perform feature extraction, determine the pet dog's body type, achieve accurate judgment of the pet dog's body type, and improve the efficiency of assessing the pet dog's condition.
[0052] Figure 2A pet dog body feature map based on spot projection is provided in an embodiment of the present application. In the embodiment of the present application, it is explained in detail through the following Example 3.
[0053] Example 3: To extract the dog's body features and reduce the complexity of the embedded control mainboard algorithm, the minimum external matrix algorithm is used to calculate the dog's binary image f pet_rg The pet dog foreground external matrix M rect , and intercept the binary image external matrix area image f rect , and finally the size of the captured image is normalized to 64×32 as the input feature of the input algorithm, that is, Figure 2 The feature image in indicates that the pet dog is in a “standing” posture.
[0054] The basic principle of the minimum circumscribed matrix is as follows:
[0055] Get the initial foreground circumscribed moment M of the point cluster rect_1 ={x min-1 , x max_1 ,y min_1 ,y max_1}, determine the initial circumscribed rectangle, calculate the area of the circumscribed rectangle, and then rotate the point cluster. The corresponding formula for the rotation is expressed by the following formulas (4) and (5).
[0056] x′=x Cos(b)-y sin(b)(4);
[0057] y′=x sin(b)+y cos(b) (5);
[0058] Among them, x and y are the coordinates of the initial point cluster;
[0059] x′, y′ are the coordinates of the point cluster after rotation;
[0060] b is the rotation angle.
[0061] Let the rotation angle be i, then the matrix area is S i , expressed by the following formula (6).
[0062] S i =(x max_1 -x min_1 )*(y max_1 -y min_1 ) (6);
[0063] Repeatedly rotate the image and calculate the matrix area S.
[0064] When the matrix area S is the smallest, find the corresponding circumscribed matrix M rect_1 ={x min , x max ,ymin ,y max}, which is the minimum enclosing rectangle.
[0065] To determine the dog's body posture label, first set five body posture labels: prone, side-lying, curled-up, sitting, and standing, represented by y i = {0, 1, 2, 3, 4}, let the sample set defining the sleeping posture image be D = {d1, d2, ..., d m}, where m is the total number of samples; the training sample set is defined as T = {(d1, y i1 ), (d2, y i2 ),…,(d n ,y in )}, where n is the number of training samples.
[0066] Then, the SVM (support vector machine) model is trained on the PC (personal computer) to obtain parameters such as the SVM model penalty factor C and the kernel function parameter g.
[0067] The embedded control motherboard uses C language to implement the SVM algorithm based on the libsvm library. The SVM algorithm parameters are pre-trained on the PC side; the SVM structure uses the SVM classification model of a directed acyclic graph. The directed acyclic graph SVM can simplify the classification of 5 types of pet dog postures (postures) into a 2-classification problem, with short training time and good versatility. After the training is completed, 10 (4+3+2+1=10) sub-SVM classifiers are generated. In the classification and recognition process, this classification model is used to output samples and corresponding type posture labels in a timely manner, and finally determine the type of pet dog posture.
[0068] Step 104: Evaluate the sleeping status of the pet dog's body type to determine the current activity status of the pet dog.
[0069] Specifically including: judging whether the pet dog's body posture type conforms to the preset sleeping posture to determine the first current state of the pet dog; wherein the pet dog's body posture types include: lying prone, lying on the side, curled up, sitting, and standing; when the first current state is a lying sleeping state, determining the second current state of the pet dog by a preset average comparison method; and determining the current activity state of the pet dog based on the current second state.
[0070] This application evaluates the sleeping condition of the pet dog's body type to determine the pet dog's current activity status, thereby achieving accurate judgment of the pet's sleeping status and improving the accuracy of judging the pet's body details.
[0071] In the examples of the present application, a detailed explanation is given by the following Example 4.
[0072] Example 4: First, determine the non-sleep state query table and the pet dog entertainment method table; wherein, the non-sleep state query table is used to determine the non-sleep state of the pet dog, based on the pet's body type and the physiological data obtained through the collar.
[0073] When the heart rate and body temperature of the pet dog rise, the pet is in a side-lying state, and the pet dog is assessed to be in a very hot state. On the contrary, when the blood pressure and heart rate decrease slowly, the pet is in a prone state, and the pet dog is assessed to be in a bored state.
[0074] The same goes for other situations, and appropriate adjustments can be made according to the different breeds and types of pet dogs.
[0075] The pet dog entertainment method table shows the entertainment measures for pet dogs in corresponding states. When the dog is overheated, turn on the air conditioner; when the dog is bored, start the light board projection and audio equipment.
[0076] To evaluate the sleeping status of pet dogs, it is necessary to judge their preliminary posture. If the dog is not in a lying position (prone, sideways, curled up), the sleeping status of the pet dog is false; if it is in a lying position, 9 thermal images within 2 minutes are collected at the same time, and the foreground binary image is calculated, and the average image is calculated.
[0077] By indexing each pixel and calculating, we get the mean image imgav r , and compare the pixel overlap degree of the ninth foreground binary image with the mean image. The calculation method is expressed by the following formulas (7) and (8).
[0078] p ij-avr =0, p ij-1 +p ij-2 +…+p ij-9 <5 (7)
[0079] p ij-avr =1, p ij-1 +p ij-2 +…+p ij-9 ≥5 (8)
[0080] Index each pixel and calculate to get img avr .
[0081] Among them, p is the pixel value of the pixel;
[0082] i, j are pixel coordinates;
[0083] p ij-1 、p ij-2 ,…,p ij-9 、p ij-avr ∈img1, img2,…, img9, img avr .
[0084] Then, compare img9 and img avr The degree of pixel overlap is as follows:
[0085] P ij-9 、p ij-avr ∈img9,img avr , where i and j are pixel coordinates.
[0086] Index img9, imgav r For each pixel, the following formulas (9), (10), and (11) are used for calculation.
[0087] p ij-9 =p ij-avr , index = index + 1 (9);
[0088] p ij-9 ≠p ij-avr , index = index (10);
[0089] index_rate=index÷HW×100% (11).
[0090] Among them, H is the image height and W is the image width.
[0091] In the case of index_rate ≥ 90%, img9 and img avr If the overlapping area accounts for more than 90%, the pet dog is deemed to be in a sleeping state and the state calculation ends.
[0092] When index_rate < 90%, the pet dog is awake and needs to be further judged. Determine whether the various physiological data of the pet dog collected by the smart collar deviate from the normal data range, and whether the value is too high or too low; finally, query the pet dog status table based on the deviation of physiological data and the body shape of the pet dog.
[0093] Step 105: Determine the pet dog entertainment strategy based on the current activity status of the pet dog by matching the pet dog activity relationship.
[0094] Specifically, it includes: determining the physical state of the pet dog based on the current activity state of the pet dog; and determining the entertainment strategy of the pet dog by matching through a preset entertainment method query table according to the physical state.
[0095] This application determines the pet dog entertainment strategy based on the pet dog's current activity status by matching the pet dog's activity relationships, thereby achieving intelligent response to the pet's different states and improving the accuracy and versatility of the pet entertainment strategy matching.
[0096] Step 106: Based on the pet dog entertainment strategy, the activity area of the pet dog is evenly processed by partitioning the light spots and determining the light spot projection strategy.
[0097] Specifically, the method includes: obtaining an activity map of the pet dog, and evenly dividing the activity map to obtain a projection distribution area group; obtaining the real-time position data of the pet dog, and determining the dynamic distribution point of the pet dog in the projection distribution area group based on the real-time position data; setting the area in the projection distribution area group corresponding to the dynamic distribution point and meeting the preset quantity conditions as the light spot projection target point; and determining the light spot projection strategy based on the light spot projection target point by determining the light spot path and the light spot speed.
[0098] After determining the light spot projection strategy according to the light spot projection target point by determining the light spot path and the light spot speed, the method also includes: executing the light spot projection strategy and monitoring the state changes of the pet dog; executing the pet dog life coping strategy according to the state changes and the preset environmental threshold; wherein the pet dog life coping strategy includes: music playing strategy, feeding strategy, and environmental temperature adjustment strategy.
[0099] This application evenly processes the light spot partitions in the pet dog's activity area and determines the light spot projection strategy, thereby achieving flexible deployment and intelligent projection of light spot projection in the pet dog's activity area and improving the projection position distribution.
[0100] Figure 3 A schematic diagram of a pyramid grid map based on spot projection is provided in an embodiment of the present application. In the embodiment of the present application, it is explained in detail through the following Example 5.
[0101] Example 5: In order to prevent pet dogs from being bored and lonely in the room for a long time, to encourage pet dogs to exercise in the room and to maintain their physical and mental health, the pet dog house uses laser lights to randomly and evenly project light spots in the house, allowing pet dogs to grasp the light spots.
[0102] Get the status of the pet dog. If the pet dog is bored, perform interactive entertainment with light spot projection. Set the light spot type to: circular, rectangular, bird, mouse, reptile, butterfly, etc. The owner can set the type of light spot projection according to the pet dog's preferences. To prevent the pet dog from feeling bored when chasing the light spot, it is necessary to reduce the repeatability of the light spot projection position, enhance the uniformity and randomness of the light spot projection position, and plan the light spot projection target position.
[0103] Based on the binary image pet dog foreground obtained by calculation based on the thermal imaging image, the foreground center is calculated as the image coordinates of the pet dog position; through the camera calibration processing, the conversion matrix between the world coordinate system and the thermal imaging camera coordinate system is obtained, and the pet dog position image coordinates are converted into the pet dog position world coordinates.
[0104] Manually set the pet dog house map, the system automatically divides the map into 4 areas to form the first layer of grid map; then the 4 areas are further divided into 4 sub-areas for each area to form the second layer of grid map; the loop is executed and repeated until the number of subdivisions reaches the user-set value. Multiple layers of maps are superimposed to form a pyramid grid map.
[0105] The real-time position of the pet is represented by coordinates, the pet dog's position is sampled twice every 1 second, and the pet dog's position is recorded 40 times in the past 20 seconds.
[0106] First, extract the first layer P1 of the pyramid grid map, Figure 4 The areas P1:S-1, P1:S-2, P1:S-3, and P1:S-4 are counted 60 times for each area where the pet dog is located, and the area with the least number of times is calculated: P1:Sn. If there are multiple areas with the least number of times, use the Random() function to randomly select one area as P1:Sn.
[0107] Extract the second layer P2 of the pyramid grid map, which has a total of 16 sub-areas. Extract the area P1:Sn with the least number of times in the first layer, and the corresponding 4 sub-areas: P2:Sn-1, P2:Sn-2, P2:Sn-3, P2:Sn-4. Count the areas where the pet dog is located 60 times, and calculate the area with the least number of times: P2:Snm. If there are multiple areas with the least number of times, use the Random() function to randomly select one area as P2:Snm.
[0108] Until the last layer, the area with the least number of pet dog positions and the smallest area in the pyramid grid map is obtained: Px:Snm-...-z. In this area, use the Random() function to randomly select a point as the target point Px for light projection.
[0109] Given the current projection point Py and the target projection point Px, calculate the line segment function between the two points. Based on this, start from the current projection point Py and move the light spot to the target projection point Px in a straight line path at the set speed to complete one projection.
[0110] Set the projection refresh time to t, recalculate the target point every t seconds, re-move the light spot, and repeat the steps described in the previous paragraph.
[0111] The above is an embodiment of the method proposed in this application. Based on the same inventive concept, this application embodiment also provides a pet dog interactive device based on spot projection, and its structure is as follows: Figure 4 shown.
[0112] Figure 4This is a schematic diagram of the internal structure of a pet dog interactive device based on spot projection provided in an embodiment of the present application. Figure 4 As shown, the device includes:
[0113] at least one processor 401;
[0114] and, a memory 402 communicatively coupled to the at least one processor;
[0115] The memory 402 stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor 401 to enable at least one processor 401 to:
[0116] A thermal imaging picture of a pet dog is obtained, and the thermal imaging picture is segmented by temperature threshold to obtain a foreground binary image of the pet dog; regional growth is performed on the foreground binary image of the pet dog to obtain a calculated binary image of the pet dog; based on the calculated binary image of the pet dog, the body type of the pet dog is determined by an external matrix method; the sleeping condition of the pet dog body type is evaluated to determine the current activity status of the pet dog; according to the current activity status of the pet dog, the entertainment strategy of the pet dog is determined by matching the activity relationship of the pet dog; based on the entertainment strategy of the pet dog, the activity area of the pet dog is evenly partitioned with a light spot to determine the light spot projection strategy.
[0117] Some embodiments of the present application provide corresponding Figure 1 A non-volatile computer storage medium for pet-dog interaction based on light spot projection, storing computer executable instructions, wherein the computer executable instructions are set as:
[0118] A thermal imaging picture of a pet dog is obtained, and the thermal imaging picture is segmented by temperature threshold to obtain a foreground binary image of the pet dog; regional growth is performed on the foreground binary image of the pet dog to obtain a calculated binary image of the pet dog; based on the calculated binary image of the pet dog, the body type of the pet dog is determined by an external matrix method; the sleeping condition of the pet dog body type is evaluated to determine the current activity status of the pet dog; according to the current activity status of the pet dog, the entertainment strategy of the pet dog is determined by matching the activity relationship of the pet dog; based on the entertainment strategy of the pet dog, the activity area of the pet dog is evenly partitioned with a light spot to determine the light spot projection strategy.
[0119] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the IoT device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0120] The system and medium provided in the embodiments of the present application correspond one-to-one to the method. Therefore, the system and medium also have similar beneficial technical effects to the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the system and medium will not be repeated here.
[0121] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0122] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0123] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0124] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0125] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0126] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0127] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0128] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0129] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A pet-dog interaction method based on light spot projection, characterized in that: The method comprises: Acquire a thermal imaging picture of a pet dog, and perform temperature threshold segmentation on the thermal imaging picture to obtain a foreground binary image of the pet dog; Performing region growing on the pet dog foreground binary image to obtain a pet dog calculation binary image; Calculating a binary image based on the pet dog and determining the body type of the pet dog by using an external matrix method; Evaluate the sleeping status of the pet dog based on its body type to determine the current activity status of the pet dog; According to the current activity state of the pet dog, determining the pet dog entertainment strategy by matching the pet dog activity relationship; Based on the pet dog entertainment strategy, the activity area of the pet dog is evenly processed by light spot partitioning to determine the light spot projection strategy.
2. A pet-dog interaction method based on spot projection according to claim 1, characterized in that: The thermal imaging image is segmented by temperature threshold to obtain a pet dog foreground binary image, specifically including: Acquire segmentation temperature reference data, and perform data averaging on the segmentation temperature reference data to determine a temperature segmentation threshold; wherein the segmentation temperature reference data includes: ambient temperature data, pet neck temperature data; Based on the temperature segmentation threshold, the thermal imaging image is threshold segmented to obtain the pet dog foreground binary image.
3. The pet-dog interaction method based on spot projection according to claim 1, characterized in that: Performing region growing on the pet dog foreground binary image to obtain a pet dog calculation binary image specifically includes: Based on the pet dog foreground binary image, determining marking parameters; wherein the marking parameters at least include: an image to be marked; sequentially scanning the image to be marked to determine a region growth seed; After the sequential scanning is completed, the seeds are grown according to the region, and the label matrix and the number of connected regions are determined to obtain the pet dog calculation binary map.
4. The pet-dog interaction method based on spot projection according to claim 1, characterized in that: Based on the binary image of the pet dog, the body type of the pet dog is determined by an external matrix method, specifically including: Calculate a binary image based on the pet dog and determine an external matrix; Obtaining a starting point cluster, and obtaining a minimum circumscribed area of the circumscribed matrix by matrix rotation according to the starting point cluster; Labeling the body posture behavior of the pet dog, and setting a pet body posture sample set according to the body posture behavior of the pet dog; According to the minimum circumscribed area and the pet body shape sample set, the pet dog body shape type is determined by using a preset pet dog body shape analysis model.
5. The pet-dog interaction method based on spot projection according to claim 1, characterized in that: The sleeping condition of the pet dog is evaluated based on the body type of the pet dog to determine the current activity state of the pet dog, specifically including: Determine whether the posture type of the pet dog meets the preset sleeping posture to determine the first current state of the pet dog; wherein the posture types of the pet dog include: lying prone, lying sideways, curled up, sitting, and standing; In the case where the first current state is a lying sleeping state, determining the second current state of the pet dog by a preset average comparison method; Based on the current second state, the current activity state of the pet dog is determined.
6. The pet-dog interaction method based on spot projection according to claim 1, characterized in that: According to the current activity state of the pet dog, the pet dog entertainment strategy is determined by matching the pet dog activity relationship, specifically including: Determining the physical condition of the pet dog based on the current activity state of the pet dog; According to the physical state, the entertainment strategy for the pet dog is determined by matching through a preset entertainment method query table.
7. The pet-dog interaction method based on spot projection according to claim 1, characterized in that: Based on the pet dog entertainment strategy, the light spot partitioning and uniform processing is performed on the activity area of the pet dog to determine the light spot projection strategy, which specifically includes: Acquire an activity map of the pet dog, and evenly divide the activity map to obtain a projection distribution area group; Acquire the real-time position data of the pet dog, and determine the dynamic distribution point of the pet dog in the projection distribution area group according to the real-time position data; The areas meeting the preset quantity conditions in the projection distribution area group corresponding to the dynamic allocation point are set as the light spot projection target points; According to the light spot projection target point, the light spot projection strategy is determined by determining the light spot path and the light spot speed.
8. The pet-dog interaction method based on spot projection according to claim 7, characterized in that: After determining the light spot projection strategy according to the light spot projection target point by determining the light spot path and the light spot speed, the method further includes: Executing the light spot projection strategy and monitoring the state changes of the pet dog; According to the state change and the preset environmental threshold, the pet dog life coping strategy is executed; wherein the pet dog life coping strategy includes: music playing strategy, feeding strategy, and environmental temperature adjustment strategy.
9. A pet dog interactive device based on spot projection, characterized in that: The device comprises: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to: Acquire a thermal imaging picture of a pet dog, and perform temperature threshold segmentation on the thermal imaging picture to obtain a foreground binary image of the pet dog; Performing region growing on the pet dog foreground binary image to obtain a pet dog calculation binary image; Calculating a binary image based on the pet dog and determining the body type of the pet dog by using an external matrix method; Evaluate the sleeping status of the pet dog based on its body type to determine the current activity status of the pet dog; According to the current activity state of the pet dog, determining the pet dog entertainment strategy by matching the pet dog activity relationship; Based on the pet dog entertainment strategy, the activity area of the pet dog is evenly processed by light spot partitioning to determine the light spot projection strategy.
10. A non-volatile computer storage medium for pet-dog interaction based on light spot projection, storing computer executable instructions, characterized in that: The computer executable instructions are configured to: Acquire a thermal imaging picture of a pet dog, and perform temperature threshold segmentation on the thermal imaging picture to obtain a foreground binary image of the pet dog; Performing region growing on the pet dog foreground binary image to obtain a pet dog calculation binary image; Calculating a binary image based on the pet dog and determining the body type of the pet dog by using an external matrix method; Evaluate the sleeping status of the pet dog based on its body type to determine the current activity status of the pet dog; According to the current activity state of the pet dog, determining the pet dog entertainment strategy by matching the pet dog activity relationship; Based on the pet dog entertainment strategy, the activity area of the pet dog is evenly processed by light spot partitioning to determine the light spot projection strategy.
Citation Information
Patent Citations
Laser guide method suitable for pet attraction
CN110146070A
Pet accompanying method and device
CN116439155A
Small animal behavior analysis method and system based on visible light imaging
CN118356168A
Pet status assessment system, pet camera, server, pet status assessment method, and program
US20230320328A1