{"action":"created","comment":{"url":"https://api.github.com/repos/shadow-robot/sr_vision/pulls/comments/33678143","id":33678143,"diff_hunk":"@@ -0,0 +1,56 @@\n+#!/usr/bin/env python\n+\n+import rospy\n+\n+from sr_object_segmentation.hsv_segmentation import HSVSegmentation\n+from sr_object_tracking.utils import Utils\n+\n+from sensor_msgs.msg import Image, RegionOfInterest\n+from sr_vision_msgs.srv import SegmentationControl\n+\n+\n+class Segmentation(object):\n+    def __init__(self):\n+        rospy.init_node('sr_object_segmentation')\n+        self.color = rospy.get_param('/color')\n+\n+        self.image_sub = rospy.Subscriber(\"/camera/rgb/image_color\", Image, self.spin)\n+        self.selection_pub = rospy.Publisher(\"/roi/segmented_box\", RegionOfInterest, queue_size=1)\n+\n+        rospy.wait_for_service('segmentation_controller')\n+        self.seg_control = rospy.ServiceProxy('segmentation_controller', SegmentationControl)\n+\n+        self.seg = HSVSegmentation(self.color)\n+        self.utils = Utils()\n+\n+        self.frame = None\n+\n+    def spin(self, data):\n+        \"\"\"\n+        Convert the ROS image to OpenCV format using a cv_bridge helper function and make a copy\n+        \"\"\"\n+        self.frame = self.utils.convert_image(data, \"bgr8\")\n+        #stop_seg = rospy.get_param('/stop_seg')","path":"sr_object_segmentation/scripts/segmentation.py","position":33,"original_position":33,"commit_id":"4425700cbaa65c30ddb4798331115d84c0d7ffc2","original_commit_id":"4425700cbaa65c30ddb4798331115d84c0d7ffc2","user":{"login":"ugocupcic","id":557182,"avatar_url":"https://avatars.githubusercontent.com/u/557182?v=3","gravatar_id":"","url":"https://api.github.com/users/ugocupcic","html_url":"https://github.com/ugocupcic","followers_url":"https://api.github.com/users/ugocupcic/followers","following_url":"https://api.github.com/users/ugocupcic/following{/other_user}","gists_url":"https://api.github.com/users/ugocupcic/gists{/gist_id}","starred_url":"https://api.github.com/users/ugocupcic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ugocupcic/subscriptions","organizations_url":"https://api.github.com/users/ugocupcic/orgs","repos_url":"https://api.github.com/users/ugocupcic/repos","events_url":"https://api.github.com/users/ugocupcic/events{/privacy}","received_events_url":"https://api.github.com/users/ugocupcic/received_events","type":"User","site_admin":false},"body":"this is not used anymore - delete the line?","created_at":"2015-07-01T13:35:07Z","updated_at":"2015-07-01T13:35:07Z","html_url":"https://github.com/shadow-robot/sr_vision/pull/32#discussion_r33678143","pull_request_url":"https://api.github.com/repos/shadow-robot/sr_vision/pulls/32","_links":{"self":{"href":"https://api.github.com/repos/shadow-robot/sr_vision/pulls/comments/33678143"},"html":{"href":"https://github.com/shadow-robot/sr_vision/pull/32#discussion_r33678143"},"pull_request":{"href":"https://api.github.com/repos/shadow-robot/sr_vision/pulls/32"}}},"pull_request":{"url":"https://api.github.com/repos/shadow-robot/sr_vision/pulls/32","id":38431427,"html_url":"https://github.com/shadow-robot/sr_vision/pull/32","diff_url":"https://github.com/shadow-robot/sr_vision/pull/32.diff","patch_url":"https://github.com/shadow-robot/sr_vision/pull/32.patch","issue_url":"https://api.github.com/repos/shadow-robot/sr_vision/issues/32","number":32,"state":"open","locked":false,"title":"F#20 add segmentation","user":{"login":"mewine","id":8849143,"avatar_url":"https://avatars.githubusercontent.com/u/8849143?v=3","gravatar_id":"","url":"https://api.github.com/users/mewine","html_url":"https://github.com/mewine","followers_url":"https://api.github.com/users/mewine/followers","following_url":"https://api.github.com/users/mewine/following{/other_user}","gists_url":"https://api.github.com/users/mewine/gists{/gist_id}","starred_url":"https://api.github.com/users/mewine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mewine/subscriptions","organizations_url":"https://api.github.com/users/mewine/orgs","repos_url":"https://api.github.com/users/mewine/repos","events_url":"https://api.github.com/users/mewine/events{/privacy}","received_events_url":"https://api.github.com/users/mewine/received_events","type":"User","site_admin":false},"body":"Add a segmentation before tracking. The region of interest doesn't need to be selected with the mouse any more. It's now published by the segmentation script, using one of the available algorithms.\r\n\r\nI wrote a new one, based upon a color segmentation (using of the HSV mode). The color wanted has to be specified on launching as ROS parameter (red, blue, green, yellow for now).\r\n\r\nFinally I added an utils module, for the common functions used by several packages.","created_at":"2015-06-24T11:18:15Z","updated_at":"2015-07-01T13:35:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6bbdbf92301d3264b4e0378bb24f9c0ba56c9614","assignee":{"login":"ugocupcic","id":557182,"avatar_url":"https://avatars.githubusercontent.com/u/557182?v=3","gravatar_id":"","url":"https://api.github.com/users/ugocupcic","html_url":"https://github.com/ugocupcic","followers_url":"https://api.github.com/users/ugocupcic/followers","following_url":"https://api.github.com/users/ugocupcic/following{/other_user}","gists_url":"https://api.github.com/users/ugocupcic/gists{/gist_id}","starred_url":"https://api.github.com/users/ugocupcic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ugocupcic/subscriptions","organizations_url":"https://api.github.com/users/ugocupcic/orgs","repos_url":"https://api.github.com/users/ugocupcic/repos","events_url":"https://api.github.com/users/ugocupcic/events{/privacy}","received_events_url":"https://api.github.com/users/ugocupcic/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/shadow-robot/sr_vision/pulls/32/commits","review_comments_url":"https://api.github.com/repos/shadow-robot/sr_vision/pulls/32/comments","review_comment_url":"https://api.github.com/repos/shadow-robot/sr_vision/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shadow-robot/sr_vision/issues/32/comments","statuses_url":"https://api.github.com/repos/shadow-robot/sr_vision/statuses/4425700cbaa65c30ddb4798331115d84c0d7ffc2","head":{"label":"shadow-robot:F#20_add_segmentation","ref":"F#20_add_segmentation","sha":"4425700cbaa65c30ddb4798331115d84c0d7ffc2","user":{"login":"shadow-robot","id":3306493,"avatar_url":"https://avatars.githubusercontent.com/u/3306493?v=3","gravatar_id":"","url":"https://api.github.com/users/shadow-robot","html_url":"https://github.com/shadow-robot","followers_url":"https://api.github.com/users/shadow-robot/followers","following_url":"https://api.github.com/users/shadow-robot/following{/other_user}","gists_url":"https://api.github.com/users/shadow-robot/gists{/gist_id}","starred_url":"https://api.github.com/users/shadow-robot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shadow-robot/subscriptions","organizations_url":"https://api.github.com/users/shadow-robot/orgs","repos_url":"https://api.github.com/users/shadow-robot/repos","events_url":"https://api.github.com/users/shadow-robot/events{/privacy}","received_events_url":"https://api.github.com/users/shadow-robot/received_events","type":"Organization","site_admin":false},"repo":{"id":23456799,"name":"sr_vision","full_name":"shadow-robot/sr_vision","owner":{"login":"shadow-robot","id":3306493,"avatar_url":"https://avatars.githubusercontent.com/u/3306493?v=3","gravatar_id":"","url":"https://api.github.com/users/shadow-robot","html_url":"https://github.com/shadow-robot","followers_url":"https://api.github.com/users/shadow-robot/followers","following_url":"https://api.github.com/users/shadow-robot/following{/other_user}","gists_url":"https://api.github.com/users/shadow-robot/gists{/gist_id}","starred_url":"https://api.github.com/users/shadow-robot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shadow-robot/subscriptions","organizations_url":"https://api.github.com/users/shadow-robot/orgs","repos_url":"https://api.github.com/users/shadow-robot/repos","events_url":"https://api.github.com/users/shadow-robot/events{/privacy}","received_events_url":"https://api.github.com/users/shadow-robot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/shadow-robot/sr_vision","description":"Contains our vision related algorithm (segmentation, tracking, recognition, etc...)","fork":false,"url":"https://api.github.com/repos/shadow-robot/sr_vision","forks_url":"https://api.github.com/repos/shadow-robot/sr_vision/forks","keys_url":"https://api.github.com/repos/shadow-robot/sr_vision/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shadow-robot/sr_vision/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shadow-robot/sr_vision/teams","hooks_url":"https://api.github.com/repos/shadow-robot/sr_vision/hooks","issue_events_url":"https://api.github.com/repos/shadow-robot/sr_vision/issues/events{/number}","events_url":"https://api.github.com/repos/shadow-robot/sr_vision/events","assignees_url":"https://api.github.com/repos/shadow-robot/sr_vision/assignees{/user}","branches_url":"https://api.github.com/repos/shadow-robot/sr_vision/branches{/branch}","tags_url":"https://api.github.com/repos/shadow-robot/sr_vision/tags","blobs_url":"https://api.github.com/repos/shadow-robot/sr_vision/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shadow-robot/sr_vision/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shadow-robot/sr_vision/git/refs{/sha}","trees_url":"https://api.github.com/repos/shadow-robot/sr_vision/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shadow-robot/sr_vision/statuses/{sha}","languages_url":"https://api.github.com/repos/shadow-robot/sr_vision/languages","stargazers_url":"https://api.github.com/repos/shadow-robot/sr_vision/stargazers","contributors_url":"https://api.github.com/repos/shadow-robot/sr_vision/contributors","subscribers_url":"https://api.github.com/repos/shadow-robot/sr_vision/subscribers","subscription_url":"https://api.github.com/repos/shadow-robot/sr_vision/subscription","commits_url":"https://api.github.com/repos/shadow-robot/sr_vision/commits{/sha}","git_commits_url":"https://api.github.com/repos/shadow-robot/sr_vision/git/commits{/sha}","comments_url":"https://api.github.com/repos/shadow-robot/sr_vision/comments{/number}","issue_comment_url":"https://api.github.com/repos/shadow-robot/sr_vision/issues/comments{/number}","contents_url":"https://api.github.com/repos/shadow-robot/sr_vision/contents/{+path}","compare_url":"https://api.github.com/repos/shadow-robot/sr_vision/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shadow-robot/sr_vision/merges","archive_url":"https://api.github.com/repos/shadow-robot/sr_vision/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shadow-robot/sr_vision/downloads","issues_url":"https://api.github.com/repos/shadow-robot/sr_vision/issues{/number}","pulls_url":"https://api.github.com/repos/shadow-robot/sr_vision/pulls{/number}","milestones_url":"https://api.github.com/repos/shadow-robot/sr_vision/milestones{/number}","notifications_url":"https://api.github.com/repos/shadow-robot/sr_vision/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shadow-robot/sr_vision/labels{/name}","releases_url":"https://api.github.com/repos/shadow-robot/sr_vision/releases{/id}","created_at":"2014-08-29T07:51:24Z","updated_at":"2015-06-22T08:34:35Z","pushed_at":"2015-07-01T13:29:52Z","git_url":"git://github.com/shadow-robot/sr_vision.git","ssh_url":"git@github.com:shadow-robot/sr_vision.git","clone_url":"https://github.com/shadow-robot/sr_vision.git","svn_url":"https://github.com/shadow-robot/sr_vision","homepage":null,"size":10367,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"indigo-devel"}},"base":{"label":"shadow-robot:indigo-devel","ref":"indigo-devel","sha":"0a588bbc7beee382f82e168247d6a9b98da6d47d","user":{"login":"shadow-robot","id":3306493,"avatar_url":"https://avatars.githubusercontent.com/u/3306493?v=3","gravatar_id":"","url":"https://api.github.com/users/shadow-robot","html_url":"https://github.com/shadow-robot","followers_url":"https://api.github.com/users/shadow-robot/followers","following_url":"https://api.github.com/users/shadow-robot/following{/other_user}","gists_url":"https://api.github.com/users/shadow-robot/gists{/gist_id}","starred_url":"https://api.github.com/users/shadow-robot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shadow-robot/subscriptions","organizations_url":"https://api.github.com/users/shadow-robot/orgs","repos_url":"https://api.github.com/users/shadow-robot/repos","events_url":"https://api.github.com/users/shadow-robot/events{/privacy}","received_events_url":"https://api.github.com/users/shadow-robot/received_events","type":"Organization","site_admin":false},"repo":{"id":23456799,"name":"sr_vision","full_name":"shadow-robot/sr_vision","owner":{"login":"shadow-robot","id":3306493,"avatar_url":"https://avatars.githubusercontent.com/u/3306493?v=3","gravatar_id":"","url":"https://api.github.com/users/shadow-robot","html_url":"https://github.com/shadow-robot","followers_url":"https://api.github.com/users/shadow-robot/followers","following_url":"https://api.github.com/users/shadow-robot/following{/other_user}","gists_url":"https://api.github.com/users/shadow-robot/gists{/gist_id}","starred_url":"https://api.github.com/users/shadow-robot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shadow-robot/subscriptions","organizations_url":"https://api.github.com/users/shadow-robot/orgs","repos_url":"https://api.github.com/users/shadow-robot/repos","events_url":"https://api.github.com/users/shadow-robot/events{/privacy}","received_events_url":"https://api.github.com/users/shadow-robot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/shadow-robot/sr_vision","description":"Contains our vision related algorithm (segmentation, tracking, recognition, etc...)","fork":false,"url":"https://api.github.com/repos/shadow-robot/sr_vision","forks_url":"https://api.github.com/repos/shadow-robot/sr_vision/forks","keys_url":"https://api.github.com/repos/shadow-robot/sr_vision/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shadow-robot/sr_vision/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shadow-robot/sr_vision/teams","hooks_url":"https://api.github.com/repos/shadow-robot/sr_vision/hooks","issue_events_url":"https://api.github.com/repos/shadow-robot/sr_vision/issues/events{/number}","events_url":"https://api.github.com/repos/shadow-robot/sr_vision/events","assignees_url":"https://api.github.com/repos/shadow-robot/sr_vision/assignees{/user}","branches_url":"https://api.github.com/repos/shadow-robot/sr_vision/branches{/branch}","tags_url":"https://api.github.com/repos/shadow-robot/sr_vision/tags","blobs_url":"https://api.github.com/repos/shadow-robot/sr_vision/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shadow-robot/sr_vision/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shadow-robot/sr_vision/git/refs{/sha}","trees_url":"https://api.github.com/repos/shadow-robot/sr_vision/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shadow-robot/sr_vision/statuses/{sha}","languages_url":"https://api.github.com/repos/shadow-robot/sr_vision/languages","stargazers_url":"https://api.github.com/repos/shadow-robot/sr_vision/stargazers","contributors_url":"https://api.github.com/repos/shadow-robot/sr_vision/contributors","subscribers_url":"https://api.github.com/repos/shadow-robot/sr_vision/subscribers","subscription_url":"https://api.github.com/repos/shadow-robot/sr_vision/subscription","commits_url":"https://api.github.com/repos/shadow-robot/sr_vision/commits{/sha}","git_commits_url":"https://api.github.com/repos/shadow-robot/sr_vision/git/commits{/sha}","comments_url":"https://api.github.com/repos/shadow-robot/sr_vision/comments{/number}","issue_comment_url":"https://api.github.com/repos/shadow-robot/sr_vision/issues/comments{/number}","contents_url":"https://api.github.com/repos/shadow-robot/sr_vision/contents/{+path}","compare_url":"https://api.github.com/repos/shadow-robot/sr_vision/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shadow-robot/sr_vision/merges","archive_url":"https://api.github.com/repos/shadow-robot/sr_vision/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shadow-robot/sr_vision/downloads","issues_url":"https://api.github.com/repos/shadow-robot/sr_vision/issues{/number}","pulls_url":"https://api.github.com/repos/shadow-robot/sr_vision/pulls{/number}","milestones_url":"https://api.github.com/repos/shadow-robot/sr_vision/milestones{/number}","notifications_url":"https://api.github.com/repos/shadow-robot/sr_vision/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shadow-robot/sr_vision/labels{/name}","releases_url":"https://api.github.com/repos/shadow-robot/sr_vision/releases{/id}","created_at":"2014-08-29T07:51:24Z","updated_at":"2015-06-22T08:34:35Z","pushed_at":"2015-07-01T13:29:52Z","git_url":"git://github.com/shadow-robot/sr_vision.git","ssh_url":"git@github.com:shadow-robot/sr_vision.git","clone_url":"https://github.com/shadow-robot/sr_vision.git","svn_url":"https://github.com/shadow-robot/sr_vision","homepage":null,"size":10367,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"indigo-devel"}},"_links":{"self":{"href":"https://api.github.com/repos/shadow-robot/sr_vision/pulls/32"},"html":{"href":"https://github.com/shadow-robot/sr_vision/pull/32"},"issue":{"href":"https://api.github.com/repos/shadow-robot/sr_vision/issues/32"},"comments":{"href":"https://api.github.com/repos/shadow-robot/sr_vision/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/shadow-robot/sr_vision/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/shadow-robot/sr_vision/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shadow-robot/sr_vision/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/shadow-robot/sr_vision/statuses/4425700cbaa65c30ddb4798331115d84c0d7ffc2"}}}}