Image 从图像中提取零件

Image 从图像中提取零件,image,imagemagick,image-manipulation,perlmagick,Image,Imagemagick,Image Manipulation,Perlmagick,我想从图像中提取小矩形,然后将小矩形转换/滚动为圆柱体。不需要动画。我只想把圆柱体作为图像 我使用的API为 任何帮助/建议都将不胜感激。假设您知道要提取的矩形的x、y坐标和几何图形 use Image::Magick; ... my $image = Image::Magick->new(); my $x = $image->Read($filename); die "$x" if "$x"; # 100x100 is the size of the cropped im

我想从图像中提取小矩形,然后将小矩形转换/滚动为圆柱体。不需要动画。我只想把圆柱体作为图像

我使用的API为


任何帮助/建议都将不胜感激。

假设您知道要提取的矩形的x、y坐标和几何图形

use Image::Magick;
...
my $image = Image::Magick->new();
my $x = $image->Read($filename);
    die "$x" if "$x";

# 100x100 is the size of the cropped image, the +40+40 are giving the x and y
# offsets (i.e. the upper-left coordinate of the cropped image)  
$image->Crop(geometry=>"100x100+40+40"); 
你必须更具体地描述气缸,但如果是我认为的,那就检查一下。给出的示例是ImageMagick命令行参数,因此需要做一些工作才能将其转换为与perl等效的参数(或者可以使用perl的exec()函数调用它们)