colRange - wrong indices (Bug #1272)


Added by Walter Lucetti over 13 years ago. Updated over 13 years ago.


Status:Done Start date:
Priority:Low Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:core
Target version:-
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

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

Revision c8378fa4
Added by Vadim Pisarevsky over 13 years ago

added "inclusive" & "exclusive" adjectives to startrow, endrow, startcol, endcol parameter descriptions (ticket #1272)

Revision 7b95bb20
Added by Roman Donchenko over 11 years ago

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

Also available in: Atom PDF