Giter Club home page Giter Club logo

ip-opengl's Introduction

Image Processing using OpenGL Compute Shaders

ALGORITHMS IMPLEMENTED

  • Color inversion
    We have access to each of the colors of the render output so it's not so hard to return the inverse of these colors in the fragment shader. We take the color of the screen texture and inverse it by subtracting it from 1.0:

  • Grayscale conversion
    We remove all colors from the scene except the white, gray and black colors; effectively grayscaling the entire image. This is done by taking all the color components and averaging their results

  • Edge detection
    For this we use a kernel(or convulation matrix) which multiplies the surrounding pixels by several weights determined in the kernel and balances the result by multiplying the current pixel by a large negative weight.
    Screenshot from 2022-04-07 15-39-26
    This kernel highlights all edges and darkens the rest, which is pretty useful when we only care about edges in an image.

  • Gamma correction
    original
    The idea of gamma correction is to apply the inverse of the monitor's gamma to the final output color before displaying to the monitor.We multiply each of the linear output colors by the inverse gamma curve (making them brighter) and as soon as the colors are displayed on the monitor, the monitor's gamma curve is applied and the resulting colors become linear. We effectively brighten the intermediate colors so that as soon as the monitor darkens them, it balances all out.


PRE-REQUISITES

sudo apt-get install cmake pkg-config
sudo apt-get install mesa-utils libglu1-mesa-dev freeglut3-dev mesa-common-dev
sudo apt-get install libglew-dev libglfw3-dev libglm-dev
sudo apt-get install libao-dev libmpg123-dev

TESTING CODE

  1. Clone the repository
git clone https://github.com/KunalA18/IP-openGL.git
  1. Build files and test
cd IP-openGL
cd build
cmake ../src
make
cd ../bin
./working

OUTPUT

Original Image

original

Color Inversion Grayscale conversion
inversion grayscale
Edge detection Gamma correction
edge-detection gamma_correction

ip-opengl's People

Contributors

kunala18 avatar

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.