bazar  1.3.1
Classes | Functions
lightcollector.cpp File Reference
#include <vector>
#include <math.h>
#include "lightcollector.h"
#include <geometry/homography.h>
Include dependency graph for lightcollector.cpp:

Go to the source code of this file.

Classes

struct  Hdr

Functions

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

Function Documentation

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().