[][src]Function opencv::core::sort

pub fn sort(
    src: &dyn ToInputArray,
    dst: &mut dyn ToOutputArray,
    flags: i32
) -> Result<()>

Sorts each row or each column of a matrix.

The function cv::sort sorts each matrix row or each matrix column in ascending or descending order. So you should pass two operation flags to get desired behaviour. If you want to sort matrix rows or columns lexicographically, you can use STL std::sort generic function with the proper comparison predicate.

Parameters

  • src: input single-channel array.
  • dst: output array of the same size and type as src.
  • flags: operation flags, a combination of #SortFlags

See also

sortIdx, randShuffle