13.01.2015 Views

Face Detection and Modeling for Recognition - Biometrics Research ...

Face Detection and Modeling for Recognition - Biometrics Research ...

Face Detection and Modeling for Recognition - Biometrics Research ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

C.2 Example Code<br />

Example code of the user interface <strong>for</strong> the pixel classes <strong>and</strong> the image template is<br />

given below.<br />

#include ”iptl.imagechnl.h”<br />

int main(){<br />

// Conversion of pixel types<br />

//<br />

GREY8 graypix = 10;<br />

FLOAT32 flpix = 3.5;<br />

ColorRGB colorpix(42,53,64);<br />

colorpix = graypix; // Assign a gray value<br />

graypix = flpix; // Truncate data<br />

colorpix.r = 100; // Change the red component<br />

graypix = colorpix; // Compute luminance<br />

flpix += 20.7; // Arithmetic operations<br />

// Image manipulation<br />

//<br />

// Image Creation<br />

ImageT gray8imageA(HOSTRAM, 128, 128, GREY8(55));<br />

ImageT gray8imageB(HOSTRAM, 128, 128, GREY8(100));<br />

ImageT gray16imageC; // An empty image<br />

//Creation of color images<br />

//Data arrangement of the image is RGB... RGB...<br />

ImageT rgbimage(HOSTRAM,32,32,128);<br />

//Data arrangement of the image is RRR...GGG...BBB...<br />

ImageRGB rgbimagechnl(rgbimage1);<br />

// A template function <strong>for</strong> converting images from one type to another<br />

//<br />

gray8imageA = rgbimage; // Extract Luminance<br />

gray16imageC = gray8imageB; // Enlarge the dynamic range of gray values<br />

gray8imageB -= gray8imageA; // Image subtraction<br />

gray8imageA[5] = 100; // Assess pixels as a 1D vector<br />

163

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!