1. An automatic optical inspection system comprising: a rotary device for driving an object to rotate; at least one line-scan camera for generating two-dimensional planar images of cylindrical surfaces of the object; means for detecting defects of the two-dimensional planar images of the cylindrical surfaces of the object according to a normalized grayscale absolute difference inspection method and generating a defect determination signal; and a recess inspection device cooperating with an infrared LED backlight plate to capture and inspect images of the object.