{"action":"created","comment":{"url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/comments/46652471","id":46652471,"diff_hunk":"@@ -0,0 +1,110 @@\n+package edu.wpi.grip.core.operations.composite;\n+\n+import com.google.common.eventbus.EventBus;\n+import edu.wpi.grip.core.InputSocket;\n+import edu.wpi.grip.core.Operation;\n+import edu.wpi.grip.core.OutputSocket;\n+import edu.wpi.grip.core.SocketHint;\n+\n+import java.io.InputStream;\n+import java.util.Optional;\n+\n+import static edu.wpi.grip.core.operations.composite.FindContourOperation.Contours;\n+import static org.bytedeco.javacpp.opencv_core.*;\n+import static org.bytedeco.javacpp.opencv_imgproc.*;\n+\n+/**\n+ * An {@link Operation} that takes in a list of contours and outputs a list of any contours in the input that match\n+ * all of several criteria.  Right now, the user can specify a minimum area, minimum perimeter, and ranges for width\n+ * and height.\n+ * <p>\n+ * This is useful because running a Find Contours on a real-life image typically leads to many small undesirable\n+ * contours from noise and small objects, as well as contours that do not meet the expected characteristics of the\n+ * feature we're actually looking for.  So, this operation can help narrow them down.\n+ */\n+public class FilterContoursOperation implements Operation {\n+\n+    private final SocketHint<Contours> contoursHint = new SocketHint<Contours>(\"Contours\", Contours.class, Contours::new);\n+    private final SocketHint<Number> minAreaHint = new SocketHint<>(\"Min Area\", Number.class, 0, SocketHint.View.SPINNER);\n+    private final SocketHint<Number> minPerimeterHint = new SocketHint<>(\"Min Perimeter\", Number.class, 0,\n+            SocketHint.View.SPINNER);\n+    private final SocketHint<Number> minWidthHint = new SocketHint<>(\"Min Width\", Number.class, 0,\n+            SocketHint.View.SPINNER);\n+    private final SocketHint<Number> maxWidthHint = new SocketHint<>(\"Max Width\", Number.class, Integer.MAX_VALUE,","path":"src/main/java/edu/wpi/grip/core/operations/composite/FilterContoursOperation.java","position":32,"original_position":33,"commit_id":"1c9af12bb719d9b71414e4d749a7b2ed5f8ad417","original_commit_id":"2d088147f2ac2fb05c604440c467adcb683d2c6e","user":{"login":"ThomasJClark","id":3964980,"avatar_url":"https://avatars.githubusercontent.com/u/3964980?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasJClark","html_url":"https://github.com/ThomasJClark","followers_url":"https://api.github.com/users/ThomasJClark/followers","following_url":"https://api.github.com/users/ThomasJClark/following{/other_user}","gists_url":"https://api.github.com/users/ThomasJClark/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasJClark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasJClark/subscriptions","organizations_url":"https://api.github.com/users/ThomasJClark/orgs","repos_url":"https://api.github.com/users/ThomasJClark/repos","events_url":"https://api.github.com/users/ThomasJClark/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasJClark/received_events","type":"User","site_admin":false},"body":"I disagree, that would be super confusing if the slider moved when you connected a different-sized image to it","created_at":"2015-12-04T06:19:43Z","updated_at":"2015-12-04T06:19:43Z","html_url":"https://github.com/WPIRoboticsProjects/GRIP/pull/181#discussion_r46652471","pull_request_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/181","_links":{"self":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/comments/46652471"},"html":{"href":"https://github.com/WPIRoboticsProjects/GRIP/pull/181#discussion_r46652471"},"pull_request":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/181"}}},"pull_request":{"url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/181","id":52623093,"html_url":"https://github.com/WPIRoboticsProjects/GRIP/pull/181","diff_url":"https://github.com/WPIRoboticsProjects/GRIP/pull/181.diff","patch_url":"https://github.com/WPIRoboticsProjects/GRIP/pull/181.patch","issue_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/181","number":181,"state":"open","locked":false,"title":"Add contour-related operations and examples","user":{"login":"ThomasJClark","id":3964980,"avatar_url":"https://avatars.githubusercontent.com/u/3964980?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasJClark","html_url":"https://github.com/ThomasJClark","followers_url":"https://api.github.com/users/ThomasJClark/followers","following_url":"https://api.github.com/users/ThomasJClark/following{/other_user}","gists_url":"https://api.github.com/users/ThomasJClark/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasJClark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasJClark/subscriptions","organizations_url":"https://api.github.com/users/ThomasJClark/orgs","repos_url":"https://api.github.com/users/ThomasJClark/repos","events_url":"https://api.github.com/users/ThomasJClark/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasJClark/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-04T02:36:47Z","updated_at":"2015-12-04T06:19:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7380f70b5835db695db72a1b5704f714fc379e8a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/181/commits","review_comments_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/181/comments","review_comment_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/181/comments","statuses_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/statuses/1c9af12bb719d9b71414e4d749a7b2ed5f8ad417","head":{"label":"ThomasJClark:contours","ref":"contours","sha":"1c9af12bb719d9b71414e4d749a7b2ed5f8ad417","user":{"login":"ThomasJClark","id":3964980,"avatar_url":"https://avatars.githubusercontent.com/u/3964980?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasJClark","html_url":"https://github.com/ThomasJClark","followers_url":"https://api.github.com/users/ThomasJClark/followers","following_url":"https://api.github.com/users/ThomasJClark/following{/other_user}","gists_url":"https://api.github.com/users/ThomasJClark/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasJClark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasJClark/subscriptions","organizations_url":"https://api.github.com/users/ThomasJClark/orgs","repos_url":"https://api.github.com/users/ThomasJClark/repos","events_url":"https://api.github.com/users/ThomasJClark/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasJClark/received_events","type":"User","site_admin":false},"repo":{"id":41703859,"name":"GRIP","full_name":"ThomasJClark/GRIP","owner":{"login":"ThomasJClark","id":3964980,"avatar_url":"https://avatars.githubusercontent.com/u/3964980?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasJClark","html_url":"https://github.com/ThomasJClark","followers_url":"https://api.github.com/users/ThomasJClark/followers","following_url":"https://api.github.com/users/ThomasJClark/following{/other_user}","gists_url":"https://api.github.com/users/ThomasJClark/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasJClark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasJClark/subscriptions","organizations_url":"https://api.github.com/users/ThomasJClark/orgs","repos_url":"https://api.github.com/users/ThomasJClark/repos","events_url":"https://api.github.com/users/ThomasJClark/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasJClark/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ThomasJClark/GRIP","description":"Program for rapidly developing computer vision applications","fork":true,"url":"https://api.github.com/repos/ThomasJClark/GRIP","forks_url":"https://api.github.com/repos/ThomasJClark/GRIP/forks","keys_url":"https://api.github.com/repos/ThomasJClark/GRIP/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ThomasJClark/GRIP/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ThomasJClark/GRIP/teams","hooks_url":"https://api.github.com/repos/ThomasJClark/GRIP/hooks","issue_events_url":"https://api.github.com/repos/ThomasJClark/GRIP/issues/events{/number}","events_url":"https://api.github.com/repos/ThomasJClark/GRIP/events","assignees_url":"https://api.github.com/repos/ThomasJClark/GRIP/assignees{/user}","branches_url":"https://api.github.com/repos/ThomasJClark/GRIP/branches{/branch}","tags_url":"https://api.github.com/repos/ThomasJClark/GRIP/tags","blobs_url":"https://api.github.com/repos/ThomasJClark/GRIP/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ThomasJClark/GRIP/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ThomasJClark/GRIP/git/refs{/sha}","trees_url":"https://api.github.com/repos/ThomasJClark/GRIP/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ThomasJClark/GRIP/statuses/{sha}","languages_url":"https://api.github.com/repos/ThomasJClark/GRIP/languages","stargazers_url":"https://api.github.com/repos/ThomasJClark/GRIP/stargazers","contributors_url":"https://api.github.com/repos/ThomasJClark/GRIP/contributors","subscribers_url":"https://api.github.com/repos/ThomasJClark/GRIP/subscribers","subscription_url":"https://api.github.com/repos/ThomasJClark/GRIP/subscription","commits_url":"https://api.github.com/repos/ThomasJClark/GRIP/commits{/sha}","git_commits_url":"https://api.github.com/repos/ThomasJClark/GRIP/git/commits{/sha}","comments_url":"https://api.github.com/repos/ThomasJClark/GRIP/comments{/number}","issue_comment_url":"https://api.github.com/repos/ThomasJClark/GRIP/issues/comments{/number}","contents_url":"https://api.github.com/repos/ThomasJClark/GRIP/contents/{+path}","compare_url":"https://api.github.com/repos/ThomasJClark/GRIP/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ThomasJClark/GRIP/merges","archive_url":"https://api.github.com/repos/ThomasJClark/GRIP/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ThomasJClark/GRIP/downloads","issues_url":"https://api.github.com/repos/ThomasJClark/GRIP/issues{/number}","pulls_url":"https://api.github.com/repos/ThomasJClark/GRIP/pulls{/number}","milestones_url":"https://api.github.com/repos/ThomasJClark/GRIP/milestones{/number}","notifications_url":"https://api.github.com/repos/ThomasJClark/GRIP/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ThomasJClark/GRIP/labels{/name}","releases_url":"https://api.github.com/repos/ThomasJClark/GRIP/releases{/id}","created_at":"2015-08-31T22:30:05Z","updated_at":"2015-10-07T03:27:13Z","pushed_at":"2015-12-04T06:16:48Z","git_url":"git://github.com/ThomasJClark/GRIP.git","ssh_url":"git@github.com:ThomasJClark/GRIP.git","clone_url":"https://github.com/ThomasJClark/GRIP.git","svn_url":"https://github.com/ThomasJClark/GRIP","homepage":"http://wpi.edu","size":2810,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"WPIRoboticsProjects:master","ref":"master","sha":"42b5b6f4407351b5ce89534aabe775c4e79ebbe5","user":{"login":"WPIRoboticsProjects","id":14004340,"avatar_url":"https://avatars.githubusercontent.com/u/14004340?v=3","gravatar_id":"","url":"https://api.github.com/users/WPIRoboticsProjects","html_url":"https://github.com/WPIRoboticsProjects","followers_url":"https://api.github.com/users/WPIRoboticsProjects/followers","following_url":"https://api.github.com/users/WPIRoboticsProjects/following{/other_user}","gists_url":"https://api.github.com/users/WPIRoboticsProjects/gists{/gist_id}","starred_url":"https://api.github.com/users/WPIRoboticsProjects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WPIRoboticsProjects/subscriptions","organizations_url":"https://api.github.com/users/WPIRoboticsProjects/orgs","repos_url":"https://api.github.com/users/WPIRoboticsProjects/repos","events_url":"https://api.github.com/users/WPIRoboticsProjects/events{/privacy}","received_events_url":"https://api.github.com/users/WPIRoboticsProjects/received_events","type":"Organization","site_admin":false},"repo":{"id":41505521,"name":"GRIP","full_name":"WPIRoboticsProjects/GRIP","owner":{"login":"WPIRoboticsProjects","id":14004340,"avatar_url":"https://avatars.githubusercontent.com/u/14004340?v=3","gravatar_id":"","url":"https://api.github.com/users/WPIRoboticsProjects","html_url":"https://github.com/WPIRoboticsProjects","followers_url":"https://api.github.com/users/WPIRoboticsProjects/followers","following_url":"https://api.github.com/users/WPIRoboticsProjects/following{/other_user}","gists_url":"https://api.github.com/users/WPIRoboticsProjects/gists{/gist_id}","starred_url":"https://api.github.com/users/WPIRoboticsProjects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WPIRoboticsProjects/subscriptions","organizations_url":"https://api.github.com/users/WPIRoboticsProjects/orgs","repos_url":"https://api.github.com/users/WPIRoboticsProjects/repos","events_url":"https://api.github.com/users/WPIRoboticsProjects/events{/privacy}","received_events_url":"https://api.github.com/users/WPIRoboticsProjects/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WPIRoboticsProjects/GRIP","description":"Program for rapidly developing computer vision applications","fork":false,"url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP","forks_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/forks","keys_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/teams","hooks_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/hooks","issue_events_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/events{/number}","events_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/events","assignees_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/assignees{/user}","branches_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/branches{/branch}","tags_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/tags","blobs_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/git/refs{/sha}","trees_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/statuses/{sha}","languages_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/languages","stargazers_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/stargazers","contributors_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/contributors","subscribers_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/subscribers","subscription_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/subscription","commits_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/commits{/sha}","git_commits_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/git/commits{/sha}","comments_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/comments{/number}","issue_comment_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/comments{/number}","contents_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/contents/{+path}","compare_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/merges","archive_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/downloads","issues_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues{/number}","pulls_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls{/number}","milestones_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/milestones{/number}","notifications_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/labels{/name}","releases_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/releases{/id}","created_at":"2015-08-27T18:59:07Z","updated_at":"2015-11-26T20:27:28Z","pushed_at":"2015-12-04T06:16:48Z","git_url":"git://github.com/WPIRoboticsProjects/GRIP.git","ssh_url":"git@github.com:WPIRoboticsProjects/GRIP.git","clone_url":"https://github.com/WPIRoboticsProjects/GRIP.git","svn_url":"https://github.com/WPIRoboticsProjects/GRIP","homepage":"http://wpiroboticsprojects.github.io/GRIP","size":11641,"stargazers_count":23,"watchers_count":23,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":7,"mirror_url":null,"open_issues_count":35,"forks":7,"open_issues":35,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/181"},"html":{"href":"https://github.com/WPIRoboticsProjects/GRIP/pull/181"},"issue":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/181"},"comments":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/181/comments"},"review_comments":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/181/comments"},"review_comment":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/181/commits"},"statuses":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/statuses/1c9af12bb719d9b71414e4d749a7b2ed5f8ad417"}}}}