Magick++ resize 2 image to get the same size!
Posted: 2008-07-18T05:25:37-07:00
Hi I want to compare two image with MeanErrorPerPixel function. But it requires that the two images have the same size.
I 've written a code that enables resizing but i've noticed that when i change the width the height also changes and vice versa. So i'm not able to resize to the same size.
Original sizes:
one:148-155
two:211-171
After resize:
one:115-120
two:145-120
Expected result:( not done )
one:148-155
two:148-155
I really need this to work, thanks in advance
I 've written a code that enables resizing but i've noticed that when i change the width the height also changes and vice versa. So i'm not able to resize to the same size.
Code: Select all
// I'm resizing the images to the smaller one
Image one=v_image[0];
Image two=v_image[1];
if(one.size().width()>two.size().width()){
Geometry scale(two.size().width(),one.size().height());
one.resize(scale);
}
else{
Geometry scale(one.size().width(),two.size().height());
two.resize(scale);
}
if(one.size().height()>two.size().height()){
Geometry scale(one.size().width(),two.size().height());
one.resize(scale);
}
else{
Geometry scale(two.size().width(),one.size().height());
two.resize(scale);
}
one:148-155
two:211-171
After resize:
one:115-120
two:145-120
Expected result:( not done )
one:148-155
two:148-155
I really need this to work, thanks in advance