mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-23 21:11:08 +00:00
Digital Image Processing Tests (#1178)
* add version of smaller image * swap image in tests * edits for image src
This commit is contained in:
parent
47d17951b8
commit
f8e30cfab1
BIN
digital_image_processing/image_data/lena_small.jpg
Normal file
BIN
digital_image_processing/image_data/lena_small.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.8 KiB |
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user