Smart line detection and histogram-based approach to robust freehand ultrasound calibration