画像の拡大と縮小
画像の拡大と縮小
寸法の変換

画像サイズの変換
cv2.resize(src, dsize, dst=None, fx=None, fy=None, interpolation=None) -> dst
src:ビデオ入力
dsize:結果としてビデオサイズは(w,h)tupleであった.(0,0)fxとfy値から決定
dst:ビデオを出力する
fx、fy:xおよびy方向のスケール(dsize=0の場合有効)
補間:補間を指定します.デフォルトはcv 2です.INTER_LINEAR
src = cv2.imread('rose.bmp') # 480x320
dst1 = cv2.resize(src, (0, 0), fx=4, fy=4, interpolation=cv2.INTER_NEAREST)
dst2 = cv2.resize(src, (1920, 1280)) # cv2.INTER_LINEAR
dst3 = cv2.resize(src, (1920, 1280), interpolation=cv2.INTER_CUBIC)
dst4 = cv2.resize(src, (1920, 1280), interpolation=cv2.INTER_LANCZOS4)
cv2.imshow('src', src)
cv2.imshow('dst1', dst1[500:900, 400:800])
cv2.imshow('dst2', dst2[500:900, 400:800])
cv2.imshow('dst3', dst3[500:900, 400:800])
cv2.imshow('dst4', dst4[500:900, 400:800])
cv2.waitKey()
cv2.destroyAllWindows()



ミラーリング


cv2.flip(src, flipCode, dst=None) -> dst
src:ビデオ入力
flipcode:逆方向
dst:ビデオを出力する
Reference
この問題について(画像の拡大と縮小), 我々は、より多くの情報をここで見つけました https://velog.io/@qsdcfd/영상의-확대와-축소テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol