-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
65cea49
commit 5d23203
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import cv2 | ||
import numpy as np | ||
|
||
|
||
image_path = 'test.jpg' | ||
image = cv2.imread(image_path, cv2.IMREAD_GRAYSCALE) | ||
|
||
mean_bin = cv2.adaptiveThreshold(image, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY, 51, 15) # Mean Adaptive Thresholding 이진화 기법 | ||
|
||
median_filter =cv2.medianBlur(mean_bin, 3) # 3 by 3 필터 | ||
# 미디언 필터 | ||
|
||
bilater_filter = cv2.bilateralFilter(mean_bin, 9, 75, 75) # (src, d, sigmaColor, sigmaSpace) | ||
# 바이레이털 필터 | ||
|
||
|
||
cv2.namedWindow('origin', cv2.WINDOW_NORMAL) | ||
cv2.imshow('origin', mean_bin) | ||
|
||
cv2.namedWindow('median filter', cv2.WINDOW_NORMAL) | ||
cv2.imshow('median filter', median_filter) | ||
|
||
cv2.namedWindow('bilater_filter', cv2.WINDOW_NORMAL) | ||
cv2.imshow('bilater_filter', bilater_filter) | ||
|
||
cv2.waitKey(0) | ||
cv2.destroyAllWindows() |