I want to resize an image with cv2 so that the image is only as big as 100x100 and display it with imshow.
From:
To:
Is there a function in cv2 that leaves out part of the image?
I want to resize an image with cv2 so that the image is only as big as 100x100 and display it with imshow.
From:
To:
Is there a function in cv2 that leaves out part of the image?
Thanks to busybyte I found the answer:
img = cv.imread("PATH")
centerx, centery = [int(img.shape[0] / 2) - 50, int(img.shape[1] / 2) - 50]
img = img[centerx:centerx + 100, centery:centery + 100]
Which crops the image to the wanted size of 100x100 from the centre.
([Region of Interest opencv python][3] - StackOverflow) [3]:https://stackoverflow.com/questions/15424852/region-of-interest-opencv-python
– busybyte Mar 09 '19 at 21:31