py-tvd

A total variation denoising implementation in python.


License
Other
Install
pip install py-tvd==1.0

Documentation

https://travis-ci.org/PNProductions/py-tvd.svg?branch=master

py-tvd

This is a Python implementation of Total Variation Denoising method proposed by Guy Gilboa.

Reduces the total-variation of the image. Filters out noise while preserving edges. Textures and fine-scale details are also removed.

Requirements

To run this code you need the following packages:

Everything but OpenCV can be installed via ``pip install -r requirements``

Because of OpenCV, this code will run only with python 2.6 and 2.7.

Installation

To install everything just type:

pip install py-tvd

For manual installation:

python setup.py install

Probably you have to run it with sudo.

Testing

Test are provided via unittest.

To run them all:

nosetests

Examples

import cv2
from tvd import TotalVariationDenoising
import os

image = cv2.imread(os.path.dirname(__file__) + '/../assets/example.bmp')
image = cv2.cvtColor(image, cv2.COLOR_BGR2YCR_CB)
subject = TotalVariationDenoising(image[:, :, 0])
output = subject.generate()
cv2.imshow('Total Variation Denoising image', output / 255)
cv2.waitKey(0)
cv2.destroyAllWindows()

The conversion to YCbCr color space is optionally (sure?)