좌우반전 #python #opencv #cv2.flip1 [Python/OpenCV] 이미지 좌우/상하 반전 하는 법, cv.flip() [Python/OpenCV] 이미지 좌우/상하 반전 하는 법, cv.flip() 이미지 좌우 혹은 상하 반전이 필요한 순간은 언제? 파이썬을 이용하여 opencv의 내장 함수로 실시간 웹캠을 읽어올 때에 기본값은 좌우 반전이 되어있지 않다. 카메라가 나를 비추고 있을 때, 내가 오른 손을 든다면 화면 속의 나는 왼쪽 손을 든 것 처럼 보인다. 이는 사용자와 상호작용하는 UI엔 적합하지 않다. 그래서 우리는 이미지를 좌우반전 할 필요가 있다. 좌우반전 하는 법 Python에서 OpenCV를 이용하여 이미지를 좌우반전 하는 코드는 아래와 같다. img_flip = cv2.flip(img, 1) 원본 이미지를 cv2.flip() 메소드의 첫 번째 입력으로 넣고, 그 뒤에 플래그 1을 넣는다. 이 메소드는 플래.. 2024. 1. 2. 이전 1 다음