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

Updated matchTemplate and added an example #389

Merged
merged 1 commit into from
Mar 22, 2016

Conversation

salmanulhaq
Copy link
Contributor

issue #387

@salmanulhaq
Copy link
Contributor Author

@padom checkout the example I wrote. matchTemplate now returns the following array:

  1. result: result image (normalized to 8bit single-channel showing the "peaks"
    2, 3, 4 and 5 are the ROI: roi_x, roi_y, roi_width and roi_height which is the match location. You can also draw a rectangle on the match by passing 3rd argument as true. Hope this helps

@dominikdolancic
Copy link

I saw that is returning array but I can't get him in nodejs. When I whant to show data that is returned in console.log I see just the Matrix object, not array that is returned.

@salmanulhaq
Copy link
Contributor Author

I can get it with output[1] and output[2] etc.

@dominikdolancic
Copy link

If I go to install npm module like fork or patch, over package.json, I get an error.
If I've edited Matrix.cc like you, nothing happens. This is a reason why I can't get array. Can I some how make that this works if I change Matrix.cc file?

@Feawel
Copy link

Feawel commented Mar 18, 2016

Same question here :) (and thanks for the fix !)

@salmanulhaq
Copy link
Contributor Author

@peterbraden can you kindly merge the fix?

@peterbraden
Copy link
Owner

Yep! Sorry for the delay.

peterbraden added a commit that referenced this pull request Mar 22, 2016
Updated matchTemplate and added an example
@peterbraden peterbraden merged commit 49b5f34 into peterbraden:master Mar 22, 2016
@acinader
Copy link

i don't get this one. i think that this is overloading matchTemplate too much and diverges the api of node from the underlying library. See my example in #419 (https://github.com/acinader/node-opencv/blob/40d5036627a830e508eac0ebf8f2c1579dfe3ccb/examples/match-template.js) which draws the rectangle on the match in the same way that the samples in opencv do: https://github.com/Itseez/opencv/blob/master/samples/cpp/mask_tmpl.cpp

if we want to augment node_opencv to make drawing the match, i'd suggest that we add a new method instead of overloading matchTemplate in a way that diverges?

https://github.com/Itseez/opencv/blob/904381c602043270fc864b29dd4749c9c75effbd/modules/imgproc/src/templmatch.cpp#L836

if that seems reasonable, I can try a pr that pulls the draw rectangle out into another method drawMatchTemplate ??

@flockonus
Copy link

@acinader thanks for the matchTemplate example, i wouldn't know how to make use of the function otherwise. Maybe could be merged to this project so may help others easily

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.

6 participants