CN116469156A - Method, apparatus, computer device and computer readable storage medium for identifying body state - Google Patents

Method, apparatus, computer device and computer readable storage medium for identifying body state Download PDF

Info

Publication number
CN116469156A
CN116469156A CN202210027102.7A CN202210027102A CN116469156A CN 116469156 A CN116469156 A CN 116469156A CN 202210027102 A CN202210027102 A CN 202210027102A CN 116469156 A CN116469156 A CN 116469156A
Authority
CN
China
Prior art keywords
key point
feature vector
vector
target object
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210027102.7A
Other languages
Chinese (zh)
Inventor
赵晨晨
李渊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan TCL Group Industrial Research Institute Co Ltd
Original Assignee
Wuhan TCL Group Industrial Research Institute Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan TCL Group Industrial Research Institute Co Ltd filed Critical Wuhan TCL Group Industrial Research Institute Co Ltd
Priority to CN202210027102.7A priority Critical patent/CN116469156A/en
Publication of CN116469156A publication Critical patent/CN116469156A/en
Pending legal-status Critical Current

Links

Abstract

The embodiment of the application provides a body state identification method, a body state identification device, computer equipment and a computer readable storage medium, wherein an image to be identified can be obtained, and the image to be identified contains key point characteristics of a target object; identifying key points of a target object in an image to be identified to obtain a key point position information set, wherein the key point position information set comprises position information of each key point of the target object; constructing a key point feature vector based on the key point position information set; and determining the body state recognition result of the target object according to the key point feature vector. According to the embodiment of the application, the human body key point characteristics of the target object in the image to be identified can be identified to obtain the position information of each key point characteristic in the current body state information of the target object, so that the body state identification result of the target object is determined according to the key point position information, dependence on a hardware module can be eliminated when the body state identification of the target object is carried out, and the efficiency of human body state identification is improved.

Description

Method, apparatus, computer device and computer readable storage medium for identifying body state
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method and apparatus for identifying a body state, a computer device, and a computer readable storage medium.
Background
With the development of artificial intelligence technology, the method is gradually applied to various fields such as face recognition, man-machine question answering, posture recognition and the like, and the living experience of people is improved. The posture recognition technology can be applied to human body posture monitoring scenes, such as sitting posture recognition detection of people working on a table such as students and white collars, so as to monitor the posture health of users of the people.
When the existing body state recognition technology is used for body state recognition, body state information of a target user needs to be detected in a mode of combining a plurality of module hardware, the requirement on hardware configuration is high, the body state recognition technology is easily limited by response time of the module hardware, and body state recognition efficiency is affected. Thus, the posture recognition technology has great challenges in application research, and a new posture recognition technology is needed at present.
Disclosure of Invention
The embodiment of the application provides a body state identification method, a body state identification device, computer equipment and a computer readable storage medium, which can improve the efficiency of human body state identification.
The embodiment of the application provides a posture identification method, which comprises the following steps:
acquiring an image to be identified, wherein the image to be identified contains key point characteristics of a target object;
identifying key points of the target object in the image to be identified to obtain a key point position information set, wherein the key point position information set comprises position information of each key point of the target object;
constructing a key point feature vector based on the key point position information set;
and determining a body state recognition result of the target object according to the key point feature vector.
Accordingly, an embodiment of the present application provides a posture identifying device, including:
the acquisition unit is used for acquiring an image to be identified, wherein the image to be identified contains key point characteristics of a target object;
the identification unit is used for identifying key points of the target object in the image to be identified to obtain a key point position information set, wherein the key point position information set comprises position information of each key point of the target object;
the construction unit is used for constructing a key point feature vector based on the key point position information set;
and the determining unit is used for determining the body state recognition result of the target object according to the key point feature vector.
In some embodiments, the determining unit includes:
the obtaining subunit is used for obtaining the vector direction corresponding to the key point feature vector;
and the determining subunit is used for determining the body state recognition result of the target object according to the vector direction corresponding to the key point feature vector.
In some embodiments, the acquisition subunit is further configured to:
identifying the vector relation of the key point feature vector in the image to be identified;
and determining the vector direction corresponding to the key point feature vector according to the vector relation.
In some embodiments, the acquisition subunit is further configured to:
establishing a rectangular coordinate system corresponding to the image to be identified;
and acquiring the vector relation of the key point feature vector in the rectangular coordinate system.
In some embodiments, the acquisition subunit is further configured to:
determining the direction angle of the key point feature vector according to the vector relation;
and determining the vector direction corresponding to the key point feature vector according to the direction angle.
In some embodiments, the key point feature vector includes a first sub-feature vector with a left ear pointing to a left eye, a second sub-feature vector with a left eye pointing to a nose, a third sub-feature vector with a right ear pointing to a right eye, and a fourth sub-feature vector with a right eye pointing to a nose, the determining subunit is further configured to determine a body recognition result of the target object according to a vector direction corresponding to the key point feature vector:
Based on vector directions corresponding to the first sub-feature vector, the second sub-feature vector, the third sub-feature vector and the fourth sub-feature vector, quadrant characteristic relations among the first sub-feature vector, the second sub-feature vector, the third sub-feature vector and the fourth sub-feature vector and a preset rectangular coordinate system are respectively determined;
if the quadrant characteristic relation of the first sub-feature vector and the second sub-feature vector is detected to point to the fourth quadrant and the quadrant characteristic relation of the third sub-feature vector and the fourth sub-feature vector is detected to point to the third quadrant, determining that the target object is in a low head state, and determining the low head state as a body state recognition result of the target object.
In some embodiments, the keypoint feature vector comprises a first parallel vector pointing to the right ear for the left ear and a second parallel vector pointing to the right eye for the left eye, the determining subunit further being for:
determining horizontal inclination angles of the first parallel vector and the second parallel vector respectively based on vector directions corresponding to the first parallel vector and the second parallel vector;
if the horizontal inclination angles of the first parallel vector and the second parallel vector are detected to be in a preset first inclination angle range value, determining that the target object is in a lateral head state, and determining the lateral head state as a body state recognition result of the target object.
In some embodiments, the keypoint feature vector comprises a first balance vector with a left shoulder pointing to a right shoulder, the determining subunit further being for:
determining a horizontal inclination angle of the first balance vector according to a vector direction corresponding to the first balance vector;
if the horizontal inclination angle of the first balance vector is detected to be in the preset second inclination angle range value, determining that the target object is in an italic state, and determining the italic state as a body state recognition result of the target object.
In some embodiments, the building unit is further configured to:
extracting a plurality of key point position sub-information in the key point data set;
determining target position coordinates of the key point position sub-information in the image to be identified;
and vector calculation is carried out on the target position coordinates to obtain the feature vector of the key point.
In some embodiments, the identification unit is further configured to:
and identifying key points of the target object in the image to be identified through a target model to obtain a key point position information set, wherein the target model is obtained by training sample body state information and sample key point position information contained in a sample image.
In some embodiments, the identification unit is further configured to:
intercepting a target human body sub-image of the target object from the image to be identified;
inputting the target human body sub-image into the target model for key point feature recognition to obtain a key point position information set.
In some embodiments, the acquiring unit is further configured to:
receiving a video to be processed;
target image frames of the target object within a history period are extracted from the video to be processed, and the target image frames are determined to be images to be identified.
In some embodiments, the acquiring unit is further configured to:
decomposing the video to be processed to obtain an image frame set;
screening a plurality of image subframes corresponding to the target object from the image frame set;
and extracting target image frames conforming to the history period from the plurality of image subframes.
In some embodiments, the image to be identified is a target video frame in the video to be processed, and the body state identifying device further includes a generating unit, configured to:
if the body state recognition results of a plurality of continuous target video frames in the video to be processed are the same preset gesture, determining that the target object is in an error body state, and generating prompt information corresponding to the error body state.
In addition, the embodiment of the application also provides computer equipment, which comprises a memory and a processor; the memory stores a computer program, and the processor is configured to execute the computer program in the memory to perform any of the body state recognition methods provided in the embodiments of the present application.
In addition, the embodiment of the application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute any of the posture identification methods provided by the embodiment of the application.
The embodiment of the application can acquire the image to be identified, wherein the image to be identified contains the key point characteristics of the target object; identifying key points of a target object in an image to be identified to obtain a key point position information set, wherein the key point position information set comprises position information of each key point of the target object; constructing a key point feature vector based on the key point position information set; and determining the body state recognition result of the target object according to the key point feature vector. According to the method, the human body key point characteristics of the target object in the image to be identified are identified to obtain the position information of each key point characteristic in the current body state information of the target object, the key point position information set is obtained, and then, the key point characteristic vector is constructed based on the key point position information set, so that the body state identification result of the target object is determined according to the direction of the constructed key point characteristic vector, and therefore, dependence on a hardware module can be eliminated when the body state identification is carried out on the target object, and the efficiency of the body state identification of the human body is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic view of a body state recognition system according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating steps of a method for identifying a seed status according to an embodiment of the present disclosure;
fig. 3 is a schematic view of a scenario of a posture recognition method provided in an embodiment of the present application;
FIG. 4 is a flowchart illustrating another step of the method for identifying a posture according to an embodiment of the present application;
fig. 5 is a schematic view of a scene flow of a posture recognition method provided in an embodiment of the present application;
fig. 6 is a schematic structural diagram of a posture identifying device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
Embodiments of the present application provide a method, apparatus, computer device, and computer-readable storage medium for identifying a posture. The body state recognition device can be integrated in computer equipment, and the computer equipment can be a server or a terminal and other equipment.
The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), basic cloud computing services such as big data and an artificial intelligent platform. The terminal may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc. The terminal and the server may be directly or indirectly connected through wired or wireless communication, which is not limited herein.
For example, referring to fig. 1, the body form recognition apparatus is integrated in a computer device, which may include a terminal or a server. The terminal or the server can acquire an image to be identified, wherein the image to be identified contains key point characteristics of a target object; identifying key points of a target object in an image to be identified to obtain a key point position information set, wherein the key point position information set comprises position information of each key point of the target object; constructing a key point feature vector based on the key point position information set; and determining the body state recognition result of the target object according to the key point feature vector.
The body state recognition process may include obtaining an image to be recognized including all key point features of the target object, recognizing the key point features included in the image, constructing a key point feature vector, determining a body state recognition result of the target object, and other processing modes.
The following will describe in detail. The following description of the embodiments is not intended to limit the preferred embodiments.
Fig. 2 is a schematic step flow diagram of a posture identifying method provided in an embodiment of the present application, and fig. 3 is a schematic scene diagram of the posture identifying method provided in an embodiment of the present application, where, for convenience of understanding, the embodiment of the present application may be understood by combining fig. 2 and fig. 3.
In the embodiment of the present application, description will be made from the perspective of a body state recognition device, which may be specifically integrated in a computer device, where the computer device may be a server, or may be a device such as a terminal. In this embodiment, taking a case that the body recognition device is specifically integrated on the terminal as an example, when the processor on the terminal executes a program corresponding to the information processing method, a specific flow is as follows:
101. and acquiring an image to be identified.
The image to be identified contains key point characteristics of the target object, wherein the key point characteristics can be characteristics representing relevant parts of the target object. By way of example, the image to be identified is an image containing the entire body of the target user, and the location corresponding to the key point in the image may be the left ear, the right ear, the left eye, the right eye, the nose, the mouth, the left shoulder, the right shoulder, etc. of the target user, which is not limited herein.
In order to perform body state recognition on the target object subsequently, the embodiment of the application can acquire an image containing the key point characteristics of the target object as an image to be recognized so as to facilitate the body state information of the target object to be recognized subsequently through the key point characteristic information contained in the image to be recognized, thereby determining the body state of the target object in the target period or evaluating the current body state of the target object.
The image to be identified may be an image obtained from a history period, such as an image of the target object 1 second ago, 1 minute ago, or 5 minutes ago. In addition, according to the embodiment of the application, the physical state information of the target object can be acquired in a video stream mode by monitoring the target object in real time, such as shooting the target object in real time through a camera. It should be noted that, in the process of shooting the target object in real time, the shot data (such as video stream, image stream, etc.) of the target object may be transmitted to the processor (such as the terminal or the server) in real time; the video stream of the collected target object can be sent to the processor at intervals of unit time, such as 1 minute or 30 seconds each time; in this way, the processor obtains the image to be identified containing the key point characteristics of the target object from the received image stream or video stream data.
In some embodiments, the step of "acquiring an image to be identified" may include: receiving a video to be processed; target image frames of the target object within the history period are extracted from the video to be processed, and the target image frames are determined as images to be recognized.
The video to be processed may be short video data for real-time monitoring of the target object, which may include body state information of the target object in a history time.
In order to acquire an image to be identified for identifying the body state information (all key point feature information) of the target object, the embodiment of the present application may acquire the image to be identified from a video containing the body state information of the target object. Specifically, a recorded video to be processed is received or obtained, and then, target image frames of a target object in a history period are extracted from the video to be processed, and the target image frames are determined to be images to be identified.
In some embodiments, the step of extracting target image frames of the target object within the history period from the video to be processed may include:
decomposing the video to be processed to obtain an image frame set; screening a plurality of image subframes corresponding to the target object from the image frame set; a target image frame conforming to the history period is extracted from the plurality of image subframes.
Specifically, in order to extract a target image frame from a video to be processed, after the video to be processed is obtained, in the embodiment of the present application, first, decomposition processing, such as framing processing, may be performed on the video to be processed to obtain an image frame set corresponding to the video to be processed, where the image frame set includes a plurality of image subframes; then, a plurality of image subframes containing the target object are screened from the image frames so as to filter other irrelevant image subframes (such as invalid image frames not containing the target object) and avoid that the irrelevant image affects the accuracy and efficiency of subsequent body state identification; finally, a target image frame in the target history period is extracted from a plurality of image subframes containing the target object, for example, the image subframe of the first 5 seconds is extracted as the target image frame, and is determined as an image to be identified, so that the body state of the target object in the target period is determined or the current body state of the target object is estimated/predicted according to the image to be identified.
In the above manner, the image to be recognized including the body state information of the target object can be acquired, so that the body state information of the target object can be recognized based on the image to be recognized later.
102. And identifying the key point characteristics of the target object in the image to be identified to obtain a key point position information set.
The key point position information set comprises position information of each key point of the target object; that is, the set of key point position information may include a plurality of key point position sub-information, and the key point position sub-information may be position information indicating that the corresponding key point is in the image to be identified, such as coordinates, distance from the center of the image, display ratio, and the like.
In order to identify the body state information of the target object, the embodiment of the application can identify the body state information of the target object through a key point characteristic identification mode. Specifically, after the image to be identified is obtained, the key point characteristics of the target object in the image to be identified can be identified by identifying the key point characteristics of the target object, and the position information corresponding to the identified key point characteristics is determined. For example, the key point positions of the left ear, the right ear, the left eye, the right eye, the nose, the mouth, the left shoulder, the right shoulder and the like of the target user in the image to be identified are identified, and the position information of the key point positions in the image to be identified, namely the key point position information, is determined, so that a key point position information set is obtained. In this way, the body state information of the target object is identified, so that the body state result of the target object can be conveniently determined according to the position information of each key point in the key point position information set.
In some embodiments, the step of identifying key point features of a target object in an image to be identified to obtain a set of key point position information may include:
and identifying key points of a target object in the image to be identified through a target model to obtain a key point position information set, wherein the target model is obtained by joint training of sample body state information and sample key point position information contained in the sample image.
In this embodiment of the present application, the target model may be obtained by iterative training of a lightweight preset model, for example, when the preset model is selected, light-openpost may be selected, and the trunk may be replaced with a shufflelenetv 2-0.5x to determine the lightweight preset model. Specifically, the training process of the target model may be: acquiring a sample image containing sample key point features; inputting the sample image into a preset model to obtain the predicted position information of the key points; acquiring a position information difference value between the predicted position information of the key point and the position information of the sample key point; and adjusting network parameters of the preset model according to the position information difference value until iteration convergence of the preset model to obtain a target model.
The sample image may at least include an upper body portion of the user, such as a head, a neck, a shoulder, etc., and in actual training, a left ear, a right ear, a left eye, a right eye, a nose, a mouth, a left shoulder, a right shoulder in the upper body portion of the sample image may be used as sample key point features to train the preset model. It should be noted that, when selecting training data, the sample image may be inherited from the disclosed data set; in addition, after an image is obtained from the disclosed data set, the same image can be amplified according to preset amplification factors to obtain images under different amplification factors, the images under different amplification factors are used as sample images, so that the sample images with different amplification factors containing the physical information of the same user are used as training data of a preset model, and the accuracy of the model during recognition after training is improved.
In addition, when sample image data for training is selected, image data enhancement operations such as random color transformation, random contrast transformation, random brightness transformation, random rotation and the like can be performed on the sample image, so that a processed sample image is obtained, a preset model is trained through the processed sample image, and the relevant robustness of a trained target model is increased.
Specifically, the identifying, by the target model, the key point of the target object in the image to be identified may include:
intercepting a target human body sub-image of a target object from an image to be identified; inputting the target human body sub-image into a target model for key point feature recognition to obtain a key point position information set.
The target human body sub-image may be an image containing only human body characterization information of the target object. After the image to be identified is obtained, the human body representation information part is intercepted from the image to be identified and used as a target human body sub-image so as to remove other invalid information in the image to be identified; and further, inputting the target human body sub-image into the trained target model to obtain a corresponding key point position information set. Therefore, interference of other irrelevant characteristic information in the image to the identification process is avoided, and efficiency and accuracy of the target model in identifying key point characteristics of the target object are improved.
By the method, the key point feature information of the target object in the image to be identified can be identified, so that the position information set corresponding to the key point feature is acquired, and the posture result of the target object is evaluated based on the key point position information set corresponding to the key point feature.
103. And constructing a key point feature vector based on the key point position information set.
The key point feature vector may be a feature vector constructed according to one or more key point position sub-information combinations, and the key point feature vector may be used for determining the posture of the target object subsequently. Specifically, the state of the relevant part of the target object can be determined through the direction or the angle of the feature vector of the key point. Illustratively, the key point features include a left eye and a right eye, a target feature vector is constructed by the key point position information corresponding to the left eye and the key point position information corresponding to the right eye, and whether the head of the target object is in a side (skew) head state is determined by the direction or angle of the target feature vector.
In order to construct a key point feature vector, after a key point position information set is obtained, the embodiment of the application may select relevant key point position sub-information from the set to combine to construct a corresponding key point feature vector.
Specifically, the process of constructing the key point feature vector may be: extracting a plurality of key point position sub-information in the key point data set; determining target position coordinates of each key point position sub-information in the image to be identified; and vector calculation is carried out on the target position coordinates to obtain the feature vector of the key point.
The target position coordinates can be specific position data representing corresponding key points in the image to be identified and accurate coordinate information; when determining the target position coordinates, the center position of the corresponding "key point" area or the coordinate information of the center pixel point may be used as the target position coordinates; for example, taking the left eye as the key point, the corresponding target position coordinate may be the center point in the image area corresponding to the "left eye", which is specific to the actual situation.
Each key point feature vector can be constructed by combining target position coordinates of a plurality of key points, and specifically, vector calculation can be performed on the target position coordinates of the plurality of key points. Specifically, when constructing the key point feature vector, a plurality of target position coordinates for constructing the corresponding key point feature vector need to be determined first, and the determining manner may be: the target position coordinates of the corresponding key points to be combined when constructing the key point feature vector can be selected according to a preset key point feature vector rule, and then vector calculation is performed according to the selected target position coordinates, so that the key point feature vector is constructed. For example, vector calculation is performed according to the target position coordinates of the left ear and the target position coordinates of the left eye, so as to construct a key point feature vector pointing to the left eye of the left ear.
For example, the keypoint feature may include: left eye, right eye, left ear, right ear, nose, left shoulder, right shoulder, etc.; in order to distinguish the position coordinates corresponding to the above key point features, the target position coordinates corresponding to the key point may be: the first position coordinate corresponding to the left ear, the second position coordinate corresponding to the right ear, the third position coordinate corresponding to the left eye, the fourth position coordinate corresponding to the right eye, the fifth position coordinate corresponding to the nose, the sixth position coordinate corresponding to the left shoulder and the seventh position coordinate corresponding to the right shoulder. The key point feature vector is constructed according to the key point position coordinates, and specifically may be: calculating a first sub-feature vector of the left ear pointing to the left eye according to the first position coordinate and the third position coordinate, calculating a second sub-feature vector of the left eye pointing to the nose according to the third position coordinate and the fifth position coordinate, calculating a third sub-feature vector of the right ear pointing to the right eye according to the second position coordinate and the fourth position coordinate, calculating a fourth sub-feature vector of the right eye pointing to the nose according to the fourth position coordinate and the fifth position coordinate, calculating a fifth sub-feature vector of the left ear pointing to the right ear according to the first position coordinate and the second position coordinate, calculating a sixth sub-feature vector of the left eye pointing to the right eye according to the third position coordinate and the fourth position coordinate, and calculating a seventh sub-feature vector of the left shoulder pointing to the right shoulder according to the sixth position coordinate and the seventh position coordinate; further, the first sub-feature vector, the second sub-feature vector, the third sub-feature vector, the fourth sub-feature vector, the fifth sub-feature vector, the sixth sub-feature vector, and the seventh sub-feature vector are determined as key point feature vectors.
By the method, the key point feature vector corresponding to the key point feature can be constructed and used for subsequent morphological recognition through the key point feature vector.
104. And determining the body state recognition result of the target object according to the key point feature vector.
The body state recognition result may be a body posture of the target object, and is used for representing body state information recorded by the image to be recognized. The posture recognition result is not limited to include a low head state, a lateral head state, an oblique body state (body tilt state), and the like.
In order to determine the body state recognition result of the target object, after the key point feature vector is constructed, the embodiment of the application can determine the body state recognition result of the target object according to the key point feature vector. Specifically, the determination process of the body state recognition result may be: acquiring a vector direction corresponding to the key point feature vector; and determining the body recognition result of the target object according to the vector direction corresponding to the key point feature vector.
The vector direction is used to describe the direction of the corresponding key point feature vector, and may specifically be the direction of the vector between two key point features. For example, taking a left eye and a right eye as key point features as examples, taking the left eye as a starting point, constructing a feature vector pointing from the left eye to the right eye, and then pointing the left eye to the right eye in the direction of the feature vector; for another example, taking the left eye and the nose as key point features and taking the left eye as a starting point, a feature vector pointing from the left eye to the nose is constructed, and then the direction of the feature vector points from the left eye to the nose.
In some embodiments, the step of "obtaining the vector direction corresponding to the keypoint feature vector" may include:
(1) And identifying the vector relation of the key point feature vector in the image to be identified.
The vector relation can be a position relation, a direction relation, an angle relation and the like of the key point feature vector in the image to be identified, and the position, the direction, the angle and the like of the related key point feature vector can be determined through the vector relation.
Specifically, the step of identifying the vector relation of the feature vector of the key point in the image to be identified may include: establishing a rectangular coordinate system corresponding to the image to be identified; and acquiring the vector relation of the feature vector of the key point in the rectangular coordinate system.
The rectangular coordinate system may be a planar rectangular coordinate system, and in this embodiment, the vector relationship of the feature vector of the key point is described by establishing a rectangular coordinate system corresponding to the image to be identified.
Specifically, when the rectangular coordinate system is constructed, the image to be identified may be placed in front (for example, the bottom edge of the image to be identified is in contact with the horizontal plane, and the image to be identified is made to be perpendicular to the horizontal plane, which may be the actual situation), the middle part (center point) of the image to be identified is taken as the midpoint of the coordinate system, the width of the image to be identified is taken as the y-axis direction, and the height of the image to be identified is taken as the y-axis direction, so that the rectangular coordinate system of the image to be identified is established. In addition, a rectangular coordinate system of the image to be identified can be established by taking a certain key point feature as a midpoint of the coordinate system, which is not limited herein.
Further, after the rectangular coordinate system of the image to be identified is established, the corresponding vector relationship can be determined according to the position, angle, direction and the like of the key point feature vector in the rectangular coordinate system. For example, taking the left-eye-to-right-eye keypoint feature vector as an example, since the left-eye-to-right-eye direction is parallel and the left-eye-to-right-eye keypoint feature vector is 180 ° under normal conditions, the left-eye-to-right-eye direction is parallel to the horizontal axis (x-axis) in the rectangular coordinate system, and thus, when determining the vector relationship of the left-eye-to-right-eye keypoint feature vector, the corresponding vector relationship can be determined according to the angle between the left-eye-to-right-eye keypoint feature vector and the horizontal axis (x-axis) in the rectangular coordinate system. For the "fifth sub-feature vector of the left ear to the right ear, sixth sub-feature vector of the left eye to the right eye, seventh sub-feature vector of the left shoulder to the right shoulder" in step 103 of the embodiment of the present application, the corresponding vector relationship may be determined according to the angle between the key point feature vector and the horizontal axis (x axis) in the rectangular coordinate system.
In addition, for some key point feature vectors inclined in directions, the vector relationship can be determined according to the key point feature vector and the direction in the rectangular coordinate system, and in particular, the vector relationship can be determined by combining the direction quadrant condition of the key point feature vector in the rectangular coordinate system. For example, for the first sub-feature vector of the left ear pointing to the left eye, the second sub-feature vector of the left eye pointing to the nose, the third sub-feature vector of the right ear pointing to the right eye, and the fourth sub-feature vector of the right eye pointing to the nose, the vector relationship may be determined according to the situation of the above feature vectors pointing in the rectangular coordinate system, for example, the direction of the second sub-feature vector of the left eye pointing to the nose has the following pointing quadrant relationship in the rectangular coordinate system: pointing to the fourth quadrant in the rectangular coordinate system, whereby "pointing to the fourth quadrant in the rectangular coordinate system" can be determined as the vector relation of the second sub-feature vector.
(2) And determining the vector direction corresponding to the feature vector of the key point according to the vector relation.
Specifically, the step of determining the vector direction corresponding to the feature vector of the key point according to the vector relation may include: determining the direction angle of the feature vector of the key point according to the vector relation; and determining the vector direction corresponding to the key point feature vector according to the direction angle.
For example, taking the second sub-feature vector of the left eye pointing to the nose as an example, when the vector relationship of the second sub-feature vector is: pointing to the fourth quadrant in the rectangular coordinate system, the corresponding direction angle should belong to 270 ° to 360 °, and the angle can be determined as the vector direction of the second sub-feature vector. For another example, taking a sixth sub-feature vector with left eye pointing to right eye as an example, when the vector relationship of the sixth sub-feature vector is: the angle between the horizontal axis and the rectangular coordinate system is 30 degrees, and the angle can be determined as the vector direction of the sixth sub-feature vector.
In the embodiment of the present application, after determining the vector direction corresponding to the feature vector of the key point, the body recognition result of the target object may be determined according to the vector direction corresponding to the feature vector of the key point. Specifically, the body state recognition result may specifically include the following cases:
A. The keypoint feature vector includes a first sub-feature vector with the left ear directed to the left eye, a second sub-feature vector with the left eye directed to the nose, a third sub-feature vector with the right ear directed to the right eye, and a fourth sub-feature vector with the right eye directed to the nose.
The process of determining the body state recognition result of the target object is:
based on vector directions corresponding to the first sub-feature vector, the second sub-feature vector, the third sub-feature vector and the fourth sub-feature vector, quadrant characteristic relations among the first sub-feature vector, the second sub-feature vector, the third sub-feature vector and the fourth sub-feature vector and a preset rectangular coordinate system are respectively determined;
if the quadrant characteristic relation of the first sub-feature vector and the second sub-feature vector is detected to point to the fourth quadrant and the quadrant characteristic relation of the third sub-feature vector and the fourth sub-feature vector is detected to point to the third quadrant, determining that the target object is in a low head state, and determining the low head state as a body state recognition result of the target object.
B. The keypoint feature vector comprises a first parallel vector with the left ear pointing to the right ear and a second parallel vector with the left eye pointing to the right eye. The step of determining the body recognition result of the target object according to the vector direction corresponding to the feature vector of the key point may include:
Determining horizontal inclination angles of the first parallel vector and the second parallel vector respectively based on vector directions corresponding to the first parallel vector and the second parallel vector;
if the horizontal inclination angles of the first parallel vector and the second parallel vector are detected to be in the preset first inclination angle range value, determining that the target object is in a lateral head state, and determining the lateral head state as a body state recognition result of the target object.
It should be noted that the first parallel vector and the "fifth sub-feature vector of the left ear to the right ear" described above in step 103 belong to the same feature vector, and the second parallel vector and the "third sub-feature vector of the left eye to the right eye" described above in step 103 belong to the same feature vector.
For example, after a first parallel vector with the left ear directed to the right ear and a second parallel vector with the left eye directed to the right eye are obtained, the horizontal tilt angle of the first parallel vector may be determined, and the horizontal tilt angle of the second parallel vector may be determined. Specifically, taking the example of determining the horizontal inclination angle of the first parallel vector, the horizontal inclination angle may be determined according to an included angle formed between the first parallel vector and the horizontal vector (1, 0) in the rectangular coordinate system, or the horizontal inclination angle may be determined according to an included angle formed between the first parallel vector and the horizontal vector (-1, 0) in the rectangular coordinate system; the determination process of the horizontal inclination angle of the second horizontal vector is consistent with the manner of determining the horizontal inclination angle of the first horizontal vector, and will not be described herein. Further, comparing the horizontal inclination angle of the first horizontal vector with a preset first inclination angle range value, if the preset first inclination angle range value is set to be (30 degrees, 90 degrees), namely more than 30 degrees and less than 90 degrees, and simultaneously comparing the horizontal inclination angle of the second horizontal vector with the preset first inclination angle range value; when the horizontal inclination angles of the first parallel vector and the second parallel vector are detected to be in the preset first inclination angle range value, determining that the target object is in a side head state or a head tilting state, and determining the state as a body state recognition result of the target object.
C. The key point feature vector includes a first balance vector with a left shoulder pointing to a right shoulder, and the step of determining a body recognition result of the target object according to a vector direction corresponding to the key point feature vector may include:
determining the horizontal inclination angle of the first balance vector according to the vector direction corresponding to the first balance vector;
if the horizontal inclination angle of the first balance vector is detected to be in the preset second inclination angle range value, determining that the target object is in an italic state, and determining the italic state as a body state recognition result of the target object.
It should be noted that, the first balance vector is the seventh sub-feature vector of the left shoulder to right shoulder in step 103 and the above description.
For example, after the first balance vector of the left shoulder directed to the right shoulder is obtained, the horizontal inclination angle of the first balance vector may be determined. Specifically, the horizontal inclination angle may be determined according to an included angle formed between the first balance vector and the horizontal vector (1, 0) in the rectangular coordinate system, or may be determined according to an included angle formed between the first balance vector and the horizontal vector (-1, 0) in the rectangular coordinate system. Further, comparing the horizontal inclination angle of the first balance vector with a preset second inclination angle range value, for example, setting the preset second inclination angle range value to be (20 degrees, 60 degrees), namely, more than 20 degrees and less than 60 degrees; when the horizontal inclination angle of the first balance vector is detected to be in the preset second inclination angle range value, the target object is determined to be in an italic state, the "italic state" can be understood as a body inclination state, and the italic state is determined to be a body state recognition result of the target object.
Further, the image to be identified may be a frame of target video frame in the video to be processed, and after the step of determining the body recognition result of the target object according to the feature vector of the key point, the method may further include: if the body state recognition results of a plurality of continuous target video frames in the video to be processed are the same preset gesture, determining that the target object is in an error body state, and generating prompt information corresponding to the error body state.
Wherein, the preset gesture may include one of the following gestures: low head state, lateral head state, or italic state. In this embodiment, it is determined that the body state recognition results of a plurality of continuous target video frames in the video to be processed are all in a low head state, a side head state or an italic state, and the determining process may be: after the body state recognition result of the target object is obtained, if the body state recognition result is detected to be in a low head state, a side head state or an oblique body state, executing the step of obtaining an image to be recognized so as to determine a second body state recognition result of the target object, wherein the second body state recognition result is a body state result after the body state recognition result; and if the second body state identification result is detected to be in a low head state, a side head state or an italic state, determining that the target object is in an error body state, and generating prompt information corresponding to the error body state.
Specifically, after the body state recognition result of the target object is determined, the body state recognition result can be detected, and when the body state recognition result is detected to be one of a low head state, a side head state or an oblique body state, the inaccurate posture of the target object can be determined, namely, the incorrect body state, and related prompt information can be generated and prompted.
Further, in order to improve accuracy in evaluating the body state recognition result of the target object, when the body state recognition result is detected to be one of a low head state, a side head state or an italic state, the embodiment of the application may further determine the body state recognition result as a first body state recognition result; further, continuously acquiring a body state recognition result of the target object corresponding to a next image to be recognized, wherein the next image to be recognized can be coherent among images to be recognized corresponding to the first body state recognition result in a time sequence arrangement corresponding to a video frame or an image stream, and acquiring a second body state recognition result corresponding to the next image to be recognized; when the second body state identification result is detected to be still in one of a low head state, a lateral head state or an italic state, the inaccurate posture of the target object can be determined, namely the incorrect body state, and related prompt information can be generated and prompted. Therefore, the accuracy of the object in the evaluation of the body state recognition result in the history period can be improved; or when the current posture is predicted according to the posture recognition result of the target object in the history period, the accuracy of prediction is improved.
From the above, the embodiment of the present application may acquire an image to be identified, where the image to be identified includes key point features of the target object; identifying key points of a target object in an image to be identified to obtain a key point position information set, wherein the key point position information set comprises position information of each key point of the target object; constructing a key point feature vector based on the key point position information set; and determining the body state recognition result of the target object according to the key point feature vector. According to the method, the human body key point characteristics of the target object in the image to be identified are identified to obtain the position information of each key point characteristic in the current body state information of the target object, the key point position information set is obtained, and then, the key point characteristic vector is constructed based on the key point position information set, so that the body state identification result of the target object is determined according to the direction of the constructed key point characteristic vector, and therefore, dependence on a hardware module can be eliminated when the body state identification is carried out on the target object, and the efficiency of the body state identification of the human body is improved.
According to the method described in the above embodiments, examples are described in further detail below.
The embodiment of the application takes the form recognition as an example, and the form recognition method provided by the embodiment of the application is further described.
Fig. 4 is a flow chart illustrating another step of the method for recognizing a posture according to the embodiment of the present application, and fig. 5 is a flow chart illustrating a scenario of the method for recognizing a posture according to the embodiment of the present application. For ease of understanding, please describe embodiments of the present application in conjunction with fig. 4 and 5.
In the embodiments of the present application, a description will be given from the perspective of a body state recognition apparatus, which may be integrated in a computer device such as a terminal and/or a server in particular. When a processor of the computer device executes a program corresponding to the application exception handling method, the specific flow of the application exception handling method is as follows:
201. and acquiring a sample image containing sample key point features of the human body, and acquiring sample key point position information corresponding to the sample key point features.
The sample image may at least include an upper body portion of the user, such as a head, a neck, a shoulder, etc., and in actual training, a left ear, a right ear, a left eye, a right eye, a nose, a left shoulder, a right shoulder in the upper body portion of the sample image may be used as sample key point features to train the preset model.
It should be noted that, when selecting training data, the sample image may be inherited from the disclosed data set; in addition, after an image is obtained from the disclosed data set, the same image can be amplified according to preset amplification factors to obtain images under different amplification factors, the images under different amplification factors are used as sample images, so that the sample images with different amplification factors containing the physical information of the same user are used as training data of a preset model, and the accuracy of the model during recognition after training is improved.
In addition, when sample image data for training is selected, image data enhancement operations such as random color transformation, random contrast transformation, random brightness transformation, random rotation and the like can be performed on the sample image, so that a processed sample image is obtained, a preset model is trained through the processed sample image, and the relevant robustness of a trained target model is increased.
202. And carrying out joint training on the preset model according to the sample image and the corresponding sample key point position information to obtain a trained target model.
When the preset model is selected, light-openpost can be selected, and the trunk can be replaced by a shufflelenet 2-0.5x to determine the lightweight preset model.
Specifically, the training process of the target model may be: acquiring a sample image containing sample key point features; inputting the sample image into a preset model to obtain the predicted position information of the key points; acquiring a position information difference value between the predicted position information of the key point and the position information of the sample key point; and adjusting network parameters of the preset model according to the position information difference value until iteration convergence of the preset model to obtain a target model. The trained target model is used as a human head and shoulder key point model for subsequent image recognition.
203. And acquiring an image to be identified.
The image to be identified contains key point characteristics of the target object, wherein the key point characteristics can be characteristics representing relevant parts of the target object. By way of example, the image to be identified is an image containing the entire body of the target user, and the location corresponding to the key point in the image may be the left ear, the right ear, the left eye, the right eye, the nose, the mouth, the left shoulder, the right shoulder, etc. of the target user, which is not limited herein.
The image to be identified may be an image obtained from a history period, such as an image of the target object 1 second ago, 1 minute ago, or 5 minutes ago. In addition, according to the embodiment of the application, the physical state information of the target object can be acquired in a video stream mode by monitoring the target object in real time, such as shooting the target object in real time through a camera. It should be noted that, in the process of shooting the target object in real time, the shot data (such as video stream, image stream, etc.) of the target object may be transmitted to the processor (such as the terminal or the server) in real time; the video stream of the collected target object can be sent to the processor at intervals of unit time, such as 1 minute or 30 seconds each time; in this way, the processor obtains the image to be identified containing the key point characteristics of the target object from the received image stream or video stream data.
204. And identifying key points of the target object in the image to be identified through the trained target model to obtain a corresponding key point position information set.
The set of key point position information may include a plurality of key point position sub-information, where the key point position sub-information may be position information that indicates a position of a corresponding key point position in the image to be identified, such as coordinates, a distance from a center of the image, and a display ratio.
205. And constructing a key point feature vector based on the key point position information set.
The key point feature vector may be a feature vector constructed according to one or more key point position sub-information combinations, and the key point feature vector may be used for determining the posture of the target object subsequently.
Exemplary, the key point features include left eye, right eye, left ear, right ear, nose, left shoulder, and right shoulder, specifically, after the position information of the key point is obtained, the key point position data corresponding to the position sub information of the key point is identified; and constructing a key point feature vector according to the key point position data. For example, a left-ear-to-left-eye keypoint feature vector is constructed, a left-eye-to-nose keypoint feature vector is constructed, a right-eye-to-right-eye keypoint feature vector is constructed, a right-eye-to-nose keypoint feature vector is constructed, a left-ear-to-right-ear keypoint feature vector is constructed, a left-eye-to-right-eye keypoint feature vector is constructed, and a left-shoulder-to-right-shoulder keypoint feature vector is constructed.
206. And obtaining the vector direction corresponding to the feature vector of the key point.
The vector direction is used to describe the direction of the corresponding key point feature vector, and may specifically be the direction of the vector between two key point features. For example, taking a left eye and a right eye as key point features as examples, taking the left eye as a starting point, constructing a feature vector pointing from the left eye to the right eye, and then pointing the left eye to the right eye in the direction of the feature vector; for another example, taking the left eye and the nose as key point features and taking the left eye as a starting point, a feature vector pointing from the left eye to the nose is constructed, and then the direction of the feature vector points from the left eye to the nose.
Specifically, a rectangular coordinate system corresponding to an image to be identified is established; and acquiring the vector relation of the feature vector of the key point in the rectangular coordinate system.
207. And determining the body recognition result of the target object according to the vector direction corresponding to the key point feature vector.
The body state recognition result may be a body posture of the target object, and is used for representing body state information recorded by the image to be recognized. The posture recognition result is not limited to include a low head state, a lateral head state, an oblique body state (body tilt state), and the like.
In the embodiment of the present application, the body form recognition result may specifically include the following cases:
(1) The keypoint feature vector includes a first sub-feature vector with the left ear directed to the left eye, a second sub-feature vector with the left eye directed to the nose, a third sub-feature vector with the right ear directed to the right eye, and a fourth sub-feature vector with the right eye directed to the nose. At this time, determining the quadrant characteristic relation between the key point feature vector and a preset rectangular coordinate system according to the vector direction of the key point feature vector; if the quadrant characteristic relation of the first sub-feature vector and the second sub-feature vector is detected to point to the fourth quadrant and the quadrant characteristic relation of the third sub-feature vector and the fourth sub-feature vector is detected to point to the third quadrant, determining that the target object is in a low head state, and determining the low head state as a body state recognition result of the target object.
(2) The key point feature vector includes a fifth sub-feature vector directed to the right ear for the left ear and a sixth sub-feature vector directed to the right eye for the left eye. At this time, determining the horizontal inclination angle of the above key point feature vector according to the vector direction of the key point feature vector; if the horizontal inclination angles of the fifth sub-feature vector and the sixth sub-feature vector are detected to be in the preset first inclination angle range value, determining that the target object is in a lateral head state, and determining the lateral head state as a body state recognition result of the target object.
(3) The keypoint feature vector includes a seventh sub-feature vector that points from the left shoulder to the right shoulder. At this time, determining a horizontal inclination angle of the seventh sub-feature vector according to the vector direction of the key point feature vector; if the horizontal inclination angle of the first balance vector is detected to be in the preset second inclination angle range value, determining that the target object is in an italic state, and determining the italic state as a body state recognition result of the target object.
208. And generating prompt information according to the body state recognition result, and prompting the prompt information.
Specifically, after the body state recognition result of the target object is determined, the body state recognition result can be detected, and when the body state recognition result is detected to be one of a low head state, a side head state or an oblique body state, the inaccurate posture of the target object can be determined, namely, the incorrect body state, and related prompt information can be generated and prompted.
When it is detected that the posture recognition result does not include any one of the low head state, the lateral head state, and the italic state, it is determined that the posture of the target object is correct, and a presentation message such as "please hold", "posture correct" or the like may be generated to present.
When the prompt information is prompted, the prompt information can be displayed on a display interface of the terminal, and the prompt information can also be prompted through other sensing components. And are not limited herein.
By the above manner, the following effects can be achieved: by adopting the processing of the existing public data set, the light head and shoulder key points are trained under the sitting posture task, so that the bad sitting posture of the human body can be detected in real time under the condition of higher accuracy, and the whole system is provided with only one module, so that the dependence on hardware is greatly reduced.
From the above, the embodiment of the present application may acquire an image to be identified, where the image to be identified includes key point features of the target object; identifying key points of a target object in an image to be identified to obtain a key point position information set, wherein the key point position information set comprises position information of each key point of the target object; constructing a key point feature vector based on the key point position information set; and determining the body state recognition result of the target object according to the key point feature vector. According to the method, the human body key point characteristics of the target object in the image to be identified are identified to obtain the position information of each key point characteristic in the current body state information of the target object, the key point position information set is obtained, and then, the key point characteristic vector is constructed based on the key point position information set, so that the body state identification result of the target object is determined according to the direction of the constructed key point characteristic vector, and therefore, dependence on a hardware module can be eliminated when the body state identification is carried out on the target object, and the efficiency of the body state identification of the human body is improved.
In order to better implement the above method, the embodiment of the application also provides a posture identifying device, which may be integrated in a computer device, such as a server or a terminal, and the terminal may include a tablet computer, a notebook computer, a personal computer, and/or the like.
For example, as shown in fig. 6, the posture identifying apparatus may include an acquisition unit 301, an identifying unit 302, a construction unit 303, and a determination unit 304, as follows:
an acquiring unit 301, configured to acquire an image to be identified, where the image to be identified includes key point features of a target object;
the identifying unit 302 is configured to identify key points of a target object in an image to be identified, and obtain a set of key point position information, where the set of key point position information includes position information of each key point of the target object;
a construction unit 303, configured to construct a key point feature vector based on the key point position information set;
the determining unit 304 is configured to determine a body recognition result of the target object according to the feature vector of the key point.
In some embodiments, the determining unit 304 includes:
the acquisition subunit is used for acquiring the vector direction corresponding to the key point feature vector;
And the determining subunit is used for determining the body state recognition result of the target object according to the vector direction corresponding to the key point feature vector.
In some embodiments, the acquisition subunit is further configured to:
identifying the vector relation of the key point feature vector in the image to be identified;
and determining the vector direction corresponding to the feature vector of the key point according to the vector relation.
In some embodiments, the acquisition subunit is further configured to:
establishing a rectangular coordinate system corresponding to the image to be identified;
and acquiring the vector relation of the feature vector of the key point in the rectangular coordinate system.
In some embodiments, the acquisition subunit is further configured to:
determining the direction angle of the feature vector of the key point according to the vector relation;
and determining the vector direction corresponding to the key point feature vector according to the direction angle.
In some embodiments, the key point feature vector includes a first sub-feature vector with a left ear pointing to a left eye, a second sub-feature vector with a left eye pointing to a nose, a third sub-feature vector with a right ear pointing to a right eye, and a fourth sub-feature vector with a right eye pointing to a nose, and the determining subunit is further configured to determine a body recognition result of the target object according to a vector direction corresponding to the key point feature vector:
based on vector directions corresponding to the first sub-feature vector, the second sub-feature vector, the third sub-feature vector and the fourth sub-feature vector, quadrant characteristic relations among the first sub-feature vector, the second sub-feature vector, the third sub-feature vector and the fourth sub-feature vector and a preset rectangular coordinate system are respectively determined;
If the quadrant characteristic relation of the first sub-feature vector and the second sub-feature vector is detected to point to the fourth quadrant and the quadrant characteristic relation of the third sub-feature vector and the fourth sub-feature vector is detected to point to the third quadrant, determining that the target object is in a low head state, and determining the low head state as a body state recognition result of the target object.
In some embodiments, the keypoint feature vector comprises a first parallel vector with the left ear pointing to the right ear and a second parallel vector with the left eye pointing to the right eye, the determining subunit further configured to:
determining horizontal inclination angles of the first parallel vector and the second parallel vector respectively based on vector directions corresponding to the first parallel vector and the second parallel vector;
if the horizontal inclination angles of the first parallel vector and the second parallel vector are detected to be in the preset first inclination angle range value, determining that the target object is in a lateral head state, and determining the lateral head state as a body state recognition result of the target object.
In some embodiments, the keypoint feature vector comprises a first balance vector with a left shoulder pointing to a right shoulder, the determining subunit further configured to:
determining the horizontal inclination angle of the first balance vector according to the vector direction corresponding to the first balance vector;
If the horizontal inclination angle of the first balance vector is detected to be in the preset second inclination angle range value, determining that the target object is in an italic state, and determining the italic state as a body state recognition result of the target object.
In some embodiments, the building unit 303 is further configured to:
extracting key point position sub-information in a key point data set; determining target position coordinates of the key point position sub-information in the image to be identified; and vector calculation is carried out on the plurality of target position coordinates, so that a key point feature vector is obtained.
In some embodiments, the identifying unit 302 is further configured to:
and identifying key points of a target object in the image to be identified through a target model to obtain a key point position information set, wherein the target model is obtained by joint training of sample body state information and sample key point position information contained in the sample image.
In some embodiments, the identifying unit 302 is further configured to:
intercepting a target human body sub-image of a target object from an image to be identified; inputting the target human body sub-image into a target model for key point feature recognition to obtain a key point position information set.
In some embodiments, the obtaining unit 301 is further configured to:
Receiving a video to be processed; target image frames of the target object within the history period are extracted from the video to be processed, and the target image frames are determined as images to be recognized.
In some embodiments, the obtaining unit 301 is further configured to:
decomposing the video to be processed to obtain an image frame set; screening a plurality of image subframes corresponding to the target object from the image frame set; a target image frame conforming to the history period is extracted from the plurality of image subframes.
In some embodiments, the image to be identified is a target video frame in the video to be processed, and the body state identification device further includes a generating unit, specifically configured to:
if the body state recognition results of a plurality of continuous target video frames in the video to be processed are the same preset gesture, determining that the target object is in an error body state, and generating prompt information corresponding to the error body state.
In some embodiments, the posture recognition device further comprises a training unit, in particular for:
acquiring a sample image containing sample key point features; inputting the sample image into a preset model to obtain the predicted position information of the key points; acquiring a position information difference value between the predicted position information of the key point and the position information of the sample key point; and adjusting network parameters of the preset model according to the position information difference value until iteration convergence of the preset model to obtain a target model.
From the above, the embodiment of the present application may acquire, through the acquiring unit 301, an image to be identified, where the image to be identified includes key point features of the target object; the method comprises the steps that key points of a target object in an image to be identified are identified through an identification unit 302, and a key point position information set is obtained, wherein the key point position information set comprises position information of each key point of the target object; constructing, by the constructing unit 303, a key point feature vector based on the key point position information set; the body recognition result of the target object is determined by the determination unit 304 from the key point feature vector. According to the method, the human body key point characteristics of the target object in the image to be identified are identified to obtain the position information of each key point characteristic in the current body state information of the target object, the key point position information set is obtained, and then, the key point characteristic vector is constructed based on the key point position information set, so that the body state identification result of the target object is determined according to the direction of the constructed key point characteristic vector, and therefore, dependence on a hardware module can be eliminated when the body state identification is carried out on the target object, and the efficiency of the body state identification of the human body is improved.
The embodiment of the application further provides a computer device, as shown in fig. 7, which shows a schematic structural diagram of the computer device according to the embodiment of the application, specifically:
The computer device may include one or more processors 401 of a processing core, memory 402 of one or more computer readable storage media, a power supply 403, and an input unit 404, among other components. Those skilled in the art will appreciate that the computer device structure shown in FIG. 7 is not limiting of the computer device and may include more or fewer components than shown, or may be combined with certain components, or a different arrangement of components. Wherein:
the processor 401 is a control center of the computer device, connects various parts of the entire computer device using various interfaces and lines, and performs various functions of the computer device and processes data by running or executing software programs and/or modules stored in the memory 402, and calling data stored in the memory 402, thereby performing overall monitoring of the computer device. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, a computer program, etc., and the modem processor mainly processes wireless communication. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by executing the software programs and modules stored in the memory 402. The memory 402 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, a computer program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the computer device, etc. In addition, memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
The computer device further comprises a power supply 403 for supplying power to the various components, preferably the power supply 403 may be logically connected to the processor 401 by a power management system, so that functions of charge, discharge, and power consumption management may be performed by the power management system. The power supply 403 may also include one or more of any of a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The computer device may also include an input unit 404, which input unit 404 may be used to receive input digital or character information communications and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the computer device may further include a display unit or the like, which is not described herein. In particular, in this embodiment, the processor 401 in the computer device loads executable files corresponding to the processes of one or more computer programs into the memory 402 according to the following instructions, and the processor 401 executes the computer programs stored in the memory 402, so as to implement various functions, as follows:
acquiring an image to be identified, wherein the image to be identified contains key point characteristics of a target object; identifying key points of a target object in an image to be identified to obtain a key point position information set, wherein the key point position information set comprises position information of each key point of the target object; constructing a key point feature vector based on the key point position information set; and determining the body state recognition result of the target object according to the key point feature vector.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
It will be appreciated by those of ordinary skill in the art that all or part of the steps of the various methods of the above embodiments may be performed by a computer program, or by computer program control related hardware, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer readable storage medium having stored therein a computer program that is capable of being loaded by a processor to perform any of the posture recognition methods provided by embodiments of the present application.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Wherein the computer-readable storage medium may comprise: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
Because the instructions stored in the computer readable storage medium may execute the steps in any of the posture identifying methods provided in the embodiments of the present application, the beneficial effects that any of the posture identifying methods provided in the embodiments of the present application may be achieved are detailed in the previous embodiments, and are not described herein.
Among other things, according to one aspect of the present application, a computer program product or computer program is provided that includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the methods provided in the various alternative implementations provided in the above embodiments.
The foregoing has described in detail the methods, apparatuses, computer devices, and computer readable storage medium for identifying a form according to embodiments of the present application, and specific examples have been applied to illustrate the principles and embodiments of the present application, where the foregoing examples are provided to assist in understanding the methods and core ideas of the present application; meanwhile, those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, and the present description should not be construed as limiting the present application in view of the above.

Claims (15)

1. A method of posture recognition, comprising:
acquiring an image to be identified, wherein the image to be identified contains key point characteristics of a target object;
Identifying key points of the target object in the image to be identified to obtain a key point position information set, wherein the key point position information set comprises position information of each key point of the target object;
constructing a key point feature vector based on the key point position information set;
and determining a body state recognition result of the target object according to the key point feature vector.
2. The method of claim 1, wherein determining the body recognition result of the target object according to the keypoint feature vector comprises:
acquiring a vector direction corresponding to the key point feature vector;
and determining a body state recognition result of the target object according to the vector direction corresponding to the key point feature vector.
3. The method for identifying a posture according to claim 2, wherein the obtaining the vector direction corresponding to the feature vector of the keypoint includes:
identifying the vector relation of the key point feature vector in the image to be identified;
and determining the vector direction corresponding to the key point feature vector according to the vector relation.
4. A method of morphological recognition according to claim 3, wherein said recognizing the vector relation of said keypoint feature vector in said image to be recognized comprises:
Establishing a rectangular coordinate system corresponding to the image to be identified;
and acquiring the vector relation of the key point feature vector in the rectangular coordinate system.
5. A method of identifying a morphology according to claim 3, wherein said determining a vector direction corresponding to the keypoint feature vector according to the vector relation comprises:
determining the direction angle of the key point feature vector according to the vector relation;
and determining the vector direction corresponding to the key point feature vector according to the direction angle.
6. The method according to claim 2, wherein the key point feature vector includes a first sub-feature vector of which the left ear is directed to the left eye, a second sub-feature vector of which the left eye is directed to the nose, a third sub-feature vector of which the right ear is directed to the right eye, and a fourth sub-feature vector of which the right eye is directed to the nose, and the determining the body state recognition result of the target object according to the vector direction corresponding to the key point feature vector includes:
based on vector directions corresponding to the first sub-feature vector, the second sub-feature vector, the third sub-feature vector and the fourth sub-feature vector, quadrant characteristic relations among the first sub-feature vector, the second sub-feature vector, the third sub-feature vector and the fourth sub-feature vector and a preset rectangular coordinate system are respectively determined;
If the quadrant characteristic relation of the first sub-feature vector and the second sub-feature vector is detected to point to the fourth quadrant and the quadrant characteristic relation of the third sub-feature vector and the fourth sub-feature vector is detected to point to the third quadrant, determining that the target object is in a low head state, and determining the low head state as a body state recognition result of the target object.
7. The method of claim 2, wherein the key point feature vector includes a first parallel vector with a left ear pointing to a right ear and a second parallel vector with a left eye pointing to a right eye, and the determining the body recognition result of the target object according to the vector direction corresponding to the key point feature vector includes:
determining horizontal inclination angles of the first parallel vector and the second parallel vector respectively based on vector directions corresponding to the first parallel vector and the second parallel vector;
if the horizontal inclination angles of the first parallel vector and the second parallel vector are detected to be in a preset first inclination angle range value, determining that the target object is in a lateral head state, and determining the lateral head state as a body state recognition result of the target object.
8. The method according to claim 2, wherein the key point feature vector includes a first balance vector having a left shoulder directed to a right shoulder, and the determining the body recognition result of the target object according to the vector direction corresponding to the key point feature vector includes:
determining a horizontal inclination angle of the first balance vector according to a vector direction corresponding to the first balance vector;
if the horizontal inclination angle of the first balance vector is detected to be in the preset second inclination angle range value, determining that the target object is in an italic state, and determining the italic state as a body state recognition result of the target object.
9. The method of claim 1, wherein constructing a keypoint feature vector based on the set of keypoint location information comprises:
extracting a plurality of key point position sub-information in the key point data set;
determining target position coordinates of each key point position sub-information in the image to be identified;
and vector calculation is carried out on the target position coordinates to obtain the feature vector of the key point.
10. The method for identifying a posture according to claim 1, wherein identifying the keypoints of the target object in the image to be identified to obtain the set of keypoint location information includes:
And identifying key points of the target object in the image to be identified through a target model to obtain a key point position information set, wherein the target model is obtained by training sample body state information and sample key point position information contained in a sample image.
11. The method for identifying a body state according to claim 10, wherein identifying, by the target model, a keypoint of the target object in the image to be identified, to obtain a set of keypoint location information, includes:
intercepting a target human body sub-image of the target object from the image to be identified;
inputting the target human body sub-image into the target model for key point feature recognition to obtain a key point position information set.
12. The method for recognizing the body state according to claim 1, wherein the image to be recognized is a target video frame in the video to be processed, and after the body state recognition result of the target object is determined according to the key point feature vector, the method further comprises:
if the body state recognition results of a plurality of continuous target video frames in the video to be processed are the same preset gesture, determining that the target object is in an error body state, and generating prompt information corresponding to the error body state.
13. A posture recognition device, characterized by comprising:
the acquisition unit is used for acquiring an image to be identified, wherein the image to be identified contains key point characteristics of a target object;
the identification unit is used for identifying key points of the target object in the image to be identified to obtain a key point position information set, wherein the key point position information set comprises position information of each key point of the target object;
the construction unit is used for constructing a key point feature vector based on the key point position information set;
and the determining unit is used for determining the body state recognition result of the target object according to the key point feature vector.
14. A computer device comprising a memory and a processor; the memory stores a computer program, the processor being configured to execute the computer program in the memory to perform the method of body state recognition according to any one of claims 1 to 12.
15. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program adapted to be loaded by a processor for performing the method of body state recognition according to any one of claims 1 to 12.
CN202210027102.7A 2022-01-11 2022-01-11 Method, apparatus, computer device and computer readable storage medium for identifying body state Pending CN116469156A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210027102.7A CN116469156A (en) 2022-01-11 2022-01-11 Method, apparatus, computer device and computer readable storage medium for identifying body state

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210027102.7A CN116469156A (en) 2022-01-11 2022-01-11 Method, apparatus, computer device and computer readable storage medium for identifying body state

Publications (1)

Publication Number Publication Date
CN116469156A true CN116469156A (en) 2023-07-21

Family

ID=87179336

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210027102.7A Pending CN116469156A (en) 2022-01-11 2022-01-11 Method, apparatus, computer device and computer readable storage medium for identifying body state

Country Status (1)

Country Link
CN (1) CN116469156A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117671732A (en) * 2023-11-30 2024-03-08 北京代码空间科技有限公司 Method, device, equipment and storage medium for detecting physical state

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117671732A (en) * 2023-11-30 2024-03-08 北京代码空间科技有限公司 Method, device, equipment and storage medium for detecting physical state

Similar Documents

Publication Publication Date Title
CN107609383B (en) 3D face identity authentication method and device
CN107066983B (en) Identity verification method and device
CN107748869B (en) 3D face identity authentication method and device
WO2020151489A1 (en) Living body detection method based on facial recognition, and electronic device and storage medium
CN110443110B (en) Face recognition method, device, terminal and storage medium based on multipath camera shooting
WO2018028546A1 (en) Key point positioning method, terminal, and computer storage medium
US10318797B2 (en) Image processing apparatus and image processing method
CN109934065B (en) Method and device for gesture recognition
CN112381104A (en) Image identification method and device, computer equipment and storage medium
CN110741387B (en) Face recognition method and device, storage medium and electronic equipment
CN110334629B (en) Method and device capable of detecting distance in multiple directions and readable storage medium
CN106471440A (en) Eye tracking based on efficient forest sensing
CN111881740B (en) Face recognition method, device, electronic equipment and medium
CN113160231A (en) Sample generation method, sample generation device and electronic equipment
CN110969045A (en) Behavior detection method and device, electronic equipment and storage medium
CN111589138A (en) Action prediction method, device, equipment and storage medium
CN116469156A (en) Method, apparatus, computer device and computer readable storage medium for identifying body state
CN112700568B (en) Identity authentication method, equipment and computer readable storage medium
CN108055461B (en) Self-photographing angle recommendation method and device, terminal equipment and storage medium
CN114513694A (en) Scoring determination method and device, electronic equipment and storage medium
CN106355182A (en) Methods and devices for object detection and image processing
CN109241942B (en) Image processing method and device, face recognition equipment and storage medium
CN111507139A (en) Image effect generation method and device and electronic equipment
CN111984803B (en) Multimedia resource processing method and device, computer equipment and storage medium
CN113723306A (en) Push-up detection method, device and computer readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication