Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

function in opencv that can give the minimum value of a 2d or 3d matrix along a specific dimension

Tags:

opencv

max

min

Is there a function in opencv, which can compute the minimum value of a 2d or 3d matrix along a specific dimension. And give me the index of the minimum value.

Minimizing in 1 dimension would mean, if I have a 3d matrix the result should be a 2d matrix, and if I have a 2d matrix than the result should be a 1d matrix(array) of indices where the min/max value is stored.

minMaxIdx and MinMaxLoc gives the global minimum index/value along all the dimensions.

like image 690
Farzad Avatar asked Dec 06 '25 05:12

Farzad


1 Answers

cv::reduce will give you row or column wise minimum or maximum. But I don't think it will give you the index. A "find()" function is what lacks in OpenCV.

like image 175
Silmarilli Avatar answered Dec 08 '25 03:12

Silmarilli



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!