Abstract:In the virtual advertisement system, we use several simple and effective algorithm to solve the field detection problem in the sport video. Firstly, through a method based on color space histogram, we automatically detect the main area venues. Secondly, through Top-hat transform and the improved otsu algorithm to detect area edge. Finally, the Hough line detection and the least squares fitting method of combining accurate detection of all lines. Through A large number of experiments show that this method has a good effect on badminton field, tennis field and table tennis field. The results can be used for camera calibration and venues reconstruction.