I always had this question.
I have an image e.g. 500 x 500 (in C++). I wanna rescale to an image e.g. 1000 x 1000. If I use e.g. OpenCV, it would be something like:
const auto fx = scale;
const auto fy = scale;
cv::resize(inputImage, outputImage, cv::Size(), fx, fy)
Now, the point is, what is the real value of scale? 2 or 2.002004008?
Explanation, I want the last pixel on inputImage to go the the last pixel in outputImage, right? That mean pixel 499 to go to 999, right? So then, the scale should be 999/499 = 2.002004008, or should just be 2?
I had this question for months and I still could not figure out the solution, my tests just work with basically the same accuracy either way, but I'd like to know the ideal way though.
Aucun commentaire:
Enregistrer un commentaire