Automatic Left Ventricular Endocardium Detection in Echocardiograms Based on Ternary Thresholding Method