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 mask parameter to matrix.matchTemplate #419

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

acinader
Copy link

@acinader acinader commented Jun 18, 2016

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.

@acinader acinader force-pushed the add-mask-to-match-template branch from 25b4a7c to c217489 Compare June 18, 2016 16:14
@acinader acinader mentioned this pull request Jun 18, 2016
@@ -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"]);
Copy link

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

@acinader
Copy link
Author

@pkallos, is that less ambiguous? Glad to take out too....

@acinader
Copy link
Author

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.

@pkallos
Copy link

pkallos commented Jun 20, 2016

One solution is to follow my suggestion in #403 and partially revert #389, basically revert everything except for the cv::imread(filename, -1);

v8::String::Utf8Value args2(info[2]->ToString());
std::string maskFilename = std::string(*args2);
cv::Mat mask;
mask = cv::imread(maskFilename, CV_8S);
Copy link
Author

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.
@acinader acinader force-pushed the add-mask-to-match-template branch from 40d5036 to f920053 Compare June 23, 2016 22:01
@peterbraden
Copy link
Owner

I merged #428 which I think partially addresses this, but I'm not sure what the best api looks like for this, and I haven't used any of these functions. Also interested in #403 - what do you all think an api should look like?

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