Skip to content

Updated opencv.js emscripten bindings for matching - #13701

Closed
ramezrafla wants to merge 1 commit into
opencv:masterfrom
ramezrafla:master
Closed

ramezrafla wants to merge 1 commit into
opencv:masterfrom
ramezrafla:master

Conversation

@ramezrafla

@ramezrafla ramezrafla commented Jan 28, 2019 •

Copy link
Copy Markdown
Contributor

This PR is necessary for opencv.js to implement the C to JS bindings for Emscripten needed for advanced pattern matching.

In the docs:

https://docs.opencv.org/3.4.5/db/d39/classcv_1_1DescriptorMatcher.html#a378f35c9b1a5dfa4022839a45cdf0e89

knnMatch needs input matches of type std::vector< std::vector< DMatch > > &
match needs input matches of type std::vector< DMatch > &

We have tested the matching functions with the code below and it worked as expected (new constructor cv.DMatchVectorVector):

  var orb = new cv.ORB();

  var kp1 = new cv.KeyPointVector();
  var des1 = new cv.Mat();
  orb.detectAndCompute(patternImg, new cv.Mat(), kp1, des1);

  var kp2 = new cv.KeyPointVector();
  var des2 = new cv.Mat();
  orb.detectAndCompute(fullImg, new cv.Mat(), kp2, des2);

  var matches = new cv.DMatchVectorVector();
  var bf = new cv.BFMatcher(cv.NORM_HAMMING2, false)
  var mask = new cv.Mat();
  bf.knnMatch(des1, des2, matches, 3, mask, false)

@alalek @huningxin

docker_image:Docs=docs-js
force_builders=linux,Docs,Custom
buildworker:Custom=linux-1,linux-2,linux-4
docker_image:Custom=javascript

…ectors of vectors (used by match and knnmatch)
@ramezrafla

Copy link
Copy Markdown
Contributor Author

@dkurt

dkurt commented Jan 28, 2019

Copy link
Copy Markdown
Member

partially intersects with #12855

@ramezrafla

Copy link
Copy Markdown
Contributor Author

If your PR is more likely to be merged given its maturity, please add Vectors of Vectors of DMatch (to support knnMatch) and we can close this PR

@dkurt

dkurt commented Jan 28, 2019 •

Copy link
Copy Markdown
Member

@ramezrafla, My PR is about testing. Let's better merge your PR first then I can rebase mine.

The only thing I ask you is to change base branch of your PR from master to 3.4 Then we'll port it to master.

@ramezrafla

Copy link
Copy Markdown
Contributor Author

Closing in favor of PR against branch 3.4 -- #13710

@ramezrafla ramezrafla closed this Jan 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants