While visualizing three dimensional (3D) structure of the coronary arteries, the projectory X-ray images can produce 3D tree of them up to a certain accuracy level with a lower dose of radiation when compared to computer tomography (CT). Here, in this study a novel and complete automatic system is designed which covers preprocessing, segmentation, matching and reconstruction steps for that purpose. First an automatic and novel pattern recognition technique is applied for the extraction of the bifurcation points with their diameters recorded in a map. Then, a novel optimization algorithm is run for matching the branches based on that map and the epipolar geometry of stereopsis. Finally, cut branches are fixed one by one at the bifurcations for completing the 3D reconstruction. The method favors the similar ones in the literature with this novelty since it inherently prevents the wrong overlapping of branches. Other essential problems like correct detection of bifurcation, detection of the true calibration parameters and fast overlapping of matched branches are addressed at acceptable levels. The precision of bifurcation extraction is high at 97% with 96% sensitivity. Accuracy of the vessel centerlines has root-mean-square (rms) error smaller than 0.5 mm for 10 different patients. For phantom model, rms error is 0.75 +/- 0.8 mm in 3D localization.