How to increase warpPerspective Or warpAffine precision?
I would like to transform my images with rotation degree of 0.001 degree, and translate them with 0.0001 pixel in row or column. The problem with this library is that it cannot manage this kind of tiny transformation steps and the result is that the source and transformed images are identical with this tiny transformations!
Is there any way to increase this precision such that I could get correct and different images when I rotate them and translate them by 0.001 degree and 0.0001 pixels respectively ?
One approach is changing the interpolation mask size which is defined by "INTER_BITS" inside imgproc.hpp file and compiling opencv library from scratch, but it could only increase the precision only a little bit.
1000*cos(0.0001degree)=1000-0.0000002
translation of 0.0001 pixel
If you have a pixel with a value 256 and nearest neighbour is 0 new pixel will be 256(1-0.0001)=255.9744
Have you try with type CV_32F?
My image pixel types are CV_64F not CV_32F, consider the source image is the following: [93.0, 0.0], then translation in column with 0.1 should give me [93.0 - 9.3, 9.3], right? but it gives me the following answer: [84.28125, 8.71875]!
This is the way I create for instance one of my images:
Ok I understand your problem using this program :
results are :
You see. Then, What do you think to do as a solution for this kind of problem? and knowing that these small images are only for test, my real images are quite large.