CodingTrain / CodingTrain/Suggestion-Box

Kuwahara Filtering

Open
#1,797 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
570
Forks
85
PR merge metrics
No merged PRs in 30d

Description

This algorithm was invented with fixing images with missing pixels.
It however doesn't work that well for that, but what it works well for is art.

[Wikipedia](https://en.wikipedia.org/wiki/Kuwahara_filter)

Kuwahara Filtering works like a blur algorithm.

Here are the needed steps:
1. Imagine a rectangle around each pixel
2. Divide the rectangle into 4 equally sized sectors
3. For each sector get the average color and the color deviation
4. Lastly pick the sector with the smallest deviation and use its color

I've somehow implemented the algorithm, but it is far from acceptable.
Here is the result:

Image before:
![stephanie-harvey-yr45Zv1MM94-unsplash](https://user-images.githubusercontent.com/50217333/228352920-05cbdf13-5015-41bb-80c8-1b0cde8e43b8.jpg)

And after:
![cat](https://user-images.githubusercontent.com/50217333/228352970-81ff711c-3d89-475b-b533-a7a9d15f4380.jpg)

With a bigger texel size **(I didn't implement the texel size computation)**:
![cat-2](https://user-images.githubusercontent.com/50217333/228353555-de9d3bd1-8a07-4fde-a96e-447829a1ddcb.jpg)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.