Is there a options in Plane2Cylinder distort of imageMagick to make a Image like bellow?

有些话、适合烂在心里 提交于 2019-12-11 06:26:47

问题


When I used Plane2Cylinder distortion I got Image like below. But I want the effect like second image. Please go through my code.

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

UPDATE: for fred's script I used below command

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

Below is my modified image.


回答1:


More of a comment than an answer.

  1. Looks like the distortion arguments only has field-of-view value set (100), but is missing the center X & Y values.

  2. Plane2Cylinder is only half of the distortion needed. The subject (mug) is not a perfect cylinder, so an additional slight-distortion (perhaps Perspective) will need to be applied to match the suffice pitch.



来源:https://stackoverflow.com/questions/43390624/is-there-a-options-in-plane2cylinder-distort-of-imagemagick-to-make-a-image-like

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!