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

Add TestDivideWithStream, TestMultiplyWithStream and Fix NewTemplateMatching, TestTemplateMatching_Match #1167

Merged
merged 4 commits into from
Apr 2, 2024

Conversation

dwchoo
Copy link
Contributor

@dwchoo dwchoo commented Apr 2, 2024

Add TestDivideWithStream and TestMultiplyWithStream

The cuda/arithm_test.go file was missing test code for two functions, so we added them.

Fix NewTemplateMatching and TestTemplateMatching_Match

Invalid arguments in the NewTemplateMatching function and an error in the TestTemplateMatching_Match code in cuda/imgproc.go

NewTemplateMatching

// Original code
func NewTemplateMatching(srcType int, method gocv.TemplateMatchMode) TemplateMatching {
	return TemplateMatching{p: unsafe.Pointer(C.TemplateMatching_Create(C.int(srcType), C.int(method)))}
}

We change srcType int -> srcType gocv.MatType

// Edit code
func NewTemplateMatching(srcType gocv.MatType, method gocv.TemplateMatchMode) TemplateMatching {
	return TemplateMatching{p: unsafe.Pointer(C.TemplateMatching_Create(C.int(srcType), C.int(method)))}
}

TestTemplateMatching_Match

We believe that the TestMatchTemplateMatching_Match Test code is designed incorrectly, and we have modified it by referring to the TestMatchTemplate in the imgproc_test.go file.
The error in the test code is now gone, and you shouldn't see FAIL.

@dwchoo dwchoo changed the title Add TestDivideWithStream and TestMultiplyWithStream, Fix NewTemplateMatching and TestTemplateMatching_Match Add TestDivideWithStrea, TestMultiplyWithStream and Fix NewTemplateMatching, TestTemplateMatching_Match Apr 2, 2024
@dwchoo dwchoo changed the title Add TestDivideWithStrea, TestMultiplyWithStream and Fix NewTemplateMatching, TestTemplateMatching_Match Add TestDivideWithStream, TestMultiplyWithStream and Fix NewTemplateMatching, TestTemplateMatching_Match Apr 2, 2024
@geon0430
Copy link
Contributor

geon0430 commented Apr 2, 2024

This picture shows fail as a test result before modification.
스크린샷 2024-04-02 오후 5 20 19

This picture is the code that shows the test code result pass after modification.
스크린샷 2024-04-02 오후 5 21 43

@deadprogram
Copy link
Member

Thank you very much for this fix @dwchoo now merging.

@deadprogram deadprogram merged commit ef6abd1 into hybridgroup:dev Apr 2, 2024
2 checks passed
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.

3 participants