Merge Multiple Photos of the Same Scene
This example demonstrates how to merge multiple photos of the same scene taken by a fixed camera. The idea is show multiple states of an object in motion in a single photo. It was originally published on Stack Overflow. Check out the detailed explanation: "how to merge Images and impose on each other" Input Images: package mergePhotos; import static marvin.MarvinPluginCollection.mergePhotos; import java.util.ArrayList; import java.util.List; import marvin.image.MarvinImage; import marvin.io.MarvinImageIO; public class MergePhotosApp { public MergePhotosApp(){ // 1. load images 01.jpg, 02.jpg, ..., 05.jpg into a List List<MarvinImage> images = new ArrayList<MarvinImage>(); for(int i=1; i<=5; i++){ images.add(MarvinImageIO.loadImage("./res/0"+i+".jpg")); } // 2. Process the image list and save the output MarvinImage output = images.get(0).clone(); mergePhotos(images, output, 38); MarvinImageIO.saveImage(output, "./res/merge_output.jpg"); } public static void main(String[] args) { new MergePhotosApp(); } } |
|||||||