Created
September 5, 2012 14:43
-
-
Save coporlock/3637659 to your computer and use it in GitHub Desktop.
pythonでopencvの練習(バイラテラルフィルタでブロックノイズ除去)
This file contains hidden or 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
# coding: UTF-8 | |
import sys | |
import os | |
import cv2 | |
param = sys.argv | |
if (len(param) < 2): | |
print 'require an argument of file path.' | |
quit() | |
src = cv2.imread(param[1]) | |
# 効果が弱めなので二度がけ | |
dst = cv2.bilateralFilter(src, 0, 32, 2) | |
dst = cv2.bilateralFilter(dst, 0, 32, 2) | |
name,ext = os.path.splitext(param[1]) | |
output = name + '_denoise.png' | |
cv2.imwrite(output, dst) | |
print 'done : ' + param[1] + ' to ' + output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment