Giter Site home page Giter Site logo

karolmajek / bayer2rgb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jdthomas/bayer2rgb

0.0 2.0 0.0 34 KB

Command line utility to convert bayer grid data to rgb data. Integrates with ImageMagick.

License: GNU Lesser General Public License v2.1

Makefile 0.34% C 98.78% Shell 0.87%

bayer2rgb's Introduction

bayer2rgb
=========

bayer2rgb will convert naked (no header) bayer grid data into rgb data. There are several choices of interpolation (though they all look essentially the same to my eye). It can output tiff files, and can integrate with ImageMagick to output other formats. 

I borrowed the bayer.c from the libdc1394 project [1], it is licensed under LGPL.

This is an implementation of the idea I stumbled upon on ImageMagick's mailing list while searching for a bayer grid converter. The thread can be found at [2].The interpolation algorithms used are described at [3].

I have tested it both on Linux and in under Cygwin on WinXP.


Installation
------------

    make
    cp bayer2rgb /usr/bin/
    cp delegates.xml ~/.magick/delegates.xml


Running
-------

    usage: ./bayer2rgb
       --input,-i     input file
       --output,-o    output file
       --width,-w     image width (pixels)
       --height,-v    image height (pixels)
       --bpp,-b       bits per pixel
       --first,-f     first pixel color: RGGB, GBRG, GRBG, BGGR
       --method,-m    interpolation method: NEAREST, SIMPLE, BILINEAR, HQLINEAR, DOWNSAMPLE, EDGESENSE, VNG, AHD
       --tiff,-t      add a tiff header
       --swap,-s      if bpp == 16, swap byte order before conversion
       --help,-h      this helpful message


Links
-----

[1] http://sourceforge.net/projects/libdc1394
[2] http://www.imagemagick.org/pipermail/magick-developers/2008-May/002953.html
[3] http://scien.stanford.edu/class/psych221/projects/99/tingchen/main.htm


ImageMagick Integration
-----------------------

A delegates.xml file is included. Add the entries from it to your delegates.xml and you should be able to do:

convert -size 1328x498 -depth 8 RGGB_BAYER:./tests/SV0030.RAW ./SV0030.jpg

Of course if you just need to get a look at the image it is much faster to simply use this program directly (probably with the -t flag).


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.