本文介绍了是否有用于在Java(或处理)中变形图像的库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在计划编写将图像变形为特定形状的软件(基于在不同图像中定义相似区域的点和矢量,以及计算平均形状)。

I'm planning on writing software that morphs images to a certain shape (based on points and vectors that define similar regions in different images, and the calculation of an "average" shape).

显然这很困难,因此我正在寻找一个可以处理图像变形的库(所以我可以专注于GUI,并为库提供必要的坐标)。

Obviously this is pretty difficult, and therefore I'm looking for a library that can handle the morphing of images (so I can focus on the GUI, and feeding the necessary coordinates to the library).

为了澄清,我想做的一个例子是:

To clarify, an example of what I want to do is:


  • 加载图片(例如,图像1和图2)

  • 在图像中定义相似的点(例如,图像1和2中的鼻尖,坐标(1,5)和(1,7) ))

  • 计算点的平均坐标(这样就是(1,6))

  • 将每个图像上的变形定义为相同的坐标(将所有鼻子变形为(1,6))

  • 保存图像

  • Load images (say, image 1 and 2)
  • Define similar points in images (say, the tip of a nose in image 1 and 2, on coordinates (1,5) and (1,7))
  • Calculate the average coordinates for the points (so that would be (1,6))
  • Morph defined points on each image to the same coordinate (so morph all noses to (1,6))
  • Save images

当然,实际的用例会更复杂(而不是单一的协调我还想变形线条和其他形状(向量),但原则会保持不变。

Now of course the actual use case would be a lot more complex (instead of singular coordinates I would also like to morph lines and other shapes (vectors), but the principle would remain sort of the same.

推荐答案

还没有尝试过,但你应该可以使用并使用它的功能

Haven't tried it myself yet, but you should be able to use a Java wrapper for ImageMagick and use it's Shepard's distortion functionality

这篇关于是否有用于在Java(或处理)中变形图像的库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 16:55