mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-06 10:31:29 +08:00
Added Nearest neighbour algorithm (#1934)
This commit is contained in:
@ -11,6 +11,7 @@ import digital_image_processing.change_contrast as cc
|
||||
import digital_image_processing.convert_to_negative as cn
|
||||
import digital_image_processing.sepia as sp
|
||||
import digital_image_processing.dithering.burkes as bs
|
||||
import digital_image_processing.resize.resize as rs
|
||||
from cv2 import imread, cvtColor, COLOR_BGR2GRAY
|
||||
from numpy import array, uint8
|
||||
from PIL import Image
|
||||
@ -82,3 +83,10 @@ def test_burkes(file_path: str = "digital_image_processing/image_data/lena_small
|
||||
burkes = bs.Burkes(imread(file_path, 1), 120)
|
||||
burkes.process()
|
||||
assert burkes.output_img.any()
|
||||
|
||||
def test_nearest_neighbour(
|
||||
file_path: str = "digital_image_processing/image_data/lena_small.jpg",
|
||||
):
|
||||
nn = rs.NearestNeighbour(imread(file_path, 1), 400, 200)
|
||||
nn.process()
|
||||
assert nn.output.any()
|
||||
|
Reference in New Issue
Block a user