This paper proposes a new target locating algorithm for detecting the weld pattern from a digital photograph and thus providing the approximate location of the weld for robotic end effector to perform various operations like cleaning, grinding etc. This reduces the human intervention and improves the quality of the work. Implementing this algorithm reduces computational complexities and can be easily adapted to the generally available automation system. In the present work, camera captures the image and MATLAB image processing toolbox is used to perform auto segmentation. The output of this algorithm is the approximate position coordinates of the weld strip. Algorithm is found effective for rough terrained weld image strips where normal edge detection and enhancing techniques fail usually.