commit 6591280c611fdaf47a9069dab9dee62b714af7be Author: jha11aditya Date: Tue Feb 2 01:48:30 2021 +0530 hog image diff --git a/face1.jpeg b/face1.jpeg new file mode 100644 index 00000000..de5504f2 Binary files /dev/null and b/face1.jpeg differ diff --git a/main.py b/main.py new file mode 100644 index 00000000..e2b8ee69 --- /dev/null +++ b/main.py @@ -0,0 +1,34 @@ +from skimage.io import imread, imshow +from skimage.transform import resize +from skimage.feature import hog +from skimage import exposure +import matplotlib.pyplot as plt +import sys + + +def display_image(img): + plt.imshow(img) + plt.show() + +if len(sys.argv) < 2: + print("no input image") + exit(1) + + +img = imread(sys.argv[1], as_gray=True) +print(img.shape) + +##resizing to 1:2 aspect ratio for easier calc + +resized_img = resize(img,(1024,512)) +print(resized_img.shape) +display_image(resized_img) + +fd, hog_img = hog(resized_img, + orientations=9, + pixels_per_cell=(4,4), + cells_per_block=(2,2), + visualize=True, + multichannel=False ) + +display_image(hog_img)