필터링 시작하기

Python으로 배우는 이미지 처리

Rebeca Gonzalez

Data Engineer

필터

  • 이미지 향상
  • 특징 강조/제거
  • 스무딩
  • 샤프닝
  • 에지 검출
Python으로 배우는 이미지 처리

이웃 영역

필터 이웃 영역

Python으로 배우는 이미지 처리

에지 검출

에지가 검출된 동전 이미지

Python으로 배우는 이미지 처리

에지 검출

초콜릿 키스 원본 이미지

에지가 검출된 초콜릿 키스 이미지

Python으로 배우는 이미지 처리

에지 검출

소벨
# Import module and function 
from skimage.filters import sobel

# Apply edge detection filter edge_sobel = sobel(image_coins)
# Show original and resulting image to compare plot_comparison(image_coins, edge_sobel, "Edge with Sobel")
Python으로 배우는 이미지 처리

에지 검출

소벨

윤곽이 검출되어 형태가 드러난 동전 이미지

Python으로 배우는 이미지 처리

플롯 비교

def plot_comparison(original, filtered, title_filtered):

    fig, (ax1, ax2) = plt.subplots(ncols=2, figsize=(8, 6), sharex=True,
                                   sharey=True)
    ax1.imshow(original, cmap=plt.cm.gray)
    ax1.set_title('original')
    ax1.axis('off')
    ax2.imshow(filtered, cmap=plt.cm.gray)
    ax2.set_title(title_filtered)
    ax2.axis('off')
Python으로 배우는 이미지 처리

가우시안 스무딩

가우시안 필터를 적용한 개 이미지와 원본을 나란히 비교

Python으로 배우는 이미지 처리

가우시안 스무딩

암스테르담에서 다리 위에 자전거를 든 Rebeca의 사진

Python으로 배우는 이미지 처리

가우시안 스무딩

# Import the module and function
from skimage.filters import gaussian

# Apply edge detection filter gaussian_image = gaussian(amsterdam_pic, multichannel=True)
# Show original and resulting image to compare plot_comparison(amsterdam_pic, gaussian_image, "Blurred with Gaussian filter")
Python으로 배우는 이미지 처리

가우시안 스무딩

결과 이미지

Python으로 배우는 이미지 처리

가우시안 스무딩

결과 이미지(확대)

Python으로 배우는 이미지 처리

연습해 봅시다!

Python으로 배우는 이미지 처리

Preparing Video For Download...