Linux 2.6.25.14-108.fc9.x86_64 #1 SMP x86_64
(same results with convert on Microsoft Windows XP SP2, official binary of ImageMagick 6.4.4 2008-10-05 Q16)
I have a series of images I am applying a barrel distortion to as a correction. To speed things up, I found the coefficients for a crop of the image--the only part I need--using PanoCoef, then tried to use:
Code: Select all
convert image.jpg -gravity Center -crop "800x600+0+0" -distort Barrel "-0.004817967 -0.010172833 -0.028159933 1.043146167" corrected-image.jpg
Code: Select all
const double distortParams[] = {-0.004817967, -0.010172833, -0.028159933, 1.043146167};
image.read("image.jpg");
image.crop(Magick::Geometry(800,600,239,211));
image.distort(Magick::BarrelDistortion,4,distortParams);
image.display();
Code: Select all
convert image.jpg -gravity Center -crop "800x600+0+0" - | convert - -distort Barrel "-0.004817967 -0.010172833 -0.028159933 1.043146167" corrected-image.jpg
Code: Select all
const double distortParams[] = {-0.004817967, -0.010172833, -0.028159933, 1.043146167};
image.read("image.jpg");
image.chop(Magick::Geometry(239,211));
image.crop(Magick::Geometry(800,600));
image.distort(Magick::BarrelDistortion,4,distortParams);
image.display();
Patrick