convert

    [DIP] Dithering

    다음은 wikipedia의 정의임. Dither is an intentionally applied form of noise used to randomize quantization error, preventing large-scale patterns such as color banding in images. Dither is routinely used in processing of both digital audio and video data. 즉, 의도적으로 삽입된 noise인데 이를 사람이 보거나 들을 때, quantizaiton error를 randomize하여 최소화된 qunantization error를 느끼게 하는 것이다. 실제로 256 단계의 gray-scale이미지를 0,1의 binary im..

    PIL과 opencv에서의 image 변환.

    필요성 tensorflow.keras.preprocessing 에서의 image를 이용한 이미지 로딩의 경우, PIL.Image.Image를 이미지 타입으로 사용함. from tensorflow.keras.preprocessing import image image_tf = image.load_img('test.gif') print(f'type : {type(image_tf)}') type : opencv를 이용한 전처리를 할 경우에는 이 두 라이브러리의 데이터간 변환이 필요했음. 방법 방법 자체는 매우 간단한데, opencv의 python라이브러리는 실제로 numpy의 ndarray를 이미지 타입으로 사용하기 때문에 PIL.Image.Image와 numpy의 array간의 변환을 이용하면 된다. 단, c..