Vessel enhancement is a primary preprocessing step for vessel segmentation and visualization of vasculatures. In this paper, a new vessel enhancement technique is proposed in order to produce accurate vesselness measures and vessel direction estimations that are less subject to local intensity abnormalities. The proposed method is called vessel enhancement using local line integrals and variational optimization (VE-LLI-VO). First, vessel enhancement using local line integrals (VE-LLI) is introduced in which a vessel model is embedded by regarding a vessel segment as a straight line based upon the second order information of the local line integrals. Useful quantities similar to the eigenvalues and eigenvectors of the Hessian matrix are produced. Moreover, based upon the local line integrals, junctions can be detected and handled effectively. This can help deal with the bifurcation suppression problem which exists in the Hessian-based enhancement methods. Then a more generic curve model is embedded to model vessels and a variational optimization (VO) framework is introduced to generate optimized vesselness measures. Experiments have been conducted on both synthetic images and retinal images. It is experimentally demonstrated that VE-LLI-VO produces improved performance as compared with the widely used techniques in terms of both vesselness measurement and vessel direction estimation.