{"action":"created","comment":{"url":"https://api.github.com/repos/JuliaImages/Images.jl/pulls/comments/120390713","pull_request_review_id":42349005,"id":120390713,"diff_hunk":"@@ -908,3 +908,83 @@ function pyramid_scale(img, downsample)\n     sz_next = map(s->ceil(Int, s/downsample), size(img))\n     imresize(img, sz_next)\n end\n+\n+\"\"\"\n+```\n+thres = otsu_threshold(img)\n+thres = otsu_threshold(img, bins)\n+```\n+\n+Computes treshold for grayscale image using Otsu's method.  \n+  \n+Parameters:  \n+-    img         = Grayscale input image    \n+-    bins        = Number of bins used to compute the histogram. Needed for floating-point images.    \n+    \n+\"\"\"\n+function otsu_threshold{T<:FixedPointNumbers.Normed}(img::AbstractArray{Gray{T}, 2})\n+    bins::Int = 2^T.parameters[2]","path":"src/algorithms.jl","position":19,"original_position":19,"commit_id":"066dfe22a94977e75f5c2974b2fa727bd98f154a","original_commit_id":"066dfe22a94977e75f5c2974b2fa727bd98f154a","user":{"login":"timholy","id":1525481,"avatar_url":"https://avatars0.githubusercontent.com/u/1525481?v=3","gravatar_id":"","url":"https://api.github.com/users/timholy","html_url":"https://github.com/timholy","followers_url":"https://api.github.com/users/timholy/followers","following_url":"https://api.github.com/users/timholy/following{/other_user}","gists_url":"https://api.github.com/users/timholy/gists{/gist_id}","starred_url":"https://api.github.com/users/timholy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timholy/subscriptions","organizations_url":"https://api.github.com/users/timholy/orgs","repos_url":"https://api.github.com/users/timholy/repos","events_url":"https://api.github.com/users/timholy/events{/privacy}","received_events_url":"https://api.github.com/users/timholy/received_events","type":"User","site_admin":false},"body":"For *display*, 0 maps to black and 1 maps to white, as always. But it's possible for an image to have values that are \"out of gamut,\" meaning \"not displayable\". ImageView uses `clamp01nan` so it doesn't error. But you have to decide: is this a display-oriented function or an algorithmic function? I assume the latter, in which case it's better to have it work on arbitrary values.\r\n```julia\r\njulia> typemax(N2f6)\r\n4.05N2f6\r\n```","created_at":"2017-06-06T15:16:26Z","updated_at":"2017-06-06T15:16:26Z","html_url":"https://github.com/JuliaImages/Images.jl/pull/639#discussion_r120390713","pull_request_url":"https://api.github.com/repos/JuliaImages/Images.jl/pulls/639","_links":{"self":{"href":"https://api.github.com/repos/JuliaImages/Images.jl/pulls/comments/120390713"},"html":{"href":"https://github.com/JuliaImages/Images.jl/pull/639#discussion_r120390713"},"pull_request":{"href":"https://api.github.com/repos/JuliaImages/Images.jl/pulls/639"}}},"pull_request":{"url":"https://api.github.com/repos/JuliaImages/Images.jl/pulls/639","id":123875936,"html_url":"https://github.com/JuliaImages/Images.jl/pull/639","diff_url":"https://github.com/JuliaImages/Images.jl/pull/639.diff","patch_url":"https://github.com/JuliaImages/Images.jl/pull/639.patch","issue_url":"https://api.github.com/repos/JuliaImages/Images.jl/issues/639","number":639,"state":"open","locked":false,"title":"Thresholding","user":{"login":"tejus-gupta","id":17504447,"avatar_url":"https://avatars0.githubusercontent.com/u/17504447?v=3","gravatar_id":"","url":"https://api.github.com/users/tejus-gupta","html_url":"https://github.com/tejus-gupta","followers_url":"https://api.github.com/users/tejus-gupta/followers","following_url":"https://api.github.com/users/tejus-gupta/following{/other_user}","gists_url":"https://api.github.com/users/tejus-gupta/gists{/gist_id}","starred_url":"https://api.github.com/users/tejus-gupta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tejus-gupta/subscriptions","organizations_url":"https://api.github.com/users/tejus-gupta/orgs","repos_url":"https://api.github.com/users/tejus-gupta/repos","events_url":"https://api.github.com/users/tejus-gupta/events{/privacy}","received_events_url":"https://api.github.com/users/tejus-gupta/received_events","type":"User","site_admin":false},"body":"Functions for computing threshold using Otsu's method and adaptive thresholding.","created_at":"2017-06-04T12:23:58Z","updated_at":"2017-06-06T15:16:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"910a17b87f9c3095e750a61f0b0b917f7c0e89a5","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/JuliaImages/Images.jl/pulls/639/commits","review_comments_url":"https://api.github.com/repos/JuliaImages/Images.jl/pulls/639/comments","review_comment_url":"https://api.github.com/repos/JuliaImages/Images.jl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JuliaImages/Images.jl/issues/639/comments","statuses_url":"https://api.github.com/repos/JuliaImages/Images.jl/statuses/066dfe22a94977e75f5c2974b2fa727bd98f154a","head":{"label":"tejus-gupta:thres","ref":"thres","sha":"066dfe22a94977e75f5c2974b2fa727bd98f154a","user":{"login":"tejus-gupta","id":17504447,"avatar_url":"https://avatars0.githubusercontent.com/u/17504447?v=3","gravatar_id":"","url":"https://api.github.com/users/tejus-gupta","html_url":"https://github.com/tejus-gupta","followers_url":"https://api.github.com/users/tejus-gupta/followers","following_url":"https://api.github.com/users/tejus-gupta/following{/other_user}","gists_url":"https://api.github.com/users/tejus-gupta/gists{/gist_id}","starred_url":"https://api.github.com/users/tejus-gupta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tejus-gupta/subscriptions","organizations_url":"https://api.github.com/users/tejus-gupta/orgs","repos_url":"https://api.github.com/users/tejus-gupta/repos","events_url":"https://api.github.com/users/tejus-gupta/events{/privacy}","received_events_url":"https://api.github.com/users/tejus-gupta/received_events","type":"User","site_admin":false},"repo":{"id":85396419,"name":"Images.jl","full_name":"tejus-gupta/Images.jl","owner":{"login":"tejus-gupta","id":17504447,"avatar_url":"https://avatars0.githubusercontent.com/u/17504447?v=3","gravatar_id":"","url":"https://api.github.com/users/tejus-gupta","html_url":"https://github.com/tejus-gupta","followers_url":"https://api.github.com/users/tejus-gupta/followers","following_url":"https://api.github.com/users/tejus-gupta/following{/other_user}","gists_url":"https://api.github.com/users/tejus-gupta/gists{/gist_id}","starred_url":"https://api.github.com/users/tejus-gupta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tejus-gupta/subscriptions","organizations_url":"https://api.github.com/users/tejus-gupta/orgs","repos_url":"https://api.github.com/users/tejus-gupta/repos","events_url":"https://api.github.com/users/tejus-gupta/events{/privacy}","received_events_url":"https://api.github.com/users/tejus-gupta/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tejus-gupta/Images.jl","description":"An image library for Julia","fork":true,"url":"https://api.github.com/repos/tejus-gupta/Images.jl","forks_url":"https://api.github.com/repos/tejus-gupta/Images.jl/forks","keys_url":"https://api.github.com/repos/tejus-gupta/Images.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tejus-gupta/Images.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tejus-gupta/Images.jl/teams","hooks_url":"https://api.github.com/repos/tejus-gupta/Images.jl/hooks","issue_events_url":"https://api.github.com/repos/tejus-gupta/Images.jl/issues/events{/number}","events_url":"https://api.github.com/repos/tejus-gupta/Images.jl/events","assignees_url":"https://api.github.com/repos/tejus-gupta/Images.jl/assignees{/user}","branches_url":"https://api.github.com/repos/tejus-gupta/Images.jl/branches{/branch}","tags_url":"https://api.github.com/repos/tejus-gupta/Images.jl/tags","blobs_url":"https://api.github.com/repos/tejus-gupta/Images.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tejus-gupta/Images.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tejus-gupta/Images.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/tejus-gupta/Images.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tejus-gupta/Images.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/tejus-gupta/Images.jl/languages","stargazers_url":"https://api.github.com/repos/tejus-gupta/Images.jl/stargazers","contributors_url":"https://api.github.com/repos/tejus-gupta/Images.jl/contributors","subscribers_url":"https://api.github.com/repos/tejus-gupta/Images.jl/subscribers","subscription_url":"https://api.github.com/repos/tejus-gupta/Images.jl/subscription","commits_url":"https://api.github.com/repos/tejus-gupta/Images.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/tejus-gupta/Images.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/tejus-gupta/Images.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/tejus-gupta/Images.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/tejus-gupta/Images.jl/contents/{+path}","compare_url":"https://api.github.com/repos/tejus-gupta/Images.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tejus-gupta/Images.jl/merges","archive_url":"https://api.github.com/repos/tejus-gupta/Images.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tejus-gupta/Images.jl/downloads","issues_url":"https://api.github.com/repos/tejus-gupta/Images.jl/issues{/number}","pulls_url":"https://api.github.com/repos/tejus-gupta/Images.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/tejus-gupta/Images.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/tejus-gupta/Images.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tejus-gupta/Images.jl/labels{/name}","releases_url":"https://api.github.com/repos/tejus-gupta/Images.jl/releases{/id}","deployments_url":"https://api.github.com/repos/tejus-gupta/Images.jl/deployments","created_at":"2017-03-18T11:31:07Z","updated_at":"2017-03-18T11:31:09Z","pushed_at":"2017-06-04T12:15:08Z","git_url":"git://github.com/tejus-gupta/Images.jl.git","ssh_url":"git@github.com:tejus-gupta/Images.jl.git","clone_url":"https://github.com/tejus-gupta/Images.jl.git","svn_url":"https://github.com/tejus-gupta/Images.jl","homepage":null,"size":3653,"stargazers_count":0,"watchers_count":0,"language":"Julia","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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":"JuliaImages:master","ref":"master","sha":"af4a8116e05d60cbad411de4a9cb0eb154c1e603","user":{"login":"JuliaImages","id":13722934,"avatar_url":"https://avatars2.githubusercontent.com/u/13722934?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaImages","html_url":"https://github.com/JuliaImages","followers_url":"https://api.github.com/users/JuliaImages/followers","following_url":"https://api.github.com/users/JuliaImages/following{/other_user}","gists_url":"https://api.github.com/users/JuliaImages/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaImages/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaImages/subscriptions","organizations_url":"https://api.github.com/users/JuliaImages/orgs","repos_url":"https://api.github.com/users/JuliaImages/repos","events_url":"https://api.github.com/users/JuliaImages/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaImages/received_events","type":"Organization","site_admin":false},"repo":{"id":7018954,"name":"Images.jl","full_name":"JuliaImages/Images.jl","owner":{"login":"JuliaImages","id":13722934,"avatar_url":"https://avatars2.githubusercontent.com/u/13722934?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaImages","html_url":"https://github.com/JuliaImages","followers_url":"https://api.github.com/users/JuliaImages/followers","following_url":"https://api.github.com/users/JuliaImages/following{/other_user}","gists_url":"https://api.github.com/users/JuliaImages/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaImages/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaImages/subscriptions","organizations_url":"https://api.github.com/users/JuliaImages/orgs","repos_url":"https://api.github.com/users/JuliaImages/repos","events_url":"https://api.github.com/users/JuliaImages/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaImages/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JuliaImages/Images.jl","description":"An image library for Julia","fork":false,"url":"https://api.github.com/repos/JuliaImages/Images.jl","forks_url":"https://api.github.com/repos/JuliaImages/Images.jl/forks","keys_url":"https://api.github.com/repos/JuliaImages/Images.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaImages/Images.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaImages/Images.jl/teams","hooks_url":"https://api.github.com/repos/JuliaImages/Images.jl/hooks","issue_events_url":"https://api.github.com/repos/JuliaImages/Images.jl/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaImages/Images.jl/events","assignees_url":"https://api.github.com/repos/JuliaImages/Images.jl/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaImages/Images.jl/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaImages/Images.jl/tags","blobs_url":"https://api.github.com/repos/JuliaImages/Images.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaImages/Images.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaImages/Images.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaImages/Images.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaImages/Images.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaImages/Images.jl/languages","stargazers_url":"https://api.github.com/repos/JuliaImages/Images.jl/stargazers","contributors_url":"https://api.github.com/repos/JuliaImages/Images.jl/contributors","subscribers_url":"https://api.github.com/repos/JuliaImages/Images.jl/subscribers","subscription_url":"https://api.github.com/repos/JuliaImages/Images.jl/subscription","commits_url":"https://api.github.com/repos/JuliaImages/Images.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaImages/Images.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaImages/Images.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaImages/Images.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaImages/Images.jl/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaImages/Images.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaImages/Images.jl/merges","archive_url":"https://api.github.com/repos/JuliaImages/Images.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaImages/Images.jl/downloads","issues_url":"https://api.github.com/repos/JuliaImages/Images.jl/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaImages/Images.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaImages/Images.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaImages/Images.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaImages/Images.jl/labels{/name}","releases_url":"https://api.github.com/repos/JuliaImages/Images.jl/releases{/id}","deployments_url":"https://api.github.com/repos/JuliaImages/Images.jl/deployments","created_at":"2012-12-05T14:43:16Z","updated_at":"2017-05-31T11:08:12Z","pushed_at":"2017-06-04T12:23:58Z","git_url":"git://github.com/JuliaImages/Images.jl.git","ssh_url":"git@github.com:JuliaImages/Images.jl.git","clone_url":"https://github.com/JuliaImages/Images.jl.git","svn_url":"https://github.com/JuliaImages/Images.jl","homepage":null,"size":3641,"stargazers_count":156,"watchers_count":156,"language":"Julia","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":94,"mirror_url":null,"open_issues_count":44,"forks":94,"open_issues":44,"watchers":156,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JuliaImages/Images.jl/pulls/639"},"html":{"href":"https://github.com/JuliaImages/Images.jl/pull/639"},"issue":{"href":"https://api.github.com/repos/JuliaImages/Images.jl/issues/639"},"comments":{"href":"https://api.github.com/repos/JuliaImages/Images.jl/issues/639/comments"},"review_comments":{"href":"https://api.github.com/repos/JuliaImages/Images.jl/pulls/639/comments"},"review_comment":{"href":"https://api.github.com/repos/JuliaImages/Images.jl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JuliaImages/Images.jl/pulls/639/commits"},"statuses":{"href":"https://api.github.com/repos/JuliaImages/Images.jl/statuses/066dfe22a94977e75f5c2974b2fa727bd98f154a"}}}}
{"actor":{"display_login":"timholy"}}