{"action":"created","issue":{"url":"https://api.github.com/repos/terraref/computing-pipeline/issues/428","repository_url":"https://api.github.com/repos/terraref/computing-pipeline","labels_url":"https://api.github.com/repos/terraref/computing-pipeline/issues/428/labels{/name}","comments_url":"https://api.github.com/repos/terraref/computing-pipeline/issues/428/comments","events_url":"https://api.github.com/repos/terraref/computing-pipeline/issues/428/events","html_url":"https://github.com/terraref/computing-pipeline/issues/428","id":307737558,"number":428,"title":"Determine threshold for QAQC metrics","user":{"login":"max-zilla","id":14166971,"avatar_url":"https://avatars1.githubusercontent.com/u/14166971?v=4","gravatar_id":"","url":"https://api.github.com/users/max-zilla","html_url":"https://github.com/max-zilla","followers_url":"https://api.github.com/users/max-zilla/followers","following_url":"https://api.github.com/users/max-zilla/following{/other_user}","gists_url":"https://api.github.com/users/max-zilla/gists{/gist_id}","starred_url":"https://api.github.com/users/max-zilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max-zilla/subscriptions","organizations_url":"https://api.github.com/users/max-zilla/orgs","repos_url":"https://api.github.com/users/max-zilla/repos","events_url":"https://api.github.com/users/max-zilla/events{/privacy}","received_events_url":"https://api.github.com/users/max-zilla/received_events","type":"User","site_admin":false},"labels":[{"id":254807797,"url":"https://api.github.com/repos/terraref/computing-pipeline/labels/help%20wanted","name":"help wanted","color":"b60205","default":true}],"state":"open","locked":false,"assignee":{"login":"dlebauer","id":464871,"avatar_url":"https://avatars2.githubusercontent.com/u/464871?v=4","gravatar_id":"","url":"https://api.github.com/users/dlebauer","html_url":"https://github.com/dlebauer","followers_url":"https://api.github.com/users/dlebauer/followers","following_url":"https://api.github.com/users/dlebauer/following{/other_user}","gists_url":"https://api.github.com/users/dlebauer/gists{/gist_id}","starred_url":"https://api.github.com/users/dlebauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlebauer/subscriptions","organizations_url":"https://api.github.com/users/dlebauer/orgs","repos_url":"https://api.github.com/users/dlebauer/repos","events_url":"https://api.github.com/users/dlebauer/events{/privacy}","received_events_url":"https://api.github.com/users/dlebauer/received_events","type":"User","site_admin":false},"assignees":[{"login":"dlebauer","id":464871,"avatar_url":"https://avatars2.githubusercontent.com/u/464871?v=4","gravatar_id":"","url":"https://api.github.com/users/dlebauer","html_url":"https://github.com/dlebauer","followers_url":"https://api.github.com/users/dlebauer/followers","following_url":"https://api.github.com/users/dlebauer/following{/other_user}","gists_url":"https://api.github.com/users/dlebauer/gists{/gist_id}","starred_url":"https://api.github.com/users/dlebauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlebauer/subscriptions","organizations_url":"https://api.github.com/users/dlebauer/orgs","repos_url":"https://api.github.com/users/dlebauer/repos","events_url":"https://api.github.com/users/dlebauer/events{/privacy}","received_events_url":"https://api.github.com/users/dlebauer/received_events","type":"User","site_admin":false},{"login":"Paheding","id":24866799,"avatar_url":"https://avatars3.githubusercontent.com/u/24866799?v=4","gravatar_id":"","url":"https://api.github.com/users/Paheding","html_url":"https://github.com/Paheding","followers_url":"https://api.github.com/users/Paheding/followers","following_url":"https://api.github.com/users/Paheding/following{/other_user}","gists_url":"https://api.github.com/users/Paheding/gists{/gist_id}","starred_url":"https://api.github.com/users/Paheding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Paheding/subscriptions","organizations_url":"https://api.github.com/users/Paheding/orgs","repos_url":"https://api.github.com/users/Paheding/repos","events_url":"https://api.github.com/users/Paheding/events{/privacy}","received_events_url":"https://api.github.com/users/Paheding/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2018-03-22T17:15:14Z","updated_at":"2018-04-11T18:19:21Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"@Paheding provided the following images as representative of the various levels of light that we see at different times of day/weather in the field. The goal here is to decide where the thresholds are in bright/dark images where we reject them as being too bright/dark.\r\n\r\nDarkness levels:\r\n![screen shot 2018-03-22 at 11 56 47 am](https://user-images.githubusercontent.com/14166971/37785433-1f2b9194-2dc8-11e8-8ce9-6ed6665884f9.png)\r\n\r\nBrightness levels:\r\n![screen shot 2018-03-22 at 11 57 16 am](https://user-images.githubusercontent.com/14166971/37785458-3169e2d4-2dc8-11e8-8a90-fd014256ba25.png)\r\n\r\nIn order to try and provide some quantification behind these, we decided to try running a known image with known canopy cover % through the same function at these different levels to see how the cc% varies from original.\r\n\r\nThe test .bin file and (already cleaned) metadata can be found here:\r\nhttps://github.com/terraref/stereo_rgb/tree/master/tests/data\r\n\r\nWe can leverage the new stereo_rgb pypi package here as well:\r\n```\r\npip install terraref-stereo-rgb\r\n```\r\n\r\nThis python code will return CC for the input image:\r\n```\r\nimport json\r\nfrom terraref.stereo_rgb import *\r\n\r\n# Get image shape from metadata\r\nwith open('metadata.json') as f: \r\n        metadata = json.load(f)\r\ndims = get_image_shape(metadata, 'left')\r\n\r\n# Convert raw to numpy array\r\nim = process_raw(dims, 'binfile.bin')\r\n\r\n# canopy_cover from numpy array, should be 85.33740515128663\r\ncc = calculate_canopycover(im)\r\n\r\n# if you want to write the binfile to a geotiff...\r\nfrom terrautils.spatial import geojson_to_tuples\r\nfrom terrautils.formats import create_geotiff\r\nboundbox = geojson_to_tuples(metadata['spatial_metadata']['left']['bounding_box'])\r\ncreate_geotiff(im, boundbox, 'output.tif')\r\n\r\n# ...and if you want to generate CC from a geotiff instead of bin (i.e. after changing brightness)\r\nfrom osgeo import gdal\r\nfrom numpy import rollaxis\r\nrast = gdal.Open(geotiff_path)\r\narr = rast.ReadAsArray()\r\ncc = calculate_canopycover(rollaxis(arr,0,3))\r\n```"},"comment":{"url":"https://api.github.com/repos/terraref/computing-pipeline/issues/comments/380548190","html_url":"https://github.com/terraref/computing-pipeline/issues/428#issuecomment-380548190","issue_url":"https://api.github.com/repos/terraref/computing-pipeline/issues/428","id":380548190,"user":{"login":"Paheding","id":24866799,"avatar_url":"https://avatars3.githubusercontent.com/u/24866799?v=4","gravatar_id":"","url":"https://api.github.com/users/Paheding","html_url":"https://github.com/Paheding","followers_url":"https://api.github.com/users/Paheding/followers","following_url":"https://api.github.com/users/Paheding/following{/other_user}","gists_url":"https://api.github.com/users/Paheding/gists{/gist_id}","starred_url":"https://api.github.com/users/Paheding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Paheding/subscriptions","organizations_url":"https://api.github.com/users/Paheding/orgs","repos_url":"https://api.github.com/users/Paheding/repos","events_url":"https://api.github.com/users/Paheding/events{/privacy}","received_events_url":"https://api.github.com/users/Paheding/received_events","type":"User","site_admin":false},"created_at":"2018-04-11T18:19:21Z","updated_at":"2018-04-11T18:19:21Z","author_association":"NONE","body":"I have added additional results as we discussed last time, plz check https://drive.google.com/open?id=1OuXE_8y9xVfIGV4YEX1AlogYx7p5bAe1"}}
{"actor":{"display_login":"Paheding"}}