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 hereenter image description here

更新: 对于fred的脚本,我使用了以下命令

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

点赞
用户438117
用户438117

更像是一条评论而非答案。

  1. 看起来,扭曲参数只设置了视场值(100),但是未设置中心 X 和 Y 值。

  2. Plane2Cylinder 只是所需扭曲的一半。主题(杯子)不是一个完美的圆柱体,因此需要应用额外的轻微扭曲(可能是透视扭曲),以匹配所需的倾斜度。

2017-04-13 13:11:02