Git Product home page Git Product logo

image-processing's Introduction

Image-Processing

Some Image Processing Algorithms implemented in cpp .

Operations supported

-> Conversion to grayscale

This readme will be updated after some cleanup of code stay tuned

Gray-Scale Conversion

Three methods have been employed for conversion into gray-scale images .

Lets convert the following image to grayscale :

Spiderman strange

1) Average method for Conversion

In this method we take the average value of the pixel values R,G,B to get the gray-scale pixel .

grayscale = R+G+B/3

The result we get is as follows :

Gray Spidey

Which looks good wnough but is not perfect .

2) Lightness Method for conversion

In this method we take the average value of the components with highest and lowest value . i.e.

grayscale = {min(R,G,B) + max(R,G,B)} / 2 (pixel intensity)

The result we get with this method is as follows :

Light gray

Which is not very accurate and actually seems to be the worst method till now.

3) Luminosity Method for conversion

The best method is the luminosity method that successfully solves the problems of previous methods.

Based on the aforementioned observations, we should take a weighted average of the components. The contribution of blue to the final value should decrease, and the contribution of green should increase. After some experiments and more in-depth analysis, researchers have concluded in the equation below:

grayscale = (0.3 * R + 0.59 * G + 0.11 * B)/3

Here most weight is given to green colored pixels as humans are said to percieve green light well .

Luminous

This is the best method for grayscale inversion .

Flipping Images

Flipping image along X axis ( Horizontal Flip)

Horizontal Flip

The formula used for the flip is illustrated below

figure

Here we exchange the pixels marked with similar colour . The formula used to find similar pixels is given below.

formula

Here x goes till w/2 and we find the pairs by substracting from the width .

Flip image over Y axis (vertical flip)

Similarly the same logic is used for vertical flip and we get the following result . Here y will go till h/2.

Vertical

image-processing's People

Contributors

ris-bali avatar

Stargazers

 avatar Arnav Zutshi avatar Sarvagnya Purohit avatar

Watchers

 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.