This paper describes a fast procedure for the calibration of an ultrasound (US) probe using a 3D optical localizer. This calibration step allows us to obtain the 3D position of any point located on the 2D ultrasonic (US) image. To carry out correctly this procedure, a phantom of known geometric properties is probed and these geometries are found in the US images. A segmentation step is applied in order to obtain automatically the needed information in the US images and then, an optimization approach is performed to find the optimal calibration parameters. A new optimization method to estimate the calibration parameters for an ultrasound (US) probe is developed.