**2. Application of a diffuse 3D model for the detection of rehabilitation exercises after hip surgery**

At the present time, it has been seen that intelligent systems embrace a large number of daily life tasks and activities of the society. The objective of these systems is to solve a variety of existing problems in society more efficiently and with accurate results. One of the characteristics of these systems is the interaction between the user and the computer [1], which allows the optimal handling of these systems intuitively.

The present work proposes the development of a virtual representation of the body structure of a patient who performs rehabilitation exercises. This digital representation is called avatar [2], which duplicates the movement of the human being that has been detected by a Kinect camera from Microsoft's Xbox One.

The captured movements are imitated by the avatar and executed in real time. Subsequently, if the patient performs an incorrect exercise, the system will show an alert with the part of the body where it is moving wrongly, with colors that help the patient's interaction. A detector subsystem applies the diffuse logic technique that identifies the execution of rehabilitation exercises; this allows the avatar to be a means of interaction between human and computer.

In the work presented by Ichim et al. [2], the development of three-dimensional facial avatars is detailed. The system detects facial expression from a template and a sequence of recorded images through an optimization that integrates the tracking of expression characteristics. This study helps the design of new applications of computer animation as well as online communication based on personalized avatars. In addition, demonstrations of several applications in real time that verify the process of avatars creation are presented.

In the work published by Pavone et al. [3], the application of immersive virtual reality and electroencephalography recording is presented to explore the avatar's error incorporation when it is viewed from a one-person perspective. The avatar activates the error monitoring system in a patient's brain and helps its development. The results show that immersive virtual reality can obtain optimal results with the application of an artificial agent. These tools improve the fine-tuning learning (motor skills), up to critical social functions (reading or anticipating the other people's intentions).

The study published by Belal et al. [4] presents the study of pulse oximetry. It is a technology used to monitor oxygen saturation in neonates and pediatric patients. The equipment that measures the pulse oximetry is not precise, whereby they generate false alarms. This study proposes the development of a knowledge-based system that uses fuzzy logic to classify plethysmogram pulses into two categories: valid and artifact. The model correctly classified 82% of the valid segments and 93% of the distorted segments.

The study developed by Guevara et al. [5] proposes a model of real-time movement detection of patients of rehabilitation from hip surgery. The model applies the fuzzy logic technique to identify correct and incorrect movements in the performance of rehabilitation exercises using the motion capture device called Kinect of Xbox One. It proposes an algorithm that works with a multivariable logic model. The diffuse model identifies movements of the patient during the performance of rehabilitation exercises. On the other hand, a 3D avatar is applied, which copies and graphically displays the real-time exercises performed by the patients.

#### **2.1 Data analysis**

The information used for the avatar development was obtained from the capture of body points by the Kinect camera of the Xbox One (**Figure 1**). In this study, we gained information of four patients who have gone through hip surgery. This

**75**

**Figure 3**.

**Figure 1.**

**2.2 Proposed model**

opening angle.

**2.3 Limb opening angle calculation**

*B(Xi, Yi)* and ending point C(Xj

as will be calculated.

*Technical Contributions to the Quality of Telerehabilitation Platforms: Case Study—ePHoRt…*

information was collected during 5 weeks of rehabilitation, with high-, medium-, and low-difficulty exercises. Patients performed a set of exercises correctly and

The detected points were 25, the same ones that can identify any movement in three dimensions. For this reason, the database contains 75 attributes. An information preprocessing has been carried out to identify the relevant information,

The attribute selection for the algorithm has been identified as 18 essential points of the skeleton detected by the Kinect Xbox One. The specific points are 0y, 6x, 6y, 10x, 10y, 12x, 12y, 13x, 13y, 14x, 14y, 15x, 15y, 16x, 16y, 17x, 17y, and 19x. These points determine the movement in a more detailed way, allowing depth and opening angle detection. The points selected for the front step exercise are those shown in **Figure 2** as well as in the lateral step exercise, as shown in

The proposed model uses the points identified in the previous section. With this information, we will calculate the speed and angle of the limb opening that have performed the rehabilitation exercises correctly. This information is vital to build the diffuse model and to determine the patient's correct posture while performing the exercise (arms, shoulders, and head), as well as the execution speed and the

To calculate the angle of the limbs, we identified starting points defined as

is defined as α, as shown in **Figure 4**. In the same way, the execution speed defined

, Yj). The value of the angle between points *B* and *C*

incorrectly, which enabled the avatar real movement.

eliminating repeated data as well as noise.

*Body points captured by Microsoft's Kinect [6].*

*DOI: http://dx.doi.org/10.5772/intechopen.83686*

*Technical Contributions to the Quality of Telerehabilitation Platforms: Case Study—ePHoRt… DOI: http://dx.doi.org/10.5772/intechopen.83686*

**Figure 1.** *Body points captured by Microsoft's Kinect [6].*

*Assistive and Rehabilitation Engineering*

**exercises after hip surgery**

**2. Application of a diffuse 3D model for the detection of rehabilitation** 

At the present time, it has been seen that intelligent systems embrace a large number of daily life tasks and activities of the society. The objective of these systems is to solve a variety of existing problems in society more efficiently and with accurate results. One of the characteristics of these systems is the interaction between the user and the computer [1], which allows the optimal handling of these systems intuitively. The present work proposes the development of a virtual representation of the body structure of a patient who performs rehabilitation exercises. This digital representation is called avatar [2], which duplicates the movement of the human being

The captured movements are imitated by the avatar and executed in real time. Subsequently, if the patient performs an incorrect exercise, the system will show an alert with the part of the body where it is moving wrongly, with colors that help the patient's interaction. A detector subsystem applies the diffuse logic technique that identifies the execution of rehabilitation exercises; this allows the avatar to be a

In the work presented by Ichim et al. [2], the development of three-dimensional facial avatars is detailed. The system detects facial expression from a template and a sequence of recorded images through an optimization that integrates the tracking of expression characteristics. This study helps the design of new applications of computer animation as well as online communication based on personalized avatars. In addition, demonstrations of several applications in real time that verify the process

In the work published by Pavone et al. [3], the application of immersive virtual reality and electroencephalography recording is presented to explore the avatar's error incorporation when it is viewed from a one-person perspective. The avatar activates the error monitoring system in a patient's brain and helps its development. The results show that immersive virtual reality can obtain optimal results with the application of an artificial agent. These tools improve the fine-tuning learning (motor skills), up to critical social functions (reading or anticipating the other people's intentions).

The study published by Belal et al. [4] presents the study of pulse oximetry. It is a technology used to monitor oxygen saturation in neonates and pediatric patients. The equipment that measures the pulse oximetry is not precise, whereby they generate false alarms. This study proposes the development of a knowledge-based system that uses fuzzy logic to classify plethysmogram pulses into two categories: valid and artifact. The model correctly classified 82% of the valid segments and

The study developed by Guevara et al. [5] proposes a model of real-time movement detection of patients of rehabilitation from hip surgery. The model applies the fuzzy logic technique to identify correct and incorrect movements in the performance of rehabilitation exercises using the motion capture device called Kinect of Xbox One. It proposes an algorithm that works with a multivariable logic model. The diffuse model identifies movements of the patient during the performance of rehabilitation exercises. On the other hand, a 3D avatar is applied, which copies and

The information used for the avatar development was obtained from the capture

of body points by the Kinect camera of the Xbox One (**Figure 1**). In this study, we gained information of four patients who have gone through hip surgery. This

graphically displays the real-time exercises performed by the patients.

that has been detected by a Kinect camera from Microsoft's Xbox One.

means of interaction between human and computer.

of avatars creation are presented.

93% of the distorted segments.

**74**

**2.1 Data analysis**

information was collected during 5 weeks of rehabilitation, with high-, medium-, and low-difficulty exercises. Patients performed a set of exercises correctly and incorrectly, which enabled the avatar real movement.

The detected points were 25, the same ones that can identify any movement in three dimensions. For this reason, the database contains 75 attributes. An information preprocessing has been carried out to identify the relevant information, eliminating repeated data as well as noise.

The attribute selection for the algorithm has been identified as 18 essential points of the skeleton detected by the Kinect Xbox One. The specific points are 0y, 6x, 6y, 10x, 10y, 12x, 12y, 13x, 13y, 14x, 14y, 15x, 15y, 16x, 16y, 17x, 17y, and 19x. These points determine the movement in a more detailed way, allowing depth and opening angle detection. The points selected for the front step exercise are those shown in **Figure 2** as well as in the lateral step exercise, as shown in **Figure 3**.

### **2.2 Proposed model**

The proposed model uses the points identified in the previous section. With this information, we will calculate the speed and angle of the limb opening that have performed the rehabilitation exercises correctly. This information is vital to build the diffuse model and to determine the patient's correct posture while performing the exercise (arms, shoulders, and head), as well as the execution speed and the opening angle.

#### **2.3 Limb opening angle calculation**

To calculate the angle of the limbs, we identified starting points defined as *B(Xi, Yi)* and ending point C(Xj , Yj). The value of the angle between points *B* and *C* is defined as α, as shown in **Figure 4**. In the same way, the execution speed defined as will be calculated.

#### **Figure 2.**

*Selected points for front step exercise.*

#### **Figure 3.** *Selected points for lateral step exercise.*

To complete the movement modeling of the limbs, it has been based on **Table 1**, which details when the rehabilitation exercise is performed in a low, correct, or high way.

The diffuse model is based on **Table 1** variables, where the patient's correct movement is obtained while performing each of the rehabilitation exercises. Any exercise that is outside the range identified as "good" will be detected as "poorly executed exercise," where the system will give an alert that the variable is being performed incorrectly. The diffuse model is presented in **Figure 5**.

The following section describes the avatar design and development process in three dimensions using the Blender tool, based on the information captured from

**77**

**Figure 8**.

step (**Figure 6**).

**Figure 4.**

**Table 1.**

*Limb opening angle calculation.*

**2.4 Avatar development**

*Technical Contributions to the Quality of Telerehabilitation Platforms: Case Study—ePHoRt…*

several patients who performed physiotherapy exercises over a period of 4 weeks. The exercises performed in this data collection phase were lateral step and front

The following section describes how the patient's avatar was designed. This

The avatar design is fundamentally based on the skeleton in **Figure 1**, which describes all the points detected by the Kinect. This design was then loaded to Blender and the scale of the header image adjusted, as shown in **Figure 7**. To generate a three-dimensional avatar was necessary to generate two 3D windows (two windows for the avatar frontal and lateral view), as can be seen in

For the avatar design, the work has to be simultaneous with the modeling of two avatars, both doctor (male) and nurse (female). This development has been implemented with all the characteristics of clothing, ethnicity, and age of the employees

avatar will imitate the patient's movements during rehabilitation.

*Rules to determine correct or incorrect movement of rehabilitation exercises.*

*DOI: http://dx.doi.org/10.5772/intechopen.83686*

*Technical Contributions to the Quality of Telerehabilitation Platforms: Case Study—ePHoRt… DOI: http://dx.doi.org/10.5772/intechopen.83686*

**Figure 4.** *Limb opening angle calculation.*

*Assistive and Rehabilitation Engineering*

**76**

correct, or high way.

*Selected points for lateral step exercise.*

**Figure 3.**

**Figure 2.**

*Selected points for front step exercise.*

To complete the movement modeling of the limbs, it has been based on **Table 1**, which details when the rehabilitation exercise is performed in a low,

The diffuse model is based on **Table 1** variables, where the patient's correct movement is obtained while performing each of the rehabilitation exercises. Any exercise that is outside the range identified as "good" will be detected as "poorly executed exercise," where the system will give an alert that the variable is being

The following section describes the avatar design and development process in three dimensions using the Blender tool, based on the information captured from

performed incorrectly. The diffuse model is presented in **Figure 5**.


**Table 1.**

*Rules to determine correct or incorrect movement of rehabilitation exercises.*

several patients who performed physiotherapy exercises over a period of 4 weeks. The exercises performed in this data collection phase were lateral step and front step (**Figure 6**).

The following section describes how the patient's avatar was designed. This avatar will imitate the patient's movements during rehabilitation.

#### **2.4 Avatar development**

The avatar design is fundamentally based on the skeleton in **Figure 1**, which describes all the points detected by the Kinect. This design was then loaded to Blender and the scale of the header image adjusted, as shown in **Figure 7**.

To generate a three-dimensional avatar was necessary to generate two 3D windows (two windows for the avatar frontal and lateral view), as can be seen in **Figure 8**.

For the avatar design, the work has to be simultaneous with the modeling of two avatars, both doctor (male) and nurse (female). This development has been implemented with all the characteristics of clothing, ethnicity, and age of the employees

**Figure 5.** *Diffuse model for exercise detection in telerehabilitation [5].*

**Figure 6.** *Exercise images for lateral step and front step.*

that work in a health center, as shown in **Figure 9**. Part of the body of the avatar is designed with proportional measures as well as with skin and clothing textures in order to have a real shape and contour avatar.

Finally, we obtained two functional avatars that will imitate the patient's movements in three dimensions. These avatars will be able to move thanks to an interconnected system between the Kinect and a diffuse model of detection of speed, rhythm, and angles of movement of each of the 75 corporal points. This diffuse model is connected to the avatar through Python language and Java for online movement, which results in efficient response time.
