Giter Site home page Giter Site logo

basic_color_interpolation's Introduction

This repo include two basic color interpolation algorithm 1.Bilinear interpolation 2.Nearest Neighbor interpolation

Also there is a function called "Color2Bayer". This function is for someone who doesnt have bayer image.
You can use this function to turn the RGB image into bayer image(GRBG, GBRG, RGGB, BGGR)

In bayer image, we only have single color value in one pixel, which means there is only one channel in pixel that has value. It is because that in morden days, most of the CMOS sensor cameras only have one sensor in one pixel to save space and cost. So there is bayer patten(Color filter) place above the CMOS sensr to get the R or G ot B color information in incident light for every single pixel. In order to get the real color image, we interpolate the patterned R,G and B color information for this purpose.

Nearest Neighbor color interpolation is taking color information from its neighbor. For example: We had GRBG 4 pixels in bayer image whose index are [0,0], [0,1], [1,0], [1,1]. We get the R and B color information of [0,0] from [0,1] and [1,0]. And we get the G color infromation of [0,1] from [1,0]. ... and so on

Bilinear interpolation is similar to the Nearest Neighbor interpolation, but it took more color infromation from neighbor pixels. And it average the color information from its neighbor pixels.

Here is the original image(took by my iphone6)

alt text

This is the bayer image by import the original image into Color2Bayer function

alt text

This is the result of Nearest Neighbor color interpolation

alt text

This is the result of Bilinear color interpolation

alt text

basic_color_interpolation's People

Contributors

rayxie29 avatar

Stargazers

 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.