aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorTimothy Knight <tknight@google.com>2014-07-31 01:58:40 -0700
committerTimothy Knight <tknight@google.com>2014-07-31 01:58:59 -0700
commitab0592b1f25133e64ece3e5d24c9d5fc5ef011f9 (patch)
tree90f3f76a43ee351c87a5f3c69c178a554fcfe2b1 /apps
parentde9775ccb24432ca0f5864ce3df900cffbf005ed (diff)
downloadpdk-ab0592b1f25133e64ece3e5d24c9d5fc5ef011f9.tar.gz
CameraITS: Added tonemap sequence test
Change-Id: I2ea3274a4fdab0753b56175098012c3148c98012
Diffstat (limited to 'apps')
-rw-r--r--apps/CameraITS/tests/scene1/test_tonemap_sequence.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/apps/CameraITS/tests/scene1/test_tonemap_sequence.py b/apps/CameraITS/tests/scene1/test_tonemap_sequence.py
new file mode 100644
index 0000000..c72e69a
--- /dev/null
+++ b/apps/CameraITS/tests/scene1/test_tonemap_sequence.py
@@ -0,0 +1,46 @@
+# Copyright 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import its.image
+import its.device
+import its.objects
+import os.path
+
+def main():
+ """Test a sequence of shots with different tonrmap curves.
+ """
+ NAME = os.path.basename(__file__).split(".")[0]
+
+ with its.device.ItsSession() as cam:
+ sens, exp_time, _,_,_ = cam.do_3a(do_af=False)
+
+ # Capture 3 manual shots with a linear tonemap.
+ req = its.objects.manual_capture_request(sens, exp_time, True)
+ for i in [0,1,2]:
+ cap = cam.do_capture(req)
+ img = its.image.convert_capture_to_rgb_image(cap)
+ its.image.write_image(img, "%s_i=%d.jpg" % (NAME, i))
+
+ # Capture 3 manual shots with the default tonemap.
+ req = its.objects.manual_capture_request(sens, exp_time, False)
+ for i in [3,4,5]:
+ cap = cam.do_capture(req)
+ img = its.image.convert_capture_to_rgb_image(cap)
+ its.image.write_image(img, "%s_i=%d.jpg" % (NAME, i))
+
+ # TODO: Add pass/fail check.
+
+if __name__ == '__main__':
+ main()
+