Coordinate Orientation #1640
-
Hey guys, Possibly a silly questions but been peaking through the github and paper but can't find anything on the (0,0) orientation point relative to the image. Searching online it seems to be varying as well. I assumed bottom left corner of the video is the orientation, making the video be represented in the 1st quadrant of a cartesian graph, where increases in Y coords are up and x to the right, but ChatGPT seems to think you guys and computer vision often does form the top left corner, or the 4th quadrant of a cartesian graph, where increases in Y go down with increases in X goes right. Thanks for all the help!
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @jramborger78, Good question! We assume that the center of the pixel is the integer coordinate, with the edges being a half-pixel off. There's some info on that in the docstring for a relevant function in our data generation pipeline: sleap/sleap/nn/data/instance_cropping.py Lines 124 to 157 in 2d24296 So the center of the of top-left pixel of the image is at Note that, as you pointed out, image coordinates are a little different than standard cartesian coordinates in that the origin Let us know if you have any questions! Talmo |
Beta Was this translation helpful? Give feedback.
-
Oh interesting, i see. So a 800x600 image would have (0,600) in the bottom left corner and the center of the image would be (400,300), and say if there was a node in the top right portion of the image itd be something like (700,200).
```
(0,0)———————————(800,0)
| |
| |
| |
| |
| |
| |
(600,0)——————————(800,600)
```
Sincerely,
Jarryd Ramborger
(951) 541-3922
On Dec 15, 2023, at 12:11 PM, Talmo Pereira ***@***.***> wrote:
Hi @jramborger78,
Good question! We assume that the center of the pixel is the integer coordinate, with the edges being a half-pixel off. There's some info on that in the docstring for a relevant function in our data generation pipeline:
https://github.com/talmolab/sleap/blob/2d24296c2149402c7ee07601e4d0272fdd308441/sleap/nn/data/instance_cropping.py#L124-L157
So the center of the of top-left pixel of the image is at (0, 0) while the top-left corner of that same top-left pixel is at (-0.5, -0.5). Here's a diagram:
image.png (view on web)
Note that, as you pointed out, image coordinates are a little different than standard cartesian coordinates in that the origin (0, 0) is close to the top-left, and it increases in the y-coordinate as you move vertically down.
Let us know if you have any questions!
Talmo
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Hi @jramborger78,
Good question! We assume that the center of the pixel is the integer coordinate, with the edges being a half-pixel off. There's some info on that in the docstring for a relevant function in our data generation pipeline:
sleap/sleap/nn/data/instance_cropping.py
Lines 124 to 157 in 2d24296