Hough transform is an effective way in object recognition and applied to many industrial processes. Based on the principle of Hough transform, a new algorithm which can detect objects through an affine transform was proposed in this paper. First, application of Hough transform to extract straight lines in a model image and a scene image, got these coordinates of the lines, sorted according to the direction angle. Because of affine transform and the periodic direction angle, the direction order of the lines on scene image were different from those on the model image, these lines on scene image were expanse a cycle. Finally affine transform parameters were applied to objects detection. The results showed the effectiveness of the algorithm.