aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/CameraITS/README13
-rw-r--r--apps/CameraITS/build/envsetup.sh7
-rw-r--r--apps/CameraITS/pymodules/its/device.py2
-rw-r--r--apps/CameraITS/tests/scene0/test_capture_result_dump.py1
-rw-r--r--apps/CameraITS/tests/scene0/test_metadata.py1
-rw-r--r--apps/CameraITS/tests/scene0/test_param_sensitivity_burst.py1
-rw-r--r--apps/CameraITS/tests/scene1/test_crop_regions.py3
-rw-r--r--apps/CameraITS/tests/scene1/test_yuv_plus_jpeg.py4
-rw-r--r--apps/CameraITS/tests/scene1/test_yuv_plus_raw.py2
-rw-r--r--apps/CameraITS/tests/scene1/test_yuv_plus_raw10.py2
-rw-r--r--apps/CameraITS/tools/compute_dng_noise_model.py5
11 files changed, 19 insertions, 22 deletions
diff --git a/apps/CameraITS/README b/apps/CameraITS/README
index 471c933..fc385f0 100644
--- a/apps/CameraITS/README
+++ b/apps/CameraITS/README
@@ -77,19 +77,6 @@ Note that the Anaconda python executable's directory must be at the front of
your PATH environment variable, assuming that you are using this Python
distribution. The Anaconda installer may set this up for you automatically.
-Some tests require OpenCV to be installed.
-
-(For Ubuntu users)
-
- sudo apt-get install python2.7-opencv
-
-(For Anaconda users)
-
- conda install opencv
-
-To verify that OpenCV is installed properly, the "cv2" package should be
-available to be imported from inside the Python interpreter.
-
Once your Python installation is ready, set up the test environment.
2.2.1. Linux + Mac OS X
diff --git a/apps/CameraITS/build/envsetup.sh b/apps/CameraITS/build/envsetup.sh
index a258ddb..7e2a86b 100644
--- a/apps/CameraITS/build/envsetup.sh
+++ b/apps/CameraITS/build/envsetup.sh
@@ -29,8 +29,11 @@ command -v python >/dev/null 2>&1 || \
python -V 2>&1 | grep -q "Python 2.7" || \
echo ">> Require python 2.7" >&2
-python -c 'import numpy, PIL, Image, matplotlib, pylab, cv2' >/dev/null 2>&1 || \
- echo ">> Require numpy+scipy stack" >&2
+for M in numpy PIL Image matplotlib pylab
+do
+ python -c "import $M" >/dev/null 2>&1 || \
+ echo ">> Require Python $M module" >&2
+done
export PYTHONPATH="$PWD/pymodules:$PYTHONPATH"
diff --git a/apps/CameraITS/pymodules/its/device.py b/apps/CameraITS/pymodules/its/device.py
index cbf579e..ea763ef 100644
--- a/apps/CameraITS/pymodules/its/device.py
+++ b/apps/CameraITS/pymodules/its/device.py
@@ -291,7 +291,7 @@ class ItsSession(object):
format(s) of the captured image. The formats may be "yuv", "jpeg",
"dng", "raw", or "raw10". The default is a YUV420 frame ("yuv")
corresponding to a full sensor frame.
-
+
Note that one or more surfaces can be specified, allowing a capture to
request images back in multiple formats (e.g.) raw+yuv, raw+jpeg,
yuv+jpeg, raw+yuv+jpeg. If the size is omitted for a surface, the
diff --git a/apps/CameraITS/tests/scene0/test_capture_result_dump.py b/apps/CameraITS/tests/scene0/test_capture_result_dump.py
index ceac43a..40c3e45 100644
--- a/apps/CameraITS/tests/scene0/test_capture_result_dump.py
+++ b/apps/CameraITS/tests/scene0/test_capture_result_dump.py
@@ -27,6 +27,7 @@ def main():
with its.device.ItsSession() as cam:
# Arbitrary capture request exposure values; image content is not
# important for this test, only the metadata.
+ # TODO: Update test to ensure manual settings are within legal ranges.
req = its.objects.manual_capture_request(100, 10*1000*1000)
req["android.statistics.lensShadingMapMode"] = 1
cap = cam.do_capture(req, cam.CAP_YUV)
diff --git a/apps/CameraITS/tests/scene0/test_metadata.py b/apps/CameraITS/tests/scene0/test_metadata.py
index ff39290..861c071 100644
--- a/apps/CameraITS/tests/scene0/test_metadata.py
+++ b/apps/CameraITS/tests/scene0/test_metadata.py
@@ -31,6 +31,7 @@ def main():
# Arbitrary capture request exposure values; image content is not
# important for this test, only the metadata.
props = cam.get_camera_properties()
+ # TODO: Update test to ensure manual settings are within legal ranges.
req = its.objects.manual_capture_request(100, 10*1000*1000)
cap = cam.do_capture(req, cam.CAP_YUV)
md = cap["metadata"]
diff --git a/apps/CameraITS/tests/scene0/test_param_sensitivity_burst.py b/apps/CameraITS/tests/scene0/test_param_sensitivity_burst.py
index ad94446..f906287 100644
--- a/apps/CameraITS/tests/scene0/test_param_sensitivity_burst.py
+++ b/apps/CameraITS/tests/scene0/test_param_sensitivity_burst.py
@@ -34,6 +34,7 @@ def main():
sens_range = props['android.sensor.info.sensitivityRange']
sens_step = (sens_range[1] - sens_range[0]) / NUM_STEPS
sensitivities = range(sens_range[0], sens_range[1], sens_step)
+ # TODO: Update test to ensure manual settings are within legal ranges.
reqs = [its.objects.manual_capture_request(s,10*1000*1000)
for s in sensitivities]
diff --git a/apps/CameraITS/tests/scene1/test_crop_regions.py b/apps/CameraITS/tests/scene1/test_crop_regions.py
index efa8573..d0cd70a 100644
--- a/apps/CameraITS/tests/scene1/test_crop_regions.py
+++ b/apps/CameraITS/tests/scene1/test_crop_regions.py
@@ -23,6 +23,9 @@ import matplotlib.pyplot
import copy
import numpy
+# TODO: Fix this test. Currently assumes a non-supported output size in the
+# HAL-cropped images.
+
def main():
"""Test that crop regions work.
"""
diff --git a/apps/CameraITS/tests/scene1/test_yuv_plus_jpeg.py b/apps/CameraITS/tests/scene1/test_yuv_plus_jpeg.py
index 305d42e..7841b36 100644
--- a/apps/CameraITS/tests/scene1/test_yuv_plus_jpeg.py
+++ b/apps/CameraITS/tests/scene1/test_yuv_plus_jpeg.py
@@ -37,12 +37,12 @@ def main():
cap_yuv, cap_jpeg = cam.do_capture(req, [fmt_yuv, fmt_jpeg])
- img = its.image.convert_capture_to_rgb_image(cap_yuv)
+ img = its.image.convert_capture_to_rgb_image(cap_yuv, True)
its.image.write_image(img, "%s_yuv.jpg" % (NAME))
tile = its.image.get_image_patch(img, 0.45, 0.45, 0.1, 0.1)
rgb0 = its.image.compute_image_means(tile)
- img = its.image.convert_capture_to_rgb_image(cap_jpeg)
+ img = its.image.convert_capture_to_rgb_image(cap_jpeg, True)
its.image.write_image(img, "%s_jpeg.jpg" % (NAME))
tile = its.image.get_image_patch(img, 0.45, 0.45, 0.1, 0.1)
rgb1 = its.image.compute_image_means(tile)
diff --git a/apps/CameraITS/tests/scene1/test_yuv_plus_raw.py b/apps/CameraITS/tests/scene1/test_yuv_plus_raw.py
index 3e4ee68..1d71626 100644
--- a/apps/CameraITS/tests/scene1/test_yuv_plus_raw.py
+++ b/apps/CameraITS/tests/scene1/test_yuv_plus_raw.py
@@ -37,7 +37,7 @@ def main():
cap_raw, cap_yuv = cam.do_capture(req, cam.CAP_RAW_YUV)
img = its.image.convert_capture_to_rgb_image(cap_yuv)
- its.image.write_image(img, "%s_yuv.jpg" % (NAME))
+ its.image.write_image(img, "%s_yuv.jpg" % (NAME), True)
tile = its.image.get_image_patch(img, 0.45, 0.45, 0.1, 0.1)
rgb0 = its.image.compute_image_means(tile)
diff --git a/apps/CameraITS/tests/scene1/test_yuv_plus_raw10.py b/apps/CameraITS/tests/scene1/test_yuv_plus_raw10.py
index ad0ee01..dd3cb58 100644
--- a/apps/CameraITS/tests/scene1/test_yuv_plus_raw10.py
+++ b/apps/CameraITS/tests/scene1/test_yuv_plus_raw10.py
@@ -37,7 +37,7 @@ def main():
cap_raw, cap_yuv = cam.do_capture(req,
[{"format":"raw10"}, {"format":"yuv"}])
- img = its.image.convert_capture_to_rgb_image(cap_yuv)
+ img = its.image.convert_capture_to_rgb_image(cap_yuv, True)
its.image.write_image(img, "%s_yuv.jpg" % (NAME))
tile = its.image.get_image_patch(img, 0.45, 0.45, 0.1, 0.1)
rgb0 = its.image.compute_image_means(tile)
diff --git a/apps/CameraITS/tools/compute_dng_noise_model.py b/apps/CameraITS/tools/compute_dng_noise_model.py
index aff71c6..60186c5 100644
--- a/apps/CameraITS/tools/compute_dng_noise_model.py
+++ b/apps/CameraITS/tools/compute_dng_noise_model.py
@@ -50,10 +50,11 @@ def main():
s_e_prod *= 2
# Capture raw frames across the full sensitivity range.
- SENSITIVITY_STEP = 400
+ NUM_SENS_STEPS = 15
+ sens_step = int((sens_max - sens_min - 1) / float(NUM_SENS_STEPS))
reqs = []
sens = []
- for s in range(sens_min, sens_max, SENSITIVITY_STEP):
+ for s in range(sens_min, sens_max, sens_step):
e = int(s_e_prod / float(s))
req = its.objects.manual_capture_request(s, e)
req["android.colorCorrection.transform"] = \