Kategori: Python / OpenCV , 03 Ekim 2019 , JanFranco
Interpolation, resmin çözünürlük değerinin sabit tutularak toplam piksel sayısının artırılmasıyla, resimdeki renk keskinliğinin deformasyona uğramasıdır. Aşağıda farklı interpolation teknikleri listelenmiştir:
Örnek görelim:cv2.INTER_AREA cv2.INTER_NEAREST cv2.INTER_LINEAR cv2.INTER_CUBIC cv2.INTER_LANCZOS4
import cv2 import numpy as np image = cv2.imread("input.jpg") image_scaled = cv2.resize(image, None, fx=0.75, fy=0.75) cv2.imshow('Scaling - Linear Interpolation', image_scaled) cv2.waitKey() img_scaled = cv2.resize(image, None, fx=2, fy=2, interpolation = cv2.INTER_CUBIC) cv2.imshow('Scaling - Cubic Interpolation', img_scaled) cv2.waitKey() img_scaled = cv2.resize(image, (900, 400), interpolation = cv2.INTER_AREA) cv2.imshow('Scaling - Skewed Size', img_scaled) cv2.waitKey() cv2.destroyAllWindows()