{"action":"created","comment":{"url":"https://api.github.com/repos/RoboJackets/roboracing-software/pulls/comments/141908994","pull_request_review_id":66199836,"id":141908994,"diff_hunk":"@@ -0,0 +1,67 @@\n+#include \"start_detector.h\"\n+#include <pluginlib/class_list_macros.h>\n+\n+using namespace std;\n+using namespace ros;\n+using namespace cv;\n+\n+namespace avc {\n+    const Scalar red_low{0, 0, 100};\n+    const Scalar red_high{100, 100, 255};\n+\n+    void start_detector::ImageCB(const sensor_msgs::ImageConstPtr &msg) {\n+        cv_bridge::CvImageConstPtr cv_ptr;\n+\n+        try {\n+            cv_ptr = cv_bridge::toCvShare(msg, \"bgr8\");\n+        } catch (cv_bridge::Exception &e) {\n+            ROS_ERROR(\"CV-Bridge error: %s\", e.what());\n+            return;\n+        }\n+        \n+        const Mat &frameBGR = cv_ptr->image;\n+        Mat blurredImage;\n+        GaussianBlur(frameBGR, blurredImage, Size{7, 7}, 3);\n+        Mat redMask = Mat::zeros(blurredImage.rows, blurredImage.cols, CV_8U);\n+        inRange(blurredImage, red_low, red_high, redMask);\n+        Mat redImage;\n+        bitwise_and(blurredImage, blurredImage, redImage, redMask);\n+        Mat gray;\n+        cvtColor(redImage, gray, CV_BGR2GRAY);\n+        vector<Vec3f> circles;\n+        HoughCircles(gray, circles, CV_HOUGH_GRADIENT, 1, 150, 10, 25, 50, 150);\n+        if (circles.size() != 0) {\n+            int maxSum = 0, maxX = 0, maxY = 0, maxR = 0;\n+            for (size_t i = 0; i < circles.size(); i++) {\n+                Point center(cvRound(circles[i][0]), cvRound(circles[i][1]));\n+                Mat circleMask = Mat::zeros(gray.rows, gray.cols, CV_8U);\n+                circle(circleMask, center, circles[i][2], Scalar(255, 255, 255), -1); \n+                Mat circleImage;\n+                bitwise_and(redImage, redImage, circleImage, circleMask);\n+                int imgSum = sum(circleImage)[0];\n+                if (imgSum > maxSum) {\n+                    maxSum = imgSum;\n+                }\n+            }\n+\n+            if (maxSum > 100) {","path":"avc/src/start_detector/start_detector.cpp","position":47,"original_position":47,"commit_id":"63e1dbd19c1bac3fb2b7f2ae386e22adaf5f9291","original_commit_id":"63e1dbd19c1bac3fb2b7f2ae386e22adaf5f9291","user":{"login":"barulicm","id":1761749,"avatar_url":"https://avatars3.githubusercontent.com/u/1761749?v=4","gravatar_id":"","url":"https://api.github.com/users/barulicm","html_url":"https://github.com/barulicm","followers_url":"https://api.github.com/users/barulicm/followers","following_url":"https://api.github.com/users/barulicm/following{/other_user}","gists_url":"https://api.github.com/users/barulicm/gists{/gist_id}","starred_url":"https://api.github.com/users/barulicm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barulicm/subscriptions","organizations_url":"https://api.github.com/users/barulicm/orgs","repos_url":"https://api.github.com/users/barulicm/repos","events_url":"https://api.github.com/users/barulicm/events{/privacy}","received_events_url":"https://api.github.com/users/barulicm/received_events","type":"User","site_admin":false},"body":"We may want to actually detect the transition from red to green. \r\nThinking about things like \"what if someone walks in front of the sign?\" and similar situations.\r\nThis might just be a thing we note for future work.","created_at":"2017-09-29T16:18:53Z","updated_at":"2017-09-29T16:24:28Z","html_url":"https://github.com/RoboJackets/roboracing-software/pull/96#discussion_r141908994","pull_request_url":"https://api.github.com/repos/RoboJackets/roboracing-software/pulls/96","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/RoboJackets/roboracing-software/pulls/comments/141908994"},"html":{"href":"https://github.com/RoboJackets/roboracing-software/pull/96#discussion_r141908994"},"pull_request":{"href":"https://api.github.com/repos/RoboJackets/roboracing-software/pulls/96"}}},"pull_request":{"url":"https://api.github.com/repos/RoboJackets/roboracing-software/pulls/96","id":143539651,"html_url":"https://github.com/RoboJackets/roboracing-software/pull/96","diff_url":"https://github.com/RoboJackets/roboracing-software/pull/96.diff","patch_url":"https://github.com/RoboJackets/roboracing-software/pull/96.patch","issue_url":"https://api.github.com/repos/RoboJackets/roboracing-software/issues/96","number":96,"state":"open","locked":false,"title":"hough circles code compiles","user":{"login":"chsahit","id":3252741,"avatar_url":"https://avatars1.githubusercontent.com/u/3252741?v=4","gravatar_id":"","url":"https://api.github.com/users/chsahit","html_url":"https://github.com/chsahit","followers_url":"https://api.github.com/users/chsahit/followers","following_url":"https://api.github.com/users/chsahit/following{/other_user}","gists_url":"https://api.github.com/users/chsahit/gists{/gist_id}","starred_url":"https://api.github.com/users/chsahit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chsahit/subscriptions","organizations_url":"https://api.github.com/users/chsahit/orgs","repos_url":"https://api.github.com/users/chsahit/repos","events_url":"https://api.github.com/users/chsahit/events{/privacy}","received_events_url":"https://api.github.com/users/chsahit/received_events","type":"User","site_admin":false},"body":"Closes issue #94 ","created_at":"2017-09-28T02:05:40Z","updated_at":"2017-09-29T16:24:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5408b17578141d8f9bd904e4a2ac77ee34f9254b","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/RoboJackets/roboracing-software/pulls/96/commits","review_comments_url":"https://api.github.com/repos/RoboJackets/roboracing-software/pulls/96/comments","review_comment_url":"https://api.github.com/repos/RoboJackets/roboracing-software/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RoboJackets/roboracing-software/issues/96/comments","statuses_url":"https://api.github.com/repos/RoboJackets/roboracing-software/statuses/63e1dbd19c1bac3fb2b7f2ae386e22adaf5f9291","head":{"label":"RoboJackets:houghcircles","ref":"houghcircles","sha":"63e1dbd19c1bac3fb2b7f2ae386e22adaf5f9291","user":{"login":"RoboJackets","id":3523251,"avatar_url":"https://avatars1.githubusercontent.com/u/3523251?v=4","gravatar_id":"","url":"https://api.github.com/users/RoboJackets","html_url":"https://github.com/RoboJackets","followers_url":"https://api.github.com/users/RoboJackets/followers","following_url":"https://api.github.com/users/RoboJackets/following{/other_user}","gists_url":"https://api.github.com/users/RoboJackets/gists{/gist_id}","starred_url":"https://api.github.com/users/RoboJackets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoboJackets/subscriptions","organizations_url":"https://api.github.com/users/RoboJackets/orgs","repos_url":"https://api.github.com/users/RoboJackets/repos","events_url":"https://api.github.com/users/RoboJackets/events{/privacy}","received_events_url":"https://api.github.com/users/RoboJackets/received_events","type":"Organization","site_admin":false},"repo":{"id":15688257,"name":"roboracing-software","full_name":"RoboJackets/roboracing-software","owner":{"login":"RoboJackets","id":3523251,"avatar_url":"https://avatars1.githubusercontent.com/u/3523251?v=4","gravatar_id":"","url":"https://api.github.com/users/RoboJackets","html_url":"https://github.com/RoboJackets","followers_url":"https://api.github.com/users/RoboJackets/followers","following_url":"https://api.github.com/users/RoboJackets/following{/other_user}","gists_url":"https://api.github.com/users/RoboJackets/gists{/gist_id}","starred_url":"https://api.github.com/users/RoboJackets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoboJackets/subscriptions","organizations_url":"https://api.github.com/users/RoboJackets/orgs","repos_url":"https://api.github.com/users/RoboJackets/repos","events_url":"https://api.github.com/users/RoboJackets/events{/privacy}","received_events_url":"https://api.github.com/users/RoboJackets/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RoboJackets/roboracing-software","description":"ROS packages for the RoboJackets RoboRacing team.","fork":false,"url":"https://api.github.com/repos/RoboJackets/roboracing-software","forks_url":"https://api.github.com/repos/RoboJackets/roboracing-software/forks","keys_url":"https://api.github.com/repos/RoboJackets/roboracing-software/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RoboJackets/roboracing-software/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RoboJackets/roboracing-software/teams","hooks_url":"https://api.github.com/repos/RoboJackets/roboracing-software/hooks","issue_events_url":"https://api.github.com/repos/RoboJackets/roboracing-software/issues/events{/number}","events_url":"https://api.github.com/repos/RoboJackets/roboracing-software/events","assignees_url":"https://api.github.com/repos/RoboJackets/roboracing-software/assignees{/user}","branches_url":"https://api.github.com/repos/RoboJackets/roboracing-software/branches{/branch}","tags_url":"https://api.github.com/repos/RoboJackets/roboracing-software/tags","blobs_url":"https://api.github.com/repos/RoboJackets/roboracing-software/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RoboJackets/roboracing-software/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RoboJackets/roboracing-software/git/refs{/sha}","trees_url":"https://api.github.com/repos/RoboJackets/roboracing-software/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RoboJackets/roboracing-software/statuses/{sha}","languages_url":"https://api.github.com/repos/RoboJackets/roboracing-software/languages","stargazers_url":"https://api.github.com/repos/RoboJackets/roboracing-software/stargazers","contributors_url":"https://api.github.com/repos/RoboJackets/roboracing-software/contributors","subscribers_url":"https://api.github.com/repos/RoboJackets/roboracing-software/subscribers","subscription_url":"https://api.github.com/repos/RoboJackets/roboracing-software/subscription","commits_url":"https://api.github.com/repos/RoboJackets/roboracing-software/commits{/sha}","git_commits_url":"https://api.github.com/repos/RoboJackets/roboracing-software/git/commits{/sha}","comments_url":"https://api.github.com/repos/RoboJackets/roboracing-software/comments{/number}","issue_comment_url":"https://api.github.com/repos/RoboJackets/roboracing-software/issues/comments{/number}","contents_url":"https://api.github.com/repos/RoboJackets/roboracing-software/contents/{+path}","compare_url":"https://api.github.com/repos/RoboJackets/roboracing-software/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RoboJackets/roboracing-software/merges","archive_url":"https://api.github.com/repos/RoboJackets/roboracing-software/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RoboJackets/roboracing-software/downloads","issues_url":"https://api.github.com/repos/RoboJackets/roboracing-software/issues{/number}","pulls_url":"https://api.github.com/repos/RoboJackets/roboracing-software/pulls{/number}","milestones_url":"https://api.github.com/repos/RoboJackets/roboracing-software/milestones{/number}","notifications_url":"https://api.github.com/repos/RoboJackets/roboracing-software/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RoboJackets/roboracing-software/labels{/name}","releases_url":"https://api.github.com/repos/RoboJackets/roboracing-software/releases{/id}","deployments_url":"https://api.github.com/repos/RoboJackets/roboracing-software/deployments","created_at":"2014-01-06T22:43:52Z","updated_at":"2017-09-26T00:49:21Z","pushed_at":"2017-09-28T02:27:05Z","git_url":"git://github.com/RoboJackets/roboracing-software.git","ssh_url":"git@github.com:RoboJackets/roboracing-software.git","clone_url":"https://github.com/RoboJackets/roboracing-software.git","svn_url":"https://github.com/RoboJackets/roboracing-software","homepage":"http://www.robojackets.org/teams/roboracing/","size":104712,"stargazers_count":19,"watchers_count":19,"language":"C++","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"open_issues_count":16,"forks":31,"open_issues":16,"watchers":19,"default_branch":"master"}},"base":{"label":"RoboJackets:master","ref":"master","sha":"7b17c7582ae3c94edc36ddd05e0548efd9f7d2ba","user":{"login":"RoboJackets","id":3523251,"avatar_url":"https://avatars1.githubusercontent.com/u/3523251?v=4","gravatar_id":"","url":"https://api.github.com/users/RoboJackets","html_url":"https://github.com/RoboJackets","followers_url":"https://api.github.com/users/RoboJackets/followers","following_url":"https://api.github.com/users/RoboJackets/following{/other_user}","gists_url":"https://api.github.com/users/RoboJackets/gists{/gist_id}","starred_url":"https://api.github.com/users/RoboJackets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoboJackets/subscriptions","organizations_url":"https://api.github.com/users/RoboJackets/orgs","repos_url":"https://api.github.com/users/RoboJackets/repos","events_url":"https://api.github.com/users/RoboJackets/events{/privacy}","received_events_url":"https://api.github.com/users/RoboJackets/received_events","type":"Organization","site_admin":false},"repo":{"id":15688257,"name":"roboracing-software","full_name":"RoboJackets/roboracing-software","owner":{"login":"RoboJackets","id":3523251,"avatar_url":"https://avatars1.githubusercontent.com/u/3523251?v=4","gravatar_id":"","url":"https://api.github.com/users/RoboJackets","html_url":"https://github.com/RoboJackets","followers_url":"https://api.github.com/users/RoboJackets/followers","following_url":"https://api.github.com/users/RoboJackets/following{/other_user}","gists_url":"https://api.github.com/users/RoboJackets/gists{/gist_id}","starred_url":"https://api.github.com/users/RoboJackets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoboJackets/subscriptions","organizations_url":"https://api.github.com/users/RoboJackets/orgs","repos_url":"https://api.github.com/users/RoboJackets/repos","events_url":"https://api.github.com/users/RoboJackets/events{/privacy}","received_events_url":"https://api.github.com/users/RoboJackets/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RoboJackets/roboracing-software","description":"ROS packages for the RoboJackets RoboRacing team.","fork":false,"url":"https://api.github.com/repos/RoboJackets/roboracing-software","forks_url":"https://api.github.com/repos/RoboJackets/roboracing-software/forks","keys_url":"https://api.github.com/repos/RoboJackets/roboracing-software/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RoboJackets/roboracing-software/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RoboJackets/roboracing-software/teams","hooks_url":"https://api.github.com/repos/RoboJackets/roboracing-software/hooks","issue_events_url":"https://api.github.com/repos/RoboJackets/roboracing-software/issues/events{/number}","events_url":"https://api.github.com/repos/RoboJackets/roboracing-software/events","assignees_url":"https://api.github.com/repos/RoboJackets/roboracing-software/assignees{/user}","branches_url":"https://api.github.com/repos/RoboJackets/roboracing-software/branches{/branch}","tags_url":"https://api.github.com/repos/RoboJackets/roboracing-software/tags","blobs_url":"https://api.github.com/repos/RoboJackets/roboracing-software/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RoboJackets/roboracing-software/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RoboJackets/roboracing-software/git/refs{/sha}","trees_url":"https://api.github.com/repos/RoboJackets/roboracing-software/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RoboJackets/roboracing-software/statuses/{sha}","languages_url":"https://api.github.com/repos/RoboJackets/roboracing-software/languages","stargazers_url":"https://api.github.com/repos/RoboJackets/roboracing-software/stargazers","contributors_url":"https://api.github.com/repos/RoboJackets/roboracing-software/contributors","subscribers_url":"https://api.github.com/repos/RoboJackets/roboracing-software/subscribers","subscription_url":"https://api.github.com/repos/RoboJackets/roboracing-software/subscription","commits_url":"https://api.github.com/repos/RoboJackets/roboracing-software/commits{/sha}","git_commits_url":"https://api.github.com/repos/RoboJackets/roboracing-software/git/commits{/sha}","comments_url":"https://api.github.com/repos/RoboJackets/roboracing-software/comments{/number}","issue_comment_url":"https://api.github.com/repos/RoboJackets/roboracing-software/issues/comments{/number}","contents_url":"https://api.github.com/repos/RoboJackets/roboracing-software/contents/{+path}","compare_url":"https://api.github.com/repos/RoboJackets/roboracing-software/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RoboJackets/roboracing-software/merges","archive_url":"https://api.github.com/repos/RoboJackets/roboracing-software/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RoboJackets/roboracing-software/downloads","issues_url":"https://api.github.com/repos/RoboJackets/roboracing-software/issues{/number}","pulls_url":"https://api.github.com/repos/RoboJackets/roboracing-software/pulls{/number}","milestones_url":"https://api.github.com/repos/RoboJackets/roboracing-software/milestones{/number}","notifications_url":"https://api.github.com/repos/RoboJackets/roboracing-software/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RoboJackets/roboracing-software/labels{/name}","releases_url":"https://api.github.com/repos/RoboJackets/roboracing-software/releases{/id}","deployments_url":"https://api.github.com/repos/RoboJackets/roboracing-software/deployments","created_at":"2014-01-06T22:43:52Z","updated_at":"2017-09-26T00:49:21Z","pushed_at":"2017-09-28T02:27:05Z","git_url":"git://github.com/RoboJackets/roboracing-software.git","ssh_url":"git@github.com:RoboJackets/roboracing-software.git","clone_url":"https://github.com/RoboJackets/roboracing-software.git","svn_url":"https://github.com/RoboJackets/roboracing-software","homepage":"http://www.robojackets.org/teams/roboracing/","size":104712,"stargazers_count":19,"watchers_count":19,"language":"C++","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"open_issues_count":16,"forks":31,"open_issues":16,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RoboJackets/roboracing-software/pulls/96"},"html":{"href":"https://github.com/RoboJackets/roboracing-software/pull/96"},"issue":{"href":"https://api.github.com/repos/RoboJackets/roboracing-software/issues/96"},"comments":{"href":"https://api.github.com/repos/RoboJackets/roboracing-software/issues/96/comments"},"review_comments":{"href":"https://api.github.com/repos/RoboJackets/roboracing-software/pulls/96/comments"},"review_comment":{"href":"https://api.github.com/repos/RoboJackets/roboracing-software/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RoboJackets/roboracing-software/pulls/96/commits"},"statuses":{"href":"https://api.github.com/repos/RoboJackets/roboracing-software/statuses/63e1dbd19c1bac3fb2b7f2ae386e22adaf5f9291"}},"author_association":"OWNER"}}
{"actor":{"display_login":"barulicm"}}