Common image segmentation methods only consider the single image and cannot extract welded components automatically and exactly. GrabCut algorithm need draw a rectangle which labels possible foreground region and determines general location to segment desired object. In this paper, a novel automatic GrabCut algorithm is proposed for segmenting Printed Circuit Board (PCB) welding component under stereo optical microscope. The proposed method considers the characteristic of welded component on the foreground region of PCB and uses unparallel stereo microscopic image to obtain foreground mask of disparity map. To obtain parallel stereo microscopic image, Quasi-Euclidean epipolar rectification algorithm is utilized into original unparallel stereo microscopic image. Then, disparity map is obtained by using the non-local filter algorithm on parallel stereo microscopic image, and foreground mask of disparity map is extracted by applying the mean-threshold method. Finally, rectified microscopic image is segmented by initializing GrabCut’s trimap T with foreground mask of disparity map. The experimental results show that the proposed method can extract PCB welding component automatically and accurately without user intervention and is much better than adaptive binary method.