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

imgproc: fix MORPH_HITMISS operation when kernel has no negative values #9048

Merged
merged 1 commit into from
Jul 14, 2017

Conversation

sovrasov
Copy link
Contributor

@sovrasov sovrasov commented Jun 30, 2017

resolves #8957

@sovrasov sovrasov added this to the 3.3-rc milestone Jun 30, 2017
@alalek
Copy link
Member

alalek commented Jun 30, 2017

@sovrasov Did you take a look on OpenCL and IPP backends about this case?

/cc @eyaler dan-masek Please take a look on this patch.

@sovrasov
Copy link
Contributor Author

IPP backend is disabled, HITMISS operation is not implemented in OpenCL function.

@mshabunin mshabunin modified the milestones: 3.3, 3.3-rc Jun 30, 2017
@eyaler
Copy link

eyaler commented Jul 1, 2017

@alalek as i wrote in the issue, i know think that for the cases where countNonZero<=0 we should take an all on pattern instead or src/~src. the idea is that if the kernel is all zeros we dont care and should short circuit the and operator.

@sovrasov
Copy link
Contributor Author

sovrasov commented Jul 3, 2017

@eyaler do you mean that if countNonZero(k1) == 0 && countNonZero(k2) == 0 we should assign dst=src?

@eyaler
Copy link

eyaler commented Jul 4, 2017

@sovrasov my c++ is rusty but in python we should do
dst = np.ones_like(src)*255
the idea is that if the kernel is all zeros we do not care and we want to pass through the AND condition

@sovrasov
Copy link
Contributor Author

sovrasov commented Jul 4, 2017

Ok, I see. In this case the algorithm will do src.copyTo(dst) without making &.

@alalek
Copy link
Member

alalek commented Jul 14, 2017

👍

@alalek alalek merged commit 63e89bc into opencv:master Jul 14, 2017
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.

MORPH_HITMISS with all zero kernels
4 participants