float321 [OpenCV] 이미지 데이터 타입 확인 및 변경 * 주요 데이터 타입 종류 uint8 : cv2.imread() 함수를 통해 읽은 경우 float32 : pytorch tensor를 numpy matrix로 바꾼 경우 * 데이터 타입 확인(Python) print(image.dtype) * 데이터 타입 변경 방법 - float32를 uint8로 J = I*255 J = J.astype(np.uint8) - uint8을 float32로 image = image.astype(np.float32) image /= 255. * Reference https://stackoverflow.com/questions/53235638/how-should-i-convert-a-float32-image-to-an-uint8-image How should I convert .. 2023. 7. 22. 이전 1 다음