A video-based traffic flow detection system requires calibration of cameras to generate accurate estimates of vehicle speed. Traditional manual calibration methods cannot satisfy this requirement because calibration has complex procedures. A new traffic camera calibration method is proposed, which exploits reference images and roadway information. The proposed method requires only two parallel lane markings with a known width and a line perpendicular to the lane markings. Camera parameters, including focal length, tilt angle, pan angle, and camera height, can be recovered. A method based on reference images is further proposed to calculate ill-conditioned camera parameters, in which reference images are acquired by a rotating camera while keeping focal length unchanged. Camera recalibration can be easily realized through reference images and roadway information when cameras are moved manually. Simulation experiments demonstrate that the proposed method has the advantages of simple operation and accurate parameter estimations. The method also requires no manual operations and saves manpower.