bazar  1.3.1
Functions | Variables
tri.cpp File Reference
#include <cv.h>
Include dependency graph for tri.cpp:

Go to the source code of this file.

Functions

static int edge_pair (IplImage *im, int sum[], int _a[2], int _b[2], int _c[2], int _d[2])
int stat_triangle (IplImage *im, int pts[3][2], float avg[3])

Variables

static const bool no_clipping = false

Function Documentation

static int edge_pair ( IplImage *  im,
int  sum[],
int  _a[2],
int  _b[2],
int  _c[2],
int  _d[2] 
)
static

Definition at line 8 of file tri.cpp.

References no_clipping.

Referenced by stat_triangle().

int stat_triangle ( IplImage *  im,
int  pts[3][2],
float  avg[3] 
)

Compute the average color over a triangle.

Parameters
imthe input image. Must be 8 bits unsigned (IPL_DEPTH_8U). The color channels can be RGB, BGR or gray levels.
ptsimage plane coordinates of the 3 vertices. Clipping is handled correctly.
avgresult average. avg[0] is either red or gray level. avg[1] and avg[2] are either green and blue or -1. If no pixel is read because the triangle is completely outside the image, the average values is set to -1. Otherwise, it is a value between 0 and 255.
Returns
the function returns the number of pixels averaged.

Definition at line 114 of file tri.cpp.

References edge_pair(), and no_clipping.

Referenced by LightCollector::averageImage().

Variable Documentation

const bool no_clipping = false
static

Definition at line 6 of file tri.cpp.

Referenced by edge_pair(), and stat_triangle().