The blur due to the rapidly relative motion between scene and camera during exposure has the well-known influence on the quality of acquired image and then target detection. An improved coded exposure is introduced in this paper to remove the image blur and obtain high quality image, so that the test accuracy of the surface defect and edge contour of motion objects can be enhanced. The improved exposure method takes advantage of code look-up table to control exposure process and image restoration. The restored images have higher Peak Signal-to-Noise Ratio (PSNR) and Structure SIMilarity (SSIM) than traditional deblur algorithm such as Wiener and regularization filter methods. The edge contour and defect of part samples, which move at constant speed relative to the industry camera used in our experiment, are detected with Sobel operator from the restored images. Experimental results verify that the improved coded exposure is better suitable for imaging moving object and detecting moving target than the traditional.