{"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/4911","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/4911/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/4911/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/4911/events","html_url":"https://github.com/tensorflow/tensorflow/issues/4911","id":182488672,"number":4911,"title":"Greenish image when using convertYUV420ToARGB8888","user":{"login":"riless","id":1511944,"avatar_url":"https://avatars.githubusercontent.com/u/1511944?v=3","gravatar_id":"","url":"https://api.github.com/users/riless","html_url":"https://github.com/riless","followers_url":"https://api.github.com/users/riless/followers","following_url":"https://api.github.com/users/riless/following{/other_user}","gists_url":"https://api.github.com/users/riless/gists{/gist_id}","starred_url":"https://api.github.com/users/riless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riless/subscriptions","organizations_url":"https://api.github.com/users/riless/orgs","repos_url":"https://api.github.com/users/riless/repos","events_url":"https://api.github.com/users/riless/events{/privacy}","received_events_url":"https://api.github.com/users/riless/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"andrewharp","id":3376817,"avatar_url":"https://avatars.githubusercontent.com/u/3376817?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewharp","html_url":"https://github.com/andrewharp","followers_url":"https://api.github.com/users/andrewharp/followers","following_url":"https://api.github.com/users/andrewharp/following{/other_user}","gists_url":"https://api.github.com/users/andrewharp/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewharp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewharp/subscriptions","organizations_url":"https://api.github.com/users/andrewharp/orgs","repos_url":"https://api.github.com/users/andrewharp/repos","events_url":"https://api.github.com/users/andrewharp/events{/privacy}","received_events_url":"https://api.github.com/users/andrewharp/received_events","type":"User","site_admin":false},"assignees":[{"login":"andrewharp","id":3376817,"avatar_url":"https://avatars.githubusercontent.com/u/3376817?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewharp","html_url":"https://github.com/andrewharp","followers_url":"https://api.github.com/users/andrewharp/followers","following_url":"https://api.github.com/users/andrewharp/following{/other_user}","gists_url":"https://api.github.com/users/andrewharp/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewharp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewharp/subscriptions","organizations_url":"https://api.github.com/users/andrewharp/orgs","repos_url":"https://api.github.com/users/andrewharp/repos","events_url":"https://api.github.com/users/andrewharp/events{/privacy}","received_events_url":"https://api.github.com/users/andrewharp/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2016-10-12T10:20:52Z","updated_at":"2016-10-12T22:33:46Z","closed_at":null,"body":"I'm experimenting the [TensorFlow Android Camera Demo](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/android). but it seems that the [ImageUtils.convertYUV420ToARGB8888](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/android/src/org/tensorflow/demo/TensorFlowImageListener.java#L164) used to convert images from the camera input to RGB  bytes array is not handling very well the [YUV_420_888 format](https://developer.android.com/reference/android/graphics/ImageFormat.html).\r\n\r\nHere is the output of `ImageUtils.saveBitmap(rgbFrameBitmap);`\r\n\r\n![](http://i.imgur.com/bsL1czy.png)\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments/253359263","html_url":"https://github.com/tensorflow/tensorflow/issues/4911#issuecomment-253359263","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/4911","id":253359263,"user":{"login":"andrewharp","id":3376817,"avatar_url":"https://avatars.githubusercontent.com/u/3376817?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewharp","html_url":"https://github.com/andrewharp","followers_url":"https://api.github.com/users/andrewharp/followers","following_url":"https://api.github.com/users/andrewharp/following{/other_user}","gists_url":"https://api.github.com/users/andrewharp/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewharp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewharp/subscriptions","organizations_url":"https://api.github.com/users/andrewharp/orgs","repos_url":"https://api.github.com/users/andrewharp/repos","events_url":"https://api.github.com/users/andrewharp/events{/privacy}","received_events_url":"https://api.github.com/users/andrewharp/received_events","type":"User","site_admin":false},"created_at":"2016-10-12T22:33:46Z","updated_at":"2016-10-12T22:33:46Z","body":"Interesting, I noticed that the resulting bmp it's not just greenish, it's completely green -- all R and B values are 0.\r\n\r\nI'd theorize that either your device is not providing a 420sp camera frame or is not providing an actual argb8888 output bitmap, as I'm unable to replicate this locally. Have you made any other modifications to the code? What sort of device are you using?\r\n\r\nTo get a little bit more detail, could you add some logging in YUV2RGB() in [yuv2rgb.cc](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/android/jni/yuv2rgb.cc), and see what both the input and output values look like?"}}
{"actor":{"display_login":"andrewharp"}}