A method is proposed that improves the robustness and accuracy of optical flow estimation in real complex scenes. The method overcomes the limitations incurred by illumination variations using a combination of the brightness constancy and gradient constancy. In addition, the method improves the reliability of optical flow estimation by applying both a bilateral filter and penalty function. Furthermore, it improves the calculations and applicability of the estimated optical flow by employing a dual algorithm and coarse-to-fine scheme. We verify the proposed method using scenes from the Middlebury optical flow database and a real complex scene. The results show that the proposed method is robust to illumination variations and improves both the accuracy of the optical flow estimation and the ability to extract target edges.