Given a set of photos of the same scene, this plug-in merges them in order to create the effect presented below.



Example:
package mergePhotos; 

import java.util.ArrayList; 
import java.util.List; 

import marvin.image.MarvinImage; 
import marvin.io.MarvinImageIO; 
import marvin.plugin.MarvinImagePlugin; 
import marvin.util.MarvinPluginLoader; 

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. Load plug-in and process the image 
        MarvinImagePlugin merge = MarvinPluginLoader.loadImagePlugin("org.marvinproject.image.combine.mergePhotos"); 
        merge.setAttribute("threshold", 38); 
         
        // 3. Process the image list and save the output 
        MarvinImage output = images.get(0).clone(); 
        merge.process(images, output); 
        MarvinImageIO.saveImage(output, "./res/merge_output.jpg"); 
    } 
     
    public static void main(String[] args) {
        new MergePhotosApp(); 
    } 
}
Input Attributes:

threshold:Integer - the difference of value between two pixels to be considered different.



Author: Gabriel Ambrósio Archanjo