pyukf_kinect_body_tracking
pyukf_kinect_body_tracking copied to clipboard
improve performance of skeleton data from kinect v2 body tracking sdk using unscented kalman filter
PyUKF Kinect Body Tracking
- This project aims to compenate skeleton data using Unscented Kalman Filter(UKF).
- Skeleton data is given 32 joint information from Kinect v2 camera and Azure Kinect Body Tracking SDK (v1.0.1).
- pykalman library is used for UKF
- python v3.7
Project Guide
install
- install python 3
- install python packages
All of these and pykalman can be install using easy_install
easy_install numpy matplotlib scipy wheel pykalman argparse
- Download
imagemagickto generate.giffile Download site:ImageMagick-7.0.10-10-Q16-x64-dll.exeinstall
How to use
Simple Test
git clone https://github.com/fbdp1202/pyukf_kinect_body_tracking.git
cd pyukf_kinect_body_tracking
python test.py jiwon crossing_arms_30sec
Optional mode
$.../pyukf_kinect_body_tracking>python test.py -h
usage: test.py [-h] [--filter {on,off}] [--model {ukf,kf}] [--plot {on,off}]
[--num NUM] [--cbr_num CBR_NUM]
First_string Second_string
positional arguments:
First_string What is your person name?
Second_string What is your pose? "*" is all pose
optional arguments:
-h, --help show this help message and exit
--filter {on,off} Do you want to plot?
--model {ukf,kf} which type of filter?
--plot {on,off} Do you want to plot?
--num NUM How many tests do you want?
--cbr_num CBR_NUM How many calibration tests do you want?
# Adjust the number of tests
python test.py jiwon crossing_arms_30sec --num 10
# off filter mode
python test.py jiwon crossing_arms_30sec --filter off
# off plot mode
python test.py jiwon crossing_arms_30sec --plot off
# one person, all pose test
python test.py jiwon *
# choose model
# not yet implement kalman filter(kf) mode
# python test.py jiwon crossing_arms_30sec --model kf
Test UKF and generate '.csv' files
-
test_skeleton_filter(person_name, pose, test_num) -
The skeleton data folder looks like this:
./data/skeleton_data/pereson_name/pose/ -
Skeleton data form named
sk_timestamp_txtand include one person data -
save original and filtered data on
./result/person_name/pose/model_name/eachoriginal_data.csvandestimate_data.csv -
Example code
(persone_name="jiwon", pose_mode="crossing_arms_30sec", model="ukf")
test_skeleton_filter("jiwon", "crossing_arms_30sec", test_num=10, cbr_num=10, "ukf")
Display Skeleton data
-
test_skeleton_draw(person_name, pose, plot_3D) -
Load .csv filesaved above to provide3D plot,(x, y, z) point plotandjoint length plotwith pyplot. -
Folder where the
point plot imagesandjoint length plot imagesare saved is as follows:./result/person_name/pose/mode_name/eachpointandlengthfolder -
point plot:
![]()
- length plot:
![]()
- 3D plot result:
![]()
test_skeleton_draw("jiwon", "crossing_arms_30sec", "ukf")
Future Work
- Finding better
covariance valuesfor UKF - Displaying the
combined depth image and filtered data - Applying various filters such as
Kalman Filter,Tobit kalman Filter,Particle Filter... - Eliminate runtime error in UKF by applying
rSVDrather thancholesky decomposition - Linking with
real-time applications - Creating algorithms to cope with
multi-skeleton data - Automatic
skeleton data classification - Creating
various disease diagnosticapplications
LICENSE
MIT