I implemented a menu-driven image scanner using the NumPy library which will execute functions as given below.
- def crop(image, dist1, dist2, dist3, dist 4): To crop the given image and where dist1, dist2, dist3, dist 4 are the distances from left edge, bottom edge, right edge and top edge respectively in pixels.
- def rgb2gray(image) : To convert an rgb image to gray
-
def threshold(image, threshold): To perform binary thresholding on an image to only view the dark written text part.
-
def resize(image, x_scale, y_scale): To resize the image and where x_scale and y_scale are the scaling factors along the x and y axes respectively.
- def combo(image1, image2, orientation): To combine two images together in an orientation specified by the input. Orientation should be of two types: the two input images can be combined in either Left-Right or Top-Bottom manner. Example: Left-Right - image1 on the left part, image2 on the right part of the image. Both will combine in this manner and give one single image. Similarly for Top-Bottom where image1 on top and image2 below.