To solve the problem of imaging ambiguity when there is random sway of ship target in inverse synthetic aperture radar (ISAR) application, a method for selecting optimal imaging time based on estimation of the Doppler centroid frequencies (DCF) and image contrast is proposed. This method calculates Doppler center from real echoes of ship target, then chooses optimal imaging time according to the change of Doppler center. After that, a definition of image contrast is given to help dealing with selecting optimal imaging time. In comparison with existing methods, the proposed one can select better period for ISAR imaging which leads to an imaging result with higher quality. The method is easy to implement and computational complexity is lower, which is suitable for realtime applications. The effectiveness of the proposed method is verified by the simulation data processing result.