In the image_filter folder:
(1). processing_tool.py inculdes:
-
load(img_path) -> load an image from a file path
-
print_stats(image) -> Prints the height, width and number of channels in an image.
-
crop(image, start_row, start_col, num_rows, num_cols) -> Crop an image based on the specified bounds. Use array slicing.
-
change_contrast(image, factor)-> Change the value of every pixel by following
x_n = factor * (x_p - 0.5) + 0.5
where x_n is the new value and x_p is the original value. Assumes pixel values between 0.0 and 1.0 If you are using values 0-255, change 0.5 to 128.
-
resize(input_image, output_rows, output_cols) -> Resize an image using the nearest neighbor method.
-
greyscale(input_image) -> Convert a RGB image to greyscale.
(2). convolution.py inculdes:
- conv2D(image, kernel) -> Convolution of a 2D image with a 2D kernel.
- test_conv2D(): -> A simple test for your 2D convolution function.
- conv(image, kernel) -> Convolution of a RGB or grayscale image with a 2D kernel
- gauss2D(size, sigma) -> Function to mimic the 'fspecial' gaussian MATLAB function.
- corr(image, kernel) -> Cross correlation of a RGB image with a 2D kernel