Computer-aided alignment method in afocal compressed optical path system