Motion capture (Mocap) is applied to motor rehabilitation of patients recovering from a trauma, a surgery, or other impairing conditions. Some rehabilitation exercises are easily tracked with low-cost technologies and a simple Mocap setup, while some others are extremely hard to track because they imply small movements and require high accuracy. In these last cases, the obvious solution is to use high performing motion tracking systems, but these devices are generally too expensive in the rehabilitation context. The aim of this paper is to provide a Mocap solution suitable for any kind of exercise but still based on low-cost sensors. This result can be reached embedding some artificial intelligence (AI), in particular a convolutional neural network (CNN), to gather a better outcome from the optical acquisition. The paper provides a methodology including the way to perform patient's tracking and to elaborate the data from infra-red sensors and from the red, green, blue (RGB) cameras in order to create a user-friendly application for physiotherapists. The approach has been tested with a known complex case concerning the rehabilitation of shoulders. The proposed solution succeeded in detecting small movements and incorrect patient behavior, as for instance, a compensatory elevation of the scapula during the lateral abduction of the arm. The approach evaluated by medical personnel provided good results and encouraged its application in different kinds of rehabilitation practices as well as in different fields where low-cost Mocap could be introduced.