mirror of
https://github.com/metafy-social/python-scripts.git
synced 2025-02-28 10:58:42 +00:00
26 lines
581 B
Python
26 lines
581 B
Python
|
|
||
|
import cv2
|
||
|
import numpy as np
|
||
|
import matplotlib.pyplot as plt
|
||
|
|
||
|
image = cv2.imread("D:\image.jpg", 1)
|
||
|
# Loading the image
|
||
|
|
||
|
half = cv2.resize(image, (0, 0), fx=0.1, fy=0.1)
|
||
|
bigger = cv2.resize(image, (1050, 1610))
|
||
|
|
||
|
stretch_near = cv2.resize(image, (780, 540),
|
||
|
interpolation=cv2.INTER_NEAREST)
|
||
|
|
||
|
|
||
|
Titles = ["Original", "Half", "Bigger", "Interpolation Nearest"]
|
||
|
images = [image, half, bigger, stretch_near]
|
||
|
count = 4
|
||
|
|
||
|
for i in range(count):
|
||
|
plt.subplot(2, 2, i + 1)
|
||
|
plt.title(Titles[i])
|
||
|
plt.imshow(images[i])
|
||
|
|
||
|
plt.show()
|