gocv icon indicating copy to clipboard operation
gocv copied to clipboard

Correct MinMaxIdx function minIdx and maxIdx

Open HIGHER98 opened this issue 4 months ago • 1 comments

Addresses issue #1151

This PR looks into changing return type of minIdx and maxIdx in the MinMaxIdx function to be an []int rather than int, i.e.

func MinMaxIdx(input Mat) (minVal, maxVal float32, minIdx, maxIdx []int) {
  ...
}

The return arrays will have input.dims elements.


Example:

	src := NewMatWithSize(10, 10, MatTypeCV32FC1)
	defer src.Close()
	src.SetFloatAt(3, 3, 17)
	src.SetFloatAt(4, 4, 16)

	minVal, maxVal, minIdx, maxIdx := MinMaxIdx(src)

In the above code snippet, minVal will be 0, maxVal will be 17, minIdx will be [0,0], maxIdx will be [3,3]

HIGHER98 avatar Feb 27 '24 16:02 HIGHER98

The Appveyor tests appear to be failing for this PR, and I'm unsure why... :confused:

The tests seem to be failing on something which I'm pretty sure should be unaffected by changes introduced here. Also, the most recent builds on Appveyor seem to be taking >30 minutes. I can see about a month ago, most builds were compiling in ~3 minutes. I suspect this is something cache-based and possibly has something to do with what's going awry. Any help would be appreciated!

Tests are failing here

=== RUN   TestOnnxMemory
Exception 0xc0000005 0x0 0x0 0x64728886
PC=0x64728886
runtime: unknown pc 0x64728886

HIGHER98 avatar Mar 08 '24 22:03 HIGHER98