如何合并图像和强加给对方 [英] how to merge Images and impose on each other

查看:203
本文介绍了如何合并图像和强加给对方的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假如我上传一些的FrameLayout 两个或两个以上的照片。在此,我上传3图片与同一个人在三个不同的位置,在所有这三个画面。那么什么样的形象都可以做一些在Android或Java或本地的处理库,如图中的照片。

我想强加给对方多张图片。

的类似: -

一个想法是:

  1. 在做一些分层在所有这些照片和发现的图片不匹配的地区和合并。

如何能与其他合并多个图片?通过检查二相似并彼此合并?

是否有任何第三方阿比的或Photoshop的一些服务,这可以帮助我在做这些有点图像处理?

解决方案

在这种情况下,你是不是只是想给图像组合。你真的要包含在不同的位置对同一对象的场景结合起来。

因此​​,它不只是一个简单的组合或α-compositve其中在输出图像中的给定像素的颜色是该像素中的每个图像,通过图像的数量除以该值的总和。

在这种情况下,你可以这样做:

  1. 确定现场背景分析不考虑改变多个图像像素。
  2. 开始与输出图像,这正好是背景。
  3. 对于每一个图像,去除背景以获得所需的对象,并用输出图像相结合。

有一个马文插件来执行此任务,叫MergePhoto。下面使用该插件程序结合了一组跑酷的照片。

 进口marvin.image.MarvinImage;
进口marvin.io.MarvinImageIO;
进口marvin.plugin.MarvinImagePlugin;
进口marvin.util.MarvinPluginLoader;

公共类MergePhotosApp {

公共MergePhotosApp(){

    // 1.装载图像01.jpg,02.jpg,...,05.jpg成列表
    名单< MarvinImage>照片=新的ArrayList< MarvinImage>();
    的for(int i = 1; I< = 5;我++){
        images.add(MarvinImageIO.loadImage(./ RES / 0+ I +JPG));
    }

    // 2.加载插件和处理图像
    MarvinImagePlugin合并= MarvinPluginLoader.loadImagePlugin(org.marvinproject.image.combine.mergePhotos);
    merge.setAttribute(门槛,38);

    // 3.处理图像列表,并保存输出
    MarvinImage输出= images.get(0).clone();
    merge.process(图像,输出);
    MarvinImageIO.saveImage(输出./res/merge_output.jpg);
}

公共静态无效的主要(字串[] args){
    新MergePhotosApp();
}
}
 

的输入图像和输出图像如下。

Suppose I'm uploading two or more than two pics in some Framelayout. Hereby I'm uploading three pics with a same person in three different position in all those three pictures. Then what image processing libraries in Android or java or Native's are available to do something as shown in the pic.

I would like to impose multiple pictures on each other.

Something like these:-

One idea is to :

  1. Do some layering in all those pictures and find mismatching areas in the pics and merge them.

How one can merge multiple picture with other? By checking the di-similarity and merge with each other?

Are there any Third party Api's or some Photoshop service which can help me in doing these kinda image processing?

解决方案

In this case you are not just trying to combine the images. You really want to combine a scene containing the same object in different positions.

Therefore, it is not just a simple combination or an alpha compositve where the color of a given pixel in the output image is the sum of the value of this pixel in each image, divided by the number of images.

In this case, you might do:

  1. Determine the scene background analysing the pixels that do not change considering multiple images.
  2. Begin with the output image being just the background.
  3. For each image, remove the background to get the desired object and combine it with the output image.

There is a Marvin plug-in to perform this task, called MergePhoto. The program below use that plug-in to combine a set of parkour photos.

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();
}
}

The input images and the output image are shown below.

这篇关于如何合并图像和强加给对方的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆