(row, column) or (column, row) ?
See original GitHub issueI am new to this, so this question may sound dumb.
As far as what I know, here are some different notations for a point (1, 100)
0/0---column--->
| --------------**.** (1,100)
|
row
|
|
v
(matrix)
0/0---X--->
|
|
Y
|
| **.** (1,100)
v
(opencv and plt)
So if I use my custom dataset, I believe I should go with the matrix one and do “xmin, ymin, xmas, ymax”, since all the internal operations are on matrices.
But in keras-retinanet/examples/ResNet50RetinaNet - COCO 2017.ipynb, I see
cv2.rectangle(draw, (b[0], b[1]), (b[2], b[3]), ...
for both detections and annotations.
Aren’t those inverted (should be (b[1], b[0]), (b[3], b[2])?), or is there anything I missed?
Thanks in advance.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Columns vs rows: What's the difference? - TheServerSide.com
The key difference between columns and rows is that a column arranges data vertically from top to bottom, while a row arranges data...
Read more >Is it "rows by columns" or "columns by rows"? - Cross Validated
"That depends." Rows are usually considered observations, and columns are variables. So I would say widgets by color level in your context.
Read more >Describing Matrices (Rows and Columns)
The basics of a matrix. Looking at rows, columns, elements and dimension. A matrix is a rectangular arrangement composed of row, columns and...
Read more >Row vs Column – Difference Between Them - Guru99
A row is a series of data put out horizontally in a table or spreadsheet, while a column is a vertical series of...
Read more >Row- and column-major order - Wikipedia
In computing, row-major order and column-major order are methods for storing multidimensional arrays in linear storage such as random access memory.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah that’s right. All image coordinates and boxes follow the
(xmin, ymin, xmax, ymax)
.I see what you did there 😉
Anyway, for numpy matrices you’re right that the first coordinate is the row index. In an image however, we say that the X axis points to the right and the Y axis points down. I’ve never seen a different convention. This doesn’t match with each other, but opencv deals with the difference internally.
Long story short: when specifying an opencv point or rectangle, you should use image coordinates, not matrix indices.