Logo Search packages:      
Sourcecode: libgphoto2 version File versions  Download package

Defines | Functions

ahd_bayer.c File Reference

Adaptive Homogeneity-Directed Bayer array conversion routine. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include "config.h"
#include "bayer.h"
#include <gphoto2/gphoto2-result.h>
#include <gphoto2/gphoto2-port-log.h>
Include dependency graph for ahd_bayer.c:

Go to the source code of this file.

Defines

#define AD(x, y, w)   ((y)*(w)*3+3*(x))
#define BLUE   2
#define CLAMP(x)   MAX(MIN(x,0xff),0)
#define GP_MODULE   "ahd_bayer"
#define GREEN   1
#define MAX(x, y)   ((x < y) ? (y) : (x))
#define MIN(x, y)   ((x > y) ? (y) : (x))
#define RED   0

Functions

static int do_green_ctr_row (unsigned char *image, unsigned char *image_h, unsigned char *image_v, int w, int h, int y, int *pos_code)
 Missing greens are reconstructed on a single row.
static int do_rb_ctr_row (unsigned char *image_h, unsigned char *image_v, int w, int h, int y, int *pos_code)
 Missing reds and/or blues are reconstructed on a single row.
static int dRGB (int i1, int i2, unsigned char *RGB)
 This function computes distance^2 between two sets of pixel data.
static int get_diffs_row2 (unsigned char *hom_buffer_h, unsigned char *hom_buffer_v, unsigned char *buffer_h, unsigned char *buffer_v, int w)
 Differences are assigned scores across row 2 of buffer_v, buffer_h.
int gp_ahd_decode (unsigned char *input, int w, int h, unsigned char *output, BayerTile tile)
 Convert a bayer raster style image to a RGB raster.
int gp_ahd_interpolate (unsigned char *image, int w, int h, BayerTile tile)
 Interpolate a expanded bayer array into an RGB image.

Detailed Description

Adaptive Homogeneity-Directed Bayer array conversion routine.

Author:
Copyright March 12, 2008 Theodore Kilgore <kilgota@auburn.edu>
gp_ahd_interpolate() from Eero Salminen <esalmine@gmail.com> and Theodore Kilgore. The work of Eero Salminen is for partial completion of a Diploma in Information and Computer Science, Helsinki University of Technology, Finland.
The algorithm is based upon the paper
Adaptive Homogeneity-Directed Democsaicing Algoritm, Keigo Hirakawa and Thomas W. Parks, presented in the IEEE Transactions on Image Processing, vol. 14, no. 3, March 2005.
License
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Definition in file ahd_bayer.c.


Generated by  Doxygen 1.6.0   Back to index