2017-04-13 48 views
1

当我使用Plane2Cylinder失真时,我得到如下图像。但我想要像第二个图像的效果。请通过我的代码。在ImageMagick的Plane2Cylinder变形中是否有一个选项可以使图像像波纹管一样?

local nelem = 1 -- number of args 
local arg = ffi.new("const double[?]", nelem, {100}) 
-- local methos = ffi.new("const int", 15) 
return handle_result(self, lib.MagickDistortImage(self.wand,13, nelem, arg, 1)) 

ffi.cdef([[ typedef void MagickWand; 
typedef void PixelWand; 
MagickBooleanType MagickDistortImage(MagickWand *wand, DistortMethod method, const size_t, const double *args, const MagickBooleanType bestfit); 

enter image description here enter image description here

UPDATE: 对弗雷德的剧本我用下面的命令

bash -x ./cylinderize.sh -m vertical -r 366.34955984688 -l 188.179 -w 16.6667 -p 23.428692808745 -n 96.097053534591 -e 1.75 -a 0 -v background -b none -f none -o -86-80.8315 single_color.png single_color.j.png 

下面是我修改后的图像。

enter image description here

回答

0

以上回答的评论。

  1. 看起来像失真参数仅具有字段的视图值集合(100),但缺少中心X & Y值。

  2. Plane2Cylinder只是所需失真的一半。主体(马克杯)不是一个完美的圆柱体,因此需要应用一个额外的轻微扭曲(可能是透视图)来匹配足够的螺距。

+0

其实我只对那个黑色标识应用了变形,然后放在了马克杯上。第二张图片是弗雷德剧本的结果。抱歉,我不完全理解它,但我想知道是否有可能使用Plane2Cylinder失真获得第二张图像的结果? – Rahul

+0

您是否可以使用用于实现Fred脚本+源图像结果的参数来更新问题?可能会帮助 – emcconville

+0

我更新了我的问题。 – Rahul

相关问题