Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct MinMaxIdx function minIdx and maxIdx #1153

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

HIGHER98
Copy link

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]

…rather than int. The return arrays will have input.dims elements. Adding test to confirm function is working with nD case.
…rather than int. The return arrays will have input.dims elements. Adding test to confirm function is working with nD case.
…rrors were occuring before because of a non-zero'd mat being created. Malloc'ing space for min and max index in MinMaxIdx rather than making array and passing in address to [0] index.
@HIGHER98
Copy link
Author

HIGHER98 commented Mar 8, 2024

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant