Skip to main content
. 2020 Feb 15;20(4):1056. doi: 10.3390/s20041056
Algorithm 2. Computing the Position of Occluded People via Shadows
Input:a represents which side of the user their shadow is located in, hf is the position of the head
 joint of Hf in the RGB image, R is the search region, C is the binary image obtained by
 background subtraction.
Output: The position pb of Hb.
 1: S (stores points on the upper contour of Hb)
 2: if a = 0 then
 3:   i1 = 0, i2 = hf.x − dx/2
 4: else
 5:   i1 = hf.x + dx/2, i2 = W
 6: for each i = i1 to i2 do
 7:   for each j = H to 0 do
 8:     if C(i, j) = 1 then
 9:       Add the point R(i, j) to S;
 10:      Break;
 11: Use the least squares method to fit the points in S to a line, and map it onto the plane G, designated as st;
 12: Compute the intersection point of st and o1pf, marked as pb;
 13: Return position pb of Hb