Line following robots requires image acquisition and processing algorithms for the determination of the line trajectory. The Viterbi algorithm is proposed for the estimation of the line trajectory in this paper. The robustness of this algorithm is verified using the Monte Carlo approach for two distortions types: additive Gaussian noise and false lines sets. The results show possibilities of reliable estimation, even if the real line is hidden in the noise, without the application of additional estimators based on the previous measurements.