ROI

    [DIP] opencv : Region of Interest (ROI) : cv2.selectROI

    cv2에서 사각형의 ROI를 선택하는 가장 쉬운 방법. ret_val = cv2.selectROI([window_name], img [, showCrossHair=True, fromCenter=False] window_name : ROI 선택을 수행할 window이름. str img : 보여질 이미지. showCrossHair : ROI 중심에 십자모양 표시 여부 fromCenter : 마우스 시작지점을 영역의 중심으로 간주 ret_val = (x,y,w,h) of ROI 선택시 `space` or `Enter` 를 누르면 됨. 선택을 취소하고 싶을 경우 c키 누름 : ret_val는 모두 0으로 import cv2 import numpy as np img_path = 'lena.png' img = cv..