This paper presents a robust, accurate and real-time model-based tracking method for markerless objects in complex environments to replace the conventional 3D tracking approach based on cooperative targets. A known 3D model of the object is projected onto a 2D plane and occlusion culling is performed with the precalibrated intrinsic parameters and initialized pose. The correspondences between a 3D object model and 2D image edges are commonly used to estimate the camera pose, so the pose optimization problem is transformed into 3D/2D model-to-image registration. For each visible model sample point, a one-dimensional search for putative image edge points is then performed along a direction perpendicular to its line by state-of-the-art methods. However, false correspondences always occur due to cluttered backgrounds or partial occlusion. To overcome this problem, a new search scheme for obtaining line correspondences instead of edge point correspondences is implemented. The outliers of 3D/2D line correspondences are then effectively detected and removed with algebraic outlier rejection, where the camera pose is iteratively optimized from correct correspondences of 3D/2D lines by minimizing the perpendicular distances from the endpoints of 3D model lines to their corresponding projection planes. The method presented in this paper has been validated on both synthetic images and real data. The experimental results show that the method is robust to strong noise, exquisite illumination changes and highly cluttered backgrounds. Meanwhile, it can easily satisfy the real time request.