A pet dog interaction method and device based on spot projection and a storage medium

CN119338836BActive Publication Date: 2026-10-09RIZHAO VOCATIONAL & TECHNICAL UNIVERSITY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411352148.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2026-10-09
Estimated Expiration
2044-09-26

AI Technical Summary

Technical Problem

[0005]本申请实施例提供了一种基于光斑投影的宠物犬互动方法、设备及存储介质,解决了现有技术中宠物犬光斑投影互动智能程度低、活动区域覆盖程度差以及投影位置分布不合理的技术问题

Benefits of technology

[0016] This application provides a pet dog interaction method, device, and storage medium based on spot projection. By matching interaction strategies and formulating corresponding spot projection strategies according to the pet dog's body posture, it solves the technical problems of low intelligence level, poor coverage of activity area, and unreasonable distribution of projection position in the prior art. It improves the intelligence level of spot projection and pet dog interaction, realizes flexible deployment and intelligent projection of spot projection in the pet dog's activity area, and improves the distribution of projection position.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119338836B_ABST
    Figure CN119338836B_ABST
Patent Text Reader

Abstract

The application discloses a pet dog interaction method and device based on spot projection and a storage medium. The method comprises the following steps: acquiring a thermal imaging picture of a pet dog, and performing temperature threshold segmentation on the thermal imaging picture to obtain a pet dog foreground binary image; performing region growing on the pet dog foreground binary image to obtain a pet dog calculation binary image; determining a pet dog posture type based on the pet dog calculation binary image by using an external matrix method; performing sleep condition evaluation on the pet dog posture type to determine a current activity state of the pet dog; determining a pet dog entertainment strategy by matching a pet dog activity relationship according to the current activity state of the pet dog; and performing uniform processing on a spot partition of an activity area of the pet dog based on the pet dog entertainment strategy to determine a spot projection strategy. The application solves the technical problems of low intelligent degree, poor activity area coverage degree and unreasonable projection position distribution of the pet dog spot projection interaction in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, device and storage medium for pet dog interaction based on light spot projection. Background Technology

[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. However, due to the fast pace of modern life, and reasons such as travel, business trips, and illness, owners cannot often spend time with their pets, keeping them confined indoors for extended periods. This can easily cause physical and psychological discomfort in pets, affecting their health. Therefore, it is necessary to provide suitable entertainment and interactive activities for pet dogs during the breeding process.

[0003] With the continuous evolution of pet dog entertainment and interaction, the use of light spot projection to attract and guide pets in entertainment activities has solved the problem of pet interaction when owners are not around. Light spot projection for pet interaction has the advantages of low cost, multiple functions, and the ability to enable pet interaction anytime.

[0004] In existing technologies, spot projection is used in pet interaction as a way to provide pets with different forms of entertainment. However, spot projection in existing technologies usually requires manual activation or control, resulting in low intelligence; furthermore, it cannot fully cover the pet's activity area, and due to the relatively singular projection location, pets may lose interest in the spot projection over time. Summary of the Invention

[0005] This application provides a pet dog interaction method, device, and storage medium based on light spot projection, which solves the technical problems of low intelligence, poor coverage of activity area, and unreasonable distribution of projection position in the prior art.

[0006] In a first aspect, embodiments of this application provide a pet dog interaction method based on light spot projection, characterized in that the method includes: acquiring a thermal imaging image of a pet dog and performing temperature threshold segmentation on the thermal imaging image to obtain a foreground binary image of the pet dog; performing region growing on the foreground binary image of the pet dog to obtain a computed binary image of the pet dog; determining the pet dog's body type based on the computed binary image of the pet dog using the circumscribed matrix method; assessing the pet dog's sleep status based on the body type of the pet dog to determine the pet dog's current activity state; determining the pet dog's entertainment strategy based on the pet dog's current activity state by matching the pet dog's activity relationships; and determining the light spot projection strategy by uniformly processing the pet dog's activity area through light spot partitioning based on the pet dog's entertainment strategy.

[0007] In one implementation of this application, a temperature threshold segmentation is performed on a thermal imaging image to obtain a binary image of a pet dog foreground. Specifically, this includes: acquiring segmentation temperature reference data and averaging the segmentation temperature reference data to determine a temperature segmentation threshold; wherein, the segmentation temperature reference data includes: ambient temperature data and pet neck temperature data; based on the temperature segmentation threshold, threshold segmentation is performed on the thermal imaging image to obtain a binary image of a pet dog foreground.

[0008] In one implementation of this application, a region growing process is performed on the foreground binary image of the pet dog to obtain a computed binary image of the pet dog. Specifically, this includes: determining labeling parameters based on the foreground binary image of the pet dog; wherein the labeling parameters include at least: an image to be labeled; sequentially scanning the image to be labeled to determine a region growing seed; and after the sequential scanning is completed, obtaining the computed binary image of the pet dog by determining the labeling matrix and the number of connected components based on the region growing seed.

[0009] In one implementation of this application, the body type of a pet dog is determined by calculating a binary image based on the pet dog and using the outer matrix method. Specifically, this includes: calculating a binary image based on the pet dog and determining the outer matrix; obtaining a starting point cluster and, based on the starting point cluster, obtaining the minimum outer area of ​​the outer matrix through matrix rotation; labeling the pet dog's body posture behavior and setting a pet body posture sample set based on the pet dog's body posture behavior; and determining the pet dog's body posture type based on the minimum outer area and the pet body posture sample set through a preset pet dog body posture analysis model.

[0010] In one implementation of this application, a sleep status assessment is performed on the pet dog's body posture type to determine the pet dog's current activity state. Specifically, this includes: determining whether the pet dog's body posture type conforms to a preset sleep posture to determine the pet dog's first current state; wherein, the pet dog's body posture type includes: lying down, lying on its side, curled up, sitting, and standing; if the first current state is a lying down sleep state, a second current state of the pet dog is determined by a preset average comparison method; based on the current second state, the pet dog's current activity state is determined.

[0011] In one implementation of this application, the pet dog's entertainment strategy is determined by matching the pet dog's activity relationships based on the pet dog's current activity status. Specifically, this includes: determining the pet dog's physical condition based on the pet dog's current activity status; and determining the pet dog's entertainment strategy by matching the physical condition through a preset entertainment method lookup table.

[0012] In one implementation of this application, based on a pet dog entertainment strategy, the activity area of ​​the pet dog is divided into uniform light spot partitions to determine a light spot projection strategy. Specifically, this includes: acquiring a map of the pet dog's activity and dividing the map into uniform partitions to obtain a projection distribution area group; acquiring real-time location data of the pet dog and determining the dynamic distribution points of the pet dog in the projection distribution area group based on the real-time location data; setting the areas in the projection distribution area group that meet a preset quantity condition corresponding to the dynamically assigned points as light spot projection target points; and determining the light spot projection strategy based on the light spot projection target points by determining the light spot path and light spot speed.

[0013] In one implementation of this application, after determining the light spot projection strategy by determining the light spot path and light spot speed based on the light spot projection target point, the method further includes: executing the light spot projection strategy and monitoring the state changes of the pet dog; executing the pet dog life coping strategy based on the state changes and preset environmental thresholds; wherein, the pet dog life coping strategy includes: music playback strategy, feeding strategy, and environmental temperature adjustment strategy.

[0014] Secondly, embodiments of this application also provide a pet dog interactive device based on 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, the instructions being executed by the at least one processor to enable the at least one processor to: acquire a thermal imaging image of a pet dog, and perform temperature threshold segmentation on the thermal imaging image to obtain a foreground binary image of the pet dog; perform region growing on the foreground binary image of the pet dog to obtain a computed binary image of the pet dog; determine the pet dog's body type based on the computed binary image of the pet dog using the circumscribed matrix method; assess the pet dog's sleep status based on the body type of the pet dog to determine the pet dog's current activity state; determine the pet dog's entertainment strategy based on the pet dog's current activity state by matching the pet dog's activity relationships; and determine the spot projection strategy by uniformly processing the pet dog's activity area through spot partitioning based on the pet dog's entertainment strategy.

[0015] Thirdly, embodiments of this application also provide a non-volatile computer storage medium for pet dog interaction based on spot projection, storing computer-executable instructions. The computer-executable instructions are characterized by: acquiring a thermal imaging image of a pet dog and performing temperature threshold segmentation on the thermal imaging image to obtain a foreground binary image of the pet dog; performing region growing on the foreground binary image of the pet dog to obtain a computed binary image of the pet dog; determining the pet dog's body type based on the computed binary image of the pet dog using the circumscribed matrix method; assessing the pet dog's sleep status based on its body type to determine its current activity state; determining a pet dog's entertainment strategy based on its current activity state by matching pet dog activity relationships; and determining a spot projection strategy by uniformly processing the pet dog's activity area through spot partitioning based on the pet dog's entertainment strategy.

[0016] This application provides a pet dog interaction method, device, and storage medium based on spot projection. By matching interaction strategies and formulating corresponding spot projection strategies according to the pet dog's body posture, it solves the technical problems of low intelligence level, poor coverage of activity area, and unreasonable distribution of projection position in the prior art. It improves the intelligence level of spot projection and pet dog interaction, realizes flexible deployment and intelligent projection of spot projection in the pet dog's activity area, and improves the distribution of projection position. Attached Figure Description

[0017] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0018] Figure 1 A flowchart illustrating a pet dog interaction method based on light spot projection, provided in an embodiment of this application;

[0019] Figure 2 This application provides a pet dog body feature map based on light spot projection as an embodiment of the present application;

[0020] Figure 3 A schematic diagram of a pyramid grid map based on spot projection is provided for an embodiment of this application;

[0021] Figure 4 This is a schematic diagram of the internal structure of a pet dog interactive device based on light spot projection, provided as an embodiment of this application. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0023] This application provides a pet dog interaction method, device, and storage medium based on spot projection. By matching interaction strategies and formulating corresponding spot projection strategies according to the pet dog's body posture, it solves the technical problems of low intelligence level, poor coverage of activity area, and unreasonable distribution of projection position in the prior art. It improves the intelligence level of spot projection and pet dog interaction, realizes flexible deployment and intelligent projection of spot projection in the pet dog's activity area, and improves the distribution of projection position.

[0024] The technical solutions proposed in the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0025] Figure 1 This is a flowchart illustrating a pet dog interaction method based on light spot projection, provided as an embodiment of this application. Figure 1 As shown in the figure, the pet dog interaction method based on light spot projection provided in this application embodiment specifically includes the following steps:

[0026] Step 101: Obtain a thermal image of the pet dog and perform temperature threshold segmentation on the thermal image to obtain a binary image of the pet dog foreground.

[0027] Specifically, this includes: acquiring 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 and pet neck temperature data; based on the temperature segmentation threshold, threshold segmentation is performed on the thermal imaging image to obtain a foreground binary image of the pet dog.

[0028] This application achieves feature analysis of pet dog infrared imaging by thresholding the thermal imaging image of the pet dog to obtain a foreground binary image of the pet dog, thereby enhancing the accuracy of infrared imaging recognition of pet dogs in the environment.

[0029] In the embodiments of this application, the following Example 1 will be explained in detail.

[0030] Example 1: Collect physiological information such as heart rate, blood oxygen, blood pressure, and body temperature of a pet dog through a smart collar; transmit the relevant information to the embedded control motherboard via the built-in Bluetooth module of the smart collar.

[0031] Thermal images of the pet dog's room are collected by a thermal imager installed in the pet dog's room, and the thermal images are transmitted to the embedded control motherboard via a network cable and an adapter box.

[0032] The thermal imaging image f is preprocessed by using median filtering to remove noise, resulting in a smoothed thermal imaging image f. med It is represented by the following formula (1).

[0033] f med (x, y)=med{(xm, yn), (m, n∈W)} (1);

[0034] Where x and y are image coordinates, W is the filter window, and m and n are coordinate indices within the filter window.

[0035] Temperature information collected by the smart collar of the pet dog is extracted through an embedded control motherboard and used as a temperature reference value for the pet dog. An indoor temperature sensor in the pet dog's house collects the indoor temperature. Given the indoor temperature and the pet dog's neck temperature, the average of these two temperatures is used as the segmentation threshold p for the binary image. thr Extract the foreground binary image of the pet dog from 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: Perform region growing on the foreground binary image of the pet dog to obtain the calculated binary image of the pet dog.

[0039] Specifically, this includes: determining labeling parameters based on the foreground binary image of the pet dog; wherein the labeling parameters include at least: the image to be labeled; sequentially scanning the image to be labeled to determine the region growth seed; after the sequential scanning is completed, obtaining the calculated binary image of the pet dog by determining the labeling matrix and the number of connected components based on the region growth seed.

[0040] This application obtains a computed binary image of the pet dog by performing region growing on the foreground binary image of the pet dog, thereby enabling feature extraction of the pet dog and obtaining the current physical condition of the pet dog.

[0041] In the embodiments of this application, the following Example 2 will be explained in detail.

[0042] Example 2: Perform an opening operation on the binary image of the pet dog foreground to remove isolated foreground elements and smooth foreground edges. Then, use the region growing algorithm to remove holes inside the foreground to obtain the final image. The region growing algorithm 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, and a label index 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, the labelIndex is incremented by 1, and p is marked in the labelmap (the value of the corresponding point is assigned to labelIndex). At the same time, the eight neighboring points of p are scanned. If there are unmarked foreground pixels, they are marked in the labelmap and put into the queue as seeds for region growth.

[0045] The third step is to take a growth seed point p1 from the queue when the queue is not empty, scan the eight neighboring points of p1, and if there are unmarked foreground pixels, mark them in the labelmap and put them into the queue.

[0046] Repeat step 3 until the queue is empty; a connected component is now marked.

[0047] Proceed to the second step until the entire image has been scanned, obtaining the label matrix labelmap and the number of connected components labelIndex.

[0048] Using the above method, the binary graph f of the pet dog is determined. pet_rg .

[0049] Step 103: Calculate the binary image based on the pet dog and determine the pet dog's body type using the outer matrix method.

[0050] Specifically, this includes: calculating a binary graph based on the pet dog and determining the outer matrix; obtaining the starting point cluster and, based on the starting point cluster, obtaining the minimum outer area of ​​the outer matrix through matrix rotation; labeling the pet dog's body posture and behavior, and setting a pet body posture sample set based on the pet dog's body posture and behavior; and determining the pet dog's body posture type based on the minimum outer area and the pet body posture sample set through a preset pet dog body posture analysis model.

[0051] This application uses the circumscribed matrix method to extract features from the binary image of a pet dog, thereby determining the pet dog's body type and achieving accurate determination of the pet dog's body type, thus improving the efficiency of assessing the pet dog's condition.

[0052] Figure 2The following example 3 provides a detailed explanation of a pet dog body feature map based on light spot projection, which is provided as an embodiment of this application.

[0053] Example 3: To facilitate the extraction of pet dog's physical features and reduce the complexity of the embedded control motherboard algorithm, the minimum bounding matrix algorithm is used to calculate the binary image f of the pet dog. pet_rg Foreground outer matrix M of pet dogs rect And extract the region f of the binary image's circumscribed matrix. rect Finally, the cropped image size is normalized to 64×32 and used as the input feature for the algorithm. Figure 2 The feature image in the image represents a pet dog in an "upright" posture.

[0054] The basic principle of minimum bounding matrix is ​​as follows:

[0055] Obtain the initial foreground bound 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 formulas corresponding to the rotation are expressed by the following formulas (4) and (5).

[0056] x′=x Cos(b)-y sin(b)(4);

[0057] y′=x sin(b)+ycos(b)(5);

[0058] Where x and y are the coordinates of the initial point cluster;

[0059] x′ and 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 area of ​​the matrix is ​​S. i It is 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 area S of the matrix.

[0064] Find the corresponding circumscribed matrix M when the area S of the matrix is ​​minimized. rect_1 ={x min x max ymin y max} is the smallest bounding rectangle.

[0065] To determine the body posture labels for pet dogs, five body posture types are first defined: lying down, lying on one's side, crouching, sitting, and standing, denoted as y. i ={0, 1, 2, 3, 4}, let the sample set of sleeping posture images be defined as D = {d1, d2, ..., d4}. m}, where m is the total number of samples; the training sample set is defined as T = {(d1, y1, y2, y3, y4, y5, y6, y7, y8, y9, y1 ... 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 a PC (personal computer) to obtain parameters such as the SVM model penalty factor C and kernel function parameter g.

[0067] The embedded control motherboard implements the SVM algorithm using the libsvm library in C language. The SVM algorithm parameters are pre-trained on the PC. The SVM structure adopts a directed acyclic graph (DAG) SVM classification model, which simplifies the classification of five dog body postures into a binary classification problem, resulting in short training time and good versatility. After training, 10 (4+3+2+1=10) sub-SVM classifiers are generated. During the classification process, this model is used to output samples and corresponding body posture labels in real time, ultimately determining the dog's body posture type.

[0068] Step 104: Assess the dog's sleep patterns based on its body type to determine its current activity level.

[0069] Specifically, this includes: determining whether the pet dog's body posture type matches a preset sleeping posture to determine the pet dog's first current state; wherein, the pet dog's body posture type includes: lying down, lying on its side, curled up, sitting, and standing; if the first current state is a lying sleeping posture, determining the pet dog's second current state through a preset average comparison method; and determining the pet dog's current activity state based on the current second state.

[0070] This application assesses a pet dog's sleep patterns based on its body type to determine its current activity level, thereby enabling accurate judgment of the pet's sleep state and improving the accuracy of determining details of the pet's body shape.

[0071] In the embodiments of this application, the following Example 4 will be explained in detail.

[0072] Example 4: First, determine the non-sleep state lookup table and the pet dog entertainment mode table; the non-sleep state lookup table is used to determine the pet dog's state when it is not asleep, based on the pet's body type and physiological data obtained through the collar.

[0073] If a dog's heart rate and body temperature are both elevated, and the dog is lying on its side, it is considered to be overheated. Conversely, if a dog's blood pressure and heart rate are decreasing slowly, and it is lying prone, it is considered to be bored.

[0074] Other situations can be handled similarly, with adjustments made as needed based on the different breeds and types of pet dogs.

[0075] The pet dog entertainment schedule outlines appropriate entertainment measures for different pet dog conditions: turn on the air conditioner when it's too hot, and turn on the light panel projector and sound equipment when the dog is bored.

[0076] To assess a dog's sleep status based on its body posture, a preliminary body posture needs to be determined. If the dog is not in a lying position (prone, side-lying, or curled up), its sleep status is considered false. If it is in a lying position, nine thermal images are collected within two minutes at equal intervals, and a binary foreground image is calculated, along with the mean image.

[0077] The mean image imgav is obtained by indexing each pixel and performing calculations. r The pixel overlap of the ninth foreground binary image and the mean image is compared and 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 perform calculations to obtain the image. avr .

[0081] Where p is the pixel value of the pixel;

[0082] i and 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 determined as follows:

[0085] P ij-9 p ij-avr ∈img9、img avr , where i and j are pixel coordinates.

[0086] Indexes img9 and imgav r Each pixel is calculated using the following formulas (9), (10), and (11).

[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] Where H is the image height and W is the image width.

[0091] When index_rate ≥ 90%, img9 and img avr If the overlapping area accounts for more than 90%, the pet dog is considered to be in a sleeping state, and the state calculation ends.

[0092] If index_rate < 90%, the dog is awake and its condition needs further assessment. This involves checking whether the various physiological data collected by the smart collar deviate from the normal range, or whether the values ​​are too high or too low. Finally, based on the deviations in physiological data and the dog's posture, the dog's condition table is consulted.

[0093] Step 105: Based on the current activity status of the pet dog, determine the pet dog's entertainment strategy by matching the pet dog's activity relationships.

[0094] Specifically, this includes: determining the pet dog's physical condition based on its current activity status; and determining the pet dog's entertainment strategy by matching the physical condition with a preset entertainment method lookup table.

[0095] This application determines pet dog entertainment strategies based on the pet dog's current activity status and by matching the pet dog's activity relationships. It achieves intelligent response to different pet states and improves the accuracy and versatility of pet entertainment strategy matching.

[0096] Step 106: Based on the pet dog entertainment strategy, perform uniform processing of light spot partitions in the pet dog's activity area to determine the light spot projection strategy.

[0097] Specifically, this includes: acquiring the activity map of the pet dog and dividing the activity map evenly to obtain projection distribution area groups; acquiring the real-time location data of the pet dog and determining the dynamic distribution points of the pet dog in the projection distribution area groups based on the real-time location data; setting the areas in the projection distribution area groups that meet the preset quantity conditions corresponding to the dynamic distribution points as light spot projection target points; and determining the light spot projection strategy based on the light spot projection target points by determining the light spot path and light spot speed.

[0098] After determining the light spot projection strategy by determining the light spot path and light spot speed based on the light spot projection target point, the method further includes: executing the light spot projection strategy and monitoring the changes in the pet dog's state; and executing pet dog life coping strategies based on the state changes and preset environmental thresholds. Among these, the pet dog life coping strategies include: music playback strategy, feeding strategy, and environmental temperature adjustment strategy.

[0099] This application achieves flexible deployment and intelligent projection of light spots in the activity area of ​​pet dogs by uniformly processing the light spot partitions and determining the light spot projection strategy, and improves the distribution of projection positions.

[0100] Figure 3 This is a schematic diagram of a pyramid grid map based on spot projection provided in an embodiment of this application. In this embodiment, it will be explained in detail through Example 5 below.

[0101] Example 5: To prevent pet dogs from getting bored and lonely in the room for a long time, and to encourage them to exercise and maintain their physical and mental health, a pet dog house uses laser lights to randomly and evenly project light spots into the room, allowing the pet dogs to grab the light spots.

[0102] The system detects the dog's status. If the dog is bored, it performs an interactive light spot projection game. The light spot type can be set to include: circle, rectangle, bird, mouse, reptile, butterfly, etc. The owner can customize the type of light spot to suit the dog's preferences. To prevent the dog from getting bored while chasing the light spot, the repetitiveness of the projection position should be reduced, and the uniformity and randomness of the projection position should be increased. The target position of the light spot should also be planned.

[0103] The foreground of the pet dog is obtained from the binary image calculated from the thermal image. The center of the foreground is calculated as the image coordinates of the pet dog's position. Through camera calibration, the transformation matrix between the world coordinate system and the thermal imaging camera coordinate system is obtained, and the image coordinates of the pet dog's position are converted into the world coordinates of the pet dog's position.

[0104] Manually set up a map of the pet dog's house. The system automatically divides the map evenly into four areas, forming the first-layer grid map. Then, each of the four areas is further subdivided into four sub-areas, forming the second-layer grid map. This process is repeated until the number of subdivisions reaches the user-defined value. These multiple maps are then overlaid to form a pyramid grid map.

[0105] The real-time location of the pet is represented by coordinates. The pet dog's location is sampled twice every second, and the pet dog's location is recorded a total of 40 times in the past 20 seconds.

[0106] First, extract layer 1 (P1) of the pyramid grid map, targeting the ground... Figure 4 Given regions P1:S-1, P1:S-2, P1:S-3, and P1:S-4, count the location of the pet dog 60 times in each region and calculate the region with the fewest occurrences: P1:Sn. If there are multiple regions with the fewest occurrences, use the Random() function to randomly select one region as P1:Sn.

[0107] Extract layer 2 (P2) of the pyramid grid map, which contains 16 sub-regions. Extract the region with the fewest occurrences from layer 1, P1:Sn, and its four corresponding sub-regions: P2:Sn-1, P2:Sn-2, P2:Sn-3, and P2:Sn-4. Count the regions where the pet dog's location is located 60 times and calculate the region with the fewest occurrences: P2:Snm. If there are multiple regions with the fewest occurrences, use the Random() function to randomly select one region as P2:Snm.

[0108] Until the last layer, the region with the fewest pet dog locations and the smallest area in the pyramid grid map is found: Px:Snm-...-z. Within this region, a random point is selected using the Random() function as the target point Px for the 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 function, starting from the current projection point Py, move the light spot to the target projection point Px along a straight path at a set speed to complete one projection.

[0110] Set the projection refresh time to t, recalculate the target point every t seconds, move the light spot again, and repeat the steps described in the previous paragraph.

[0111] The above are embodiments of the method proposed in this application. Based on the same inventive concept, embodiments of this application also provide a pet dog interactive device based on light spot projection, the structure of which is as follows: Figure 4 As shown.

[0112] Figure 4This is a schematic diagram of the internal structure of a pet dog interactive device based on light spot projection, provided as an embodiment of this application. Figure 4 As shown, the device includes:

[0113] At least one processor 401;

[0114] And a memory 402 that is communicatively connected to at least one processor;

[0115] The memory 402 stores instructions executable by at least one processor, which are executed by at least one processor 401 to enable at least one processor 401 to:

[0116] Acquire thermal imaging images of a pet dog and segment them using temperature thresholds to obtain a foreground binary image of the dog. Perform region growing on the foreground binary image to obtain a computational binary image of the dog. Based on the computational binary image, determine the dog's body type using the circumscribing matrix method. Assess the dog's sleep status based on its body type to determine its current activity state. Based on the dog's current activity state, determine the dog's entertainment strategy by matching its activity relationships. Based on the dog's entertainment strategy, perform uniform light spot partitioning on the dog's activity area to determine the light spot projection strategy.

[0117] Some embodiments of this application provide corresponding to 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 configured as follows:

[0118] Acquire thermal imaging images of a pet dog and segment them using temperature thresholds to obtain a foreground binary image of the dog. Perform region growing on the foreground binary image to obtain a computational binary image of the dog. Based on the computational binary image, determine the dog's body type using the circumscribing matrix method. Assess the dog's sleep status based on its body type to determine its current activity state. Based on the dog's current activity state, determine the dog's entertainment strategy by matching its activity relationships. Based on the dog's entertainment strategy, perform uniform light spot partitioning on the dog's activity area to determine the light spot projection strategy.

[0119] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments for IoT devices and media are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0120] The systems, media, and methods provided in this application are one-to-one correspondences. Therefore, the systems and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the systems and media will not be repeated here.

[0121] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0122] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0123] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0124] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function 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] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0127] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, 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 technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0128] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0129] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for pet dog interaction based on light spot projection, characterized in that, The method includes: Acquire thermal imaging images of the pet dog and perform temperature threshold segmentation on the thermal imaging images to obtain a foreground binary image of the pet dog. The foreground binary image of the pet dog is subjected to region growing to obtain the computed binary image of the pet dog; Based on the binary image of the pet dog, the body type of the pet dog is determined by the outer matrix method; The sleep patterns of the described dog body types were assessed to determine the dog's current activity level. Based on the current activity status of the pet dog, the pet dog's entertainment strategy is determined by matching the pet dog's activity relationships; Based on the pet dog entertainment strategy, the activity area of ​​the pet dog is divided into light spots for uniform processing to determine the light spot projection strategy. The thermal imaging image is segmented by a temperature threshold to obtain a binary image of the pet dog foreground, specifically including: Acquire segmented temperature reference data and average the segmented temperature reference data to determine the temperature segmentation threshold; wherein, the segmented temperature reference data includes: ambient temperature data and pet neck temperature data; Based on the temperature segmentation threshold, the thermal imaging image is segmented to obtain the foreground binary image of the pet dog. The foreground binary image of the pet dog is subjected to region growing to obtain a computed binary image of the pet dog, specifically including: Based on the foreground binary image of the pet dog, labeling parameters are determined; wherein, the labeling parameters include at least: the image to be labeled; The image to be labeled is scanned sequentially to determine the regions where seeds will grow. After the sequential scanning is completed, seeds are grown in the region, and the binary graph of the pet dog is obtained by determining the marker matrix and the number of connected components. Based on the binary image of the pet dog, the body type of the pet dog is determined by the outer matrix method, specifically including: Calculate the binary graph based on the pet dog and determine the outer matrix; Obtain the starting point cluster, and based on the starting point cluster, obtain the minimum circumscribed area of ​​the circumscribed matrix through matrix rotation; The physical behaviors of pet dogs are labeled, and a pet body posture sample set is set based on the physical behaviors of pet dogs; Based on the minimum circumscribed area and the pet body shape sample set, the pet dog body shape type is determined through a preset pet dog body shape analysis model; Based on the aforementioned pet dog entertainment strategy, the activity area of ​​the pet dog is divided into light spots for uniform processing, and a light spot projection strategy is determined, specifically including: Obtain the activity map of the pet dog and divide the activity map evenly to obtain a group of projected distribution areas; The real-time location data of the pet dog is obtained, and the dynamic distribution points of the pet dog in the projected distribution area group are determined based on the real-time location data. The regions in the projection distribution area group corresponding to the dynamic distribution points that meet the preset quantity conditions are set as the light spot projection target points; Based on the target point of the light spot projection, the light spot projection strategy is determined by determining the light spot path and the light spot velocity; Based on the real-time location data, determine the dynamic distribution points of the pet dog in the projection distribution area group, and set the areas in the projection distribution area group that meet the preset quantity conditions corresponding to the dynamic distribution points as the light spot projection target points, specifically including: Based on the projected distribution area groups, a pyramid grid map is constructed by superimposing the data. Based on the real-time location data and the pyramid grid map, the first layer to the last layer of the pyramid grid map are extracted to obtain the area with the fewest pet dog locations and the smallest area in the pyramid grid map, and any point in the area is taken as the target point for the light spot projection.

2. The pet dog interaction method based on light spot projection according to claim 1, characterized in that, The sleep patterns of the described dog body type were assessed to determine the dog's current activity level, specifically including: Determine whether the pet dog's body posture type matches a preset sleeping posture to determine the pet dog's first current state; wherein, the pet dog's body posture type includes: lying down, lying on its side, curled up, sitting, and standing; When the first current state is a lying sleeping position, the second current state of the pet dog is determined by a preset average comparison method. Based on the second current state, the current activity state of the pet dog is determined.

3. The pet dog interaction method based on light spot projection according to claim 1, characterized in that, Based on the current activity status of the pet dog, an entertainment strategy for the pet dog is determined by matching the pet dog's activity relationships, specifically including: Determine the physical condition of the pet dog based on its current activity status; Based on the described physical condition, a pre-defined entertainment method lookup table is used to determine the pet dog's entertainment strategy.

4. The pet dog interaction method based on light spot projection according to claim 1, characterized in that, After determining the light spot projection strategy based on the light spot projection target point by determining the light spot path and light spot velocity, the method further includes: The light spot projection strategy is executed, and the status changes of the pet dog are monitored in real time; Based on the state changes and preset environmental thresholds, implement pet dog life coping strategies; wherein, the pet dog life coping strategies include: music playback strategy, feeding strategy, and environmental temperature adjustment strategy.

5. 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; The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to: Acquire thermal imaging images of the pet dog and perform temperature threshold segmentation on the thermal imaging images to obtain a foreground binary image of the pet dog. The foreground binary image of the pet dog is subjected to region growing to obtain the computed binary image of the pet dog; Based on the binary image of the pet dog, the body type of the pet dog is determined by the outer matrix method; The sleep patterns of the described dog body types were assessed to determine the dog's current activity level. Based on the current activity status of the pet dog, the pet dog's entertainment strategy is determined by matching the pet dog's activity relationships; Based on the pet dog entertainment strategy, the activity area of ​​the pet dog is divided into light spots for uniform processing to determine the light spot projection strategy. The thermal imaging image is segmented by a temperature threshold to obtain a binary image of the pet dog foreground, specifically including: Acquire segmented temperature reference data and average the segmented temperature reference data to determine the temperature segmentation threshold; wherein, the segmented temperature reference data includes: ambient temperature data and pet neck temperature data; Based on the temperature segmentation threshold, the thermal imaging image is segmented to obtain the foreground binary image of the pet dog. The foreground binary image of the pet dog is subjected to region growing to obtain a computed binary image of the pet dog, specifically including: Based on the foreground binary image of the pet dog, labeling parameters are determined; wherein, the labeling parameters include at least: the image to be labeled; The image to be labeled is scanned sequentially to determine the regions where seeds will grow. After the sequential scanning is completed, seeds are grown in the region, and the binary graph of the pet dog is obtained by determining the marker matrix and the number of connected components. Based on the binary image of the pet dog, the body type of the pet dog is determined by the outer matrix method, specifically including: Calculate the binary graph based on the pet dog and determine the outer matrix; Obtain the starting point cluster, and based on the starting point cluster, obtain the minimum circumscribed area of ​​the circumscribed matrix through matrix rotation; The physical behaviors of pet dogs are labeled, and a pet body posture sample set is set based on the physical behaviors of pet dogs; Based on the minimum circumscribed area and the pet body shape sample set, the pet dog body shape type is determined through a preset pet dog body shape analysis model; Based on the aforementioned pet dog entertainment strategy, the activity area of ​​the pet dog is divided into light spots for uniform processing, and a light spot projection strategy is determined, specifically including: Obtain the activity map of the pet dog and divide the activity map evenly to obtain a group of projected distribution areas; The real-time location data of the pet dog is obtained, and the dynamic distribution points of the pet dog in the projected distribution area group are determined based on the real-time location data. The regions in the projection distribution area group corresponding to the dynamic distribution points that meet the preset quantity conditions are set as the light spot projection target points; Based on the target point of the light spot projection, the light spot projection strategy is determined by determining the light spot path and the light spot velocity; Based on the real-time location data, determine the dynamic distribution points of the pet dog in the projection distribution area group, and set the areas in the projection distribution area group that meet the preset quantity conditions corresponding to the dynamic distribution points as the light spot projection target points, specifically including: Based on the projected distribution area groups, a pyramid grid map is constructed by superimposing the data. Based on the real-time location data and the pyramid grid map, the first layer to the last layer of the pyramid grid map are extracted to obtain the area with the fewest pet dog locations and the smallest area in the pyramid grid map, and any point in the area is taken as the target point for the light spot projection.

6. A non-volatile computer storage medium for pet dog interaction based on light spot projection, storing computer-executable instructions, characterized in that, When executed by a computer, the computer-executable instructions can realize a pet dog interaction method based on light spot projection as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Pet accompanying method and device

    CN116439155A