[OpenCV] Desired Data Type : ddtype
·
Programming/DIP
OpenCV에서 filter등의 함수에서 주로 등장하는 ddtype parameter는 결과 image의 data type을 의미한다. desired data type이라고도 불리고 이를 줄여서 ddtype라고 기재하는데, 일반적으로 input image와 같은 data type을 유지하도록 -1을 사용하는 경우가 많다. 이 방식은 대부분 큰 문제가 없지만, gradient나 laplacian을 구하는 filter 연산의 경우, 음수값을 결과로 가질 수 있는데 OpenCV에서 image를 나타내기 위해 사용하는 기본 데이터 타입이 np.uint8 (or cv2.CV_8U)이기 때문에 -1로 ddtype를 지정할 경우 문제가 발생한다. 이는 음수를 고려하지 않은 cv2.CV_8U는 음수값의 gradient..
[DIP] opencv 에서 H264 encoding error
·
Programming/DIP
colab등에서 video를 재생시키는 처리를 하다가 계속 에러가 나서 헤맸다. HTML5에서 표준 비디오인코딩이 H264라 fourcc = cv2.VideoWriter_fourcc(*'H264')로 계속 처리를 했는데... 계속 정상동작을 안하는 문제에 봉착... 새로 테스트하던 부분만 신경쓰느라, cv2.VideoWriter instance가 아예 open이 안된 것을 놓쳤고 때문에 엄한 시간을 날렸다. 비디오는 잘 안다루다보니... 일단 현재 opencv의 python binding은 기본으로 H264 encoding을 제공하지 않는다. GPL 때문... If you installed this package via pip install opencv-python then there&#3..
[DIP] Kornia 소개
·
Programming/DIP
https://github.com/kornia/kornia GitHub - kornia/kornia: Open Source Differentiable Computer Vision Library Open Source Differentiable Computer Vision Library - GitHub - kornia/kornia: Open Source Differentiable Computer Vision Library github.com Kornia는 PyTorch를 위한 differentiable computer vision library 이다. 일반적인 computer vision problem들을 해결할 수 있는 다양한 함수와 differentiable module들로 구성되어 있다. 기본적으로 P..
[DIP] Dithering
·
Programming/DIP
다음은 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..
[DIP] Image Format (summary)
·
Programming/DIP
Digital Image 들의 대표적인 encoding 방식들은 다음과 같음:더보기encoding 과 decoding에 대한 일반적 정의:https://dsaint31.me/mkdocs_site/CE/ch01/code_for_character/#code-encoding BMECodes for Characters Code 란 특정 형태의 information을 다른 방법으로 표현하는 규칙 또는 해당 규칙으로 표현된 결과물 을 가르킴. 문자를 나타내기 위한 code는 인간이 사용하는 문자 를 일종의 기호 또dsaint31.me BMP (Bitmap):비트맵(bitmap) 방식. extension(확장자)가 bmp임.압축도 가능하나 주로 압축되지 않는 방식으로 많이 사용됨 (1998년 Windows2.0과 함..
[DIP] Deconvolution: Richardson-Lucy deconvolution algorithm
·
Programming/DIP
Deconvolution : Richardson-Lucy deconvolution algorithmImage Restoration의 대표적인 예이기도 함. Blurring을 결정하는 PSF (blur kenel이라고도 불림)가 알려진 경우 사용되는 non-blind deblurring algorithm의 대표적 기법.The algorithm is based on a PSF (Point Spread Function), where PSF is described as the impulse response of the optical system.The blurred image is sharpened through a number of iterations, which needs to be hand-tuned.단점..