A non-transitory computer-readable storage medium storing computer program codes for executing a method of generating a panorama image, when the non-transitory computer-readable storage medium is read and the computer program codes executed by a processor, the method comprising:
- storing a plurality of captured images;
- detecting motion of a target object from the plurality of captured images and obtaining motion information as a result of the detecting;
- determining a plurality of selection images from the plurality of captured images, based on the motion information about the target object;
- setting a plurality of composition areas in the plurality of selection images, based on a user input;
- and
- generating a panorama image, based on images included in the plurality of composition areas.