Giter VIP home page Giter VIP logo

mamdasn / im2dhisteq Goto Github PK

View Code? Open in Web Editor NEW
25.0 1.0 0.0 34.01 MB

This module attempts to enhance contrast of a given image by equalizing its two dimensional histogram.

Home Page: https://pypi.org/project/im2dhisteq/

License: GNU General Public License v3.0

Python 79.10% Go 12.87% Shell 8.04%
python histogram-equalization histogram imhist 2dhist hist2d im2dhisteq two-dimensional-histogram contrast-enhancement image-processing

im2dhisteq's Introduction

PyPI Latest Release Package Status Downloads License Repository Size

im2dhisteq

This module attempts to enhance contrast of a given image by equalizing its two dimensional histogram. An easy way to enhance quality of a given image is to just equalize its histogram, but despite using minimum resources and a very short process time, there are a lot of drawbacks to it. One of the ways to tackle drawbacks of histogram equalization method is to instead equalize the image's two dimensional histogram, as one dimensional histogram of a given image does not contain the image's contextual information. Tests on a multitude of images has shown, by taking contextual information of an image in addition to the image's histogram into account when attempting to enhance contrast, output images are significantly better in quality in compare to histogram equalizaion and a handful of other known methods.

You can access the article that came up with this method here.

Two Dimensional Histogram

Here is the source code for the im2dhist python library with a short description on how it's done.

Installation

Run the following to install:

pip install im2dhisteq

Usage

For images

im2dhisteq --input 'cloudy-day.jpg' --output 'assets/cloudy-day-2dhisteq.jpg' --w 6

For videos

vid2dhisteq --input 'video-input.mp4' --output 'video-output-enhanced.mp4' --w 6

Speed up

The speed of the program can be significantly increased if the go library lib-im2dhist.go in src/go_libs in the package is compiled and moved to a dir in the system path. To compile, first make sure go is installed on your system. Then run

go mod init lib-im2dhist.go
go mod tidy

followed by running the script make-library.

Download binary

Instead of compiling the go library lib-im2dhist.go, you can download the library based on your system configuration:

Showcase

im2dhisteq's People

Contributors

mamdasn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

im2dhisteq's Issues

Improve Speed

This module is not optimized for speed, so optimize the code for numba.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.