-
Notifications
You must be signed in to change notification settings - Fork 857
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 mask parameter to matrix.matchTemplate #419
base: master
Are you sure you want to change the base?
Conversation
25b4a7c
to
c217489
Compare
@@ -2200,7 +2200,7 @@ NAN_METHOD(Matrix::TemplateMatches) { | |||
|
|||
// @author ytham | |||
// Match Template filter | |||
// Usage: output = input.matchTemplate("templateFileString", method); | |||
// Usage: output = input.matchTemplate("templateFileString", ["method"], ["maskPath"]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you mean the []
notation to mean 'optional'? But it's confusing in javascript because it looks like you mean Array
@pkallos, is that less ambiguous? Glad to take out too.... |
I now also see that this conflicts (not irresolvably :)) with #389 So i need some direction on how to integrate that mask functionality. You can see my suggestion in #389 (comment) I'd like to help out and get the match with a mask into the main line. |
v8::String::Utf8Value args2(info[2]->ToString()); | ||
std::string maskFilename = std::string(*args2); | ||
cv::Mat mask; | ||
mask = cv::imread(maskFilename, CV_8S); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be -1 instead of CV_8S??
add examples for matchTemplate with and without mask.
40d5036
to
f920053
Compare
Add examples for matchTemplate with and without mask.
Due to #381 I forked this off of v5.0.0 commit 5fb426a which is why it has conflicts.
I'm glad to rebase it when #381 is resolved and head can do a templateMatch without an assert fail.
In matrix.cpp, I don't check if the opencv version can handle the mask (>= 3.1 it think?). I poked around a little to see if this is done anywhere, but didn't see. Let me know if its important and I can poke around some more to find an example.