Closed-circuit television (CCTV), also referred to as security cameras, plays a crucial role for both preventing and detecting crimes. However, manually monitoring CCTV footage presents significant challenges, especially when managing multiple screens. Missed incidents often occur due to human limitations such as loss of focus, boredom, distractions, and inexperience. Research has been conducted to automate the analysis of CCTV footage to detect unusual events with minimal human intervention. One example of such an unusual event is loitering, where individuals remain in a place without an apparent reason, potentially posing a public security threat. This research proposes an automated loitering detection method to address these challenges. The method focuses on abnormal trajectory patterns, which are characterized by frequent direction changes, zigzag movements, and circling objects without clear intent. The proposed system involves three main steps. First, YOLOv9 is employed to detect individuals in video fr