Home > ISET > imgproc > Demosaic > bayerIndices.m

bayerIndices

PURPOSE ^

Identify pixel positions in a Bayer array

SYNOPSIS ^

function [rx, ry ,bx ,by, g1x, g1y, g2x, g2y] = bayerIndices(bPattern,sz,clip)

DESCRIPTION ^

Identify pixel positions in a Bayer array

   [rx, ry ,bx ,by, g1x, g1y, g2x, g2y] = bayerIndices(bPattern,sz,[clip])

 This routine is called by AdaptiveLaplacian and other demosaicking
 routines.  The locations of the various pixel types are returned in the
 parameters.  An array of all the r pixels in a mosaic can be calculated
 as bayerData(ry,rx)

  bPattern is a string (e.g., 'rggb')
  sz:  the array size (e.g., 128).  It can be specified as a single
       number or as a 2-vector (row,col)
  clip: 
    In some cases, we only want the locations of the pixels in a certain
    region of sensor, say in from the edge.  For example in
    AdaptiveLaplacian, we want indices that start at 3,4 and end at
    Hex-2,Vex-2. So, we allow a special parameter, clip, that lets the
    measurements start a 1+clip and end at Hex/Vex - clip.

 Example:
   [rx, ry ,bx ,by, g1x, g1y, g2x, g2y] = bayerIndices('grbg',[16,16]);
   [rx, ry ,bx ,by, g1x, g1y, g2x, g2y] = bayerIndices('gbrg',16);
   [rx, ry ,bx ,by, g1x, g1y, g2x, g2y] = bayerIndices('rggb',16,2);
   [rx, ry ,bx ,by, g1x, g1y, g2x, g2y] = bayerIndices('gbrg',16);

 Copyright ImagEval Consultants, LLC, 2005.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Sun 14-Jan-2007 10:24:23 by m2html © 2003