From 084c640db62673a0aaf7c0fb77beb2eb78de83e2 Mon Sep 17 00:00:00 2001 From: Ilya Lysenkov Date: Tue, 7 Jun 2011 11:43:09 +0000 Subject: [PATCH] Asked users to pass two operation flags tothe sort() function (ticket #315) --- modules/core/doc/operations_on_arrays.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/core/doc/operations_on_arrays.rst b/modules/core/doc/operations_on_arrays.rst index 0161ec1b10..ca081644f7 100644 --- a/modules/core/doc/operations_on_arrays.rst +++ b/modules/core/doc/operations_on_arrays.rst @@ -3026,7 +3026,7 @@ sort * **CV_SORT_DESCENDING** Each matrix row is sorted in the descending order. This flag and the previous one are also mutually exclusive. -The function ``sort`` sorts each matrix row or each matrix column in ascending or descending order. If you want to sort matrix rows or columns lexicographically, you can use STL ``std::sort`` generic function with the proper comparison predicate. +The function ``sort`` sorts each matrix row or each matrix column in ascending or descending order. So you should pass two operation flags to get desirable behaviour. If you want to sort matrix rows or columns lexicographically, you can use STL ``std::sort`` generic function with the proper comparison predicate. See Also: :func:`sortIdx`, @@ -3057,7 +3057,7 @@ sortIdx * **CV_SORT_DESCENDING** Each matrix row is sorted in the descending order. This flag and the previous one are also mutually exclusive. -The function ``sortIdx`` sorts each matrix row or each matrix column in the ascending or descending order. Instead of reordering the elements themselves, it stores the indices of sorted elements in the destination array. For example: :: +The function ``sortIdx`` sorts each matrix row or each matrix column in the ascending or descending order. So you should pass two operation flags to get desirable behaviour. Instead of reordering the elements themselves, it stores the indices of sorted elements in the destination array. For example: :: Mat A = Mat::eye(3,3,CV_32F), B; sortIdx(A, B, CV_SORT_EVERY_ROW + CV_SORT_ASCENDING);