# An Image-Based Fall Detection System for the Elderly
## 4 Methodology
### Person Positioning and Posture Recognition  
Algorithm 3 shows the steps of person positioning. For each person in the frame, we pair the person and the chair nearest to the person by computing the distance between the person and the chair. If the horizontal distance \(D_{x}\) from \(P\) to \(C\) is less than or equal to twice the width of the person's bounding box and the vertical distance \(D_{y}\) from \(P\) to \(C\) is less than or equal to half the height of the chair's bounding box, we consider that the person is near the chair. Otherwise, we consider that the person is far from the chair. Figure 2 shows the flow of the state when the person is far from the chair. If the person is far from the chair, IFADS detects falls while they are walking. In addition, if \(D_{x}\) is less than or equal to half the width of the person's bounding box, we consider that the person is beside the chair. Otherwise, we consider that the person is near the chair. When the person is beside the chair, since the elderly usually fall when they try to sit down on, or stand up from, a chair, IFADS executes posture recognition. Algorithm 4 shows the steps of the posture recognition pre-progress. When we execute posture recognition, we need the latest height of the person \(P_{i}^{N}\) when the person is near the chair. The height is  
Figure 2: The flow of the state when the person is far from the chair. the most objective height, since the person and the chair are on the same horizontal plane, instead of subject to the effect of the angle of the camera or the distance from the camera. ```
Input: \(P_{i,fid}S_{i,fid}\), \(fid\) Output: \(P_{i}^{N}\)
1. for\(fid^{N}=fid\) to 0 do
2. if \((S_{i,fid^{N}}=\) Near the chair) then
3. \(P_{i}^{N}\gets P_{i,fid^{N}}\)
4. return \(P_{i}^{N}\)
5. end for
```  
**Algorithm 4** Posture recognition pre-progress  
Algorithm 5 shows the steps of posture recognition (between in progress and beside the chair). First, we execute posture recognition pre-progress to obtain the bounding box of person \(P_{i}^{N}\) when the person is near the chair. If the state of the person in the latest frame \(S_{i,fid-1}\) is beside the chair, then IFADS detects the posture of the person by comparing the height of \(P_{i}^{N}\) and \(P_{i}\). We adopt the idea of some specialists that the body height equals eight heads [34]. Since a person bending his/her leg is almost 7.5/8 times the height of the person, if the height of the person's bounding box in the current frame \(P_{i}\) is less than or equal to 7.5/8 times the height of the person's bounding box \(P_{i}^{N}\), we consider that the person is not standing completely. Conversely, if the state of the person in the latest frame \(S_{i,fid-1}\) is in progress, and if the height of the person's bounding box in the current frame is more than 7.5/8 times the height of the person's bounding box \(P_{i}^{N}\), then we consider that the person is standing completely. Figure 3 shows the flow of the state when the person is near or beside the chair. Figure 3: The flow of the state when the person is near or beside the chair. Algorithm 6 shows the steps of posture recognition (in progress, sitting, and in danger). First, we execute posture recognition pre-progress to obtain the bounding box of person \(P_{i}^{N}\) when the person is near the chair. If the state of the person in the latest frame \(S_{i,fid-1}\) is in progress, sitting, or in danger, we recognize the posture of the person. Since, when a person is sitting, the top of the person should be higher than the top of the chair, if the top of the person is lower than the top of the chair, we consider that the person is in danger and execute fall detection. Conversely, if the top of the person is higher than the top of the chair, since the center of \(C_{n}\) is the center of the faceplate of the chair, if the center of \(C_{n}\) is in \(P_{i}\), it means that the person is in the process of sitting down on or standing up from the chair.