What's wrong with scaling?
Hello.
I'm trying to scale an image into 4x4 pixels by this code:
Mat image4x4;
vector<int> compression_params;
compression_params.push_back(CV_IMWRITE_PNG_COMPRESSION);
compression_params.push_back(9);
resize(imageFromFile, image4x4, Size(4,4), INTER_CUBIC);
imwrite("/Users/macuser/Desktop/4x4/"+names.at(i), image4x4, compression_params);
The result is this:
but if I do it with GIMP (in 'cubic' as well), the result is:
I don't know what factor I'm not considering when scaling... do you have any clue?
Thank you very much. Regards.
There can be several reasons
I would start by comparing implementations, that will shed light on the result. Also, could you give the original 4 pixels from which you start your analysis?
Hi @StevenPuttemans, thanks for your reply.
Okay your image is still unclear to me. WHAT region are you expendaning?
The whole image.
O now I get it, you are parsing a complete image in 16 pixels? O_O why would you need that :P
hahahaha :) I need it for a game
Well, you are comparing the resize algorithm of two different softwares.. there is no clue as to which one is working better.
What I'd do now would be to resize the image sequentially by a reasonable ratio (first 1/2, then 1/4 and so on) and compare results in both softwares. This might help you understand better what is going on.