Skip to content

KunalA18/IP-openGL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Image processing using openGL compute shaders

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published