This paper address the problem of detecting visual objects in images which is a fundamental problem in computer vision. We proposed a method based on matching a sample of object with all sub-windows in the testing images to solve this problem instead of training a classifier to determine the location of visual objects. Local histogram of gradient(LHOG) feature are extracted from the sample image and testing images respectively to describe patterns in the images. Integral image technique are employed to accelerate the process of calculating LHOG feature. Then, we apply PCA to reduce the dimensionality of LHOG feature. Distance between sample image and sub-windows are measured by using cosine angle. Adaptive strategy is used to distinguish the object sub-window from non-object sub-window.