이미지 ROI 설정
ROI란 ? : 관심영역. 영상처리상의 방법으로, 측정하고자 하는 장기나 부위의 범위를 설정하는 것을 말한다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| import cv2 import numpy import matplotlib.pyplot as plt
img = cv2.imread("Image/Lenna.png",1) cv2.imshow('Original',img) '''
plt.imshow(img,cmap = 'gray',interpolation='bicubic') plt.xticks([]) plt.yticks([]) plt.title('Model') plt.show()
''' cut = img[103:127,97:155] #[y1:y2,x1:x2] cv2.imshow('Cut',cut) print("이미지 크기 : ",img.shape) cv2.waitKey(0) cv2.destroyAllWindows()
|
사용한 Lenna 사진

실행결과
