aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorTimothy Knight <tknight@google.com>2014-08-14 14:55:00 -0700
committerTimothy Knight <tknight@google.com>2014-08-14 14:55:00 -0700
commit30e0482adc97f52bb3965334411fb75082bc58bb (patch)
tree3ff7d562144c652fe46ebeb9363e40f43dc2a3fa /apps
parentd223dabfa229c213b18b89458b25f8bb0e62566a (diff)
downloadpdk-30e0482adc97f52bb3965334411fb75082bc58bb.tar.gz
CameraITS: Clarified how the crop regions test works.
Change-Id: Ifb9033c00dfda0adfa8110ac2d6fa6326f500bc8
Diffstat (limited to 'apps')
-rw-r--r--apps/CameraITS/tests/scene1/test_crop_regions.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/CameraITS/tests/scene1/test_crop_regions.py b/apps/CameraITS/tests/scene1/test_crop_regions.py
index 30e447d..efa8573 100644
--- a/apps/CameraITS/tests/scene1/test_crop_regions.py
+++ b/apps/CameraITS/tests/scene1/test_crop_regions.py
@@ -52,6 +52,9 @@ def main():
wfull, hfull = cap_full["width"], cap_full["height"]
# Capture a burst of crop region frames.
+ # Each is captured into an image 1/2x1/2 the size, which should allow
+ # these crop images to be compared with 1/2x1/2 regions that are
+ # cropped from the full frame.
reqs = []
for x,y,w,h in REGIONS:
req = its.objects.manual_capture_request(s,e)
@@ -73,6 +76,7 @@ def main():
# the full image, to find the best match (which should be
# the region that corresponds to this crop image).
img_crop = its.image.convert_capture_to_rgb_image(cap)
+ its.image.write_image(img_crop, "%s_crop%d.jpg" % (NAME, i))
min_diff = None
min_diff_region = None
for j,(x,y,w,h) in enumerate(REGIONS):
@@ -82,7 +86,6 @@ def main():
tile_full = tile_full[0:htest:, 0:wtest:, ::]
tile_crop = img_crop[0:htest:, 0:wtest:, ::]
its.image.write_image(tile_full, "%s_fullregion%d.jpg"%(NAME,j))
- its.image.write_image(tile_crop, "%s_crop%d.jpg" % (NAME, i))
diff = numpy.fabs(tile_full - tile_crop).mean()
if min_diff is None or diff < min_diff:
min_diff = diff