**2.5 Implementation**

The telerehabilitation model implementation was obtained with N-layer development architecture of the intelligent system. As shown in **Figure 10**, the architecture covers layers such as a database, application server, web server, and application.

**79**

**Figure 7.**

**Figure 8.**

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

The database server contains the patient's information (name, age, gender, and medical history). It also contains the data of each of the rehabilitation exercises performed correctly. This allows that during the execution of a movement in the rehabilitation, the system can identify if the patient is doing the exercises correctly or incorrectly. The application server is the one that contains all the programming to register the information in the database, interconnection with devices (Kinect), consumption of complementary applications (avatar in Blender), and system security. The application server's architecture is presented in **Figure 11**. This architecture is serviceoriented, due to the fact that many add-ons to the system are not executed in Java. In the business rules layer is the diffuse model of detection of rehabilitation exercises. The implemented model uses the points captured by the Kinect, to later calculate the angles and maximum and minimum speeds of the limbs, so that the

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

*Skeleton detected by Kinect uploaded to the Blender tool.*

*Front view and side view windows of the doctor avatar.*

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

**Figure 7.** *Skeleton detected by Kinect uploaded to the Blender tool.*

**Figure 8.** *Front view and side view windows of the doctor avatar.*

The database server contains the patient's information (name, age, gender, and medical history). It also contains the data of each of the rehabilitation exercises performed correctly. This allows that during the execution of a movement in the rehabilitation, the system can identify if the patient is doing the exercises correctly or incorrectly. The application server is the one that contains all the programming to register the information in the database, interconnection with devices (Kinect), consumption of complementary applications (avatar in Blender), and system security. The application server's architecture is presented in **Figure 11**. This architecture is serviceoriented, due to the fact that many add-ons to the system are not executed in Java.

In the business rules layer is the diffuse model of detection of rehabilitation exercises. The implemented model uses the points captured by the Kinect, to later calculate the angles and maximum and minimum speeds of the limbs, so that the

*Assistive and Rehabilitation Engineering*

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

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

The telerehabilitation model implementation was obtained with N-layer development architecture of the intelligent system. As shown in **Figure 10**, the architecture covers layers such as a database, application server, web server, and application.

order to have a real shape and contour avatar.

*Exercise images for lateral step and front step.*

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

movement, which results in efficient response time.

**78**

**Figure 5.**

**Figure 6.**

**2.5 Implementation**

**Figure 9.** *Doctor avatar (man) and nurse avatar (woman).*

patient can perform a correct rehabilitation exercise. In addition, it detects the optimal distances of movement for complementary points such as the arms, shoulders, and head. To calculate the appropriate angles for each of the exercises was necessary to identify the starting point B(Xi, Yi), the ending point C(Xj , Yj), and the value of the angle α of the triangle formed by the trajectory.

The diffuse model shown in **Figure 5** detects the opening angle between the legs, hip movement, shoulder movement, head movement, and the speed at which the exercise was executed. With these variables, it can be efficiently determined in real time if an exercise has been performed correctly or incorrectly [7, 8].

While the patient is performing the exercises, the avatar copies and performs the patient's movements in real time, which makes it easier to graphically identify the exact moment of an incorrect movement. The system's graphical interface developed in Java and hosted in an Apache Tomcat web server allows user's access around the world through an Internet domain.

The web application is deployed by the user's device, which must be connected to the Kinect motion capture device, that allows it to be connected to the system and records the patient's movement in real time. The system requires a bandwidth greater than 2 MB/s Internet access so that the application can perform optimal results.

#### **2.6 Results**

The results obtained in this proposal have revealed that the exercise detection rate is 97.42% with a false-positive percentage of 2.58%, as shown in **Table 2**.

**81**

**Table 2.**

**Figure 11.**

**Figure 10.**

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

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

*N-layer architecture of the telerehabilitation platform.*

*Telerehabilitation system service-oriented architecture.*

*Test results in the diffuse model of rehabilitation exercise detection.*

Well-executed exercise 2100 0 Badly executed exercise 1310 90 **Total 3410 90**

**Correctly classified Incorrectly classified**

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

**Figure 10.** *N-layer architecture of the telerehabilitation platform.*

#### **Figure 11.**

*Assistive and Rehabilitation Engineering*

patient can perform a correct rehabilitation exercise. In addition, it detects the optimal distances of movement for complementary points such as the arms, shoulders, and head. To calculate the appropriate angles for each of the exercises was necessary

The diffuse model shown in **Figure 5** detects the opening angle between the legs, hip movement, shoulder movement, head movement, and the speed at which the exercise was executed. With these variables, it can be efficiently determined in real

While the patient is performing the exercises, the avatar copies and performs the patient's movements in real time, which makes it easier to graphically identify the exact moment of an incorrect movement. The system's graphical interface developed in Java and hosted in an Apache Tomcat web server allows user's access around

The web application is deployed by the user's device, which must be connected to the Kinect motion capture device, that allows it to be connected to the system and records the patient's movement in real time. The system requires a bandwidth greater than 2 MB/s Internet access so that the application can perform optimal results.

The results obtained in this proposal have revealed that the exercise detection

rate is 97.42% with a false-positive percentage of 2.58%, as shown in **Table 2**.

, Yj), and the value of

to identify the starting point B(Xi, Yi), the ending point C(Xj

time if an exercise has been performed correctly or incorrectly [7, 8].

the angle α of the triangle formed by the trajectory.

the world through an Internet domain.

*Doctor avatar (man) and nurse avatar (woman).*

**80**

**2.6 Results**

**Figure 9.**

*Telerehabilitation system service-oriented architecture.*


#### **Table 2.**

*Test results in the diffuse model of rehabilitation exercise detection.*

In addition, it has been observed in the development of the tests that 18% of the time, the patients perform correctly an exercise with respect to the angle and only 27% do it at an acceptable speed during its execution. On the other hand, the detection time is 0.0045 s while training and 0.002 s in the testing phase.
