The increasing popularity of computers has advanced the progress and applicability of computer vision technology. This thesis adopts computer vision technology to detect people falling out of bed. Since looking after a person 24 hours a day is difficult, whether in a hospital or at home, the proposed system can offer a safe environment. An incident of falling out of bed causes the system to send out an alarm to the person responsible for looking after the patient, whether they are nursing staff or a relative, by cell phone. This thesis uses a webcam video to do background subtraction and image processing and human behavior analysis to identify incidents of patients falling out of bed. The webcam is erected in an appropriate place in a hospital, so that the system can notify users in real time when falling occurs, thus increasing the opportunity for timely rescue, and reducing the possibility of injury. The proposed system is simpler than previous systems. It has fast processing, high detection and examination rates, and high efficiency. An experiment it performed by enacting various motions, including standing, squatting, sitting down, lying down and postures leading to falling. Experimental results demonstrate that the proposed system performs well, and effectively monitors patients.