Skip to content

Instantly share code, notes, and snippets.

@coporlock
Created September 5, 2012 14:43
Show Gist options
  • Save coporlock/3637659 to your computer and use it in GitHub Desktop.
Save coporlock/3637659 to your computer and use it in GitHub Desktop.
pythonでopencvの練習(バイラテラルフィルタでブロックノイズ除去)
# 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