{"action":"created","issue":{"url":"https://api.github.com/repos/IntelRealSense/librealsense/issues/547","repository_url":"https://api.github.com/repos/IntelRealSense/librealsense","labels_url":"https://api.github.com/repos/IntelRealSense/librealsense/issues/547/labels{/name}","comments_url":"https://api.github.com/repos/IntelRealSense/librealsense/issues/547/comments","events_url":"https://api.github.com/repos/IntelRealSense/librealsense/issues/547/events","html_url":"https://github.com/IntelRealSense/librealsense/issues/547","id":240413159,"number":547,"title":"Actual exposure time and gain for each fisheye camera frame","user":{"login":"NikolausDemmel","id":479562,"avatar_url":"https://avatars2.githubusercontent.com/u/479562?v=3","gravatar_id":"","url":"https://api.github.com/users/NikolausDemmel","html_url":"https://github.com/NikolausDemmel","followers_url":"https://api.github.com/users/NikolausDemmel/followers","following_url":"https://api.github.com/users/NikolausDemmel/following{/other_user}","gists_url":"https://api.github.com/users/NikolausDemmel/gists{/gist_id}","starred_url":"https://api.github.com/users/NikolausDemmel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NikolausDemmel/subscriptions","organizations_url":"https://api.github.com/users/NikolausDemmel/orgs","repos_url":"https://api.github.com/users/NikolausDemmel/repos","events_url":"https://api.github.com/users/NikolausDemmel/events{/privacy}","received_events_url":"https://api.github.com/users/NikolausDemmel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-07-04T12:56:55Z","updated_at":"2017-07-13T07:25:57Z","closed_at":null,"body":"| Required Info  |   |\r\n|---|---|\r\n| Camera Model | ZR300 | \r\n| Firmware Version |  Camera FW: 2.0.71.28, Adapter FW: 1.29.0.0, Motion Module FW: 1.25.0.0 | \r\n| Operating System & Version | Ubuntu 16.04  |\r\n| Kernel Version (Linux Only)  | 4.4.0-83-generic #106-Ubuntu SMP Mon Jun 26 17:54:43 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux  |\r\n\r\nI would like to determine the actual gain and exposure times for the frames of the ZR300's fisheye camera. I am using librealsense `master` branch from this repository.\r\n\r\nIn order to investigate I modified the `cpp-config-ui` example a little bit to add output for every fisheye frame: exposure time in metadata of the frame, as well as exposure time and gain from `dev->get_options(...)`. I also enabled some output in the fisheye AEC code to see when gain / exposure options are changed.\r\n\r\nThere are some strange things and unclarities:\r\n\r\n1. Whenever exposure time changes, the value embedded in the metadata is about 2x the actual exposure time for one frame. For large exposure times it is sometimes also smaller (maybe some wrap-around).\r\n2. Embedded exposure time is sometimes of by 1 (actually, this is probably the resolution of the metadata embedding, which seems resolved only to 0.2 ms, not 0.1ms like the option).\r\n3. When setting the exposure time, there seems to sometimes be a lag until it takes effect. Which frame does setting the exposure time affect (next one)? Is it the same for gain? Is there any way to know the actual exposure and gain for a given frame?\r\n\r\nHere is a section of output with AEC on, followed by some output of changing exposure / gain manually in the gui:\r\n\r\nAEC:\r\n```\r\nReading fisheye frame with exposure metadata 200.0, exposure option 200.0 and gain option 21.0\r\nReading fisheye frame with exposure metadata 200.0, exposure option 200.0 and gain option 21.0\r\nTotalExposure 56.6, target_exposure 50.5\r\n ModifyExposure: DecreaseExposureGain: \r\n target_exposure0 51.5\r\n exposure 20.0, gain 2.6\r\nGainModified: gain = 2.6\r\n rounded to: 2.6\r\nReading fisheye frame with exposure metadata 400.0, exposure option 200.0 and gain option 19.0\r\nReading fisheye frame with exposure metadata 200.0, exposure option 200.0 and gain option 19.0\r\nReading fisheye frame with exposure metadata 200.0, exposure option 200.0 and gain option 19.0\r\nTotalExposure 51.5, target_exposure 44.5\r\n ModifyExposure: DecreaseExposureGain: \r\n target_exposure0 46.8\r\n exposure 20.0, gain 2.3\r\nGainModified: gain = 2.3\r\n rounded to: 2.3\r\nReading fisheye frame with exposure metadata 400.0, exposure option 200.0 and gain option 17.0\r\nReading fisheye frame with exposure metadata 200.0, exposure option 200.0 and gain option 17.0\r\n\r\n[...]\r\n\r\nReading fisheye frame with exposure metadata 110.0, exposure option 110.0 and gain option 15.0\r\nReading fisheye frame with exposure metadata 110.0, exposure option 110.0 and gain option 15.0\r\nReading fisheye frame with exposure metadata 110.0, exposure option 110.0 and gain option 15.0\r\nTotalExposure 22.0, target_exposure 23.9\r\n ModifyExposure: IncreaseExposureGain: \r\n target_exposure0 23.9\r\n exposure 12.0, gain 2.0\r\noutput exposure by algo = 12.0\r\nReading fisheye frame with exposure metadata 110.0, exposure option 119.0 and gain option 15.0\r\nReading fisheye frame with exposure metadata 220.0, exposure option 119.0 and gain option 15.0\r\nReading fisheye frame with exposure metadata 118.0, exposure option 119.0 and gain option 15.0\r\nTotalExposure 23.9, target_exposure 26.2\r\n ModifyExposure: IncreaseExposureGain: \r\n target_exposure0 26.2\r\n exposure 13.1, gain 2.0\r\noutput exposure by algo = 13.1\r\nReading fisheye frame with exposure metadata 118.0, exposure option 130.0 and gain option 15.0\r\nReading fisheye frame with exposure metadata 238.0, exposure option 130.0 and gain option 15.0\r\nReading fisheye frame with exposure metadata 130.0, exposure option 130.0 and gain option 15.0\r\nTotalExposure 26.2, target_exposure 28.5\r\n ModifyExposure: IncreaseExposureGain: \r\n target_exposure0 28.5\r\n exposure 14.3, gain 2.0\r\noutput exposure by algo = 14.3\r\nReading fisheye frame with exposure metadata 130.0, exposure option 130.0 and gain option 15.0\r\nReading fisheye frame with exposure metadata 260.0, exposure option 142.0 and gain option 15.0\r\nReading fisheye frame with exposure metadata 142.0, exposure option 142.0 and gain option 15.0\r\nReading fisheye frame with exposure metadata 142.0, exposure option 142.0 and gain option 15.0\r\n```\r\n\r\nManually changing:\r\n```\r\nReading fisheye frame with exposure metadata 210.0, exposure option 212.0 and gain option 42.0\r\nmanually setting fisheye exposure to 213.0\r\nReading fisheye frame with exposure metadata 424.0, exposure option 213.0 and gain option 42.0\r\nReading fisheye frame with exposure metadata 212.0, exposure option 213.0 and gain option 42.0\r\nmanually setting fisheye exposure to 214.0\r\nmanually setting fisheye exposure to 216.0\r\nReading fisheye frame with exposure metadata 426.0, exposure option 216.0 and gain option 42.0\r\nmanually setting fisheye exposure to 217.0\r\nmanually setting fisheye exposure to 219.0\r\nReading fisheye frame with exposure metadata 432.0, exposure option 219.0 and gain option 42.0\r\nReading fisheye frame with exposure metadata 434.0, exposure option 219.0 and gain option 42.0\r\nmanually setting fisheye exposure to 220.0\r\nReading fisheye frame with exposure metadata 438.0, exposure option 220.0 and gain option 42.0\r\nmanually setting fisheye exposure to 222.0\r\nReading fisheye frame with exposure metadata 220.0, exposure option 222.0 and gain option 42.0\r\nReading fisheye frame with exposure metadata 440.0, exposure option 222.0 and gain option 42.0\r\nReading fisheye frame with exposure metadata 222.0, exposure option 222.0 and gain option 42.0\r\nReading fisheye frame with exposure metadata 222.0, exposure option 222.0 and gain option 42.0\r\n\r\n[...]\r\n\r\nReading fisheye frame with exposure metadata 304.0, exposure option 304.0 and gain option 31.0\r\nReading fisheye frame with exposure metadata 304.0, exposure option 304.0 and gain option 31.0\r\nmanually setting fisheye exposure to 303.0\r\nReading fisheye frame with exposure metadata 96.0, exposure option 303.0 and gain option 31.0\r\nReading fisheye frame with exposure metadata 302.0, exposure option 303.0 and gain option 31.0\r\nReading fisheye frame with exposure metadata 302.0, exposure option 303.0 and gain option 31.0\r\nmanually setting fisheye exposure to 301.0\r\nReading fisheye frame with exposure metadata 94.0, exposure option 301.0 and gain option 31.0\r\nmanually setting fisheye exposure to 297.0\r\nmanually setting fisheye exposure to 295.0\r\nReading fisheye frame with exposure metadata 82.0, exposure option 295.0 and gain option 31.0\r\nmanually setting fisheye exposure to 291.0\r\nmanually setting fisheye exposure to 290.0\r\nReading fisheye frame with exposure metadata 70.0, exposure option 290.0 and gain option 31.0\r\nmanually setting fisheye exposure to 285.0\r\nmanually setting fisheye exposure to 282.0\r\nReading fisheye frame with exposure metadata 58.0, exposure option 282.0 and gain option 31.0\r\nmanually setting fisheye exposure to 278.0\r\nmanually setting fisheye exposure to 277.0\r\nReading fisheye frame with exposure metadata 52.0, exposure option 277.0 and gain option 31.0\r\nmanually setting fisheye exposure to 275.0\r\nReading fisheye frame with exposure metadata 42.0, exposure option 275.0 and gain option 31.0\r\nmanually setting fisheye exposure to 272.0\r\nReading fisheye frame with exposure metadata 38.0, exposure option 272.0 and gain option 31.0\r\nmanually setting fisheye exposure to 271.0\r\nReading fisheye frame with exposure metadata 32.0, exposure option 271.0 and gain option 31.0\r\nmanually setting fisheye exposure to 269.0\r\nReading fisheye frame with exposure metadata 30.0, exposure option 269.0 and gain option 31.0\r\nReading fisheye frame with exposure metadata 268.0, exposure option 269.0 and gain option 31.0\r\nReading fisheye frame with exposure metadata 268.0, exposure option 269.0 and gain option 31.0\r\n\r\n[...]\r\n\r\nReading fisheye frame with exposure metadata 268.0, exposure option 269.0 and gain option 31.0\r\nReading fisheye frame with exposure metadata 268.0, exposure option 269.0 and gain option 31.0\r\nReading fisheye frame with exposure metadata 268.0, exposure option 269.0 and gain option 31.0\r\nmanually setting fisheye exposure to 268.0\r\nReading fisheye frame with exposure metadata 268.0, exposure option 268.0 and gain option 31.0\r\nReading fisheye frame with exposure metadata 26.0, exposure option 268.0 and gain option 31.0\r\nReading fisheye frame with exposure metadata 268.0, exposure option 268.0 and gain option 31.0\r\nmanually setting fisheye exposure to 269.0\r\nmanually setting fisheye exposure to 272.0\r\nReading fisheye frame with exposure metadata 24.0, exposure option 272.0 and gain option 31.0\r\nmanually setting fisheye exposure to 275.0\r\nmanually setting fisheye exposure to 278.0\r\nReading fisheye frame with exposure metadata 32.0, exposure option 278.0 and gain option 31.0\r\nmanually setting fisheye exposure to 282.0\r\nmanually setting fisheye exposure to 284.0\r\nReading fisheye frame with exposure metadata 44.0, exposure option 284.0 and gain option 31.0\r\nmanually setting fisheye exposure to 287.0\r\nReading fisheye frame with exposure metadata 56.0, exposure option 287.0 and gain option 31.0\r\nmanually setting fisheye exposure to 290.0\r\nmanually setting fisheye exposure to 293.0\r\nReading fisheye frame with exposure metadata 62.0, exposure option 293.0 and gain option 31.0\r\nReading fisheye frame with exposure metadata 68.0, exposure option 293.0 and gain option 31.0\r\nmanually setting fisheye exposure to 295.0\r\nmanually setting fisheye exposure to 297.0\r\nReading fisheye frame with exposure metadata 74.0, exposure option 297.0 and gain option 31.0\r\nmanually setting fisheye exposure to 298.0\r\nReading fisheye frame with exposure metadata 78.0, exposure option 298.0 and gain option 31.0\r\nReading fisheye frame with exposure metadata 82.0, exposure option 298.0 and gain option 31.0\r\nmanually setting fisheye exposure to 300.0\r\nReading fisheye frame with exposure metadata 84.0, exposure option 300.0 and gain option 31.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 31.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 31.0\r\n\r\n[...]\r\n\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 31.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 31.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 31.0\r\nmanually setting fisheye gain to 30.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 30.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 30.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 30.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 30.0\r\nmanually setting fisheye gain to 31.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 31.0\r\nmanually setting fisheye gain to 36.0\r\nmanually setting fisheye gain to 41.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 41.0\r\nmanually setting fisheye gain to 43.0\r\nmanually setting fisheye gain to 48.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 48.0\r\nmanually setting fisheye gain to 50.0\r\nmanually setting fisheye gain to 53.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 53.0\r\nmanually setting fisheye gain to 56.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 56.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 56.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 56.0\r\n\r\n[...]\r\n\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 56.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 56.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 56.0\r\nmanually setting fisheye gain to 53.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 53.0\r\nmanually setting fisheye gain to 52.0\r\nmanually setting fisheye gain to 48.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 48.0\r\nmanually setting fisheye gain to 44.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 44.0\r\nmanually setting fisheye gain to 36.0\r\nmanually setting fisheye gain to 34.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 34.0\r\nmanually setting fisheye gain to 29.0\r\nmanually setting fisheye gain to 24.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 24.0\r\nmanually setting fisheye gain to 22.0\r\nmanually setting fisheye gain to 19.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 19.0\r\nmanually setting fisheye gain to 15.0\r\nmanually setting fisheye gain to 13.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 13.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 13.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 13.0\r\nmanually setting fisheye gain to 12.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 12.0\r\nReading fisheye frame with exposure metadata 300.0, exposure option 300.0 and gain option 12.0\r\n```"},"comment":{"url":"https://api.github.com/repos/IntelRealSense/librealsense/issues/comments/314995172","html_url":"https://github.com/IntelRealSense/librealsense/issues/547#issuecomment-314995172","issue_url":"https://api.github.com/repos/IntelRealSense/librealsense/issues/547","id":314995172,"user":{"login":"dorodnic","id":6958867,"avatar_url":"https://avatars1.githubusercontent.com/u/6958867?v=3","gravatar_id":"","url":"https://api.github.com/users/dorodnic","html_url":"https://github.com/dorodnic","followers_url":"https://api.github.com/users/dorodnic/followers","following_url":"https://api.github.com/users/dorodnic/following{/other_user}","gists_url":"https://api.github.com/users/dorodnic/gists{/gist_id}","starred_url":"https://api.github.com/users/dorodnic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dorodnic/subscriptions","organizations_url":"https://api.github.com/users/dorodnic/orgs","repos_url":"https://api.github.com/users/dorodnic/repos","events_url":"https://api.github.com/users/dorodnic/events{/privacy}","received_events_url":"https://api.github.com/users/dorodnic/received_events","type":"User","site_admin":false},"created_at":"2017-07-13T07:25:57Z","updated_at":"2017-07-13T07:25:57Z","body":"SR300 (Close-Range) and upcoming RS400 (Long-Range) both provide actual exposure and gain through UVC metadata. Once this functionality is upstreamed we will align to the standard. Until then we will make proprietary pacthes available for 4.4, 4.8 and 4.10. \r\nIt seems that ZR300 firmware is pretty much \"sealed\" at this time so it is hard to get a comment. You can however submit official support request through the [support site](http://www.intel.com/content/www/us/en/support/emerging-technologies/intel-realsense-technology.html). "}}
{"actor":{"display_login":"dorodnic"}}