1. Introduction
Prosthetic devices are essential for individuals with limb amputations [
1], helping restore mobility and independence. While upper limb amputees face challenges with grasping [
2] and biosignal-based control [
3], individuals with lower limb prostheses also face significant limitations—and one that is often overlooked is leg length discrepancy (LLD). This condition arises from inequality between the lower limbs, resulting in biomechanical imbalances. Extensive research has been dedicated to investigating this subject, resulting in the identification of adverse alterations in the subject’s body, including pathological changes in gait, spinal issues, and other complications [
4,
5].
The severity of these effects is determined by the magnitude of the discrepancy and the underlying etiology. The magnitude of LLD has been classified into three categories: mild LLD (0–30 mm), moderate LLD (30–60 mm), and severe LLD (greater than 60 mm) [
6]. Recent research findings have indicated significant variations in the thresholds at which LLD becomes problematic for the human body. For instance, studies have demonstrated that an LLD of up to 5 mm can result in long-term physical complications [
7], while an LLD ranging from 5 to 10 mm has been observed to affect the user [
4,
8]. It is posited by other research that an LLD of 20 mm may be tolerated [
8,
9], although such a condition may still result in frequent dysfunctions.
1.1. Current Methods for Assessing Limb Length Discrepancy
In order to receive appropriate compensation, it is essential to accurately quantify LLD. The quantification of LLD is carried out through functional measurements [
8] and several static methods described in the specialized literature. These solutions have been visually classified and hierarchized in this paper in order to provide an overview of the methods and devices used for LLD quantification. A limited selection of these solutions has been previously documented in [
10,
11]. To critically track the current state of the techniques for LLD assessment, the idea diagram method [
12] was used, which allowed for systematic classification and visualization of the methods and representative devices for determining leg length discrepancy found in the specialized literature on the subject.
As illustrated in
Figure 1, the methods and devices are categorized into two primary subdomains.
These subdomains are not confined to the following examples (as indicated by the use of “?”): (1) classical clinical methods (direct, indirect, and imaging-based), which are well-known and not emphasized in this paper, and (2) modern, automated solutions that are applied through indirect procedures with biomechatronic, electronic devices, or image-based solutions using specialized digital programs, sometimes combined with clinical imaging methods. The authors’ primary focus is on the second category, a subject of particular relevance in the context of this paper.
Contemporary indirect methods involve the implementation of electronic systems positioned beneath the subject’s feet during analysis. These devices include both classical instruments, such as electronic scales, which find primary application in experimental settings, and advanced mechatronic systems capable of detecting changes in the center of mass (CoM) triggered by a shorter limb [
11]. These systems are designed to compensate for the difference in weight, thereby restoring the subject’s body to a state of symmetry. The value by which these systems re-balance the body is equivalent to the LLD value. A similar principle underlies plantar analysis, a functional assessment of LLD [
13,
14,
15].
In the pursuit of non-invasive methods, alternative approaches have been developed, employing ultrasound or a combination of ultrasound and lasers. One such example is the utilization of an ultrasound probe affixed to a rod, accompanied by a laser system to measure the distance from the ground to the rod. This rod is then automatically maneuvered by a linear actuator, based on ultrasound images, to identify the highest point of the femoral head [
16]. Other systems involve the loading of radiograms into machine learning or deep learning systems, which are then compared and classified to determine LLD [
17,
18]. Intraoperative methods are also employed in specific surgical procedures [
19].
Another LLD assessment method is based on computer vision, utilizing the video camera of a smartphone to detect a series of strategically placed markers on the subject. This method enables the rapid, non-invasive, and cost-effective quantification of LLD [
20].
Regular evaluation of LLD is imperative for prosthetic patients. These individuals require periodic visits to medical specialists to ensure congruence between the prosthetic limb and the biological limb, thereby averting the onset of LLD and the ensuing complications. This is particularly salient in the case of pediatric patients undergoing growth, as their biological processes are subject to variability [
8,
21,
22]. Special attention must be given to post-amputation patients when they begin using a definitive prosthesis, which no longer resembles the biological limb that was amputated. In such cases, patients initially use a temporary prosthesis until the residual limb’s final shape is defined. These patients undergo regular adjustments to the length of the prosthesis, for reasons including preventing the occurrence of LLD [
23].
1.2. Current Adjustable Lower Limb Prostheses
Prosthetic systems developed to ensure periodic length adjustments are described in [
24] and further elaborated upon in this paper. To provide a clearer visual presentation, the prosthetic systems have been hierarchically organized in this study, using the idea diagram in
Figure 2. This emphasizes the fact that they represent manual technical solutions. Following a clinical evaluation employing various methods, manual length adjustments to the prosthesis may be undertaken. It is important to note that these systems lack automation and, as such, are prone to errors.
Another prosthetic system, developed to automatically equalize leg length discrepancies in growing children, utilizes a Master–Slave mechanism. This system utilizes the inclination measurement of the lower limbs in unilateral prosthetic patients, with a specialized system regulating an extensible prosthetic module that compensates for the LLD [
24]. While this system is operational and offers tangible benefits to the user, it does not satisfy the criterion of being an accessible, everyday home device, as it is specialized equipment requiring dedicated hardware.
1.3. Bridging the Gap: Accessible Automation for LLD Compensation
Currently, there is a notable absence of cost-effective, automated solutions capable of evaluating and compensating for leg length discrepancy (LLD) in real time. Specifically, there is no functional system that provides a closed-loop connection between LLD evaluation and compensation using an accessible, non-dedicated device, such as a smartphone. This is especially relevant for patients with unilateral amputations who require frequent adjustments due to growth and for patients undergoing rehabilitation after amputation, as changes to the residual limb necessitate regular prosthetic adjustment. In children, the prosthesis can function as a long-term adaptive tool throughout the growth and development period, thereby helping to maintain body symmetry. Developing such a system would allow for real-time image capture and automatic prosthesis alignment relative to the intact limb. This would eliminate the need for clinical supervision and offer a patient-centered solution.
The proposed system is characterized by its originality, functionality, and autonomy. It integrates real-time evaluation of LLD with mechanical compensation, a feat made possible by the utilization of a smartphone. The proposed methodology entails the detection of LLD through image processing, underpinned by a novel implementation of a newly designed algorithm, and involves the incremental adjustment of prosthesis length via closed-loop control. This innovative solution has the potential to effectively replace a set of prostheses of different lengths. It is particularly advantageous for transtibial amputees in developing regions, as it does not require clinical supervision and utilizes low-cost, accessible hardware.
The initial step in addressing LLD in amputee patients is a clinical evaluation of LLD using a standardized method. The evaluation is conducted by a medical specialist equipped with a proper device to determine the LLD. Following this evaluation, the prosthetist undertakes a manual adjustment of the prosthesis length, or, in instances where modification is unfeasible, replaces it with an appropriately sized prosthesis.
The present study has developed a prosthesis that utilizes computer vision to address LLD, with a focus on the transtibial aspect. This prosthesis is designed to be adaptable, and its design is based on smartphone technology, which is a technology that the user typically already possesses. The prosthesis’s development encompassed multiple stages, including the creation of a computer vision-based application for LLD compensation and the establishment of an experimental setup for laboratory testing of the prototype. The results obtained demonstrate the functionality of the first automated LLD compensation method, based on computer vision, managed through a smartphone and integrated into a transtibial prosthesis. The present study makes a novel contribution by introducing the first integrated method that combines computer vision-based assessment and real-time compensation of leg length discrepancy directly within a transtibial prosthesis. In contrast to prevailing methodologies that depend on specialized equipment or manual interventions, the proposed solution uses a standard smartphone and an adaptive prosthetic module to automatically restore limb symmetry. Extensive experimental validation was conducted, and the system demonstrated high accuracy and repeatability. It is a low-cost, accessible alternative to existing methods and demonstrates strong potential for home use, particularly among children or patients in remote areas.
2. Materials and Methods
The primary objective of this study was to develop and evaluate an application integrated into a smartphone. This application was designed to assist unilateral amputee patients with a transtibial prosthesis during the post-amputation recovery period or during the growth phase.
The prosthesis was designed to automatically adjust its length, thereby preventing the occurrence of limb length discrepancies during the post-amputation recovery period. At this stage, the residual limb undergoes dimensional changes and does not yet have a stabilized shape. At present, prosthetic patients require periodic adjustments of the prosthesis length to maintain an optimal fit and ensure body symmetry, thus preventing the onset of secondary degenerative conditions.
2.1. General Architecture of the Self-Adaptive Temporary Transtibial Prosthesis
The prosthetic system was designed to utilize a smartphone as a key component to assist the entire process, from evaluating the limb length discrepancy (LLD) to compensating for this issue faced by prosthetic users.
The fundamental block diagram of the system for detecting and correcting the simulated limb length discrepancy is presented in
Figure 3. The architecture encompasses a microcontroller (1), which orchestrates the functional connections and control processes of the extensible prosthetic module (3) (EPM). The microcontroller is responsible for orchestrating the interaction with the integrated actuator in the EPM via a control driver. This ensures the operation of the EPM’s DC motor.
The block diagram also incorporates a user-prototype feedback loop facilitated by the functional link between the microcontroller and a notification module (4). This module provides real-time information to the user regarding the operations of the prosthetic system, thus enabling monitoring and adjustment of ongoing processes.
The detection of LLD is facilitated by a smartphone equipped with a video camera (5). The smartphone can be placed on a tripod or held manually by the user. It captures the necessary data, including a series of reference markers strategically placed on the prosthetic user and on the wall behind the user, and transmits this data wirelessly to a signal processing unit (6), which can be an interface connected to a PC. Subsequent to this, an image processing algorithm is applied, relevant data is extracted, and based on this, commands are sent to the electric actuator within the EPM.
As a result of these functional connections, the EPM is capable of adjusting the prosthesis length, thereby compensating for the existing lower limb length discrepancy. The entire prosthetic system is powered by an external power source (7) to avoid increasing the weight of the portable system. The displacement performed by the EPM is subsequently measured using instruments to evaluate the accuracy of the adjustments.
2.2. Flowchart of the Control Mechanism for Leg Length Discrepancy Compensation
The control logic diagram of the LLD compensation mechanism, detailing the entire algorithm—from patient positioning in front of the marker-equipped plane to completion of the artificial limb alignment process—is illustrated in
Figure 4.
The algorithm commences with the positioning of the prosthetic user, who must assume a predefined stance. The process entails the utilization of markers positioned on the residual limb, the intact limb, and the background surface behind the subject. These markers are subsequently detected by the smartphone camera, facilitating the assessment of LLD.
The subsequent stage involves the LLD detection process, which is performed by processing the collected data using specially developed algorithms. Once LLD has been identified, the algorithm activates an automated prosthetic length adjustment system to compensate for the discrepancy and restore proper alignment of the artificial limb relative to the contralateral limb.
The LLD compensation is performed in real time based on feedback from the detection system, while the user receives continuous updates on the process status through a simple and accessible interface. Throughout this process, the user maintains active control over the device, with the ability to manually intervene for additional adjustments or to halt the compensation process if necessary.
This methodological approach facilitates extensive prosthetic customization, ensuring not only the correction of limb length asymmetries but also the prevention of secondary complications such as joint pain or muscular imbalances, which may arise from misaligned prosthetic devices.
The subsequent paragraph delineates the image processing steps employed to detect markers and evaluate alignment prior to each compensation step. The smartphone is positioned in front of the mannequin at a distance of approximately 1.5 m and captures real-time images using the IP Webcam Pro© application. A leg length discrepancy is then simulated. The system is capable of detecting circular green markers, which are isolated from the background through the application of a segmentation threshold in the HSV (Hue, Saturation, Value) color space. A binary mask is generated to highlight only the green markers. Following the detection stage, morphological dilation operations are applied to enhance the contours. These are followed by the reconstruction of any interrupted regions within the marked area.
The centers of the detected markers are then connected with virtual lines. A comparison of the initial and final positions of these lines, prior to and following EPM activation, respectively, enables the system to assess the symmetry of the prosthetic user’s posture. In the event that the lines are found to be parallel and do not intersect, the adjustment process is halted, as symmetry is deemed to have been achieved. In the event that the lines intersect or are non-parallel, the algorithm identifies the discrepancy as persisting and repeats the compensation step. Each adjustment is followed by a brief delay, allowing for the capture of a new frame and re-evaluation.
2.3. Summary of the Computer Vision Algorithm for LLD Assessment
The image processing algorithm for detecting the visual markers and computing leg alignment is based on the approach presented in our previous work [
20], where a non-invasive, HSV color space-based segmentation technique was employed to detect green-colored markers on the subject and background wall. First, RGB images are converted to HSV space, and a binary mask is created using empirically defined threshold ranges for hue, saturation, and value. Morphological operations, specifically dilation, are applied to close gaps between segmented regions.
Once the markers are isolated, their centroids are computed using first-order spatial image moments. Marker pairs are used to define lines for alignment: the prosthetic leg (knee line), the middle wall markers (middle line), and upper wall markers (upper line). The angle of each line relative to the image’s X-axis is computed using the atan2 function.
The alignment is assessed by comparing the knee line to the middle and upper wall lines. During calibration, baseline angles (
θ_middle,
θ_upper) are computed, and each new frame’s alignment is checked against these baselines using computed tolerances (
tol_middle,
tol_upper). Further details, including the full algorithm flow and marker configuration, are available in [
20].
2.4. Calibration and Tolerance Derivation
A calibration procedure was performed using 60 frames captured in a known aligned pose. The angle between the prosthetic line and each wall reference line was computed, and the mean angle was stored as the nominal reference: θ_middle = 161.2°, θ_upper = 108.2°. For each set of frames, the standard deviation was computed, and tolerances were set as twice the standard deviation to cover 95% of natural variation. This yielded tol_middle = ±0.073°, tol_upper = ±0.90°. These tolerances were used as thresholds for detecting alignment in real-time operation.
4. Discussion
The findings derived from the implementation of the initial method for compensating for leg length discrepancy (LLD) employing computer vision integrated into a smartphone, with a transtibial prosthesis serving as the effector, substantiate the viability of the adopted approach in restoring the user’s body symmetry. The method’s applicability extends to two distinct patient populations: those who have undergone unilateral amputation and are initially using a temporary transtibial prosthesis, and those in the growth phase.
In comparison with conventional LLD assessment methods that depend on medical imaging (most often X-rays or ultrasound) [
8,
9,
16], functional evaluations (e.g., plantar analysis using baropodometric platforms) performed by specialists [
11,
13], or automated assessments utilizing a dedicated Master–Slave system [
24], our proposed solution is based on a rapid, non-invasive method with a brief patient preparation time. It is both financially and technically accessible, as nearly everyone today owns a smartphone. These considerations ensure a high potential for at-home implementation of the developed and tested method. The primary advantage of this approach lies in its use of a common device—a smartphone—thereby eliminating the need for expensive equipment.
It has been demonstrated by preceding studies that contemporary clinical methodologies are accurate. Nevertheless, these methodologies necessitate specialized equipment and access to qualified medical personnel.
Moreover, extant LLD compensation solutions are passive, lacking automation, and requiring regular manual adjustments [
22,
25,
26,
27,
28,
29,
30,
31,
32,
33]. For instance, certain prosthetic rods are engineered to permit length modification with an extension of up to 50 mm, in 1 mm increments, secured with a counter nut [
31]. Another variant of an artificial lower limb enables length adjustment from 12.7 cm to 20.3 cm [
28]. Additionally, Ottobock offers an adjustable prosthetic rod that allows for manual modification of prosthesis length [
29]. As documented in the scientific literature, the extant solutions offer a range of length adjustment capabilities. However, these devices do not incorporate automated or semi-automated adjustment methods and necessitate the presence of a medical specialist to perform the modifications. Despite the substantial advancements in lower limb prostheses in recent years, from conventional systems to intelligent prosthetic systems managed by artificial intelligence (AI), allowing adaptability to various user interactions or environments, such as joint control through AI algorithms [
40] or prostheses that can interpret electromyographic (EMG) signals from the patient to facilitate control during gait phases [
41], AI remains underutilized for control of lower limb prostheses. However, the extant literature mentions applications of machine learning for fall detection in amputees and for managing the temperature within the prosthetic socket [
42]. Recently, advanced methods for human gait pattern recognition have been proposed, with applications in sports and clinical contexts [
43]. However, such complex systems do not provide a dedicated technical solution for correcting LLD in children with unilateral transtibial amputation, where a practical, adaptable, and accessible approach is required. Furthermore, a review of the specialized literature reveals a paucity of reports on lower limb prostheses that exhibit the capacity for automatic adaptation to the amputee’s body conformation. This approach, in comparison to the previously described solutions, is characterized by its simplicity, feasibility at low cost, and the ability to maintain body symmetry without necessitating frequent visits to the prosthetist. The proposed system integrates the benefits of image-based digital methods [
11,
13,
14,
15,
16,
17,
18,
19,
20,
21] with the ease of use of a smartphone, which is connected to a transtibial prosthesis. This innovative and accessible approach to automatic LLD compensation represents a substantial advancement in the field.
The experimental results revealed the progression of the SATP process for automatic compensation of simulated LLD. It was observed that the SATP exhibited an incremental compensation pattern, reflecting the prosthesis’s response to the detection of leg length discrepancy. The consistent compensation rate indicates a stable automatic control system, allowing for rapid assessment of LLD and gradual restoration of body alignment, without inducing abrupt variations, unwanted oscillations, or significant overcompensation.
The results obtained from the present study demonstrate that the implementation of this compensation method has the potential to ensure the maintenance of an appropriately sized prosthesis over an extended period, particularly in cases involving growing children. Additionally, its application in patients utilizing temporary prostheses following amputation could facilitate adjustment to a prosthesis of the correct size. It is imperative to acknowledge the significance of this aspect in the prevention of limb length discrepancies and the subsequent secondary conditions that may arise.
The system was evaluated using 1000 frames recorded under strictly controlled laboratory conditions, with constant indoor lighting and fixed camera placement. In this environment, the system correctly identified alignment in 94.6% of frames. The maximum observed angular deviations from the calibrated baselines were: Δθ_middle = 2.814°, Δθ_upper = 1.888°
Frames exceeding the calibrated tolerances (±0.073° for the middle line, ±0.90° for the upper line) were flagged as misaligned, indicating a leg length discrepancy (LLD).
Preliminary occlusion tests showed that the system remained functional with up to 50% of a marker partially blocked, but alignment detection failed when occlusion exceeded this threshold. These results demonstrate the algorithm’s reliability and accuracy under stable, repeatable laboratory conditions.
This study introduced a self-adaptive prosthetic control system that incorporates a vision-based mechanism for detecting and correcting leg length discrepancies (LLD) in real time. The system employs a calibrated, marker-based computer vision algorithm operating on high-resolution video input (3840 × 2160), utilizing HSV color segmentation and centroid-based geometric analysis to extract and evaluate angular relationships between the prosthesis and fixed wall reference markers.
Calibration trials conducted under controlled laboratory conditions established baseline angular references of θ_middle = 161.2° and θ_upper = 108.2°, with corresponding tolerances of ±0.073° and ±0.90°, determined through statistical analysis of 60 aligned frames. The algorithm achieved a correct alignment detection rate of 94.6% across 1000 test frames, with maximum observed deviations of 2.81° and 1.88° for the middle and upper lines, respectively. Additional tests confirmed stable performance while occlusion resistance was maintained up to 50% marker coverage.
In the present study, the proposed SATP correction system achieved a mean absolute error of 0.134 mm, calculated based on the test case set, with a maximum individual error of 0.28 mm. These values are significantly below the lowest clinically relevant threshold for LLD (i.e., 5 mm), which is generally considered the lower limit at which long-term complications may begin to appear [
4,
7,
8]. Consequently, the correction accuracy achieved by the SATP system demonstrates high precision and remains well within the clinically acceptable range, even for mild discrepancies. These results support the feasibility of integrating SATP into clinical practice as a preventive and compensatory solution for LLD.
Furthermore, the system has the potential to reduce the frequency of visits to the prosthetist, as minor adjustments can be made automatically, thereby eliminating the need for frequent professional intervention.
Despite the system’s notable advantages, it is imperative to acknowledge potential limitations that must be taken into account. The precision of LLD evaluation is contingent upon the quality of the captured image, which is susceptible to external factors such as lighting conditions or the resolution of the smartphone camera. A further limitation is that the current solution is optimized for users with transtibial amputations and would require adaptations for other types of prostheses. In future research, we aim to address the impact of lighting conditions on the algorithm and extend the correction method to other amputated anatomical segments.
Future research will address the impact of lighting conditions on the algorithm and extend the correction method to other amputated anatomical segments. The goal is to simplify the system by reducing the number of markers and minimize environmental errors to reduce error accumulation over time. Additionally, we will evaluate the adjustment frequency during clinical trials in collaboration with medical specialists.
At this experimental stage, validation was carried out on a mannequin in a static and controlled environment. The aim was to demonstrate the technical feasibility of the proposed method for correcting a simulated LLD. While this approach does not fully replicate the biomechanical complexity of a real human user, it enabled an initial evaluation of the system’s accuracy and the operating principle of the SATP. However, this approach falls short in fully capturing the intricate biomechanical nuances inherent in real-world applications. The limitations of static testing will be addressed in subsequent research phases, which will include clinical studies and dynamic testing on human users.
The proposed method in this study offers a novel approach to the assessment of and compensation for LLD in transtibial amputee patients by leveraging accessible technologies. Notwithstanding the challenges associated with optimization for enhanced accuracy, the proposed solution offers considerable potential for clinical implementation, with the potential to reduce the necessity for manual adjustments and contribute to an enhancement in the quality of life of patients.
5. Conclusions
The present study constitutes an investigation into the development of a methodology for the correction of leg length discrepancy (LLD). The method was grounded in the field of computer vision and integrated into a self-adaptive temporary transtibial prosthesis. The system was developed for patients who have undergone transtibial amputation and are undergoing medical rehabilitation. During this process, the residual limb is shaped to adapt to the needs of the individual patient. It is also suitable for children whose limb length discrepancies may change frequently over time.
These results demonstrate that the proposed approach offers reliable, precise, and computationally efficient alignment monitoring, supporting its integration into closed-loop control for prosthetic systems in structured clinical or home environments.
The proposed system utilizes a smartphone application, an accessible and familiar device for most users, which also ensures a very short preparation time. The development process entailed the creation of a computer vision-based LLD compensation application and the construction of an experimental setup for laboratory testing of the prototype.
The experimental results obtained from this study confirm the feasibility and functionality of the initial computer vision-based automatic LLD compensation method, which is managed via a smartphone and integrated into a transtibial prosthesis.
Subsequent research will concentrate on clinical trials, encompassing transtibial amputees and a range of cases, with a view to evaluating the efficacy and long-term usability of the system. Furthermore, the expansion of the adaptability of the system to other types of prostheses, in addition to the optimization of the algorithm for real-time performance, will increase the practical applicability of this method.