This paper presents a new algorithm for object detection using a stereo camera system, which is applicable for machine vision applications. The propose algorithm has four stages which the first stage is matching cost computation. This step acquires the preliminary result using a pixel based differences method. Then, the second stage known as aggregation step uses a guided filter with fixed window support size. This filter is efficiently reduce the noise and increase the edge properties. After that, the optimization stage uses winner-takes-all (WTA) approach which selects the smallest matching differences value and normalized it to the disparity level. The last stage in the framework uses a bilateral filter, which is effectively further reduce the remaining noise on the disparity map. This map is two-dimensional mapping of the final result which contains information of object detection and locations. Based on the standard benchmarking stereo dataset, the proposed work produces good results and performs much better compared with some recently published methods.