300x250

Image Processing 11

blur estimation or detection with python 관련 정리

stackoverflow 등의 사이트에서 검색한 결과 주로 사용되는 방법은 2가지이며, cv2.Laplacian(gray, cv2.CV_64F).var() 값으로 blur인지 아닌지를 평가 Fast Fourier Transform(FFT)을 사용한 blur 평가 방법 관련해서 직접 설명 및 python 코드로 구현한 사이트가 있습니다. www.pyimagesearch.com/2015/09/07/blur-detection-with-opencv/ Blur detection with OpenCV - PyImageSearch In this tutorial, I will teach you how to detect the amount of blur in an image using OpenCV and Python. ..

Image Processing 2021.04.22

Image Blur/Smoothing/Gaussian Blur/Median Blur/Bilateral Filter/Motion Blur

Image Blur def blur(image, ksize = 3): blur_image = cv2.blur(image, (ksize, ksize)) return blur_image Bilateral Filtering def bilateral_blur(image, d, sigmaColor, sigmaSpace): return cv2.bilateralFilter(image, d, sigmaColor, sigmaSpace) Gaussian Blur def gaussian_blur(image, ksize, sigma=0): gausblur_image = cv2.GaussianBlur(image, (ksize, ksize), sigma) return gausblur_image Median Blur # image..

Image Processing 2020.10.13

Histogram Equalization (히스토그램 평활화)/CLAHE

Histogram Equalization은 이미지의 픽셀이 특정 범위 값 주변에 분포해 있을 때, 양쪽 끝으로 히스토그램을 펼쳐서 Contrast 조정하는 방법이다. 예제는 이미지를 histogram equlization을 사용해서 Contrast 조정을 했고, 히스토그램 그래프를 보면 어두운 부분과 밝은 부분이 고르게 분포되어 있는 것을 확인할 수 있다. 이미지에 따라서 histogram equalization 후 품질 저하가 발생할 수 있는데, 이미지 전체의 누적 히스토그램을 평활화하면서 특정 색 범위가 훼손되는 경우이다. 대안으로, 이미지를 여러 개의 블록으로 나누고(8x8), 각 블록 별로 histogram equalization을 사용하는 방법을 적용하면, Histogram Equalizatio..

Image Processing 2020.10.12

Invert Image color / Invert Image lightness (python opencv)

일반적인 Image Color의 반전 import cv2 src_bgr = cv2.imread("src.jpg", cv2.IMREAD_COLOR) # invert color (색반전) invert_img = cv2.bitwise_not(src_bgr) cv2.imshow("original image", src_bgr) cv2.imshow("inverted image", invert_img) 이미지의 밝기만 반전 - 색상은 유지 (Invert only lmage lightness) 기본적인 색상은 유지하며, 밝기만 반전하는 코드 import cv2 src_bgr = cv2.imread("src.jpg", cv2.IMREAD_COLOR) // convert bgr to hls hls 모드로 변경 hls = ..

Image Processing 2020.10.08
300x250