{"action":"created","comment":{"url":"https://api.github.com/repos/Itseez/opencv/pulls/comments/29568855","id":29568855,"diff_hunk":"@@ -0,0 +1,89 @@\n+#include <opencv2/opencv.hpp>\n+#include <vector>\n+#include <iostream>\n+\n+using namespace std;\n+using namespace cv;\n+\n+\n+int main(void)\n+{\n+    vector<String> typeAlgoMatch;\n+    typeAlgoMatch.push_back(\"BruteForce\");\n+    typeAlgoMatch.push_back(\"BruteForce-Hamming\");\n+    typeAlgoMatch.push_back(\"BruteForce-Hamming(2)\");\n+\n+    vector<String> typeDesc;\n+    typeDesc.push_back(\"AKAZE\");\n+    typeDesc.push_back(\"ORB\");\n+    typeDesc.push_back(\"BRISK\");\n+\n+    String  dataFolder(\"../data/\");\n+    vector<String> fileName;\n+    fileName.push_back(\"basketball1.png\");\n+    fileName.push_back(\"basketball2.png\");\n+\n+    Mat img1 = imread(dataFolder+fileName[0], IMREAD_GRAYSCALE);\n+    Mat img2 = imread(dataFolder+fileName[1], IMREAD_GRAYSCALE);\n+\n+    Ptr<Feature2D> b;\n+\n+    vector<String>::iterator itDesc;\n+// Descriptor loop\n+    for (itDesc = typeDesc.begin(); itDesc != typeDesc.end(); itDesc++){\n+        Ptr<DescriptorMatcher> descriptorMatcher;\n+        vector<DMatch> matches;\t        /*<! Match between img and img2*/\n+        vector<KeyPoint> keyImg1;\t\t/*<! keypoint  for img1 */\n+        vector<KeyPoint> keyImg2;\t\t/*<! keypoint  for img2 */\n+        Mat descImg1, descImg2;         /*<! Descriptor for img1 and img2 */\n+        vector<String>::iterator itMatcher = typeAlgoMatch.end();\n+        if (*itDesc == \"AKAZE\"){\n+            b = AKAZE::create();\n+        }\n+        if (*itDesc == \"ORB\"){\n+            b = ORB::create();\n+        }\n+        else if (*itDesc == \"BRISK\"){\n+            b = BRISK::create();\n+        }\n+        try {\n+            b->detect(img1, keyImg1, Mat());\n+            b->compute(img1, keyImg1, descImg1);\n+            b->detectAndCompute(img2, Mat(),keyImg2, descImg2,false);\n+ // Match method loop\n+             for (itMatcher = typeAlgoMatch.begin(); itMatcher != typeAlgoMatch.end(); itMatcher++){\n+                descriptorMatcher = DescriptorMatcher::create(*itMatcher);\n+                descriptorMatcher->match(descImg1, descImg2, matches, Mat());\n+ // Keep best matches only to have a nice drawing\n+                Mat index;\n+                int nbMatch=int(matches.size());\n+                Mat tab(nbMatch, 1, CV_32F);\n+                for (int i = 0; i<nbMatch; i++)\n+                    tab.at<float>(i, 0) = matches[i].distance;","path":"samples/cpp/matchmethod_orb_akaze_brisk.cpp","position":62,"original_position":62,"commit_id":"9ddb8bdb8bf4c593d34647ff9f49be4e5a6abd04","original_commit_id":"9ddb8bdb8bf4c593d34647ff9f49be4e5a6abd04","user":{"login":"StevenPuttemans","id":4621239,"avatar_url":"https://avatars.githubusercontent.com/u/4621239?v=3","gravatar_id":"","url":"https://api.github.com/users/StevenPuttemans","html_url":"https://github.com/StevenPuttemans","followers_url":"https://api.github.com/users/StevenPuttemans/followers","following_url":"https://api.github.com/users/StevenPuttemans/following{/other_user}","gists_url":"https://api.github.com/users/StevenPuttemans/gists{/gist_id}","starred_url":"https://api.github.com/users/StevenPuttemans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StevenPuttemans/subscriptions","organizations_url":"https://api.github.com/users/StevenPuttemans/orgs","repos_url":"https://api.github.com/users/StevenPuttemans/repos","events_url":"https://api.github.com/users/StevenPuttemans/events{/privacy}","received_events_url":"https://api.github.com/users/StevenPuttemans/received_events","type":"User","site_admin":false},"body":"It seems useless, but I prefer to add brackets even with a single execution command. For new users it is quite confusing to not find these brackets.","created_at":"2015-05-04T07:10:39Z","updated_at":"2015-05-04T07:10:39Z","html_url":"https://github.com/Itseez/opencv/pull/3984#discussion_r29568855","pull_request_url":"https://api.github.com/repos/Itseez/opencv/pulls/3984","_links":{"self":{"href":"https://api.github.com/repos/Itseez/opencv/pulls/comments/29568855"},"html":{"href":"https://github.com/Itseez/opencv/pull/3984#discussion_r29568855"},"pull_request":{"href":"https://api.github.com/repos/Itseez/opencv/pulls/3984"}}},"pull_request":{"url":"https://api.github.com/repos/Itseez/opencv/pulls/3984","id":34598862,"html_url":"https://github.com/Itseez/opencv/pull/3984","diff_url":"https://github.com/Itseez/opencv/pull/3984.diff","patch_url":"https://github.com/Itseez/opencv/pull/3984.patch","issue_url":"https://api.github.com/repos/Itseez/opencv/issues/3984","number":3984,"state":"open","locked":false,"title":"A sample program  : how to use ORB AKAZE BRISK descriptors for matching.","user":{"login":"LaurentBerger","id":3591626,"avatar_url":"https://avatars.githubusercontent.com/u/3591626?v=3","gravatar_id":"","url":"https://api.github.com/users/LaurentBerger","html_url":"https://github.com/LaurentBerger","followers_url":"https://api.github.com/users/LaurentBerger/followers","following_url":"https://api.github.com/users/LaurentBerger/following{/other_user}","gists_url":"https://api.github.com/users/LaurentBerger/gists{/gist_id}","starred_url":"https://api.github.com/users/LaurentBerger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LaurentBerger/subscriptions","organizations_url":"https://api.github.com/users/LaurentBerger/orgs","repos_url":"https://api.github.com/users/LaurentBerger/repos","events_url":"https://api.github.com/users/LaurentBerger/events{/privacy}","received_events_url":"https://api.github.com/users/LaurentBerger/received_events","type":"User","site_admin":false},"body":"see http://answers.opencv.org/question/61062/features2d-example/","created_at":"2015-05-03T09:48:11Z","updated_at":"2015-05-04T07:10:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bfd201d94fa1100dbb826aace38d5b9acd72278e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Itseez/opencv/pulls/3984/commits","review_comments_url":"https://api.github.com/repos/Itseez/opencv/pulls/3984/comments","review_comment_url":"https://api.github.com/repos/Itseez/opencv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Itseez/opencv/issues/3984/comments","statuses_url":"https://api.github.com/repos/Itseez/opencv/statuses/9ddb8bdb8bf4c593d34647ff9f49be4e5a6abd04","head":{"label":"LaurentBerger:ExampleCppORB","ref":"ExampleCppORB","sha":"9ddb8bdb8bf4c593d34647ff9f49be4e5a6abd04","user":{"login":"LaurentBerger","id":3591626,"avatar_url":"https://avatars.githubusercontent.com/u/3591626?v=3","gravatar_id":"","url":"https://api.github.com/users/LaurentBerger","html_url":"https://github.com/LaurentBerger","followers_url":"https://api.github.com/users/LaurentBerger/followers","following_url":"https://api.github.com/users/LaurentBerger/following{/other_user}","gists_url":"https://api.github.com/users/LaurentBerger/gists{/gist_id}","starred_url":"https://api.github.com/users/LaurentBerger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LaurentBerger/subscriptions","organizations_url":"https://api.github.com/users/LaurentBerger/orgs","repos_url":"https://api.github.com/users/LaurentBerger/repos","events_url":"https://api.github.com/users/LaurentBerger/events{/privacy}","received_events_url":"https://api.github.com/users/LaurentBerger/received_events","type":"User","site_admin":false},"repo":{"id":34456835,"name":"opencv","full_name":"LaurentBerger/opencv","owner":{"login":"LaurentBerger","id":3591626,"avatar_url":"https://avatars.githubusercontent.com/u/3591626?v=3","gravatar_id":"","url":"https://api.github.com/users/LaurentBerger","html_url":"https://github.com/LaurentBerger","followers_url":"https://api.github.com/users/LaurentBerger/followers","following_url":"https://api.github.com/users/LaurentBerger/following{/other_user}","gists_url":"https://api.github.com/users/LaurentBerger/gists{/gist_id}","starred_url":"https://api.github.com/users/LaurentBerger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LaurentBerger/subscriptions","organizations_url":"https://api.github.com/users/LaurentBerger/orgs","repos_url":"https://api.github.com/users/LaurentBerger/repos","events_url":"https://api.github.com/users/LaurentBerger/events{/privacy}","received_events_url":"https://api.github.com/users/LaurentBerger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/LaurentBerger/opencv","description":"Open Source Computer Vision Library","fork":true,"url":"https://api.github.com/repos/LaurentBerger/opencv","forks_url":"https://api.github.com/repos/LaurentBerger/opencv/forks","keys_url":"https://api.github.com/repos/LaurentBerger/opencv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LaurentBerger/opencv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LaurentBerger/opencv/teams","hooks_url":"https://api.github.com/repos/LaurentBerger/opencv/hooks","issue_events_url":"https://api.github.com/repos/LaurentBerger/opencv/issues/events{/number}","events_url":"https://api.github.com/repos/LaurentBerger/opencv/events","assignees_url":"https://api.github.com/repos/LaurentBerger/opencv/assignees{/user}","branches_url":"https://api.github.com/repos/LaurentBerger/opencv/branches{/branch}","tags_url":"https://api.github.com/repos/LaurentBerger/opencv/tags","blobs_url":"https://api.github.com/repos/LaurentBerger/opencv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LaurentBerger/opencv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LaurentBerger/opencv/git/refs{/sha}","trees_url":"https://api.github.com/repos/LaurentBerger/opencv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LaurentBerger/opencv/statuses/{sha}","languages_url":"https://api.github.com/repos/LaurentBerger/opencv/languages","stargazers_url":"https://api.github.com/repos/LaurentBerger/opencv/stargazers","contributors_url":"https://api.github.com/repos/LaurentBerger/opencv/contributors","subscribers_url":"https://api.github.com/repos/LaurentBerger/opencv/subscribers","subscription_url":"https://api.github.com/repos/LaurentBerger/opencv/subscription","commits_url":"https://api.github.com/repos/LaurentBerger/opencv/commits{/sha}","git_commits_url":"https://api.github.com/repos/LaurentBerger/opencv/git/commits{/sha}","comments_url":"https://api.github.com/repos/LaurentBerger/opencv/comments{/number}","issue_comment_url":"https://api.github.com/repos/LaurentBerger/opencv/issues/comments{/number}","contents_url":"https://api.github.com/repos/LaurentBerger/opencv/contents/{+path}","compare_url":"https://api.github.com/repos/LaurentBerger/opencv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LaurentBerger/opencv/merges","archive_url":"https://api.github.com/repos/LaurentBerger/opencv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LaurentBerger/opencv/downloads","issues_url":"https://api.github.com/repos/LaurentBerger/opencv/issues{/number}","pulls_url":"https://api.github.com/repos/LaurentBerger/opencv/pulls{/number}","milestones_url":"https://api.github.com/repos/LaurentBerger/opencv/milestones{/number}","notifications_url":"https://api.github.com/repos/LaurentBerger/opencv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LaurentBerger/opencv/labels{/name}","releases_url":"https://api.github.com/repos/LaurentBerger/opencv/releases{/id}","created_at":"2015-04-23T13:09:08Z","updated_at":"2015-04-23T13:09:20Z","pushed_at":"2015-05-03T12:09:20Z","git_url":"git://github.com/LaurentBerger/opencv.git","ssh_url":"git@github.com:LaurentBerger/opencv.git","clone_url":"https://github.com/LaurentBerger/opencv.git","svn_url":"https://github.com/LaurentBerger/opencv","homepage":"opencv.org","size":440322,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Itseez:master","ref":"master","sha":"e01b485ac65c72ae5fdf4631fb18cb3d4c3ce910","user":{"login":"Itseez","id":1786446,"avatar_url":"https://avatars.githubusercontent.com/u/1786446?v=3","gravatar_id":"","url":"https://api.github.com/users/Itseez","html_url":"https://github.com/Itseez","followers_url":"https://api.github.com/users/Itseez/followers","following_url":"https://api.github.com/users/Itseez/following{/other_user}","gists_url":"https://api.github.com/users/Itseez/gists{/gist_id}","starred_url":"https://api.github.com/users/Itseez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Itseez/subscriptions","organizations_url":"https://api.github.com/users/Itseez/orgs","repos_url":"https://api.github.com/users/Itseez/repos","events_url":"https://api.github.com/users/Itseez/events{/privacy}","received_events_url":"https://api.github.com/users/Itseez/received_events","type":"Organization","site_admin":false},"repo":{"id":5108051,"name":"opencv","full_name":"Itseez/opencv","owner":{"login":"Itseez","id":1786446,"avatar_url":"https://avatars.githubusercontent.com/u/1786446?v=3","gravatar_id":"","url":"https://api.github.com/users/Itseez","html_url":"https://github.com/Itseez","followers_url":"https://api.github.com/users/Itseez/followers","following_url":"https://api.github.com/users/Itseez/following{/other_user}","gists_url":"https://api.github.com/users/Itseez/gists{/gist_id}","starred_url":"https://api.github.com/users/Itseez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Itseez/subscriptions","organizations_url":"https://api.github.com/users/Itseez/orgs","repos_url":"https://api.github.com/users/Itseez/repos","events_url":"https://api.github.com/users/Itseez/events{/privacy}","received_events_url":"https://api.github.com/users/Itseez/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Itseez/opencv","description":"Open Source Computer Vision Library","fork":false,"url":"https://api.github.com/repos/Itseez/opencv","forks_url":"https://api.github.com/repos/Itseez/opencv/forks","keys_url":"https://api.github.com/repos/Itseez/opencv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Itseez/opencv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Itseez/opencv/teams","hooks_url":"https://api.github.com/repos/Itseez/opencv/hooks","issue_events_url":"https://api.github.com/repos/Itseez/opencv/issues/events{/number}","events_url":"https://api.github.com/repos/Itseez/opencv/events","assignees_url":"https://api.github.com/repos/Itseez/opencv/assignees{/user}","branches_url":"https://api.github.com/repos/Itseez/opencv/branches{/branch}","tags_url":"https://api.github.com/repos/Itseez/opencv/tags","blobs_url":"https://api.github.com/repos/Itseez/opencv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Itseez/opencv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Itseez/opencv/git/refs{/sha}","trees_url":"https://api.github.com/repos/Itseez/opencv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Itseez/opencv/statuses/{sha}","languages_url":"https://api.github.com/repos/Itseez/opencv/languages","stargazers_url":"https://api.github.com/repos/Itseez/opencv/stargazers","contributors_url":"https://api.github.com/repos/Itseez/opencv/contributors","subscribers_url":"https://api.github.com/repos/Itseez/opencv/subscribers","subscription_url":"https://api.github.com/repos/Itseez/opencv/subscription","commits_url":"https://api.github.com/repos/Itseez/opencv/commits{/sha}","git_commits_url":"https://api.github.com/repos/Itseez/opencv/git/commits{/sha}","comments_url":"https://api.github.com/repos/Itseez/opencv/comments{/number}","issue_comment_url":"https://api.github.com/repos/Itseez/opencv/issues/comments{/number}","contents_url":"https://api.github.com/repos/Itseez/opencv/contents/{+path}","compare_url":"https://api.github.com/repos/Itseez/opencv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Itseez/opencv/merges","archive_url":"https://api.github.com/repos/Itseez/opencv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Itseez/opencv/downloads","issues_url":"https://api.github.com/repos/Itseez/opencv/issues{/number}","pulls_url":"https://api.github.com/repos/Itseez/opencv/pulls{/number}","milestones_url":"https://api.github.com/repos/Itseez/opencv/milestones{/number}","notifications_url":"https://api.github.com/repos/Itseez/opencv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Itseez/opencv/labels{/name}","releases_url":"https://api.github.com/repos/Itseez/opencv/releases{/id}","created_at":"2012-07-19T09:40:17Z","updated_at":"2015-05-04T05:26:58Z","pushed_at":"2015-05-04T07:03:07Z","git_url":"git://github.com/Itseez/opencv.git","ssh_url":"git@github.com:Itseez/opencv.git","clone_url":"https://github.com/Itseez/opencv.git","svn_url":"https://github.com/Itseez/opencv","homepage":"opencv.org","size":1103669,"stargazers_count":5236,"watchers_count":5236,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4797,"mirror_url":null,"open_issues_count":30,"forks":4797,"open_issues":30,"watchers":5236,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Itseez/opencv/pulls/3984"},"html":{"href":"https://github.com/Itseez/opencv/pull/3984"},"issue":{"href":"https://api.github.com/repos/Itseez/opencv/issues/3984"},"comments":{"href":"https://api.github.com/repos/Itseez/opencv/issues/3984/comments"},"review_comments":{"href":"https://api.github.com/repos/Itseez/opencv/pulls/3984/comments"},"review_comment":{"href":"https://api.github.com/repos/Itseez/opencv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Itseez/opencv/pulls/3984/commits"},"statuses":{"href":"https://api.github.com/repos/Itseez/opencv/statuses/9ddb8bdb8bf4c593d34647ff9f49be4e5a6abd04"}}}}