A posture deviation recognition method based on image recognition

By employing an image recognition-based posture deviation identification method and utilizing complex number domain and Fourier transform techniques, the subjective nature and equipment complexity of limb posture assessment in rehabilitation training are addressed. This method enables objective and detailed posture deviation analysis and grade index output, supporting personalized rehabilitation adjustments.

CN122135431APending Publication Date: 2026-06-02FIRST AFFILIATED HOSPITAL OF XINJIANG MEDICAL UNIVERSITY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
FIRST AFFILIATED HOSPITAL OF XINJIANG MEDICAL UNIVERSITY
Filing Date
2026-02-26
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing technologies for assessing patients' limb posture in rehabilitation medicine suffer from problems such as high subjectivity, high equipment costs, complex system deployment, difficulty in cross-scenario comparison, and difficulty in analyzing subtle posture deviations. In particular, in the rehabilitation training of patients with hemiplegia after stroke and functional recovery after joint surgery, there is a lack of objective and unified assessment indicators.

Method used

An image recognition-based posture deviation identification method is adopted. The human body contour on the two-dimensional plane is mapped to the complex domain. The shape features are extracted by using discrete Fourier transform. Combined with global difference measurement and local residual signal, a posture deviation level index is constructed to realize macroscopic deviation measurement and microscopic deviation location.

Benefits of technology

It provides intuitive and operable rehabilitation posture deviation level indicators, reduces equipment costs, simplifies system deployment, improves the objectivity of assessment and cross-scenario comparison capabilities, can finely analyze posture deviations, and supports real-time monitoring and personalized training program development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122135431A_ABST
    Figure CN122135431A_ABST
Patent Text Reader

Abstract

This invention relates to the field of image processing technology and discloses a posture deviation recognition method based on image recognition. The method involves acquiring a posture image at the moment a specified rehabilitation movement is completed, preprocessing and segmenting it to obtain a binary contour of the target posture, representing the contour points as a complex sequence, and performing closure processing and arc length resampling to standardize the number of contour points. Based on this, a DC-free and normalized Fourier descriptor is constructed to obtain the frequency domain features of the posture and the standard posture. The global shape deviation intensity and adaptive judgment threshold are calculated through frequency domain comparison, and the residual signal is reconstructed at the resampling point location to obtain the local deviation distribution. Finally, the posture deviation level and structured results are output according to a grading rule, thereby reducing the dependence on sensors and manual thresholding, realizing the quantitative assessment and presentation of posture deviation, and providing a basis for clinical assessment and training adjustment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, specifically to a posture deviation recognition method based on image recognition. Background Technology

[0002] In the field of rehabilitation medicine, rehabilitation training for patients with hemiplegia after stroke or functional recovery after joint surgery generally requires quantitative or semi-quantitative assessment of the patient's limb posture during training to determine whether the training movements are standardized and whether the rehabilitation progress meets expectations. Currently, the most common practice is still to rely primarily on the visual experience of rehabilitation physicians or therapists, supplemented by a small number of scales. This method is highly subjective, depends on personal experience, and makes it difficult to establish unified and stable objective indicators. It is prone to inconsistencies in assessment results between different physicians or even within the same physician at different times, and it cannot perform detailed analysis of subtle postural deviations.

[0003] To improve the objectivity of assessments, some existing technologies have introduced wearable sensors or motion capture systems. These systems acquire three-dimensional motion trajectories and joint angle changes by attaching accelerometers, gyroscopes, or reflective markers to multiple key locations on the patient's limbs. While these technologies provide relatively detailed motion data, they suffer from high equipment costs, complex system deployment, and stringent environmental requirements. Furthermore, the need to deploy multiple sensors or markers on the patient makes the process cumbersome, leading to poor patient compliance and hindering widespread adoption in routine rehabilitation training. In the area of ​​analysis based on two-dimensional contours or shapes, existing methods often use simple geometric features (such as area, perimeter, rectangular envelopes, and angles at specific points) for comparison, or directly calculate pixel-level differences in the spatial domain. These methods are often sensitive to translation and scale changes; even slight changes in shooting distance or position amplify numerical differences, making them difficult to use directly for stable comparisons across different scenarios or patients. Meanwhile, many methods only provide an overall similarity or error value, lacking a mechanism to decompose global differences into specific contours, and cannot clearly indicate whether the main postural deviation exists in the shoulder, elbow, or wrist joint, thus having limited clinical guidance value.

[0004] Therefore, this case aims to propose a posture deviation recognition method based on image recognition. It maps the human body contour on the two-dimensional plane to the complex domain, extracts shape features using discrete Fourier transform (DFT), and eliminates scale effects through normalization. Then, it achieves the unification of macroscopic deviation measurement and microscopic deviation localization by constructing a global difference metric and local residual signal. Finally, it provides an intuitive and operable rehabilitation posture deviation level index by combining interpretable threshold grading rules. Summary of the Invention

[0005] This invention provides a posture deviation recognition method based on image recognition, which helps to solve the problems mentioned in the background art above.

[0006] This invention provides the following technical solution: a posture deviation recognition method based on image recognition, comprising:

[0007] A static posture image of a specified rehabilitation action is acquired. The static posture image is preprocessed to generate a binary image representing the target posture contour region. Contour points in the binary image are converted into a point sequence on the complex plane. The point sequence is then subjected to contour head-to-tail distance judgment and closure processing to obtain a complex-form contour point sequence after closure. Resampling is performed along the contour path corresponding to the closed-form contour point sequence at preset arc length intervals, with the number of contour points being consistent during resampling to obtain a resampled contour point sequence with a uniform number of points. Based on the resampled contour point sequence, contour shape features are extracted in the frequency domain to construct a DC-degraded Fourier descriptor vector. The DC-degraded Fourier descriptor vector is then normalized to obtain the normalized Fourier expression for the posture contour. Descriptor vectors are generated by performing contour extraction, closure processing, resampling, and frequency domain feature construction on standard rehabilitation posture images to obtain standard Fourier descriptor vectors that are dimensionally consistent with the posture contours. The normalized Fourier descriptor vectors of the posture contours are compared with the standard Fourier descriptor vectors in the frequency domain to obtain a global shape deviation intensity index and a posture deviation judgment threshold. A complex residual signal is constructed based on the frequency domain differences, and the local deviation amount at each position is reconstructed on the resampled contour point sequence to obtain a set of local deviation points and their spatial locations. Based on the global shape deviation intensity index, the set of local deviation points, and preset grading rules, a posture deviation level index is calculated, and the posture deviation level index, local deviation locations, and related indices are combined into a posture deviation recognition result structure for output.

[0008] Optionally, the step of acquiring a static posture image at the instant of completing the specified rehabilitation movement, and performing preprocessing on the static posture image to generate a binary image representing the target posture contour region specifically includes:

[0009] A fixed camera captures a single color still image at the moment a specified rehabilitation movement is performed. A two-dimensional Cartesian coordinate system is established on the color still image, with the top left corner of the image as the origin, the horizontal direction as the first coordinate axis, and the vertical direction as the second coordinate axis. The height and width in pixels of the color still image are recorded. For each pixel in the color still image, the grayscale values ​​of the red, green, and blue channels are obtained, multiplied by 29.9%, 58.7%, and 11.4% respectively, and then summed. A grayscale image is generated based on this weighted sum, so that the grayscale image provides the single-channel grayscale value for each pixel position. The minimum and maximum grayscale values ​​within the entire image range are obtained, and the minimum and maximum grayscale values ​​are added together. Half of the sum is taken as the grayscale value. A grayscale segmentation threshold is used. On the grayscale image, the grayscale value of each pixel is compared with the grayscale segmentation threshold. If the grayscale value is less than the threshold, the current pixel is marked as a foreground pixel; if the grayscale value is greater than or equal to the threshold, the current pixel is marked as a background pixel. This rule is used to generate a binary image. Connected region labeling is performed on the binary image based on four-neighbor connectivity. The connected region with the largest number of pixels is selected as the target pose contour region. Contour point sequences are sequentially extracted from the boundary of the target pose contour region, and all adjacent contour points with identical coordinates are deleted to form the original contour point sequence. When the number of contour points in the original contour point sequence is less than two, the subsequent processing flow is terminated, and the recognition is marked as invalid in the pose deviation recognition result data record.

[0010] Optionally, the step of converting contour points in the binary image into a point sequence on the complex plane, performing contour start-end distance judgment and closure processing on the point sequence to obtain a complex form contour point sequence after closure processing specifically includes:

[0011] For each contour point in the original contour point sequence, the horizontal coordinate of the current contour point in the image plane is taken as the real part of the complex plane, and the vertical coordinate is taken as the imaginary part of the complex plane. The contour points are arranged in the contour traversal order to obtain a complex form contour point sequence. The Euclidean distance between the first and last contour points in the complex form contour point sequence is calculated. The Euclidean distance is compared with the closure distance threshold, which corresponds to a distance of three pixels. When the Euclidean distance is greater than the closure distance threshold, a new complex contour point with the same position as the first contour point is added to the end of the complex form contour point sequence. The number of contour points after connecting the first and last points is recorded as the number of contour points after closure. When the Euclidean distance is not greater than the closure distance threshold, the complex form contour point sequence remains unchanged, and the original number of contour points is recorded as the number of contour points after closure.

[0012] Optionally, the contour path corresponding to the complex form contour point sequence after the closure process is resampled at a preset arc length interval. During the resampling process, the number of contour points is standardized to obtain a resampled contour point sequence with a consistent number of points. Specifically, this includes:

[0013] Following the arrangement order of the complex-form contour point sequence after closure processing, the Euclidean distance between any two adjacent contour points is calculated. The Euclidean distances between all adjacent contour points are summed to obtain the total arc length of the closed contour. Based on the preset number of resampled contour points, the total arc length is divided into equal-length arc segments equal to the number of resampled contour points, resulting in resampled arc length intervals. The first point of the closed contour is used as the starting contour point of the resampled sequence. Starting from the first point of the closed contour, the arc lengths between adjacent contour points are sequentially accumulated along the contour path, constructing a cumulative arc length sequence along the contour direction. Each item represents the cumulative arc length from the first point to the current contour point. For each target resampling index, the corresponding target arc length position is calculated, and the target arc length position is mapped to the arc length interval between a certain pair of adjacent contour points in the cumulative arc length sequence. The complex coordinates of the target resampling point are calculated between the two endpoints of the arc length interval between the adjacent pair of adjacent contour points where the target arc length position is located according to the linear interpolation rule. All target resampling points are arranged in the order of resampling index to form a resampling contour point sequence with a uniform number of points, which is used for subsequent frequency domain feature extraction processing.

[0014] Optionally, the step of extracting contour shape features in the frequency domain based on the resampled contour point sequence, constructing a DC-degraded Fourier descriptor vector, and performing amplitude normalization processing on the DC-degraded Fourier descriptor vector to obtain a normalized Fourier descriptor vector for the attitude contour specifically includes:

[0015] For the resampled contour point sequence, a Discrete Fourier Transform (DFT) is performed according to a preset truncation frequency order. Complex frequency coefficients of each order are calculated along the frequency index from negative to positive within a preset frequency range, resulting in a sequence of complex frequency coefficients representing the shape characteristics of the attitude contour in the frequency domain. The complex frequency coefficient sequence is arranged into a vector according to the frequency index order, and the zero-order DC component is removed from the vector, retaining all non-zero-order complex frequency coefficients to form a DC-degraded Fourier descriptor vector. The magnitude of each complex frequency coefficient in the DC-degraded Fourier descriptor vector is calculated, and the squared magnitudes are calculated for all non-zero-order frequency components. The summation is performed to obtain the total energy of the DC-deferred Fourier descriptor. When the total energy of the DC-deferred Fourier descriptor is greater than zero, the normalization result is calculated for each order of complex frequency coefficient. The normalized complex frequency coefficient is obtained by dividing the real and imaginary parts of each order of complex frequency coefficient by the square root of the total energy of the DC-deferred Fourier descriptor. When the total energy of the DC-deferred Fourier descriptor is equal to zero, the normalized value of all non-zero order complex frequency coefficients is set to zero. All normalized complex frequency coefficients are combined to form a normalized Fourier descriptor vector, which serves as the normalized frequency domain shape feature representation of the attitude profile.

[0016] Optionally, the step of performing contour extraction, closure processing, resampling, and frequency domain feature construction on the standard rehabilitation posture image to obtain a standard Fourier descriptor vector consistent with the posture contour in dimension specifically includes:

[0017] Import a color image of a standard rehabilitation posture corresponding to a specified rehabilitation movement. In the image plane coordinate system, multiply the grayscale values ​​of the red, green, and blue channels of each pixel in the standard color image by 29.9%, 58.7%, and 11.4% respectively, and then sum them to generate a standard grayscale image. This standard grayscale image provides the single-channel grayscale value for each pixel. Obtain the minimum and maximum grayscale values ​​across the entire image range from the standard grayscale image. Use half of their sum as the standard grayscale segmentation threshold. Perform a pixel-by-pixel comparison operation on the standard grayscale image based on this threshold. Pixels with grayscale values ​​less than the threshold are marked as foreground pixels. The remaining pixels are marked as background pixels to obtain a standard binary image. In the standard binary image, the connected region with the largest number of pixels is extracted based on the connected region labeling method. The boundary of the connected region with the largest number of pixels is taken as the standard pose contour region. Standard contour point sequences are sequentially extracted on the boundary of the standard pose contour region, and all contour points with identical adjacent coordinates are deleted to obtain the standard original contour point sequence. When the number of contour points in the standard original contour point sequence is less than two, the corresponding standard pose template is marked as invalid, and the system does not output the pose deviation recognition result based on the corresponding standard pose template in subsequent recognition processes. For each contour point in the standard original contour point sequence, the x-coordinate is used as... The real part of the complex plane is used, and the ordinate is used as the imaginary part of the complex plane. A standard complex number sequence of contour points is obtained by arranging them according to the contour traversal order. The Euclidean distance between the first and last contour points in the standard complex number sequence is calculated and compared with a closure distance threshold (corresponding to a three-pixel distance). If the Euclidean distance is greater than the closure distance threshold, a complex contour point with the same position as the first contour point is appended to the end of the sequence. If the Euclidean distance is not greater than the closure distance threshold, the sequence remains unchanged, thus obtaining the closed standard contour point sequence and its number of points. Following the arrangement order of the closed standard contour point sequence, the Euclidean distance between adjacent standard contour points is calculated, and all adjacent points are... The Euclidean distances between the quasi-contour points are accumulated to obtain the total arc length of the standard contour. Based on the same number of resampled contour points as in the attitude contour resampling process, the total arc length of the standard contour is divided into a corresponding number of equal-length arc segments to obtain the standard resampled arc length interval, and a cumulative arc length sequence of the standard contour is established accordingly. For each standard target resampled index, the arc length interval containing the corresponding target arc length position is found in the standard cumulative arc length sequence. The complex coordinates of the standard resampled points are calculated between the two endpoints of the arc length interval between adjacent standard contour point pairs where the target arc length position is located in the standard cumulative arc length sequence according to the linear interpolation rule. All standard resampled points are arranged in index order to form a standard resampled contour point sequence.Using the standard resampled contour point sequence as input, a Discrete Fourier Transform is performed within the same truncation frequency range as the attitude contour. Standard complex frequency coefficients of each order are calculated along the frequency index from negative to positive, and the zero-order DC component is removed, resulting in a standard Fourier descriptor vector consisting only of non-zero-order frequency components. The same number of resampled contour points and frequency order as the attitude contour normalized Fourier descriptor vector are used to ensure that the standard Fourier descriptor vector and the attitude contour normalized Fourier descriptor vector are completely identical in dimension.

[0018] Optionally, the step of comparing the normalized Fourier descriptor vector of the attitude contour with the standard Fourier descriptor vector in the frequency domain to obtain the global shape deviation intensity index and the attitude deviation judgment threshold specifically includes:

[0019] For each non-zero frequency component in the normalized Fourier descriptor vector of the attitude profile, the complex frequency coefficients of the same frequency component in the standard Fourier descriptor vector are subtracted from the normalized complex frequency coefficients of the attitude profile to obtain a sequence of complex differences for each frequency component. The magnitude of each term in the sequence is calculated, and the squared magnitudes of each term are summed over all non-zero frequency components to obtain the global shape deviation intensity index of the attitude relative to the standard attitude. Similarly, the magnitude of the complex frequency coefficients of each non-zero frequency component in the standard Fourier descriptor vector is calculated, and the squared magnitudes of each term are summed over all non-zero frequency components. Add the standard Fourier descriptor energy sum to obtain the standard Fourier descriptor energy sum. When the standard Fourier descriptor energy sum is greater than zero, the product of the standard Fourier descriptor energy sum and a fixed proportionality coefficient of 10% is used as the attitude deviation judgment threshold. When the standard Fourier descriptor energy sum is equal to zero, the attitude deviation judgment threshold is set to zero. Compare the global shape deviation intensity index with the attitude deviation judgment threshold. When the global shape deviation intensity index is greater than the attitude deviation judgment threshold, it is determined that the current attitude contour shape has a deviation. When the global shape deviation intensity index is not greater than the attitude deviation judgment threshold, it is determined that the current attitude contour shape has no deviation.

[0020] Optionally, the step of constructing a complex residual signal based on frequency domain differences, reconstructing the local deviation at each position on the resampled contour point sequence, and obtaining the set of local deviation points and their spatial locations specifically includes:

[0021] Using the complex difference sequence of non-zero frequency components of each order as input, an inverse discrete Fourier transform is performed within the frequency range corresponding to the discrete Fourier transform. For each resampled contour point position, a complex residual signal reconstructed from all frequency differences is calculated. The magnitude of the complex residual signal corresponding to each resampled contour point position is calculated, and the magnitude of the complex residual signal is used as the local deviation magnitude of the corresponding resampled contour point position, resulting in a local deviation magnitude sequence corresponding to all resampled contour points. All local deviation magnitudes in the local deviation magnitude sequence are summed, and the summation result is divided by the number of resampled contour points to obtain the local deviation judgment threshold. In the local deviation magnitude sequence, resampled contour points with local deviation magnitudes greater than the local deviation judgment threshold are selected, and these resampled contour points and their spatial positions are combined to form a local deviation point set, obtaining the mapping result of the attitude contour local deviation in the spatial domain.

[0022] Optionally, the step of calculating the attitude deviation level index based on the global shape deviation intensity index, the set of local deviation points, and preset grading rules, and outputting the attitude deviation level index, local deviation location, and related indexes as a structure for attitude deviation identification results, specifically includes:

[0023] When the sum of the standard Fourier descriptor energies is greater than zero, the ratio of the global shape deviation intensity index to the sum of the standard Fourier descriptor energies is used as the normalized deviation ratio. When the sum of the standard Fourier descriptor energies is equal to zero, the normalized deviation ratio is set to zero. The number of local deviation points in the local deviation point set is counted, and the ratio of the number of local deviation points to the number of resampled contour points is used as the local deviation point ratio. An attitude deviation level index is constructed based on the normalized deviation ratio and the local deviation point ratio. When the normalized deviation ratio does not exceed 10% and the local deviation point ratio does not exceed 10%, the attitude deviation level index is set to the first level of deviation. When the normalized deviation ratio is greater than 10% but does not exceed 30%, the attitude deviation level index is set to the second level. If the proportion of local deviation points does not exceed 30%, or if the proportion of local deviation points is greater than 10% but not more than 30% and the normalized deviation ratio does not exceed 30%, the attitude deviation level index is set to the second level of deviation. If the normalized deviation ratio is greater than 30% or the proportion of local deviation points is greater than 30%, the attitude deviation level index is set to the third level of deviation. Construct an attitude deviation identification result structure that includes the global shape deviation intensity index, attitude deviation judgment threshold, normalized deviation ratio, number of local deviation points, proportion of local deviation points, attitude deviation level index, and coordinates of all local deviation points, and write the attitude deviation identification result structure into the attitude deviation identification result data record.

[0024] The present invention has the following beneficial effects:

[0025] 1. By establishing an image coordinate system, weighted grayscale conversion, and adaptive threshold segmentation, the original color image is accurately converted into a binary image, effectively suppressing illumination and background interference. Furthermore, four-neighbor connected region labeling is introduced, and the largest connected region is selected as the target pose contour, clearly separating the human target region. The entire process eliminates complex background modeling or multi-sensor fusion, offering advantages such as low deployment cost and strong real-time performance. In practical rehabilitation environments, cameras can be quickly installed to complete motion capture without cumbersome calibration or pre-training, making it easier to promote and maintain compared to traditional methods based on depth cameras or multi-angle acquisition.

[0026] 2. To address the frequency domain feature distortion caused by the open contour, this scheme designs a closure strategy based on the Euclidean distance between the first and last points and a pixel-level closure distance threshold (3 pixels): when the first and last point distance exceeds the limit, the complex coordinates of the first point are automatically appended to the end of the sequence to complete a smooth closure. This lightweight closure avoids complex curve fitting or interpolation, while ensuring the mathematical premise for subsequent resampling and frequency domain transformation. By directly mapping the two-dimensional coordinates to the complex plane and preserving the traversal order, the contour curve and the complex sequence are matched one-to-one, laying a solid foundation for frequency domain analysis. This method not only has low computational cost and is easy to deploy in real time, but also has adaptive compensation capabilities for small breaks in the arm or leg contour, improving the integrity of the closed contour.

[0027] 3. Based on the complex-form contour point sequence after closed-loop processing, the cumulative arc length is calculated, and the total arc length is divided into equally spaced segments according to the preset number of resampling points. Linear interpolation is then used to accurately reconstruct the coordinates of the target sampling points. This approach ensures both spatial sampling uniformity and sequence length consistency, resulting in a fixed and equally spaced signal length required for subsequent discrete Fourier transforms, thus providing a standardized input for frequency domain feature extraction. Compared to traditional grid-based or pixel-neighborhood-based resampling, this scheme can adaptively adjust the sampling density and resolution. The number of points can be flexibly set for different joints or limb parts, ensuring both complete feature representation and computational efficiency.

[0028] 4. In the frequency domain feature extraction stage, the scheme extracts the complex frequency coefficients of each order through a truncated frequency-order Discrete Fourier Transform, removes the zero-order DC component to form a de-DC descriptor vector, and then performs amplitude normalization based on the sum of the descriptor energy. This one-step de-DC removal and normalization eliminates the influence of size, scaling, and coordinate system offset on the descriptor, allowing direct comparison of descriptors under different acquisition conditions. By fully preserving the complex form of the coefficients and normalizing them, this scheme balances shape details and global consistency, significantly improving sensitivity and discriminative power against attitude deviations.

[0029] 5. The scheme establishes a consistent frequency domain feature construction process for standard rehabilitation posture images with the comparison end, ensuring complete consistency in descriptor dimensions under the same number of sampling points and frequency order. Using the same resampling and frequency domain parameters, the scheme compares the posture contour normalized Fourier descriptor vector with the standard Fourier descriptor vector, directly calculating the complex difference at the component level to obtain a global shape deviation intensity index. This matching method avoids the complexity of distance matrix-based or machine learning-based classification, while exhibiting high robustness to subtle deformations, accurately reflecting the degree of deviation during rehabilitation training.

[0030] 6. The scheme obtains a global shape deviation intensity index by accumulating the squares of the moduli of the complex difference sequence, and constructs a judgment threshold by combining the sum of the energy of the standard Fourier descriptors with a fixed scaling factor, forming a concise global deviation judgment process. In setting the threshold, the principle of relative energy is adhered to, which can both adapt to the shape changes of different standard templates and avoid misjudgments caused by rigid thresholds. This method does not require complex statistical or learning models, is simple and clear, and allows for manual adjustment of the scaling factor to adapt to different rehabilitation movements, making it practical and interpretable for both clinical applications and engineering deployment.

[0031] 7. To address the inadequacy of global indicators in reflecting local deformation, this solution introduces complex residual signal reconstruction based on inverse discrete Fourier transform. Local deviation is calculated and its magnitude extracted at each resampling point, forming a sequence of local deviation magnitudes. Combined with a local deviation judgment threshold, prominent deviation points are identified, and a set of local deviation points and their spatial locations are output, achieving a visual mapping of deviations. This method innovatively restores frequency domain difference information to the spatial domain, not only intuitively displaying the distribution of deviations in various parts but also providing a precise basis for personalized rehabilitation adjustments.

[0032] 8. The solution integrates the normalized deviation ratio and the proportion of local deviation points, classifying deviations into three levels according to preset grading rules, and outputting a structure containing global and local deviation indicators, levels, and coordinates of all local deviation points. This grading method considers both the overall degree of deformation and the distribution of local deviations, providing doctors or rehabilitation therapists with multi-dimensional assessment criteria. Compared to existing evaluation systems that rely on only a single indicator, the structured output of this solution is more valuable for decision-making, supporting real-time monitoring, historical review, and the development of personalized training programs. Attached Figure Description

[0033] Figure 1 This is a schematic diagram of the process of the present invention.

[0034] Figure 2 This is a schematic diagram of the two-dimensional rectangular coordinate system structure of the present invention.

[0035] In the figure: 1-Origin of coordinates, 2-First coordinate axis, 3-Second coordinate axis, 4-Graph. Detailed Implementation

[0036] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0037] Example, refer to Figure 1 A pose deviation recognition method based on image recognition, comprising:

[0038] 1. A posture deviation recognition method based on image recognition, characterized in that it includes:

[0039] A static posture image is acquired at the moment a specified rehabilitation movement is completed. The static posture image is preprocessed to generate a binary image representing the target posture contour region. Contour points in the binary image are converted into a point sequence on the complex plane. The point sequence is then subjected to contour head-to-tail distance judgment and closure processing to obtain a closed complex-form contour point sequence. Resampling is performed along the contour path corresponding to the closed complex-form contour point sequence at preset arc length intervals, with the number of contour points being consistent during resampling to obtain a resampled contour point sequence with a uniform number of points. Based on the resampled contour point sequence, contour shape features are extracted in the frequency domain to construct a DC-degraded Fourier descriptor vector. The DC-degraded Fourier descriptor vector is then normalized to obtain the posture contour normalized Fourier. Fourier descriptor vectors are generated. Contour extraction, closure processing, resampling, and frequency domain feature construction are performed on standard rehabilitation posture images to obtain standard Fourier descriptor vectors that are dimensionally consistent with the posture contour. The normalized Fourier descriptor vectors of the posture contour are compared with the standard Fourier descriptor vectors in the frequency domain to obtain a global shape deviation intensity index and a posture deviation judgment threshold. A complex residual signal is constructed based on the frequency domain differences, and the local deviation amount at each position is reconstructed on the resampled contour point sequence to obtain a set of local deviation points and their spatial locations. Based on the global shape deviation intensity index, the set of local deviation points, and preset grading rules, a posture deviation level index is calculated, and the posture deviation level index, local deviation locations, and related indices are combined into a posture deviation recognition result structure for output.

[0040] First, static images of the moment a specified rehabilitation movement is completed are acquired and generated into binary images, ensuring accurate extraction of the human body contour. Next, the contour points in the binary image are converted into complex numbers and automatically closed at both ends, resolving the issue of frequency domain analysis failure caused by openings and contour breaks. Then, the closed contour is resampled at equidistant intervals according to a preset arc length, achieving strict alignment between the input data length and the requirements of subsequent frequency domain algorithms. Based on this, a DC-free Fourier descriptor is constructed and its amplitude is normalized, successfully eliminating the influence of different acquisition scales and coordinate offsets, achieving comparability of features between different subjects and the standard template. Subsequently, by comparing the normalized descriptor vectors of the subject and the standard, the intensity of global shape deviation is accurately quantified, and an adaptive judgment threshold is calculated, avoiding the risk of misjudgment caused by a fixed threshold. The inverse complex residual transform is used to reconstruct local deviations in the spatial domain and screen out significant deviation points, providing spatial distribution information of the deviations. Finally, based on global and local deviation indicators, the deviation level is derived according to preset grading rules and output in a structured manner, providing intuitive and quantifiable deviation evaluation results for clinical practice. Unlike traditional methods that rely on angle or depth cameras at key points and multi-sensor fusion, this method can complete high-precision closed-loop evaluation using only monocular images. It is not affected by marker occlusion or failure to identify key points, and has the advantages of being lightweight, real-time, and easy to deploy.

[0041] Reference Figure 2 The step of acquiring a static posture image at the moment the specified rehabilitation action is completed, performing preprocessing on the static posture image to generate a binary image representing the target posture contour region, specifically includes:

[0042] A fixed camera captures a single color still image at the moment a specified rehabilitation movement is performed. A two-dimensional Cartesian coordinate system is established on the color still image, with the top left corner of the image as the origin, the horizontal direction as the first coordinate axis, and the vertical direction as the second coordinate axis. The height and width in pixels of the color still image are recorded. For each pixel in the color still image, the grayscale values ​​of the red, green, and blue channels are obtained, multiplied by 29.9%, 58.7%, and 11.4% respectively, and then summed. A grayscale image is generated based on this weighted sum, so that the grayscale image provides the single-channel grayscale value for each pixel position. The minimum and maximum grayscale values ​​within the entire image range are obtained, and the minimum and maximum grayscale values ​​are added together. Half of the sum is taken as the grayscale value. A grayscale segmentation threshold is used. On the grayscale image, the grayscale value of each pixel is compared with the grayscale segmentation threshold. If the grayscale value is less than the threshold, the current pixel is marked as a foreground pixel; if the grayscale value is greater than or equal to the threshold, the current pixel is marked as a background pixel. This rule is used to generate a binary image. Connected region labeling is performed on the binary image based on four-neighbor connectivity. The connected region with the largest number of pixels is selected as the target pose contour region. Contour point sequences are sequentially extracted from the boundary of the target pose contour region, and all adjacent contour points with identical coordinates are deleted to form the original contour point sequence. When the number of contour points in the original contour point sequence is less than two, the subsequent processing flow is terminated, and the recognition is marked as invalid in the pose deviation recognition result data record.

[0043] A still image was captured using a fixed camera at the moment the specified rehabilitation movement was completed, denoted as . The image size is Pixels, and establish a two-dimensional Cartesian coordinate system on the image plane, setting the top left corner of the image as the origin. , The axis moves to the right in the horizontal direction. The axis points downwards in the vertical direction; among which, A static image of the rehabilitation posture obtained in a single acquisition; For image The height in pixels; For image The number of pixels in width;

[0044] Image Convert to grayscale image The grayscale value is calculated using the following formula:

[0045] ;in, For pixel coordinates The grayscale value at that location; , These are the pixel coordinates in the horizontal and vertical directions, respectively; , , Images In pixel coordinates The grayscale values ​​of the red, green, and blue channels;

[0046] The minimum grayscale value within the entire range of a grayscale image is denoted as . The maximum grayscale value of a grayscale image within the entire image range is denoted as . ;

[0047] Construct a grayscale threshold for binary segmentation as follows: ;

[0048] The binary image generated based on the grayscale threshold is as follows:

[0049] ;in, For binary images in pixel coordinates The value at;

[0050] The binary image is labeled with 4-connected regions. The contour region with the largest area is selected, and its contour point sequence is extracted. Then, all adjacent points with the same coordinates are deleted from this contour point sequence, so that adjacent contour points satisfy the condition... : ;in, This is the set of original contour points corresponding to the image; For the first in the original contour set The pixel coordinates of each contour point; Index of contour points; This represents the total number of original contour points;

[0051] when If the error occurs, the processing flow is stopped, and the identification is marked as invalid in the attitude deviation identification result data record.

[0052] The process of converting contour points in a binary image into a point sequence on a complex plane, performing contour start-end distance judgment and closure processing on the point sequence to obtain a complex-form contour point sequence after closure processing specifically includes:

[0053] For each contour point in the original contour point sequence, the horizontal coordinate of the current contour point in the image plane is taken as the real part of the complex plane, and the vertical coordinate is taken as the imaginary part of the complex plane. The contour points are arranged in the contour traversal order to obtain a complex form contour point sequence. The Euclidean distance between the first and last contour points in the complex form contour point sequence is calculated. The Euclidean distance is compared with the closure distance threshold, which corresponds to a distance of three pixels. When the Euclidean distance is greater than the closure distance threshold, a new complex contour point with the same position as the first contour point is added to the end of the complex form contour point sequence. The number of contour points after connecting the first and last points is recorded as the number of contour points after closure. When the Euclidean distance is not greater than the closure distance threshold, the complex form contour point sequence remains unchanged, and the original number of contour points is recorded as the number of contour points after closure.

[0054] Each contour point Represented in complex form:

[0055] , ;in, For the first in the original contour The complex coordinates of each contour point; The imaginary unit satisfies ;

[0056] The distance between the first and last points is calculated as follows: ;in, The Euclidean distance between the first and last points of the original contour; This is the first complex point in the original contour; For the first in the original contour A number of complex points;

[0057] Set the closing distance threshold to ;

[0058] like Then add a point to the end of the sequence. and order ;in, These are additional points added when the distance between the beginning and end is too large; This represents the number of contour points after the closure process.

[0059] like If no new point is added, then let .

[0060] The contour path corresponding to the complex form contour point sequence after closure processing is resampled at preset arc length intervals. During the resampling process, the number of contour points is standardized to obtain a resampled contour point sequence with a consistent number of points. Specifically, this includes:

[0061] Following the arrangement order of the complex-form contour point sequence after closure processing, the Euclidean distance between any two adjacent contour points is calculated. The Euclidean distances between all adjacent contour points are summed to obtain the total arc length of the closed contour. Based on the preset number of resampled contour points, the total arc length is divided into equal-length arc segments equal to the number of resampled contour points, resulting in resampled arc length intervals. The first point of the closed contour is used as the starting contour point of the resampled sequence. Starting from the first point of the closed contour, the arc lengths between adjacent contour points are sequentially accumulated along the contour path, constructing a cumulative arc length sequence along the contour direction. Each item represents the cumulative arc length from the first point to the current contour point. For each target resampling index, the corresponding target arc length position is calculated, and the target arc length position is mapped to the arc length interval between a certain pair of adjacent contour points in the cumulative arc length sequence. The complex coordinates of the target resampling point are calculated between the two endpoints of the arc length interval between the adjacent pair of adjacent contour points where the target arc length position is located according to the linear interpolation rule. All target resampling points are arranged in the order of resampling index to form a resampling contour point sequence with a uniform number of points, which is used for subsequent frequency domain feature extraction processing.

[0062] The total arc length of the original contour after closure is calculated as follows: ;

[0063] Set the number of contour points after resampling to The length of the equal interval is calculated as follows: ;in, This represents the arc length interval along the contour during resampling;

[0064] Initialize sampling points ;in, This is the 0th contour point in the resampled sequence;

[0065] The cumulative arc length function is constructed as follows: , , ;in, Starting from the first point of the original contour The cumulative arc length from the starting point to the point where no line segment has been traversed; From the first original contour point to the second The cumulative arc length between the original contour points;

[0066] For each integer satisfy Select the smallest integer Make:

[0067] ;in, The index of the resampling point; In order to be with the first Integer indices of the arc length intervals corresponding to each resampling point;

[0068] And calculate the first by linear interpolation The interpolation coefficients for each sampling point and the sampling points are as follows:

[0069] , ;in, For the first The resampling point is located at the original contour. Linear interpolation coefficients on the segment; For the resampled first A complex number of contour points;

[0070] The final resampled contour point sequence is as follows: ;in, It is the set of all resampled contour points.

[0071] The step of extracting contour shape features in the frequency domain based on the resampled contour point sequence, constructing a DC-degraded Fourier descriptor vector, and performing amplitude normalization processing on the DC-degraded Fourier descriptor vector to obtain the attitude contour normalized Fourier descriptor vector specifically includes:

[0072] For the resampled contour point sequence, a Discrete Fourier Transform (DFT) is performed according to a preset truncation frequency order. Complex frequency coefficients of each order are calculated along the frequency index from negative to positive within a preset frequency range, resulting in a sequence of complex frequency coefficients representing the shape characteristics of the attitude contour in the frequency domain. The complex frequency coefficient sequence is arranged into a vector according to the frequency index order, and the zero-order DC component is removed from the vector, retaining all non-zero-order complex frequency coefficients to form a DC-degraded Fourier descriptor vector. The magnitude of each complex frequency coefficient in the DC-degraded Fourier descriptor vector is calculated, and the squared magnitudes are calculated for all non-zero-order frequency components. The summation is performed to obtain the total energy of the DC-deferred Fourier descriptor. When the total energy of the DC-deferred Fourier descriptor is greater than zero, the normalization result is calculated for each order of complex frequency coefficient. The normalized complex frequency coefficient is obtained by dividing the real and imaginary parts of each order of complex frequency coefficient by the square root of the total energy of the DC-deferred Fourier descriptor. When the total energy of the DC-deferred Fourier descriptor is equal to zero, the normalized value of all non-zero order complex frequency coefficients is set to zero. All normalized complex frequency coefficients are combined to form a normalized Fourier descriptor vector, which serves as the normalized frequency domain shape feature representation of the attitude profile.

[0073] Calculate the first The complex frequency coefficients are:

[0074] , ;in, Contour resampling point sequence The Discrete Fourier frequency coefficients; Frequency index; The truncated Fourier frequency order; It is an exponential function;

[0075] The original Fourier descriptor vector is constructed as follows: ;in, The Fourier coefficient vector is arranged in frequency order.

[0076] Discard DC component ,get: ;in, The Fourier descriptor vector after removing the DC component; These are the 0th order Fourier coefficients;

[0077] The total energy of the DC Fourier coefficients is calculated as follows: ;in, For the frequency index used in the summation;

[0078] like Then for each The normalization coefficients are constructed as follows: ;in, For the first Normalized Fourier coefficients;

[0079] like Then for each make: ;

[0080] Therefore, the normalized Fourier descriptor subset is obtained as follows:

[0081] ;in, It is the set of all normalized Fourier descriptor subsystems.

[0082] The process of performing contour extraction, closure processing, resampling, and frequency domain feature construction on standard rehabilitation posture images to obtain standard Fourier descriptor vectors consistent with the posture contours in dimensionality specifically includes:

[0083] Import a color image of a standard rehabilitation posture corresponding to a specified rehabilitation movement. In the image plane coordinate system, multiply the grayscale values ​​of the red, green, and blue channels of each pixel in the standard color image by 29.9%, 58.7%, and 11.4% respectively, and then sum them to generate a standard grayscale image. This standard grayscale image provides the single-channel grayscale value for each pixel. Obtain the minimum and maximum grayscale values ​​across the entire image range from the standard grayscale image. Use half of their sum as the standard grayscale segmentation threshold. Perform a pixel-by-pixel comparison operation on the standard grayscale image based on this threshold. Pixels with grayscale values ​​less than the threshold are marked as foreground pixels. The remaining pixels are marked as background pixels to obtain a standard binary image. In the standard binary image, the connected region with the largest number of pixels is extracted based on the connected region labeling method. The boundary of the connected region with the largest number of pixels is taken as the standard pose contour region. Standard contour point sequences are sequentially extracted on the boundary of the standard pose contour region, and all contour points with identical adjacent coordinates are deleted to obtain the standard original contour point sequence. When the number of contour points in the standard original contour point sequence is less than two, the corresponding standard pose template is marked as invalid, and the system does not output the pose deviation recognition result based on the corresponding standard pose template in subsequent recognition processes. For each contour point in the standard original contour point sequence, the x-coordinate is used as... The real part of the complex plane is used, and the ordinate is used as the imaginary part of the complex plane. A standard complex number sequence of contour points is obtained by arranging them according to the contour traversal order. The Euclidean distance between the first and last contour points in the standard complex number sequence is calculated and compared with a closure distance threshold (corresponding to a three-pixel distance). If the Euclidean distance is greater than the closure distance threshold, a complex contour point with the same position as the first contour point is appended to the end of the sequence. If the Euclidean distance is not greater than the closure distance threshold, the sequence remains unchanged, thus obtaining the closed standard contour point sequence and its number of points. Following the arrangement order of the closed standard contour point sequence, the Euclidean distance between adjacent standard contour points is calculated, and all adjacent points are... The Euclidean distances between the quasi-contour points are accumulated to obtain the total arc length of the standard contour. Based on the same number of resampled contour points as in the attitude contour resampling process, the total arc length of the standard contour is divided into a corresponding number of equal-length arc segments to obtain the standard resampled arc length interval, and a cumulative arc length sequence of the standard contour is established accordingly. For each standard target resampled index, the arc length interval containing the corresponding target arc length position is found in the standard cumulative arc length sequence. The complex coordinates of the standard resampled points are calculated between the two endpoints of the arc length interval between adjacent standard contour point pairs where the target arc length position is located in the standard cumulative arc length sequence according to the linear interpolation rule. All standard resampled points are arranged in index order to form a standard resampled contour point sequence.Using the standard resampled contour point sequence as input, a Discrete Fourier Transform is performed within the same truncation frequency range as the attitude contour. Standard complex frequency coefficients of each order are calculated along the frequency index from negative to positive, and the zero-order DC component is removed, resulting in a standard Fourier descriptor vector consisting only of non-zero-order frequency components. The same number of resampled contour points and frequency order as the attitude contour normalized Fourier descriptor vector are used to ensure that the standard Fourier descriptor vector and the attitude contour normalized Fourier descriptor vector are completely identical in dimension.

[0084] Import standard rehabilitation posture images In the image plane coordinate system, Convert to grayscale image, specifically: ;in, For standard images in pixels The grayscale value at that location; , , The standard image in pixels The grayscale values ​​of the red, green, and blue channels at that location;

[0085] Obtain the minimum and maximum grayscale values ​​of the standard grayscale image, denoted as . , ;

[0086] The grayscale segmentation threshold for constructing a standard image is: ;

[0087] The standard binary image generated based on the grayscale segmentation threshold is as follows:

[0088] ;in, The binary image corresponding to the standard image in pixels The value at;

[0089] exist Extract the contour region with the largest area to obtain a contour point sequence, and delete all adjacent points with the same coordinates from this contour point sequence, so that adjacent standard contour points satisfy... The standard contour point set is obtained as follows:

[0090] ;in, This is the set of original contour points of the largest connected component in the standard image; For the first in the standard profile The pixel coordinates of each contour point; Index of standard contour points; The standard original outline point count;

[0091] like If the standard posture template is invalid, the system will not output the posture deviation identification result based on the template.

[0092] The standard contour points in complex form are: , ;in, For the first standard original contour A number of complex points;

[0093] The standard distance between the first and last points is calculated as follows: ;in, The distance between the first and last points of the standard profile;

[0094] like Then add a point to the end of the sequence. and order ;in, This represents the number of points after the standard contour closure process.

[0095] like If no new point is added, then let ;

[0096] Using the total arc length of the standard profile Resampling arc length interval of standard profile Cumulative arc length function of standard profile In the standard outline and the first Integer arc length interval index corresponding to each resampling point and standard profile in Linear interpolation function for each resampling point Perform arc length calculation and linear interpolation, in Based on this, the standard resampled contour point sequence is obtained: ;in, The first standard contour after resampling A number of complex points;

[0097] The first step in constructing the standard profile Fourier frequency coefficients Specifically:

[0098] , ;

[0099] After removing the DC component, a standard descriptor vector is formed. Specifically:

[0100] ;

[0101] Use the same number of sampling points as the contour. With frequency order This ensures that the descriptor dimensions are consistent, satisfying: ;in, Let be the dimension of the vector.

[0102] The step of comparing the normalized Fourier descriptor vector of the attitude contour with the standard Fourier descriptor vector in the frequency domain to obtain the global shape deviation intensity index and the attitude deviation judgment threshold specifically includes:

[0103] For each non-zero frequency component in the normalized Fourier descriptor vector of the attitude profile, the complex frequency coefficients of the same frequency component in the standard Fourier descriptor vector are subtracted from the normalized complex frequency coefficients of the attitude profile to obtain a sequence of complex differences for each frequency component. The magnitude of each term in the sequence is calculated, and the squared magnitudes of each term are summed over all non-zero frequency components to obtain the global shape deviation intensity index of the attitude relative to the standard attitude. Similarly, the magnitude of the complex frequency coefficients of each non-zero frequency component in the standard Fourier descriptor vector is calculated, and the squared magnitudes of each term are summed over all non-zero frequency components. Add the standard Fourier descriptor energy sum to obtain the standard Fourier descriptor energy sum. When the standard Fourier descriptor energy sum is greater than zero, the product of the standard Fourier descriptor energy sum and a fixed proportionality coefficient of 10% is used as the attitude deviation judgment threshold. When the standard Fourier descriptor energy sum is equal to zero, the attitude deviation judgment threshold is set to zero. Compare the global shape deviation intensity index with the attitude deviation judgment threshold. When the global shape deviation intensity index is greater than the attitude deviation judgment threshold, it is determined that the current attitude contour shape has a deviation. When the global shape deviation intensity index is not greater than the attitude deviation judgment threshold, it is determined that the current attitude contour shape has no deviation.

[0104] For each frequency component, the complex difference is calculated as follows:

[0105] , ;in, The profile of the identified person is compared with the standard profile in the first... Complex differences on the first-order frequency components;

[0106] The deviation strength index is constructed as follows: ;in, The global shape deviation intensity index between the pose of the identified object and the standard pose;

[0107] The sum of the standard pose Fourier descriptor energies is calculated as follows: ;

[0108] like Then the attitude deviation judgment threshold is constructed as follows: ;

[0109] like Let the attitude deviation judgment threshold be... ;

[0110] like If so, it is determined that there is a deviation in the current posture shape;

[0111] like If the current posture shape is determined to be without deviation, then it is determined that there is no deviation.

[0112] The process of constructing a complex residual signal based on frequency domain differences, reconstructing the local deviation at each position on the resampled contour point sequence, and obtaining the set of local deviation points and their spatial locations specifically includes:

[0113] Using the complex difference sequence of non-zero frequency components of each order as input, an inverse discrete Fourier transform is performed within the frequency range corresponding to the discrete Fourier transform. For each resampled contour point position, a complex residual signal reconstructed from all frequency differences is calculated. The magnitude of the complex residual signal corresponding to each resampled contour point position is calculated, and the magnitude of the complex residual signal is used as the local deviation magnitude of the corresponding resampled contour point position, resulting in a local deviation magnitude sequence corresponding to all resampled contour points. All local deviation magnitudes in the local deviation magnitude sequence are summed, and the summation result is divided by the number of resampled contour points to obtain the local deviation judgment threshold. In the local deviation magnitude sequence, resampled contour points with local deviation magnitudes greater than the local deviation judgment threshold are selected, and these resampled contour points and their spatial positions are combined to form a local deviation point set, obtaining the mapping result of the attitude contour local deviation in the spatial domain.

[0114] The complex residual signal is calculated as follows:

[0115] , ;in, In the first At each resampling point, the frequency difference is... The complex residual signal obtained from reconstruction;

[0116] Extracting the modulus of local deviation points: , ;in, For the first The magnitude of the local deviation at each resampling location, i.e., the magnitude of the residual signal;

[0117] The threshold for determining local deviation is: ;

[0118] Construct the set of local deviation points as .

[0119] The process involves calculating an attitude deviation level index based on a global shape deviation intensity index, a set of local deviation points, and preset grading rules. The attitude deviation level index, local deviation locations, and related indices are then combined to form an attitude deviation identification result structure, which is then output. Specifically, this includes:

[0120] When the sum of the standard Fourier descriptor energies is greater than zero, the ratio of the global shape deviation intensity index to the sum of the standard Fourier descriptor energies is used as the normalized deviation ratio. When the sum of the standard Fourier descriptor energies is equal to zero, the normalized deviation ratio is set to zero. The number of local deviation points in the local deviation point set is counted, and the ratio of the number of local deviation points to the number of resampled contour points is used as the local deviation point ratio. An attitude deviation level index is constructed based on the normalized deviation ratio and the local deviation point ratio. When the normalized deviation ratio does not exceed 10% and the local deviation point ratio does not exceed 10%, the attitude deviation level index is set to the first level of deviation. When the normalized deviation ratio is greater than 10% but does not exceed 30%, the attitude deviation level index is set to the second level. If the proportion of local deviation points does not exceed 30%, or if the proportion of local deviation points is greater than 10% but not more than 30% and the normalized deviation ratio does not exceed 30%, the attitude deviation level index is set to the second level of deviation. If the normalized deviation ratio is greater than 30% or the proportion of local deviation points is greater than 30%, the attitude deviation level index is set to the third level of deviation. Construct an attitude deviation identification result structure that includes the global shape deviation intensity index, attitude deviation judgment threshold, normalized deviation ratio, number of local deviation points, proportion of local deviation points, attitude deviation level index, and coordinates of all local deviation points, and write the attitude deviation identification result structure into the attitude deviation identification result data record.

[0121] like Then the normalized deviation ratio is calculated as follows: ;

[0122] like Then let ;

[0123] Calculate the proportion of local deviation points to the total number of resampling points. ;in, For set The cardinality;

[0124] Execute steps S801 to S803, according to and The deviation level index is constructed as follows:

[0125] S801, if and Then let: ;in, This is an indicator of attitude deviation level;

[0126] S802, if

[0127] or Then let: ;

[0128] S803, if or Then let: ;

[0129] The structure for constructing the posture deviation recognition result is as follows:

[0130] ;in, The result structure of a single attitude deviation identification consists of multiple scalars and sets; For all sets belonging to the local deviation set Contour points A set;

[0131] And Write it into the attitude deviation recognition result data record.

[0132] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0133] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A posture deviation recognition method based on image recognition, characterized in that, include: Acquire a static posture image at the moment the specified rehabilitation action is completed, perform preprocessing on the static posture image, and generate a binary image representing the target posture contour region; The contour points in the binary image are converted into a sequence of points on the complex plane. The point sequence is then subjected to the first and last contour distance judgment and closure processing to obtain the complex form contour point sequence after closure processing. The contour path corresponding to the complex form contour point sequence after the closed processing is resampled at a preset arc length interval. The number of contour points is unified during the resampling process to obtain a resampled contour point sequence with the same number of points. Based on the resampled contour point sequence, contour shape features are extracted in the frequency domain, DC-degraded Fourier descriptor vectors are constructed, and amplitude normalization is performed on the DC-degraded Fourier descriptor vectors to obtain attitude contour normalized Fourier descriptor vectors. Contour extraction, closure processing, resampling, and frequency domain feature construction are performed on standard rehabilitation posture images to obtain standard Fourier descriptor vectors that are consistent with the posture contours in dimensionality. In the frequency domain, the normalized Fourier descriptor vector of the attitude profile is compared with the standard Fourier descriptor vector to obtain the global shape deviation intensity index and the attitude deviation judgment threshold. Based on the frequency domain difference, a complex residual signal is constructed, and the local deviation at each position is reconstructed on the resampled contour point sequence to obtain the set of local deviation points and their spatial locations. The attitude deviation level index is calculated based on the global shape deviation intensity index, the set of local deviation points, and the preset grading rules. The attitude deviation level index, the local deviation location, and related indexes are combined into an output structure for the attitude deviation recognition result.

2. The posture deviation recognition method based on image recognition according to claim 1, characterized in that, The step of acquiring a static posture image at the moment the specified rehabilitation action is completed, and performing preprocessing on the static posture image to generate a binary image representing the target posture contour region specifically includes: A fixed camera captures a color still image at the moment a specified rehabilitation movement is completed. A two-dimensional rectangular coordinate system is established on the color still image, with the upper left corner of the image as the origin, the horizontal direction as the first coordinate axis, and the vertical direction as the second coordinate axis. The height and width of the color still image are recorded. For each pixel in a color still image, obtain the gray values ​​of the red, green, and blue channels, multiply them by 29.9%, 58.7%, and 11.4% respectively, and then sum them up. Generate a grayscale image according to the weighted sum so that the grayscale image gives the single-channel grayscale value of each pixel position. In a grayscale image, the minimum and maximum grayscale values ​​within the entire image range are obtained respectively. The minimum and maximum grayscale values ​​are added together, and half of the sum is used as the grayscale segmentation threshold. In a grayscale image, the grayscale value of each pixel is compared with a grayscale segmentation threshold. When the grayscale value is less than the grayscale segmentation threshold, the current pixel is marked as a foreground pixel. When the grayscale value is greater than or equal to the grayscale segmentation threshold, the current pixel is marked as a background pixel. A binary image is generated according to this rule. Connectivity labeling is performed on the binary image based on the four-neighbor connectivity relationship. The connected region with the largest number of pixels is selected as the target pose contour region. Contour point sequences are extracted sequentially on the boundary of the target pose contour region, and all adjacent contour points with identical coordinates are deleted to form the original contour point sequence. When the number of contour points in the original contour point sequence is less than two, the subsequent processing is terminated, and the identification is marked as invalid in the pose deviation identification result data record.

3. The posture deviation recognition method based on image recognition according to claim 2, characterized in that, The process of converting contour points in a binary image into a point sequence on the complex plane, performing contour start-end distance judgment and closure processing on the point sequence to obtain a complex form contour point sequence after closure processing specifically includes: For each contour point in the original contour point sequence, the horizontal coordinate of the current contour point in the image plane is taken as the real part of the complex plane, and the vertical coordinate is taken as the imaginary part of the complex plane. The contour points are arranged in the contour traversal order to obtain the complex form contour point sequence. Calculate the Euclidean distance between the first and last contour points in the complex form contour point sequence, and compare the Euclidean distance with the closure distance threshold, which corresponds to a three-pixel distance. When the Euclidean distance is greater than the closure distance threshold, a new complex contour point with the same position as the first contour point is added to the end of the complex contour point sequence, and the number of contour points after connecting the first and last ones is recorded as the number of contour points after closure. When the Euclidean distance is not greater than the closure distance threshold, the complex contour point sequence remains unchanged, and the original number of contour points is recorded as the number of contour points after closure.

4. The posture deviation recognition method based on image recognition according to claim 3, characterized in that, The contour path corresponding to the complex form contour point sequence after closure processing is resampled at preset arc length intervals. During the resampling process, the number of contour points is standardized to obtain a resampled contour point sequence with a consistent number of points. Specifically, this includes: According to the arrangement order of the complex form contour point sequence after closure processing, calculate the Euclidean distance between two adjacent contour points, and sum up the Euclidean distances between all adjacent contour points to obtain the total arc length of the closed contour. Based on the preset number of resampled contour points, the total arc length is divided into equal-length arc segments of the same number as the number of resampled contour points to obtain the resampled arc length interval, and the first point of the closed contour is taken as the starting contour point of the resampled sequence. Starting from the first point of the closed contour, the arc length between adjacent contour points is accumulated sequentially along the contour path to construct a cumulative arc length sequence along the contour direction, such that each item in the cumulative arc length sequence represents the cumulative arc length value from the first point to the current contour point. For each target resampling index, calculate the corresponding target arc length position, map the target arc length position to the arc length interval between a certain pair of adjacent contour points in the cumulative arc length sequence, and calculate the complex coordinates of the target resampling point between the two endpoints of the arc length interval between the adjacent pair of contour points where the target arc length position is located according to the linear interpolation rule. All target resampled points are arranged in resampled index order to form a resampled contour point sequence with a uniform number of points, which is then used for subsequent frequency domain feature extraction processing.

5. The posture deviation recognition method based on image recognition according to claim 4, characterized in that, The step of extracting contour shape features in the frequency domain based on the resampled contour point sequence, constructing a DC-degraded Fourier descriptor vector, and performing amplitude normalization processing on the DC-degraded Fourier descriptor vector to obtain the attitude contour normalized Fourier descriptor vector specifically includes: For the resampled contour point sequence, a discrete Fourier transform is performed according to the preset truncation frequency order. The complex frequency coefficients of each order are calculated from the negative order to the positive order along the frequency index within the preset frequency range to obtain a sequence of complex frequency coefficients representing the shape characteristics of the attitude contour in the frequency domain. The complex frequency coefficient sequence is arranged into a vector according to the frequency index order, and the zero-order DC component is removed from the vector, while all non-zero-order complex frequency coefficients are retained to form a DC-de-Fourier descriptor vector. The magnitude of each complex frequency coefficient in the DC-de-Fourier descriptor vector is calculated. The magnitudes of each coefficient are squared and then summed over all non-zero frequency components to obtain the total energy of the DC-de-Fourier descriptor. When the total energy of the DC-de-Fourier descriptor is greater than zero, the normalization result is calculated for each order of complex frequency coefficient. The normalized complex frequency coefficient is obtained by dividing the real part and imaginary part of each order of complex frequency coefficient by the square root of the total energy of the DC-de-Fourier descriptor. When the total energy of the DC-de-Fourier descriptor is equal to zero, the normalized value of all non-zero order complex frequency coefficients is set to zero complex. All normalized complex frequency coefficients are combined to form a normalized Fourier descriptor vector, which serves as the normalized frequency domain shape feature representation of the attitude profile.

6. The posture deviation recognition method based on image recognition according to claim 5, characterized in that, The process of performing contour extraction, closure processing, resampling, and frequency domain feature construction on standard rehabilitation posture images to obtain standard Fourier descriptor vectors consistent with the posture contours in dimensionality specifically includes: Import a standard rehabilitation posture color image corresponding to the specified rehabilitation action. In the image plane coordinate system, multiply the gray values ​​of the red, green and blue channels of each pixel in the standard color image by 29.9%, 58.7% and 11.4% respectively and then sum them to generate a standard grayscale image. This standard grayscale image will give the single-channel grayscale value of each pixel position. In a standard grayscale image, the minimum and maximum grayscale values ​​within the entire image range are obtained respectively. Half of the sum of the two is used as the standard grayscale segmentation threshold. The standard grayscale image is then compared pixel by pixel according to the standard grayscale segmentation threshold. When the grayscale value is less than the standard grayscale segmentation threshold, the pixel is marked as a foreground pixel, and the remaining pixels are marked as background pixels, thus obtaining a standard binary image. In a standard binary image, the connected region with the largest number of pixels is extracted based on the connected region labeling method. The boundary of the connected region with the largest number of pixels is taken as the standard pose contour region. The standard contour point sequence is extracted sequentially on the boundary of the standard pose contour region, and all contour points with identical adjacent coordinates are deleted to obtain the standard original contour point sequence. When the number of contour points in the standard original contour point sequence is less than two, the corresponding standard pose template is marked as invalid, and the system does not output the pose deviation recognition result based on the corresponding standard pose template in the subsequent recognition process. For each contour point in the standard original contour point sequence, the horizontal coordinate is taken as the real part of the complex plane and the vertical coordinate is taken as the imaginary part of the complex plane. The contour points are arranged in the contour traversal order to obtain the standard complex form contour point sequence. The Euclidean distance between the first and last contour points in the standard complex form contour point sequence is calculated and compared with the closure distance threshold, which corresponds to a distance of three pixels. When the Euclidean distance is greater than the closure distance threshold, a complex contour point with the same position as the first contour point is appended to the end of the sequence. When the Euclidean distance is not greater than the closure distance threshold, the sequence remains unchanged, thus obtaining the standard contour point sequence after closure processing and the number of points. According to the arrangement order of the standard contour point sequence after closure processing, calculate the Euclidean distance between adjacent standard contour points, accumulate the Euclidean distances between all adjacent standard contour points to obtain the total arc length of the standard contour, divide the total arc length of the standard contour into a corresponding number of equal-length arc segments according to the number of resampled contour points in the same attitude contour resampling process, obtain the standard resampled arc length interval, and establish the cumulative arc length sequence of the standard contour accordingly. For each standard target resampling index, find the arc length interval containing the corresponding target arc length position in the standard cumulative arc length sequence. Calculate the complex coordinates of the standard resampling points between the two endpoints of the arc length interval between adjacent standard contour point pairs where the target arc length position is located in the standard cumulative arc length sequence according to the linear interpolation rule. Arrange all standard resampling points in index order to form a standard resampling contour point sequence. The standard resampled contour point sequence is used as input. The discrete Fourier transform is performed within the same cutoff frequency order as the attitude contour. The standard complex frequency coefficients of each order are calculated along the frequency index from negative to positive order. The zero-order DC component is removed to obtain the standard Fourier descriptor vector consisting only of non-zero-order frequency components. The same number of resampled contour points and frequency order as the attitude contour normalized Fourier descriptor vector are used to make the standard Fourier descriptor vector and the attitude contour normalized Fourier descriptor vector completely identical in dimension.

7. The posture deviation recognition method based on image recognition according to claim 6, characterized in that, The step of comparing the normalized Fourier descriptor vector of the attitude contour with the standard Fourier descriptor vector in the frequency domain to obtain the global shape deviation intensity index and the attitude deviation judgment threshold specifically includes: For each non-zero frequency component in the normalized Fourier descriptor vector of the attitude profile, the complex frequency coefficients of the same frequency component in the standard Fourier descriptor vector are subtracted from the normalized complex frequency coefficients of the attitude profile to obtain the complex difference sequence of each frequency component. The modulus of each term in the complex difference sequence is calculated. The squared modulus of each term is then summed over all non-zero frequency components to obtain the global shape deviation intensity index of the attitude relative to the standard attitude. The magnitude of the complex frequency coefficients of each non-zero frequency component in the standard Fourier descriptor vector is calculated. The magnitudes of each component are squared and then summed over all non-zero frequency components to obtain the total energy of the standard Fourier descriptor. When the sum of the standard Fourier descriptor energies is greater than zero, the product of the sum of the standard Fourier descriptor energies and a fixed proportionality coefficient of 10% is used as the attitude deviation judgment threshold. When the sum of the standard Fourier descriptor energies is equal to zero, the attitude deviation judgment threshold is set to zero. The global shape deviation intensity index is compared with the attitude deviation judgment threshold. If the global shape deviation intensity index is greater than the attitude deviation judgment threshold, the current attitude contour shape is determined to have a deviation. If the global shape deviation intensity index is not greater than the attitude deviation judgment threshold, the current attitude contour shape is determined to have no deviation.

8. The posture deviation recognition method based on image recognition according to claim 7, characterized in that, The process of constructing a complex residual signal based on frequency domain differences, reconstructing the local deviation at each position on the resampled contour point sequence, and obtaining the set of local deviation points and their spatial locations specifically includes: Using the complex difference sequence of non-zero frequency components of each order as input, an inverse discrete Fourier transform is performed in the frequency range corresponding to the discrete Fourier transform, and the complex residual signal reconstructed by all frequency differences is calculated for each resampled contour point position. The magnitude of the complex residual signal corresponding to each resampled contour point is calculated, and the magnitude of the complex residual signal is used as the local deviation of the corresponding resampled contour point, thus obtaining a sequence of local deviations that correspond one-to-one with all resampled contour points. The local deviation magnitudes are summed in the local deviation magnitude sequence, and the summation result is divided by the number of resampled contour points to obtain the local deviation judgment threshold. In the sequence of local deviation magnitudes, resampled contour points whose local deviation magnitudes are greater than the local deviation judgment threshold are selected. These resampled contour points and their spatial locations are combined to form a set of local deviation points, thus obtaining the mapping result of the local deviation of the attitude contour in the spatial domain.

9. The posture deviation recognition method based on image recognition according to claim 8, characterized in that, The process involves calculating an attitude deviation level index based on a global shape deviation intensity index, a set of local deviation points, and preset grading rules. The attitude deviation level index, local deviation locations, and related indices are then combined to form an attitude deviation identification result structure, which is then output. Specifically, this includes: When the sum of the standard Fourier descriptor energies is greater than zero, the ratio of the global shape deviation intensity index to the sum of the standard Fourier descriptor energies is used as the normalized deviation ratio. When the sum of the standard Fourier descriptor energies is equal to zero, the normalized deviation ratio is set to zero. The number of local deviation points in the set of local deviation points is counted, and the ratio of the number of local deviation points to the number of resampled contour points is taken as the local deviation point ratio. The attitude deviation level index is constructed by combining the normalized deviation ratio and the proportion of local deviation points. When the normalized deviation ratio does not exceed 10% and the proportion of local deviation points does not exceed 10%, the attitude deviation level index is set to the first level of deviation. When the normalized deviation ratio is greater than 10% but not more than 30% and the proportion of local deviation points does not exceed 30%, or when the proportion of local deviation points is greater than 10% but not more than 30% and the normalized deviation ratio does not exceed 30%, the attitude deviation level index is set to the second level of deviation. When the normalized deviation ratio is greater than 30% or the proportion of local deviation points is greater than 30%, the attitude deviation level index is set to the third level of deviation. Construct an attitude deviation recognition result structure that includes global shape deviation intensity index, attitude deviation judgment threshold, normalized deviation ratio, number of local deviation points, proportion of local deviation points, attitude deviation level index, and coordinates of all local deviation points, and write the attitude deviation recognition result structure into the attitude deviation recognition result data record.