1 Introduction

Home security is always a focused topic for people. In this field, fast and effective automatic identity verification plays an important role in security entrance control applications. Fingerprint recognition will reduce accuracy due to finger cuts. Exquisite makeup techniques and headscarf cover will cause misjudgment of face recognition. However, the bone information of the human body belongs to the physical properties of the creature, it’s unable to fake and its stability is extremely high [1]. In order to improve the smart home intelligence and security level and achieve autonomous control, this article designs a smart home automatic control system based on IOT technology [2] which is relied on wifi data transmission with STM32 as the control core. Smart door used in the system introduces Kinect somatosensory equipment [3], its 3D infrared camera is used to obtain human skeleton information and adopts a new identification method based on human skeleton information so as to control the switch of the door through judging the legitimacy of the visitor. it successfully achieves a higher skeletal motion information recognition rate. At the same time, the data model is established for different home-customized posture control methods. The use of somatosensory interaction technology to achieve intelligent home control. Its Ingenious use of infrared sensors to complete the anti-drop wear design of infants and young children is cost-effective, with market value. This article focuses on the composition of the system, Kinect somatosensory technology applications, data collection and classification identification, as well as other hardware and software design.

2 Overall Structure of the System

The smart home cloud system designed in this paper is mainly composed of three parts: control terminal, link end, and client. The control terminal mainly uses the STM32 as the processing center to collect various types of sensor data, perform data processing and analysis according to different pre-set conditions, issue control instructions, and upload the processing results to the client through the link end, which can achieve Real-time feedback to users via mobile app and receive data instructions from the client to achieve home control. The link end mainly uses the wifi module and cloud server platform for data transmission and exchange so that to realize real-time human-computer interaction between the control end and the client. The client is used to receive and display the system data sent by the control terminal, and the status of the home system is intuitively displayed in the form of a graphical interface. The user can remotely control the home through the interactive interface.

3 Kinect Model Establishment, Data Classification Recognition

3.1 Skeletal Structure Recognition Principle

In Kinect, a skeleton is represented by 25 joint points, as shown in Fig. 1. When a person walks into the field of vision of Kinect, Kinect automatically finds the position of the 25 joints of the individual (stationary) [4], and expresses it by three-dimensional coordinates (x, y, z). What we ultimately need in this system is the three-dimensional coordinates of the individual’s 25 joint points.

Fig. 1.
figure 1

Human skeleton structure defined by Kinect

3.2 The Selection and Optimization of Bone Features

3.2.1 Dataset Construction and Feature Selection

In this paper, several bone data of different heights and genders were collected. In this experiment, 300 human bone data were randomly selected as samples. Due to the instability of Kinect, the identification of some joint points will have a large error, making the distance between the corresponding joint points unstable, such as the distance between the ankle and the sole of the foot [5]. Then, we selected 30 relatively stable bone fragments as features. The coordinates of the skeletal joint point are the coordinates relative to the three-dimensional coordinate system of Kinect [6]. As shown in Fig. 2.

Fig. 2.
figure 2

Kinect three-dimensional coordinate system

According to the coordinates of the extracted 25 individual bone skeleton joints, each joint point is connected to form a bone fragment, and different bone feature quantities are obtained by calculating different bone fragment distances. Dist i represents the distance between skull joint points and zygomatic joint, which is one of the skeletal features we selected. Assuming that the coordinates of the two joint points a and b are known to be \( \left( {x_{1} ,y_{1} ,z_{1} } \right) \) and \( \left( {x_{2} ,y_{2} ,z_{2} } \right) \) respectively, the distance between these two joint points is calculated as:

$$ {\text{Dist}}(a,b) = \sqrt {(x_{1} - x_{2} )^{2} + (y_{1} - y_{2} )^{2} + (z_{1} - z_{2} )^{2} } $$
(1)

We arrange and combine 25 joint points and calculate the distance between different joint points to obtain various feature quantities. The skeleton eigenvector we finally get can be expressed as:

$$ F = (Dist_{1} ,Dist_{2} , \ldots ,Dist_{n} ) $$
(2)

Where \( {\text{Dist}}_{n} \) represents the distance of a segment of a bone [7].

3.2.2 SVM Parameter Optimization and Feature Screening

In this paper, SVM (support vector machine) is used as the classification algorithm, and Gaussian radial basis function (RBF) is chosen as the kernel function [8]. In order to make the classification better, we used the 10-fold cross-validation to combine different features freely and found the feature combinations with the highest recognition rate by changing the number of samples, the number of kernel functions, the number of feature points, and the variable parameters c and g. The recognition rate reaches 97.059% under the optimal parameters. At this time, the first 50% feature combinations are selected as the optimal features. Finally, we will use the optimal characteristics of the sample as input to obtain the optimal SVM model. The specific process is shown in Fig. 3.

Fig. 3.
figure 3

Kinect figure skeleton identification flow chart

4 System Implementation

For ease of development and research, the smart home system adopts the C/S architecture, uses wifi networking, and establishes real-time data exchange links between the control terminal and the client through the home gateway to realize information collection and control of various homes. Make sure the system is stable and reliable. The system structure is shown in Fig. 4.

Fig. 4.
figure 4

Smart home system structure diagram

4.1 Kinect Online Real-Time Character Recognition System

We use the C# language to develop a Kinect real-time character recognition system based on WPF. The system includes six modules: bone data entry, training model, adjustment parameters, person recognition, gesture recognition, and real-time character image display. Figure 5 is the system character recognition interface diagram. The dots in the figure are the 25 skeleton joints identified by the system.

Fig. 5.
figure 5

System character recognition interface

4.2 Based on Kinect Gesture Recognition Control Home

By the way of using Kinect’s 3D somatosensory technology, people’s movements and gestures are recognized. We formulate different home control systems according to different users’ living habits and action behaviors. Different home appliances have different gestures, which are simple and easy to distinguish. In order to reduce the probability of system misoperation, each action must be maintained for more than 3s, otherwise it is regarded as an invalid instruction. In general, in order to reduce the energy consumption and ensure the service life of the smart home system, the system uses an infrared human body sensor to sense the human body position. When a person stands above Kinect for more than 5s, the system Starts Kinect; when Kinect does not detect a matching custom operation command for more than 5s, the system turns on the self-protection mode and enters the standby state. The system custom operation instructions designed in this paper are shown in Table 1.

Table 1. Smart home system custom operation instructions

4.3 Analysis of Results

In order to verifying the reliability and stability of the system’s posture recognition, each instruction was measured 100 times under the same conditions. Table 2 shows the correct number of times for each instruction and its accuracy. Experiments show that the gesture recognition scheme designed in this paper can effectively control the smart home system and has a very high reliability and stability.

Table 2. The recognition rate of each instruction

For the purpose of facilitating maintenance and function expansion, this system designed a mobile client based on Android operating system and JAVA language. The mobile client control interface is shown in Fig. 6.

Fig. 6.
figure 6

Mobile client system interface

5 Conclusions

The system is based on the Internet of Things smart home, it has successfully introduced Kinect somatosensory sensor into the smart home system for gesture control command information and face information, and used SVM as a classification recognition algorithm, then performs information matching verification with pre-customized posture to obtain control instructions to achieve home Intelligent control. The experimental result shows that with the successful introduction of Kinect, only one gesture can be used to control indoor facilities, which can effectively improve the smart home’s level of intelligence and security and get rid of the dependence on the mobile Internet. In the next step, we can further utilize the advantages of Kinect somatosensory recognition technology to combine smart homes with smart medical care to improve people’s smart living standards.