728x90 반응형 Python2 Python Opencv 이미지 붙이기(cv2.vconcat cv2.hconcat) 가끔 이미지를 붙여서 사용할 때가 있다. 그럴 때마다 opencv에 있는 vconcat과 hconcat을 사용하는데 방향이 항상 헷갈려서 기록한다. import cv2 img1 = cv2.imread("11.png") img2 = cv2.imread("22.png") img1 = cv2.resize(img1, (int(img1.shape[0] / 2), int(img1.shape[1] / 2))) img2 = cv2.resize(img2, (int(img2.shape[0] / 2), int(img2.shape[1] / 2))) img3 = cv2.vconcat([img1, img2]) cv2.imshow("t1", img3) cv2.waitKey(0) img4 = cv2.hconcat([img1, img.. 2022. 10. 27. Python OpenCv 이미지 투명하게 만들기(cv2.addWeighted) 2장의 이미지 중 1장의 이미지 위에 다른 한장의 이미지를 투명하게 투영시키기 import cv2 import numpy as np Draw_img = cv2.imread('2.png') Draw_img2 = np.zeros((Draw_img.shape[0], Draw_img.shape[1], 3), dtype='uint8') #사각형 그리기 cv2.rectangle(Draw_img2, (300,300), (800,800), (100,255,255), -1) a = 0.1 Draw_img = cv2.addWeighted(Draw_img2, a, Draw_img, 1, 0) Draw_img = cv2.resize(Draw_img, (255, 600)) cv2.imshow("test", Draw_img) c.. 2022. 9. 23. 이전 1 다음 728x90 반응형