This paper proposes a vision-based collision avoidance system for unmanned aerial vehicles (UAVs). A method to detect and avoid approaching objects is necessary for UAVs since they are inherently vulnerable to external impacts. To resolve common issues with motion detection on a moving platform, computer vision algorithms such as optical flow and homography transform are utilized. The robustness of these algorithms is improved by employing characteristics of differential images. The proposed method is implemented in a camera-equipped onboard computer and then mounted onto a UAV as a collision avoidance system. It performs evasive maneuvers to avoid various objects thrown in its flight path, demonstrating its functionality and robustness.