We present a vision system design for landing an unmanned aerial vehicle on a ship's flight deck autonomously. The edge information from the international landing target is used to perform line segment detection, feature point mapping and clustering. Then a cascade filtering scheme is applied for target recognition. Meanwhile, the 4DoF pose of the vehicle with respect to the target is estimated. The vision system has been implemented on the Asctec Pelican quadrotor in conjunction with a state estimator to perform real-time target recognition and tracking. An onboard controller is designed to close the control loop. Experiments show that the vision system is accurate, robust, and capable of dealing with an incomplete landing target, whilst the overall implementation shows the practicability of real-time onboard target tracking and closed-loop control.