-
-
Notifications
You must be signed in to change notification settings - Fork 55.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Absent documentation for sub-pixel coordinate system #10130
Comments
It depends on concrete implementation of algorithm. I suggest to start digging from |
Alright, so you are saying that there is no "global library convention" for pixel coordinates beyond integer indexing? Then documentation for Or are you saying that different backends of that function can assign different meaning to where point |
If you mean OpenCL, IPP, OpenVX backends then answer is no - they must use the same meaning of pixel points as original C++ implementation.
Usually you can see selected pixel coordinate symbols via provided formulas (in case of OpenCV there is sometimes lack of details in documentation, but there is open source code and tests).
|
Thank you for the links, unfortunately they too seem to lack the definition of where exactly I have established experimentally that https://gist.github.com/Kirill888/0861c2508d41766a0145682e330ff8f5 |
BTW, There is another experiment with resize: #9096 |
Also warpAffine uses (-0.5,-0.5)-(0.5,0.5) as coordinates for the area and the missing documentation leads to errors (including OpenCV code) #11784. It is not intuitive, it's different than natural area coordinates used for vector/shape object for example. |
#22288 is good example for where this can lead to hard to detect and debug problems. |
@Kirill888 Thank you for opening this very fundamental topic. For
Does this mean this library's implicit specification of the alignment of (0, 0) pixel differs from function to function? |
Can please anybody update about this issue? thank you very much |
System information (version)
Detailed description
There are a number of methods in OpenCV that accept or generate pixel coordinates as floating point numbers,
remap
is one of those methods I am using. I googled for a while trying to find out whether this method places centre of the top-left pixel at0,0
or at0.5,0.5
, some conflicting information came up:http://answers.opencv.org/question/87923/sub-pixel-coordinate-origin/
http://answers.opencv.org/question/35111/origin-pixel-in-the-image-coordinate-system-in-opencv/
It seems that the correct answer is
0,0
is the centre of the top left pixel, judging by this commit:e646f9d
There should be a place somewhere in the documentation where the pixel coordinate system is properly defined, not just for the integer case. One paragraph stating what the coordinates of the centre and the four corners of the top left pixel are would suffice.
The text was updated successfully, but these errors were encountered: