{"action":"closed","number":103,"pull_request":{"url":"https://api.github.com/repos/openmv/openmv/pulls/103","id":63987580,"html_url":"https://github.com/openmv/openmv/pull/103","diff_url":"https://github.com/openmv/openmv/pull/103.diff","patch_url":"https://github.com/openmv/openmv/pull/103.patch","issue_url":"https://api.github.com/repos/openmv/openmv/issues/103","number":103,"state":"closed","locked":false,"title":"Redid MLX Code","user":{"login":"kwagyeman","id":5694981,"avatar_url":"https://avatars.githubusercontent.com/u/5694981?v=3","gravatar_id":"","url":"https://api.github.com/users/kwagyeman","html_url":"https://github.com/kwagyeman","followers_url":"https://api.github.com/users/kwagyeman/followers","following_url":"https://api.github.com/users/kwagyeman/following{/other_user}","gists_url":"https://api.github.com/users/kwagyeman/gists{/gist_id}","starred_url":"https://api.github.com/users/kwagyeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwagyeman/subscriptions","organizations_url":"https://api.github.com/users/kwagyeman/orgs","repos_url":"https://api.github.com/users/kwagyeman/repos","events_url":"https://api.github.com/users/kwagyeman/events{/privacy}","received_events_url":"https://api.github.com/users/kwagyeman/received_events","type":"User","site_admin":false},"body":"First, a few things:\r\n\r\nThe MLX 16x4 sensor has just too low of a resolution for mass appeal for\r\nthe price. The product is not going to sell very well. We need to look\r\ninto supporting sensors with a better res. Like the FLIR 1. The MLX\r\nmodule was renamed to the \"flir\" module with this idea in mind.\r\n\r\nThe flir code now takes care of doing scaling and blending itself. I did\r\nthis to get rid of the user having to scale the image themselves and\r\nblend themselves. Its too easy to run out of memory given our current\r\nultra small heap. In general, anything that requires multiple images in\r\nRAM has got to go. When we do another OpenMV Cam with external RAM in\r\nthe MB range then maybe such functions will be safe. But, right now they\r\nare definitely not.\r\n\r\nAnyway, moving on, I fixed a few bugs with the MLX math code. But, for\r\nthe most part was correct. I also added recommended polling code for\r\nbrownouts as required by the datasheet.\r\n\r\nLast, I designed this code like the LCD code to support a type value\r\nwhen inited. This will allow the system to user a different sensor in the\r\nfuture without any API changes to the user.\r\n\r\nI will add test scripts for this next. Basic usage follows:\r\n\r\nimport flir\r\nflir.init()\r\nflir.display_ir(sensor.snapshot())\r\n\r\nAnd that's it. Super easy. If the user wants the raw temp values they\r\ncan use flir.read_ir() to get the ta and to values. The display function\r\nhas a hidden alpha and scale argument for controlling blending and the\r\nmin/max scaling.\r\n\r\nThe previous way we worked out scaling kinda sucked... it was a good\r\nshot, but, controllable min and maxes that autoscale by default just\r\nwork better. If the user knows the temp range then they can just set the\r\nmin and max.\r\n\r\nOne more thing - scaling is just done using nearest neighbor. Better scaling would have been cool, but, I think, pointless since the res is so low its not really buying anyone anything. We have to get that 80x60 FLIR 1 sensor in the future.\r\n\r\nAnyway, longest commit ever done.","created_at":"2016-03-24T04:06:36Z","updated_at":"2016-03-24T22:36:27Z","closed_at":"2016-03-24T22:36:27Z","merged_at":"2016-03-24T22:36:27Z","merge_commit_sha":"3b293addff28795e95dac4bb54d35ddf58b56e05","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openmv/openmv/pulls/103/commits","review_comments_url":"https://api.github.com/repos/openmv/openmv/pulls/103/comments","review_comment_url":"https://api.github.com/repos/openmv/openmv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openmv/openmv/issues/103/comments","statuses_url":"https://api.github.com/repos/openmv/openmv/statuses/88907c438c7f641242e102b2a58cf4f2428eea8c","head":{"label":"kwagyeman:master","ref":"master","sha":"88907c438c7f641242e102b2a58cf4f2428eea8c","user":{"login":"kwagyeman","id":5694981,"avatar_url":"https://avatars.githubusercontent.com/u/5694981?v=3","gravatar_id":"","url":"https://api.github.com/users/kwagyeman","html_url":"https://github.com/kwagyeman","followers_url":"https://api.github.com/users/kwagyeman/followers","following_url":"https://api.github.com/users/kwagyeman/following{/other_user}","gists_url":"https://api.github.com/users/kwagyeman/gists{/gist_id}","starred_url":"https://api.github.com/users/kwagyeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwagyeman/subscriptions","organizations_url":"https://api.github.com/users/kwagyeman/orgs","repos_url":"https://api.github.com/users/kwagyeman/repos","events_url":"https://api.github.com/users/kwagyeman/events{/privacy}","received_events_url":"https://api.github.com/users/kwagyeman/received_events","type":"User","site_admin":false},"repo":{"id":51560369,"name":"openmv","full_name":"kwagyeman/openmv","owner":{"login":"kwagyeman","id":5694981,"avatar_url":"https://avatars.githubusercontent.com/u/5694981?v=3","gravatar_id":"","url":"https://api.github.com/users/kwagyeman","html_url":"https://github.com/kwagyeman","followers_url":"https://api.github.com/users/kwagyeman/followers","following_url":"https://api.github.com/users/kwagyeman/following{/other_user}","gists_url":"https://api.github.com/users/kwagyeman/gists{/gist_id}","starred_url":"https://api.github.com/users/kwagyeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwagyeman/subscriptions","organizations_url":"https://api.github.com/users/kwagyeman/orgs","repos_url":"https://api.github.com/users/kwagyeman/repos","events_url":"https://api.github.com/users/kwagyeman/events{/privacy}","received_events_url":"https://api.github.com/users/kwagyeman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kwagyeman/openmv","description":"OpenMV Camera Module","fork":true,"url":"https://api.github.com/repos/kwagyeman/openmv","forks_url":"https://api.github.com/repos/kwagyeman/openmv/forks","keys_url":"https://api.github.com/repos/kwagyeman/openmv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kwagyeman/openmv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kwagyeman/openmv/teams","hooks_url":"https://api.github.com/repos/kwagyeman/openmv/hooks","issue_events_url":"https://api.github.com/repos/kwagyeman/openmv/issues/events{/number}","events_url":"https://api.github.com/repos/kwagyeman/openmv/events","assignees_url":"https://api.github.com/repos/kwagyeman/openmv/assignees{/user}","branches_url":"https://api.github.com/repos/kwagyeman/openmv/branches{/branch}","tags_url":"https://api.github.com/repos/kwagyeman/openmv/tags","blobs_url":"https://api.github.com/repos/kwagyeman/openmv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kwagyeman/openmv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kwagyeman/openmv/git/refs{/sha}","trees_url":"https://api.github.com/repos/kwagyeman/openmv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kwagyeman/openmv/statuses/{sha}","languages_url":"https://api.github.com/repos/kwagyeman/openmv/languages","stargazers_url":"https://api.github.com/repos/kwagyeman/openmv/stargazers","contributors_url":"https://api.github.com/repos/kwagyeman/openmv/contributors","subscribers_url":"https://api.github.com/repos/kwagyeman/openmv/subscribers","subscription_url":"https://api.github.com/repos/kwagyeman/openmv/subscription","commits_url":"https://api.github.com/repos/kwagyeman/openmv/commits{/sha}","git_commits_url":"https://api.github.com/repos/kwagyeman/openmv/git/commits{/sha}","comments_url":"https://api.github.com/repos/kwagyeman/openmv/comments{/number}","issue_comment_url":"https://api.github.com/repos/kwagyeman/openmv/issues/comments{/number}","contents_url":"https://api.github.com/repos/kwagyeman/openmv/contents/{+path}","compare_url":"https://api.github.com/repos/kwagyeman/openmv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kwagyeman/openmv/merges","archive_url":"https://api.github.com/repos/kwagyeman/openmv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kwagyeman/openmv/downloads","issues_url":"https://api.github.com/repos/kwagyeman/openmv/issues{/number}","pulls_url":"https://api.github.com/repos/kwagyeman/openmv/pulls{/number}","milestones_url":"https://api.github.com/repos/kwagyeman/openmv/milestones{/number}","notifications_url":"https://api.github.com/repos/kwagyeman/openmv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kwagyeman/openmv/labels{/name}","releases_url":"https://api.github.com/repos/kwagyeman/openmv/releases{/id}","deployments_url":"https://api.github.com/repos/kwagyeman/openmv/deployments","created_at":"2016-02-12T01:23:48Z","updated_at":"2016-02-12T01:23:55Z","pushed_at":"2016-03-24T22:11:34Z","git_url":"git://github.com/kwagyeman/openmv.git","ssh_url":"git@github.com:kwagyeman/openmv.git","clone_url":"https://github.com/kwagyeman/openmv.git","svn_url":"https://github.com/kwagyeman/openmv","homepage":null,"size":41846,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"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":"openmv:master","ref":"master","sha":"9320338b7edebdf864bfe8d3dd6cfb1a5c2f868d","user":{"login":"openmv","id":12023962,"avatar_url":"https://avatars.githubusercontent.com/u/12023962?v=3","gravatar_id":"","url":"https://api.github.com/users/openmv","html_url":"https://github.com/openmv","followers_url":"https://api.github.com/users/openmv/followers","following_url":"https://api.github.com/users/openmv/following{/other_user}","gists_url":"https://api.github.com/users/openmv/gists{/gist_id}","starred_url":"https://api.github.com/users/openmv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openmv/subscriptions","organizations_url":"https://api.github.com/users/openmv/orgs","repos_url":"https://api.github.com/users/openmv/repos","events_url":"https://api.github.com/users/openmv/events{/privacy}","received_events_url":"https://api.github.com/users/openmv/received_events","type":"Organization","site_admin":false},"repo":{"id":14360940,"name":"openmv","full_name":"openmv/openmv","owner":{"login":"openmv","id":12023962,"avatar_url":"https://avatars.githubusercontent.com/u/12023962?v=3","gravatar_id":"","url":"https://api.github.com/users/openmv","html_url":"https://github.com/openmv","followers_url":"https://api.github.com/users/openmv/followers","following_url":"https://api.github.com/users/openmv/following{/other_user}","gists_url":"https://api.github.com/users/openmv/gists{/gist_id}","starred_url":"https://api.github.com/users/openmv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openmv/subscriptions","organizations_url":"https://api.github.com/users/openmv/orgs","repos_url":"https://api.github.com/users/openmv/repos","events_url":"https://api.github.com/users/openmv/events{/privacy}","received_events_url":"https://api.github.com/users/openmv/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openmv/openmv","description":"OpenMV Camera Module","fork":false,"url":"https://api.github.com/repos/openmv/openmv","forks_url":"https://api.github.com/repos/openmv/openmv/forks","keys_url":"https://api.github.com/repos/openmv/openmv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openmv/openmv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openmv/openmv/teams","hooks_url":"https://api.github.com/repos/openmv/openmv/hooks","issue_events_url":"https://api.github.com/repos/openmv/openmv/issues/events{/number}","events_url":"https://api.github.com/repos/openmv/openmv/events","assignees_url":"https://api.github.com/repos/openmv/openmv/assignees{/user}","branches_url":"https://api.github.com/repos/openmv/openmv/branches{/branch}","tags_url":"https://api.github.com/repos/openmv/openmv/tags","blobs_url":"https://api.github.com/repos/openmv/openmv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openmv/openmv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openmv/openmv/git/refs{/sha}","trees_url":"https://api.github.com/repos/openmv/openmv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openmv/openmv/statuses/{sha}","languages_url":"https://api.github.com/repos/openmv/openmv/languages","stargazers_url":"https://api.github.com/repos/openmv/openmv/stargazers","contributors_url":"https://api.github.com/repos/openmv/openmv/contributors","subscribers_url":"https://api.github.com/repos/openmv/openmv/subscribers","subscription_url":"https://api.github.com/repos/openmv/openmv/subscription","commits_url":"https://api.github.com/repos/openmv/openmv/commits{/sha}","git_commits_url":"https://api.github.com/repos/openmv/openmv/git/commits{/sha}","comments_url":"https://api.github.com/repos/openmv/openmv/comments{/number}","issue_comment_url":"https://api.github.com/repos/openmv/openmv/issues/comments{/number}","contents_url":"https://api.github.com/repos/openmv/openmv/contents/{+path}","compare_url":"https://api.github.com/repos/openmv/openmv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openmv/openmv/merges","archive_url":"https://api.github.com/repos/openmv/openmv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openmv/openmv/downloads","issues_url":"https://api.github.com/repos/openmv/openmv/issues{/number}","pulls_url":"https://api.github.com/repos/openmv/openmv/pulls{/number}","milestones_url":"https://api.github.com/repos/openmv/openmv/milestones{/number}","notifications_url":"https://api.github.com/repos/openmv/openmv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openmv/openmv/labels{/name}","releases_url":"https://api.github.com/repos/openmv/openmv/releases{/id}","deployments_url":"https://api.github.com/repos/openmv/openmv/deployments","created_at":"2013-11-13T10:23:44Z","updated_at":"2016-03-21T22:35:52Z","pushed_at":"2016-03-24T22:36:27Z","git_url":"git://github.com/openmv/openmv.git","ssh_url":"git@github.com:openmv/openmv.git","clone_url":"https://github.com/openmv/openmv.git","svn_url":"https://github.com/openmv/openmv","homepage":null,"size":42295,"stargazers_count":248,"watchers_count":248,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":75,"mirror_url":null,"open_issues_count":8,"forks":75,"open_issues":8,"watchers":248,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openmv/openmv/pulls/103"},"html":{"href":"https://github.com/openmv/openmv/pull/103"},"issue":{"href":"https://api.github.com/repos/openmv/openmv/issues/103"},"comments":{"href":"https://api.github.com/repos/openmv/openmv/issues/103/comments"},"review_comments":{"href":"https://api.github.com/repos/openmv/openmv/pulls/103/comments"},"review_comment":{"href":"https://api.github.com/repos/openmv/openmv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openmv/openmv/pulls/103/commits"},"statuses":{"href":"https://api.github.com/repos/openmv/openmv/statuses/88907c438c7f641242e102b2a58cf4f2428eea8c"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"iabdalkader","id":4498013,"avatar_url":"https://avatars.githubusercontent.com/u/4498013?v=3","gravatar_id":"","url":"https://api.github.com/users/iabdalkader","html_url":"https://github.com/iabdalkader","followers_url":"https://api.github.com/users/iabdalkader/followers","following_url":"https://api.github.com/users/iabdalkader/following{/other_user}","gists_url":"https://api.github.com/users/iabdalkader/gists{/gist_id}","starred_url":"https://api.github.com/users/iabdalkader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iabdalkader/subscriptions","organizations_url":"https://api.github.com/users/iabdalkader/orgs","repos_url":"https://api.github.com/users/iabdalkader/repos","events_url":"https://api.github.com/users/iabdalkader/events{/privacy}","received_events_url":"https://api.github.com/users/iabdalkader/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":1,"additions":520,"deletions":401,"changed_files":9}}