colRange - wrong indices (Bug #1272)
Description
The method
Mat Mat::colRange(int startcol, int endcol) const;
works with "endcol" 1-based instead of 0-based as in documentation.
Please verify rowcol function too.
Associated revisions
added "inclusive" & "exclusive" adjectives to startrow, endrow, startcol, endcol parameter descriptions (ticket #1272)
Merge pull request #1272 from kamjagin:fixingQTKitPublic2.4
History
Updated by Vadim Pisarevsky over 13 years ago
endcol is not included into the range, that is,
matrix.colRange(col1, col2) will include col1, col1+1, col1+2, ..., col2-2 and col2-1, but not col2. This is pointed out in the reference manual.
- Status changed from Open to Done
- (deleted custom field) set to invalid
Updated by Walter Lucetti over 13 years ago
Sorry Vadim to be tedious, but online documentation (2.3 itseez) is ambiguous:
Mat::rowRange
Creates a matrix header for the specified row span.
C++: MatMat::rowRange(int startrow,int endrow) const
C++: MatMat::rowRange(const Range& r) const
Parameters:
startrow –A 0-based start index of the row span.
endrow –A 0-based ending index of the row span.
r –Range structure containing both the start and the end indices.
The method makes a new header for the specified row span of the matrix. Similarly toMat::row() andMat::col() ,this is an O(1) operation.
Mat::colRange
Creates a matrix header for the specified row span.
C++: MatMat::colRange(int startcol,int endcol) const
C++: MatMat::colRange(const Range& r) const
Parameters:
startcol –A 0-based start index of the column span.
endcol –A 0-based ending index of the column span.
r –Range structure containing both the start and the end indices.
The method makes a new header for the specified column span of the matrix. Similarly toMat::row() andMat::col() ,this is an O(1) operation.
Updated by Vadim Pisarevsky over 13 years ago
sorry. my apologies. Indeed, somehow descriptions of these functions lack this information. I added it, and it should be available at opencv.itseez.com/trunk.
Updated by Vadim Pisarevsky over 13 years ago
I meant, it should be updated within a day
Updated by Walter Lucetti over 13 years ago
Thank you.
Walter