Skip to main content

Kuwahara filter in python

Project description

pykuwahara

Kuwahara filter in Python (numpy + OpenCV).

The Kuwahara filter is a non-linear smoothing filter used in image processing for adaptive noise reduction. It is able to apply smoothing on the image while preserving the edges. Source: Wikipedia

This implementation provide two variants of the filter:

  • The classic one, using a uniform kernel to compute the window mean.
  • A gaussian based filter, by computing the window gaussian mean. This is inspired by the ImageMagick approach.

Installation

pip install pykuwahara

Usage

import cv2
from pykuwahara import kuwahara

image = cv2.imread('lena.jpg')

filtered1 = kuwahara(image, radius=3, method='mean')    # default
filtered2 = kuwahara(image, radius=3, method='gaussian')

cv2.imwrite('lena-filtered1.jpg', filtered1)
cv2.imwrite('lena-filtered2.jpg', filtered2)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pykuwahara-0.2.tar.gz (16.1 kB view hashes)

Uploaded Source

Built Distribution

pykuwahara-0.2-py3-none-any.whl (15.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page