Live subject motion center of gravity identification method, system, and computer readable storage medium
By identifying the center of gravity of a live object and fitting the average speed and hair features of the live object with two-dimensional image blocks, the problem of image blurring and shaking in the shooting of live objects such as pets is solved, and a low-cost and efficient autofocus effect is achieved.
Patent Information
- Application Number
- CN202211271932.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-18
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2042-10-18
AI Technical Summary
Existing technologies struggle to achieve accurate autofocus when photographing live subjects, especially pets. Feedback-based autofocus requires high computing power, while active autofocus cannot predict motion trajectories, resulting in blurry and shaky images.
By identifying the center of gravity of a living object, fitting the average velocity of the living object with two-dimensional image blocks, and combining hair features to identify the center of gravity, a center of gravity library is established, reducing computational load and achieving accurate focus tracking.
It achieves clear imaging of live objects under low-cost hardware conditions, reduces computational load, and improves image quality and focus accuracy.
Smart Images

Figure CN115457666B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of pet photography technology, and relates to the photography technology of moving objects, specifically to a method, system and computer-readable storage medium for recognizing the center of gravity of a moving object. Background Technology
[0002] One of the key techniques in photography and videography is the ability to accurately focus on the subject. If the subject is moving, it is necessary to maintain focus on the moving target throughout the shooting process, a process known as autofocus. Shooting moving subjects typically demands a high level of focus control from the photographer. Based on this need, autofocus technology has been developed and applied in many scenarios.
[0003] For tracking and focusing on moving objects, two methods are typically used. One method is to identify and extract the target from the image acquired by the camera and calculate the object's position for feedback-based focus adjustment. The other method is to actively adjust and control the focus based on a preset trajectory for a target with a specific path.
[0004] However, when applied to live objects such as animals and pets, the target extraction and recognition scheme with feedback-based focus adjustment has the following shortcomings:
[0005] (1) Feedback-type focus adjustment requires the camera system to have strong image recognition and computing capabilities and focus response speed, and it is difficult to meet the requirements when the object moves at a high speed or when the focus requirement is high.
[0006] (2) When animals and pets are live animals, their forms are not fixed (different animal postures such as squatting, standing, running, jumping, and curling up vary greatly when they are used as image objects), and they have many types of changes and fast change speed, which will bring great difficulty to the target recognition process itself. Summary of the Invention
[0007] To address the aforementioned problems in the prior art, this invention provides a method, system, and computer-readable storage medium for identifying the center of gravity of a moving object.
[0008] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0009] A method for recognizing the center of gravity of a moving object is provided, characterized by the following steps:
[0010] Step S1: Obtain raw data of a living object leaving the ground and being subjected to gravity only, wherein the raw data includes video data and image data;
[0011] Step S2: Obtain a reference image containing only the living object from the original data;
[0012] Step S3: Obtain the relative velocity of a local body of the living object in the horizontal direction at the first moment from the reference image;
[0013] Step S4: Fit the relative velocity of the local body in the horizontal direction at the first moment to obtain the average velocity of the living object in the horizontal direction;
[0014] Step S5: Obtain a two-dimensional image block in the reference image that has the same speed as the average speed. The coordinates of the two-dimensional image block are the coordinates of the center of gravity of the motion.
[0015] Preferably, in step S4,
[0016] The average velocity of a living object in the horizontal direction is,
[0017] V=F(v1,v2,...,vm) (1)
[0018] The living object has a head, eyes, front paws, and hind paws in part of its body;
[0019] Where vm is the horizontal velocity of a local body of the living object at the first moment, and m is an integer greater than 1;
[0020] Where F() is the fitting function for the average velocity.
[0021] Preferably, the hair features on the surface of the living object at the coordinate position of the center of gravity of motion in step S5 are used as the center of gravity identification object of the living object.
[0022] Preferably, the method for recognizing the center of gravity of a moving object according to claim 3 is characterized in that,
[0023] Before step S2, the raw data is uploaded to the cloud computer. After step S5, the motion center of gravity coordinates and the corresponding reference image obtained by the cloud computer are returned to the local machine.
[0024] Preferably, the coordinates of the center of gravity of the same living object are obtained by capturing multiple video data.
[0025] Preferably, when the living object is fully extended, the distance S = {S1, S2, ..., Sn} between the coordinates of the center of gravity of the living object and the characteristic parts of the living object is calculated and recorded;
[0026] Among them, the characteristic parts include eyes, nose, ears, head, legs, belly, and tail;
[0027] Where Sn represents the distance from a local feature in the image data to the centroid of motion, and n is an integer greater than 2.
[0028] Preferably, the coordinates of the center of gravity of the living object are updated at intervals.
[0029] Preferably, after step S5, a motion center of gravity database is established, and the motion center of gravity information is saved to the motion center of gravity database;
[0030] The motion center of gravity information includes the motion center of gravity identification object at a certain moment and the corresponding reference image.
[0031] Preferably, time information is used as a tag for storing motion center of gravity information;
[0032] The time information includes first time information and second time information;
[0033] The first time information is used as the first storage tag for the center of gravity information, and the second time information is used as the second storage tag for the center of gravity information.
[0034] Preferably, the first-time information includes morning, afternoon, evening, and early morning;
[0035] The second time information includes the time before and after meals.
[0036] A system for recognizing the center of gravity of a moving object, characterized in that it includes,
[0037] An executable program that can execute the aforementioned method for recognizing the center of gravity of a moving object.
[0038] A computer-readable storage medium, characterized in that it comprises,
[0039] Used to store a specified computer program, the execution of which can implement the method for recognizing the center of gravity of a moving object.
[0040] The beneficial effects of this invention are reflected in providing a method, system, and computer-readable storage medium for identifying the center of gravity of a living object. This invention significantly reduces the computational load by identifying the center of gravity, and it simplifies complex data to derive the center of gravity of the living object. This enables the identification of the center of gravity even under less powerful hardware conditions, achieving the requirements of low-cost, mass-producible hardware. Attached Figure Description
[0041] Figure 1 A flowchart of a method for recognizing the center of gravity of a moving object;
[0042] Figure 2 Flowchart for another method of recognizing the center of gravity of a moving object;
[0043] Figure 3 A schematic diagram of a method for recognizing the center of gravity of a moving object;
[0044] Figure 4 This is a schematic diagram of a sports center library;
[0045] Figure 5 This is a schematic diagram of another type of sports center library. Detailed Implementation
[0046] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0047] Please see Figures 1-5 As shown, the specific embodiments provided by the present invention are as follows:
[0048] Example 1:
[0049] A method for recognizing the center of gravity of a moving object, characterized by comprising the following steps:
[0050] Step S1: Obtain raw data of a living object leaving the ground and being subjected to gravity only, wherein the raw data includes video data and image data;
[0051] Step S2: Obtain a reference image containing only the living object from the original data;
[0052] Step S3: Obtain the relative velocity of a local body of the living object in the horizontal direction at the first moment from the reference image;
[0053] Step S4: Fit the relative velocity of the local body in the horizontal direction at the first moment to obtain the average velocity of the living object in the horizontal direction;
[0054] Step S5: Obtain a two-dimensional image block in the reference image that has the same speed as the average speed. The coordinates of the two-dimensional image block are the coordinates of the center of gravity of the motion.
[0055] With the continuous development of the Internet, a large number of pet lovers share their pet information, including videos, pictures, and text. Short videos spread information very quickly and widely, and pet information has gradually occupied most of the content of short videos. In particular, users who own pets are more willing to watch videos and pictures of their own pets. Therefore, it is very meaningful to provide a device for filming pets.
[0056] When using a home security camera, a common issue is automatic focus. When filming moving objects, the camera needs to refocus in real-time to ensure sharpness. Current technology offers two focus methods: manual and automatic. While master photographers can adjust the focus arbitrarily based on the moving object to achieve good results, the number of master photographers is limited, making this method too costly.
[0057] One type of autofocus is feedback autofocus. Feedback autofocus requires first identifying the moving object, then determining the distance between the moving object and the lens, and then adjusting the focus accordingly. This method requires the camera to have strong computing power to perform complex image processing tasks, which poses a significant challenge for real-time video data processing. Moreover, this method is particularly difficult to implement for focusing on fast-moving live objects. Another type of autofocus is based on a fixed motion trajectory. It can preset the focus based on a known motion trajectory to achieve an automatic focusing effect. However, the accurate focusing of this method depends on knowing the motion trajectory in advance. Since live objects such as pets move erratically, their motion trajectory cannot be known in advance. Therefore, this method cannot accurately focus on live objects, making it difficult to capture clear videos of moving live objects.
[0058] When a live subject moves rapidly, there is a high probability that only a portion of its body will move. For example, a pet's head may remain stationary while its body moves, or vice versa. In such cases, the camera will automatically adjust its focus. However, because the pet's movements are unpredictable, the camera is likely to over-adjust the focus, resulting in unacceptable shaking in the video and a blurry image. This significantly impacts the overall quality of the raw data and provides a very poor user experience.
[0059] Because living objects like pets (such as cats and dogs) move as a whole, their movement is singular, especially when jumping or leaving the ground. In this case, the object is only subject to gravity, and regardless of its posture, its center of gravity follows a simple movement pattern under a single force. Therefore, identifying and accurately obtaining the object's unique center of gravity, and then applying its coordinates to follow-focus shooting of that object, is one of the key technologies for improving the quality of videos featuring such objects, especially for shooting jumping or other ground-leaning movements, enabling precise trajectory prediction and follow-focus shooting.
[0060] In this embodiment, as Figure 1As shown, a method for recognizing the center of gravity of a moving object is provided, characterized by the following steps: Step S1, acquiring raw data of a moving object leaving the ground and being subject only to gravity, the raw data including video data and image data; Step S2, acquiring a reference image containing only the moving object from the raw data; Step S3, acquiring the relative velocity of a local part of the moving object in the horizontal direction from the reference image at a first moment; Step S4, fitting the relative velocity of the local part of the moving object in the horizontal direction at the first moment to obtain the average velocity of the moving object in the horizontal direction; Step S5, acquiring a two-dimensional image patch in the reference image that has the same velocity as the average velocity, the coordinates of the two-dimensional image patch being the coordinates of the center of gravity. Since the number of pets in a user's home is limited, generally 1-2, and the pets are relatively fixed, by learning and storing the center of gravity image of the moving object, and then tracking and filming the object, the center of gravity is calculated from its daily movement trajectory. The center of gravity recognition method of this invention only needs to calculate the center of gravity of the pet in the user's home, by acquiring a fixed video of the pet's movement, processing the video, and obtaining the coordinates of the center of gravity of the moving object in the video data. Compared to feedback-based autofocus, this invention predicts the trajectory of a 2D image patch identified by the center of gravity. The predicted trajectory closely approximates the actual movement trajectory of the living object. The camera, focusing on the 2D image patch identified by the center of gravity, captures a clear image without blurring or jitter. This invention simplifies the calculation of the center of gravity of the living object by simplifying complex data, significantly reducing the computational load for center of gravity identification. Furthermore, this invention can achieve center of gravity identification even under less powerful hardware conditions, meeting the requirements for low-cost, mass-producible hardware.
[0061] Example 2:
[0062] In step S4,
[0063] The average velocity of a living object in the horizontal direction is,
[0064] V=F(v1,v2,...,vm) (1)
[0065] The living object has a head, eyes, front paws, and hind paws in part of its body;
[0066] Where vm is the horizontal velocity of a local part of the living object at the first moment, and m is an integer greater than 1; s
[0067] Where F() is the fitting function for the average velocity.
[0068] When a living object jumps off the ground, it is only subject to gravity. Since its center of gravity is unique, its trajectory can be determined to pinpoint the camera's focal length, thus preventing image shake. Because the living object experiences no force in the horizontal direction, its momentum is conserved in that direction.
[0069] In this embodiment, the average velocity of the living object in the horizontal direction is obtained by fitting the relative velocity of a local part of the body in the horizontal direction at the first moment. Based on the conservation of momentum in the horizontal direction, the average velocity V of the living object in the horizontal direction is fitted using a fitting function. The average velocity V of the living object in the horizontal direction is the velocity of the center of gravity of the living object in the horizontal direction. In one embodiment, the living object is a cat, and the average velocity of the cat in the horizontal direction is V = F(v1, v2, v3), where v1 represents the velocity of the cat's front paws at a certain moment, v2 represents the velocity of the cat's hind paws at a certain moment, and v3 represents the velocity of the cat's head at a certain moment.
[0070] Example 3:
[0071] The hair features on the surface of the living object at the coordinate position of the center of gravity in step S5 are used as the center of gravity identification object of the living object.
[0072] Since the center of gravity of a living object is generally located within its body, and the data captured by the camera is a two-dimensional image, it is difficult to locate the three-dimensional coordinates of the center of gravity in a two-dimensional image. In this embodiment, the hair features on the surface of the living object at the coordinate position of the center of gravity are used as the object for identifying the center of gravity of the living object. The hair features can be approximated as the object for identifying the center of gravity in the two-dimensional image, thereby greatly reducing the amount of calculation required for subsequent identification of the center of gravity.
[0073] In one embodiment, the hair feature image is used as a template. In the raw data of the next capture, for each frame of the image, the center of gravity of the motion of the living object in the image is quickly found by template matching, thereby achieving accurate focus tracking of the living object.
[0074] Example 4:
[0075] Before step S2, the raw data is uploaded to the cloud computer. After step S5, the motion center of gravity coordinates and the corresponding reference image obtained by the cloud computer are returned to the local machine.
[0076] In this embodiment, as Figures 2-3As shown, by collecting motion videos of a stationary pet, the motion video data is uploaded to a cloud computer. The cloud computer calculates the coordinates of its center of gravity and the corresponding reference image data. The motion center of gravity recognition object and corresponding reference image data obtained from the cloud computer are then returned to the local machine. The raw data captured locally does not need to undergo complex fitting and searching for the motion center of gravity coordinates of a live object. Instead, the returned motion center of gravity recognition object is directly used as the target to find the motion center of gravity. This method can greatly reduce the amount of calculation required for subsequent motion center of gravity recognition, and the recognition speed is also greatly improved.
[0077] Example 5:
[0078] The coordinates of the center of gravity of the same living object are obtained by capturing multiple video data.
[0079] In this embodiment, due to the partial distortion of two-dimensional images, it may occur that there is more than one two-dimensional image block with the same speed as the average speed V in the original data. Some of these two-dimensional image blocks do not correspond to the center of gravity of the motion. It is necessary to filter out the two-dimensional image blocks that do not correspond to the center of gravity of the motion by filtering through multiple video data.
[0080] Example 6:
[0081] When the living object is fully extended, calculate and record the distance S = {S1, S2, ..., Sn} between the coordinates of the center of gravity of the living object and the characteristic parts of the living object;
[0082] Among them, the characteristic parts include eyes, nose, ears, head, legs, belly, and tail;
[0083] Where Sn represents the distance from a local feature in the image data to the centroid of motion, and n is an integer greater than 2.
[0084] When the hair or fur features on the surface of a living object are similar, identifying the center of gravity based on these features is quite challenging, such as with solid-colored living objects or hairless cats. In this embodiment, the center of gravity is determined by the relative position of the living object. When a living object jumps, taking a cat as an example, in many cases, a cat's body is fully extended for a considerable period while jumping, including its two front legs, two hind legs, and head. At this time, the distance S = {S1, S2, ..., Sn} between the coordinates of the center of gravity and the characteristic parts of the living object is calculated and recorded to construct the relative relationship between the center of gravity and the posture of the living object. This determines the hair feature corresponding to the cat's center of gravity in its fully extended state, and then uses this hair feature as the focus point. This method, on the one hand, can determine the position of the center of gravity based on the cat's local position, reducing the computational load, and on the other hand, can alleviate the false recognition rate caused by indistinct hair features. It should be noted that this embodiment uses a cat as an example of a living object, but the living object is not limited to cats.
[0085] Example 7:
[0086] Update the coordinates of the center of gravity of the living object at regular intervals.
[0087] In this embodiment, since a pet's shape and weight change over time, the coordinates of its center of gravity also change. When the pet's actual center of gravity changes, if its coordinates are not updated, the video image captured will likely be blurry. Therefore, updating the center of gravity is very valuable. Updating the coordinates of a live animal's center of gravity at intervals ensures the clarity of the captured image. The update interval is set according to the growth pattern of the live animal. In one embodiment, the interval is set according to the pet's specific age group. For example, for kittens, the update interval is 10-15 days; for adult male cats and non-pregnant female cats, the update interval is 25-40 days; and for pregnant female cats, the update interval is 15-20 days.
[0088] Example 8:
[0089] After step S5, a motion center of gravity database is established, and the motion center of gravity information is saved to the motion center of gravity database;
[0090] The motion center of gravity information includes the motion center of gravity identification object at a certain moment and the corresponding reference image.
[0091] In a real-life pet-owning household, there is usually more than one pet. For multiple living objects, there are also multiple centers of gravity. Since the center of gravity of a living object is unique, the coordinates of the center of gravity in the three-dimensional coordinate system are mapped to a two-dimensional image, and there is a hair feature corresponding to the center of gravity. However, when the living object is in different postures or directions, there are multiple sets of hair features corresponding to the center of gravity in the two-dimensional image captured by the camera. If only one set is taken as the center of gravity identification mark, when the living object changes posture, there is a high probability that the center of gravity identification mark cannot be identified, and it is impossible to accurately and in real time locate the center of gravity of the living object.
[0092] In this embodiment, as Figure 4 As shown, by establishing a motion center of gravity database, the motion center of gravity identification objects of living objects in image data can be stored in the database, thus preserving more complete motion center of gravity identification objects. In another embodiment, as... Figure 5 As shown, saving the motion center of gravity identification object of the living object and its corresponding reference image together into the motion database can reduce the error caused by the similarity of the motion center of gravity identification object features, and can more accurately identify the motion center of gravity of the living object.
[0093] Example 9:
[0094] Use time information as a tag to store motion center of gravity information;
[0095] The time information includes first time information and second time information;
[0096] The first time information is used as the first storage tag for the center of gravity information, and the second time information is used as the second storage tag for the center of gravity information.
[0097] Preferably, the first-time information includes morning, afternoon, evening, and early morning;
[0098] The second time information includes the time before and after meals.
[0099] Preferably, a system for recognizing the center of gravity of a living object is characterized by comprising:
[0100] An executable program that can execute the aforementioned method for recognizing the center of gravity of a moving object.
[0101] A computer-readable storage medium, characterized in that it comprises,
[0102] Used to store a specified computer program, the execution of which can implement the method for recognizing the center of gravity of a moving object.
[0103] In this embodiment, since a pet's shape and weight change over time, the coordinates of its center of gravity also change. The coordinates of its center of gravity within a specific time period are collected based on the pet's daily routine. This invention uses time information as a storage tag for the center of gravity information; wherein, the time information includes first time information and second time information; the first time information is used as the first storage tag for the center of gravity information, and the second time information is used as the second storage tag for the center of gravity information. The time information and the corresponding center of gravity coordinates are saved in a center of gravity database, further classifying and managing the center of gravity. When actually photographing a pet, the optimal center of gravity can be selected for focusing based on the pet's real-time state. This method improves the quality of the image after focusing and also greatly enhances the accuracy of focusing.
[0104] In the description of the embodiments of the present invention, it should be understood that the terms "upper", "lower", "front", "back", "left", "right", "vertical", "horizontal", "center", "top", "bottom", "top", "bottom", "inner", "outer", "inner side", "outer side", etc. indicate the orientation or positional relationship.
[0105] In the description of the embodiments of the present invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," "joining," and "assembly" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal communication between two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.
[0106] In the description of embodiments of the present invention, specific features, structures, materials or characteristics may be combined in any suitable manner in one or more embodiments or examples.
[0107] In the description of the embodiments of the present invention, it should be understood that "-" and "~" represent a range of two numerical values, and this range includes the endpoints. For example, "AB" represents a range greater than or equal to A and less than or equal to B. "A~B" represents a range greater than or equal to A and less than or equal to B.
[0108] In the description of embodiments of the present invention, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0109] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for identifying a center of motion gravity of a living subject, characterized by, The method comprises the following steps, Step S1, obtaining original data of a living object leaving the ground and only under gravity, the original data having video data and image data; Step S2, obtaining a reference image of only the living object in the original data; Step S3, obtaining a relative speed of a local body of the living object in a horizontal direction at a first time from the reference image; Step S4, fitting the relative speed of the local body in the horizontal direction at the first time to obtain an average speed of the living object in the horizontal direction; Step S5, obtaining a two-dimensional image block with the same average speed in the reference image, the two-dimensional image block being in a motion barycenter coordinate; In step S4, The average speed of the living object in the horizontal direction is (1) Wherein, the local body of the living object has a head, eyes, forepaws, and hindpaws; Wherein, vm is the speed of the local body of the living object in the horizontal direction at the first time, and m is an integer greater than 1; Wherein, F() is a fitting function of the average speed.
2. The method of claim 1, wherein, The surface hair features of the living object at the motion barycenter coordinate position in step S5 are taken as the motion barycenter recognition object of the living object.
3. The method of claim 2, wherein, Before step S2, the original data is uploaded to a cloud computer, and after step S5, the motion barycenter coordinate obtained by the cloud computer is returned to the local together with the corresponding reference image.
4. The method of claim 3, wherein, The motion barycenter coordinates of the same living object are obtained by shooting multiple video data.
5. The method of claim 4, wherein, After step S5, When the living object is fully stretched out, the motion center of gravity coordinates of the living object and the distances from the characteristic parts of the living object are calculated and recorded ; Wherein, the feature parts have eyes, noses, ears, heads, legs, bellies, and tails; Wherein, Sn represents the distance from the feature parts to the motion barycenter in the image data, and n is an integer greater than 2.
6. The method of claim 5, wherein, The motion barycenter coordinates of the living object are updated at intervals.
7. The method of claim 6, wherein, After step S5, a motion barycenter library is established, and the motion barycenter information is saved to the motion barycenter library; Wherein, the motion barycenter information has a motion barycenter recognition object at a certain time and a corresponding reference image.
8. The method of claim 7, wherein, Time information is taken as a saving tag of the motion barycenter information; Wherein, the time information has first time information and second time information; The first time information is taken as a first saving tag of the motion barycenter information, and the second time information is taken as a second saving tag of the motion barycenter information.
9. The method of claim 8, wherein, The first time information has morning, afternoon, evening, and early morning; The second time information has pre-meal time and post-meal time.
10. A system for recognizing the center of gravity of a moving object, characterized in that, Comprise: a memory; The memory stores an executable program, and the executable program is executable to implement the method for identifying the center of gravity of the moving living body object according to any one of claims 1-9.
11. A computer readable storage medium characterized by, The medium stores a specified computer program, and the specified computer program is executable to implement the method for identifying the center of gravity of the moving living body object according to any one of claims 1-9.
Citation Information
Patent Citations
Method of mouse spontaneous behavior motion monitoring and posture image recognition
CN101526996A
Pet recognition method and system, readable storage medium and computer equipment
CN111598062A