Skip to main content
. 2021 Jan 20;21(3):704. doi: 10.3390/s21030704
Algorithm A1 Streamed data processing
1. Input: F, Dfloor, Doffset, Dbed
2. Output: Pbed zone, Pleave zone, Pboundary
3. F = Extract Kinect depth streamed data
4. Convert F to grey scale image
5. Determine Dfloor and Dbed by reading Kinect sensor
6. Dsleep = Dbed − Doffset
7. Repeat                          // Setup loop
8.        B = Extract one frame from Kinect depth streaming to background buffer
9. Until no motion in 5 seconds period time
10. Repeat                         // Main loop
11.               Bbpm = UWB-IR sensor reading
12.               Resultant frame F = F − B
13.               Pdepth = count the pixels with value
14.               Pbed zone = count the pixels with value above Dsleep in bed region from F’
15.               Pleave zone = count the pixels with value above Dfloor in leave zone from F’
16.               Pboundary = count the pixels with value above Dfloor in boundary from F’
17.               Pdepth = Pabove sleep + Pleave zone + Pboundary zone
18.               Call (Algorithm A2)
19.               Pdepth = Pdepth
20.               P’bed zone = Pbed zone
21.               P’leave zone = Pleave zone
22.               P’boundary = Pboundary
23. Until break