Digital Image Processing Tests (#1178)

* add version of smaller image

* swap image in tests

* edits for image src
This commit is contained in:
Marvin M. Michum 2019-09-13 07:40:14 -04:00 committed by GitHub
parent 47d17951b8
commit f8e30cfab1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -12,15 +12,15 @@ from cv2 import imread, cvtColor, COLOR_BGR2GRAY
from numpy import array, uint8
from PIL import Image
img = imread(r"digital_image_processing/image_data/lena.jpg")
img = imread(r"digital_image_processing/image_data/lena_small.jpg")
gray = cvtColor(img, COLOR_BGR2GRAY)
# Test: change_contrast()
def test_change_contrast():
with Image.open("digital_image_processing/image_data/lena.jpg") as img:
with Image.open("digital_image_processing/image_data/lena_small.jpg") as img:
# Work around assertion for response
assert str(cc.change_contrast(img, 110)).startswith(
"<PIL.Image.Image image mode=RGB size=512x512 at"
"<PIL.Image.Image image mode=RGB size=100x100 at"
)
@ -33,7 +33,7 @@ def test_gen_gaussian_kernel():
# canny.py
def test_canny():
canny_img = imread("digital_image_processing/image_data/lena.jpg", 0)
canny_img = imread("digital_image_processing/image_data/lena_small.jpg", 0)
# assert ambiguos array for all == True
assert canny_img.all()
canny_array = canny.canny(canny_img)