Skip to content

Fix the problem that the non-maximum suppression return position is 0#999

Open
Hexert wants to merge 12 commits intohybridgroup:releasefrom
Hexert:release
Open

Fix the problem that the non-maximum suppression return position is 0#999
Hexert wants to merge 12 commits intohybridgroup:releasefrom
Hexert:release

Conversation

@Hexert
Copy link

@Hexert Hexert commented Jul 5, 2022

No description provided.

@Hexert
Copy link
Author

Hexert commented Jul 5, 2022

image

For the same target, when the length of boxes and indices is 2, after the NMSBoxes method, the length of the returned indices is also 2, and the values in the indices are all 0. At this time, one of the boxes cannot be removed, and the appropriate target detection is retained. frame, so return the length of indicesVector to extract a suitable target detection frame

@deadprogram
Copy link
Member

Hello @Hexert thanks for looking into this.

Seems to me the correct solution is to set the size/values of the slice returned with indices, that way a developer does not have to "guess" the resulting size.

For example:

...
indices = make([]int, indicesVector.length)
for i := 0; i < int(indicesVector.length); i++ {
		indices[i] = int(ptr[i])
}
return

Generally speaking we almost never add another param to a function signature that does not exist in the OpenCV function itself.

The same solution would also be needed for NMSBoxesWithParams().

Also, the branch for PRs is normally against dev. See https://github.com/hybridgroup/gocv/blob/release/CONTRIBUTING.md for details.

@Hexert Hexert closed this Oct 30, 2022
@Hexert Hexert reopened this Oct 30, 2022
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.

2 participants