Closed chronicom closed 6 months ago
Nice spot on the typo! Besides the name of the return type, it also seems that an array should be returned with mat.dims elements. This array should always contain at least two elements as per the OpenCV spec:
When minIdx is not NULL, it must have at least 2 elements (as well as maxIdx), even if src is a single-row or single-column matrix. In OpenCV (following MATLAB) each array has at least 2 dimensions, i.e. single-column matrix is Mx1 matrix (and therefore minIdx/maxIdx will be (i1,0)/(i2,0)) and single-row matrix is 1xN matrix (and therefore minIdx/maxIdx will be (0,j1)/(0,j2)).
Released as part of 0.36 so now closing. Thank you!
The problem seems to me a typo in the code.
In stead of returning
I guess it should be returning
Moreover, the opencv version of MinMaxIdx returns the indexs in the form of an array of size corresponding to the dimension of the input mat. Here the index is simply a scalar. Does it mean it is a linearized version of the nd-index?