Giter Club home page Giter Club logo

shading_correction's Introduction

#Lens shading/vignetting correction algorithm
This repo is the implementation of Patent US20070211154 which is the lens vignetting correction algorithm.
Vigetting is a pheonmenon that the brightness is decreasing from image center to corner. This pheonmenon might due to design of camera lens or camera setting.
This patent is using a radially symmetric polynomial function to correct the issue. This might because the vignetting effect is happened radially symmertic from center to corner.


First we need to use a raw image to calculate the paramteres of correction function. This raw image is from the camera system you want to correct and it doesnt have any ISP pipeline processing yet. If your camera is using color sensor, then the raw image should be a bayer image. Normally this raw image should take an flat uniform light source. We can from the image of your camera taking flat uniform light source to know the vignetting situation. And use this situation to calibrate the function parameters.

Here is my raw image, resolution : 640x480 , bayer pattern : BGGR
alt text
We use this raw image to calculate the function parameters -> "ShadingParameters.csv"
Then we use the correction function to correct the image, here is the result
alt text
Then we do some color interpolation and correction on them to make the images normal.
Here is the original image after color interpolation and correction
alt text
And here is the image after shading correction and color interpolation/correction
alt text


I also used the corrected image to subtract the original image to see the correction effect. From this difference we can see the image region close to center has very few change. But the corner part, which is the serious vignetting region has very effective change.

alt text
reference:
https://patents.google.com/patent/US20070211154

shading_correction's People

Contributors

rayxie29 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.