I am trying to sort elements of 1D mat in descending order. Code seems to work fine in python (openCV) but does not work in C++. In C++, I get zero values as output
My code:
> cv::Mat temp = cvCreateMat(5,
> 1,CV_32F); temp.setTo(10);
> temp.at<float>(2, 0) = 20;
> temp.at<float>(4, 0) = 40; cv::Mat
> ind; cv::sortIdx(temp, ind,
> CV_SORT_DESCENDING);
My output index array turns out to be zero which is strange ... I tried a lot but don't know what's going on