- Control vector (uk),
should be NULL iff there is no external control (
control_params
=0).
The function cvKalmanPredict
estimates the subsequent stochastic model state
by its current state and stores it at kalman->state_pre
:
x'k=A•xk+B•uk
P'k=A•Pk-1*AT + Q,
where
x'k is predicted state (kalman->state_pre),
xk-1 is corrected state on the previous step (kalman->state_post)
(should be initialized somehow in the beginning, zero vector by default),
uk is external control (control
parameter),
P'k is priori error covariance matrix (kalman->error_cov_pre)
Pk-1 is posteriori error covariance matrix on the previous step (kalman->error_cov_post)
(should be initialized somehow in the beginning, identity matrix by default),
The function returns the estimated state.
KalmanCorrect
Adjusts model state
const CvMat* cvKalmanCorrect( CvKalman* kalman, const CvMat* measurement );
#define cvKalmanUpdateByMeasurement cvKalmanCorrect
- kalman
- Pointer to the structure to be updated.
- measurement
- Pointer to the structure CvMat containing the measurement vector.
The function cvKalmanCorrect
adjusts stochastic model state on the
basis of the given measurement of the model state:
Kk=P'k•HT•(H•P'k•HT+R)-1
xk=x'k+Kk•(zk-H•x'k)
Pk=(I-Kk•H)•P'k
where
zk - given measurement (mesurement
parameter)
Kk - Kalman "gain" matrix.
The function stores adjusted state at kalman->state_post
and returns it on output.
Example. Using Kalman filter to track a rotating point
#include "cv.h"
#include "highgui.h"
#include <math.h>
int main(int argc, char** argv)
{
/* A matrix data */
const float A[] = { 1, 1, 0, 1 };
IplImage* img = cvCreateImage( cvSize(500,500), 8, 3 );
CvKalman* kalman = cvCreateKalman( 2, 1, 0 );
/* state is (phi, delta_phi) - angle and angle increment */
CvMat* state = cvCreateMat( 2, 1, CV_32FC1 );
CvMat* process_noise = cvCreateMat( 2, 1, CV_32FC1 );
/* only phi (angle) is measured */
CvMat* measurement = cvCreateMat( 1, 1, CV_32FC1 );
CvRandState rng;
int code = -1;
cvRandInit( &rng, 0, 1, -1, CV_RAND_UNI );
cvZero( measurement );
cvNamedWindow( "Kalman", 1 );
for(;;)
{
cvRandSetRange( &rng, 0, 0.1, 0 );
rng.disttype = CV_RAND_NORMAL;
cvRand( &rng, state );
memcpy( kalman->transition_matrix->data.fl, A, sizeof(A));
cvSetIdentity( kalman->measurement_matrix, cvRealScalar(1) );
cvSetIdentity( kalman->process_noise_cov, cvRealScalar(1e-5) );
cvSetIdentity( kalman->measurement_noise_cov, cvRealScalar(1e-1) );
cvSetIdentity( kalman->error_cov_post, cvRealScalar(1));
/* choose random initial state */
cvRand( &rng, kalman->state_post );
rng.disttype = CV_RAND_NORMAL;
for(;;)
{
#define calc_point(angle) \
cvPoint( cvRound(img->width/2 + img->width/3*cos(angle)), \
cvRound(img->height/2 - img->width/3*sin(angle)))
float state_angle = state->data.fl[0];
CvPoint state_pt = calc_point(state_angle);
/* predict point position */
const CvMat* prediction = cvKalmanPredict( kalman, 0 );
float predict_angle = prediction->data.fl[0];
CvPoint predict_pt = calc_point(predict_angle);
float measurement_angle;
CvPoint measurement_pt;
cvRandSetRange( &rng, 0, sqrt(kalman->measurement_noise_cov->data.fl[0]), 0 );
cvRand( &rng, measurement );
/* generate measurement */
cvMatMulAdd( kalman->measurement_matrix, state, measurement, measurement );
measurement_angle = measurement->data.fl[0];
measurement_pt = calc_point(measurement_angle);
/* plot points */
#define draw_cross( center, color, d ) \
cvLine( img, cvPoint( center.x - d, center.y - d ), \
cvPoint( center.x + d, center.y + d ), color, 1, 0 ); \
cvLine( img, cvPoint( center.x + d, center.y - d ), \
cvPoint( center.x - d, center.y + d ), color, 1, 0 )
cvZero( img );
draw_cross( state_pt, CV_RGB(255,255,255), 3 );
draw_cross( measurement_pt, CV_RGB(255,0,0), 3 );
draw_cross( predict_pt, CV_RGB(0,255,0), 3 );
cvLine( img, state_pt, predict_pt, CV_RGB(255,255,0), 3, 0 );
/* adjust Kalman filter state */
cvKalmanCorrect( kalman, measurement );
cvRandSetRange( &rng, 0, sqrt(kalman->process_noise_cov->data.fl[0]), 0 );
cvRand( &rng, process_noise );
cvMatMulAdd( kalman->transition_matrix, state, process_noise, state );
cvShowImage( "Kalman", img );
code = cvWaitKey( 100 );
if( code > 0 ) /* break current simulation by pressing a key */
break;
}
if( code == 27 ) /* exit by ESCAPE */
break;
}
return 0;
}
CvConDensation
ConDenstation state
typedef struct CvConDensation
{
int MP; //Dimension of measurement vector
int DP; // Dimension of state vector
float* DynamMatr; // Matrix of the linear Dynamics system
float* State; // Vector of State
int SamplesNum; // Number of the Samples
float** flSamples; // array of the Sample Vectors
float** flNewSamples; // temporary array of the Sample Vectors
float* flConfidence; // Confidence for each Sample
float* flCumulative; // Cumulative confidence
float* Temp; // Temporary vector
float* RandomSample; // RandomVector to update sample set
CvRandState* RandS; // Array of structures to generate random vectors
} CvConDensation;
The structure CvConDensation stores CONditional DENSity propagATION tracker state.
The information about the algorithm can be found at
http://www.dai.ed.ac.uk/CVonline/LOCAL_COPIES/ISARD1/condensation.html
CreateConDensation
Allocates ConDensation filter structure
CvConDensation* cvCreateConDensation( int dynam_params, int measure_params, int sample_count );
- dynam_params
- Dimension of the state vector.
- measure_params
- Dimension of the measurement vector.
- sample_count
- Number of samples.
The function cvCreateConDensation
creates CvConDensation
structure and returns pointer to the structure.
ReleaseConDensation
Deallocates ConDensation filter structure
void cvReleaseConDensation( CvConDensation** condens );
- condens
- Pointer to the pointer to the structure to be released.
The function cvReleaseConDensation
releases the structure CvConDensation (see
cvConDensation) and frees all memory previously allocated for the structure.
ConDensInitSampleSet
Initializes sample set for ConDensation algorithm
void cvConDensInitSampleSet( CvConDensation* condens, CvMat* lower_bound, CvMat* upper_bound );
- condens
- Pointer to a structure to be initialized.
- lower_bound
- Vector of the lower boundary for each dimension.
- upper_bound
- Vector of the upper boundary for each dimension.
The function cvConDensInitSampleSet
fills the samples arrays in the structure
CvConDensation with values within specified ranges.
ConDensUpdateByTime
Estimates subsequent model state
void cvConDensUpdateByTime( CvConDensation* condens );
- condens
- Pointer to the structure to be updated.
The function cvConDensUpdateByTime
estimates the subsequent stochastic model state from its current state.
Pattern Recognition
Object Detection
The object detector described below has been initially proposed by Paul Viola
[Viola01] and improved by Rainer Lienhart
[Lienhart02].
First, a classifier (namely a cascade of boosted classifiers working
with haar-like features
) is trained with a few hundreds of sample
views of a particular object (i.e., a face or a car), called positive
examples, that are scaled to the same size (say, 20x20), and negative examples
- arbitrary images of the same size.
After a classifier is trained, it can be applied to a region of interest (of
the same size as used during the training) in an input image. The
classifier outputs a "1" if the region is likely to show the object
(i.e., face/car), and "0" otherwise. To search for the object in the
whole image one can move the search window across the image and check
every location using the classifier. The classifier is designed so that it can
be easily "resized" in order to be able to find the objects of interest
at different sizes, which is more efficient than resizing the image itself. So,
to find an object of an unknown size in the image the scan procedure should be
done several times at different scales.
The word "cascade" in the classifier name means that the resultant classifier
consists of several simpler classifiers (stages
) that are applied
subsequently to a region of interest until at some stage the candidate
is rejected or all the stages are passed. The word
"boosted" means that the classifiers at every stage of the cascade are complex
themselves and they are built out of basic classifiers using one of four
different boosting
techniques (weighted voting). Currently
Discrete Adaboost, Real Adaboost, Gentle Adaboost and Logitboost are supported.
The basic classifiers are decision-tree classifiers with at least
2 leaves. Haar-like features are the input to the basic classifers, and
are calculated as described below. The current algorithm uses the following
Haar-like features:
The feature used in a particular classifier is specified by its shape (1a,
2b etc.), position within the region of interest and the scale (this scale is
not the same as the scale used at the detection stage, though these two scales
are multiplied). For example, in case of the third line feature (2c) the
response is calculated as the difference between the sum of image pixels
under the rectangle covering the whole feature (including the two white
stripes and the black stripe in the middle) and the sum of the image
pixels under the black stripe multiplied by 3 in order to compensate for
the differences in the size of areas. The sums of pixel values over a
rectangular regions are calculated rapidly using integral images
(see below and
cvIntegral description).
To see the object detector at work, have a look at HaarFaceDetect demo.
The following reference is for the detection part only. There is a
separate application called haartraining
that can train a
cascade of boosted classifiers from a set of samples.
See opencv/apps/haartraining
for details.
CvHaarFeature, CvHaarClassifier, CvHaarStageClassifier, CvHaarClassifierCascade
Boosted Haar classifier structures
#define CV_HAAR_FEATURE_MAX 3
/* a haar feature consists of 2-3 rectangles with appropriate weights */
typedef struct CvHaarFeature
{
int tilted; /* 0 means up-right feature, 1 means 45--rotated feature */
/* 2-3 rectangles with weights of opposite signs and
with absolute values inversely proportional to the areas of the rectangles.
if rect[2].weight !=0, then
the feature consists of 3 rectangles, otherwise it consists of 2 */
struct
{
CvRect r;
float weight;
} rect[CV_HAAR_FEATURE_MAX];
}
CvHaarFeature;
/* a single tree classifier (stump in the simplest case) that returns the response for the feature
at the particular image location (i.e. pixel sum over subrectangles of the window) and gives out
a value depending on the responce */
typedef struct CvHaarClassifier
{
int count; /* number of nodes in the decision tree */
/* these are "parallel" arrays. Every index i
corresponds to a node of the decision tree (root has 0-th index).
left[i] - index of the left child (or negated index if the left child is a leaf)
right[i] - index of the right child (or negated index if the right child is a leaf)
threshold[i] - branch threshold. if feature responce is <= threshold, left branch
is chosen, otherwise right branch is chosed.
alpha[i] - output value correponding to the leaf. */
CvHaarFeature* haar_feature;
float* threshold;
int* left;
int* right;
float* alpha;
}
CvHaarClassifier;
/* a boosted battery of classifiers(=stage classifier):
the stage classifier returns 1
if the sum of the classifiers' responces
is greater than threshold
and 0 otherwise */
typedef struct CvHaarStageClassifier
{
int count; /* number of classifiers in the battery */
float threshold; /* threshold for the boosted classifier */
CvHaarClassifier* classifier; /* array of classifiers */
/* these fields are used for organizing trees of stage classifiers,
rather than just stright cascades */
int next;
int child;
int parent;
}
CvHaarStageClassifier;
typedef struct CvHidHaarClassifierCascade CvHidHaarClassifierCascade;
/* cascade or tree of stage classifiers */
typedef struct CvHaarClassifierCascade
{
int flags; /* signature */
int count; /* number of stages */
CvSize orig_window_size; /* original object size (the cascade is trained for) */
/* these two parameters are set by cvSetImagesForHaarClassifierCascade */
CvSize real_window_size; /* current object size */
double scale; /* current scale */
CvHaarStageClassifier* stage_classifier; /* array of stage classifiers */
CvHidHaarClassifierCascade* hid_cascade; /* hidden optimized representation of the cascade,
created by cvSetImagesForHaarClassifierCascade */
}
CvHaarClassifierCascade;
All the structures are used for representing a cascaded of boosted Haar
classifiers. The cascade has the following hierarchical structure:
Cascade:
Stage1:
Classifier11:
Feature11
Classifier12:
Feature12
...
Stage2:
Classifier21:
Feature21
...
...
The whole hierarchy can be constructed manually or loaded from a file
using functions cvLoadHaarClassifierCascade
or cvLoad.
cvLoadHaarClassifierCascade
Loads a trained cascade classifier from file
or the classifier database embedded in OpenCV
CvHaarClassifierCascade* cvLoadHaarClassifierCascade(
const char* directory,
CvSize orig_window_size );
- directory
- Name of directory containing the description of a trained cascade
classifier.
- orig_window_size
- Original size of objects the cascade has been
trained on. Note that it is not stored in the cascade and therefore must
be specified separately.
The function cvLoadHaarClassifierCascade
loads a trained cascade of haar classifiers from a file or the classifier
database embedded in OpenCV. The base can be trained using haartraining
application (see opencv/apps/haartraining for details).
The function is obsolete. Nowadays object detection classifiers are stored in
XML or YAML files, rather than in directories. To load cascade from a
file, use cvLoad function.
cvReleaseHaarClassifierCascade
Releases haar classifier cascade
void cvReleaseHaarClassifierCascade( CvHaarClassifierCascade** cascade );
- cascade
- Double pointer to the released cascade.
The pointer is cleared by the function.
The function cvReleaseHaarClassifierCascade
deallocates the cascade that has been created manually or loaded using
cvLoadHaarClassifierCascade or
cvLoad.
cvHaarDetectObjects
Detects objects in the image
typedef struct CvAvgComp
{
CvRect rect; /* bounding rectangle for the object (average rectangle of a group) */
int neighbors; /* number of neighbor rectangles in the group */
}
CvAvgComp;
CvSeq* cvHaarDetectObjects( const CvArr* image, CvHaarClassifierCascade* cascade,
CvMemStorage* storage, double scale_factor=1.1,
int min_neighbors=3, int flags=0,
CvSize min_size=cvSize(0,0) );
- image
- Image to detect objects in.
- cascade
- Haar classifier cascade in internal representation.
- storage
- Memory storage to store the resultant sequence of the
object candidate rectangles.
- scale_factor
- The factor by which the search window is scaled between the subsequent scans,
for example, 1.1 means increasing window by 10%.
- min_neighbors
- Minimum number (minus 1) of neighbor rectangles
that makes up an object. All the groups of a smaller number of rectangles
than
min_neighbors
-1 are rejected.
If min_neighbors
is 0, the function does not any
grouping at all and returns all the detected candidate rectangles,
which may be useful if the user wants to apply a customized grouping procedure.
- flags
- Mode of operation. It can be a combination of zero or more of the following values:
CV_HAAR_SCALE_IMAGE
- for each scale factor used the function will
downscale the image rather than "zoom" the feature coordinates in the classifier cascade.
Currently, the option can only be used alone, i.e. the flag can not be set together with the others.
CV_HAAR_DO_CANNY_PRUNING
- If it is set, the function uses Canny
edge detector to reject some image regions that contain too few or too much edges
and thus can not contain the searched object. The particular threshold values
are tuned for face detection and in this case the pruning speeds up the processing.
CV_HAAR_FIND_BIGGEST_OBJECT
- If it is set, the function finds
the largest object (if any) in the image. That is, the output sequence will
contain one (or zero) element(s).
CV_HAAR_DO_ROUGH_SEARCH
- It should be used only when
CV_HAAR_FIND_BIGGEST_OBJECT
is set and min_neighbors
> 0.
If the flag is set, the function does not look for candidates of a smaller size
as soon as it has found the object (with enough neighbor candinates) at the current
scale. Typically, when min_neighbors
is fixed, the
mode yields less accurate (a bit larger) object rectangle than
the regular single-object mode (flags
=CV_HAAR_FIND_BIGGEST_OBJECT
),
but it is much faster, up to an order of magnitude. A greater value of
min_neighbors
may be specified to improve the accuracy.
Note, that in single-object mode CV_HAAR_DO_CANNY_PRUNING
does not improve performance much and can even slow down the processing.
- min_size
- Minimum window size. By default, it is set to the size of samples the classifier
has been trained on (~20×20 for face detection).
The function cvHaarDetectObjects
finds
rectangular regions in the given image that are likely to contain objects
the cascade has been trained for and returns those regions as
a sequence of rectangles. The function scans the image several
times at different scales (see
cvSetImagesForHaarClassifierCascade). Each time it considers
overlapping regions in the image and applies the classifiers to the regions
using cvRunHaarClassifierCascade.
It may also apply some heuristics to reduce number of analyzed regions, such as
Canny prunning. After it has proceeded and collected the candidate rectangles
(regions that passed the classifier cascade), it groups them and returns a
sequence of average rectangles for each large enough group. The default
parameters (scale_factor
=1.1, min_neighbors
=3, flags
=0)
are tuned for accurate yet slow object detection. For a faster operation on
real video images the more preferrable settings are: scale_factor
=1.2, min_neighbors
=2,
flags
=CV_HAAR_DO_CANNY_PRUNING, min_size
=<minimum possible face size>
(for example, ~1/4 to 1/16 of the image area in case of video conferencing).
Example. Using cascade of Haar classifiers to find objects (e.g. faces).
#include "cv.h"
#include "highgui.h"
CvHaarClassifierCascade* load_object_detector( const char* cascade_path )
{
return (CvHaarClassifierCascade*)cvLoad( cascade_path );
}
void detect_and_draw_objects( IplImage* image,
CvHaarClassifierCascade* cascade,
int do_pyramids )
{
IplImage* small_image = image;
CvMemStorage* storage = cvCreateMemStorage(0);
CvSeq* faces;
int i, scale = 1;
/* if the flag is specified, down-scale the input image to get a
performance boost w/o loosing quality (perhaps) */
if( do_pyramids )
{
small_image = cvCreateImage( cvSize(image->width/2,image->height/2), IPL_DEPTH_8U, 3 );
cvPyrDown( image, small_image, CV_GAUSSIAN_5x5 );
scale = 2;
}
/* use the fastest variant */
faces = cvHaarDetectObjects( small_image, cascade, storage, 1.2, 2, CV_HAAR_DO_CANNY_PRUNING );
/* draw all the rectangles */
for( i = 0; i < faces->total; i++ )
{
/* extract the rectanlges only */
CvRect face_rect = *(CvRect*)cvGetSeqElem( faces, i, 0 );
cvRectangle( image, cvPoint(face_rect.x*scale,face_rect.y*scale),
cvPoint((face_rect.x+face_rect.width)*scale,
(face_rect.y+face_rect.height)*scale),
CV_RGB(255,0,0), 3 );
}
if( small_image != image )
cvReleaseImage( &small_image );
cvReleaseMemStorage( &storage );
}
/* takes image filename and cascade path from the command line */
int main( int argc, char** argv )
{
IplImage* image;
if( argc==3 && (image = cvLoadImage( argv[1], 1 )) != 0 )
{
CvHaarClassifierCascade* cascade = load_object_detector(argv[2]);
detect_and_draw_objects( image, cascade, 1 );
cvNamedWindow( "test", 0 );
cvShowImage( "test", image );
cvWaitKey(0);
cvReleaseHaarClassifierCascade( &cascade );
cvReleaseImage( &image );
}
return 0;
}
cvSetImagesForHaarClassifierCascade
Assigns images to the hidden cascade
void cvSetImagesForHaarClassifierCascade( CvHaarClassifierCascade* cascade,
const CvArr* sum, const CvArr* sqsum,
const CvArr* tilted_sum, double scale );
- cascade
- Hidden Haar classifier cascade, created by
cvCreateHidHaarClassifierCascade.
- sum
- Integral (sum) single-channel image of 32-bit integer format. This image as well as the
two subsequent images are used for fast feature evaluation and
brightness/contrast normalization. They all can be retrieved from input 8-bit
or floating point single-channel image using The function
cvIntegral
.
- sqsum
- Square sum single-channel image of 64-bit floating-point format.
- tilted_sum
- Tilted sum single-channel image of 32-bit integer format.
- scale
- Window scale for the cascade. If
scale
=1, original window size is
used (objects of that size are searched) - the same size as specified in
cvLoadHaarClassifierCascade
(24x24 in case of "<default_face_cascade>"), if scale
=2,
a two times larger window is used (48x48 in case of default face cascade).
While this will speed-up search about four times,
faces smaller than 48x48 cannot be detected.
The function cvSetImagesForHaarClassifierCascade
assigns images and/or window scale to the hidden classifier cascade.
If image pointers are NULL, the previously set images are used further
(i.e. NULLs mean "do not change images"). Scale parameter has no such a "protection" value, but
the previous value can be retrieved by
cvGetHaarClassifierCascadeScale function and reused again. The function
is used to prepare cascade for detecting object of the particular size in the
particular image. The function is called internally by
cvHaarDetectObjects, but it can be called by user if there is a need in
using lower-level function cvRunHaarClassifierCascade.
cvRunHaarClassifierCascade
Runs cascade of boosted classifier at given image location
int cvRunHaarClassifierCascade( CvHaarClassifierCascade* cascade,
CvPoint pt, int start_stage=0 );
- cascade
- Haar classifier cascade.
- pt
- Top-left corner of the analyzed
region. Size of the region is a original window size scaled by the currenly set
scale. The current window size may be retrieved using
cvGetHaarClassifierCascadeWindowSize function.
- start_stage
- Initial zero-based index of the cascade stage to start from.
The function assumes that all the previous stages are passed.
This feature is used internally by
cvHaarDetectObjects for better processor cache utilization.
The function cvRunHaarHaarClassifierCascade
runs Haar classifier cascade at a single image location. Before using this
function the integral images and the appropriate scale (=> window size)
should be set using cvSetImagesForHaarClassifierCascade.
The function returns positive value if the analyzed rectangle passed all the classifier
stages (it is a candidate) and zero or negative value otherwise.
Camera Calibration and 3D Reconstruction
Pinhole Camera Model, Distortion
The functions in this section use so-called pinhole camera model. That is,
a scene view is formed by projecting 3D points into the image plane using perspective transformation.
s*m' = A*[R|t]*M', or
[u] [fx 0 cx] [r11 r12 r13 t1] [X]
s[v] = [0 fy cy]*[r21 r22 r23 t2]*[Y]
[1] [0 0 1] [r31 r32 r33 t2] [Z]
[1]
Where (X, Y, Z)
are coordinates of a 3D point in the world coordinate space,
(u, v)
are coordinates of point projection in pixels.
A
is called a camera matrix, or matrix of intrinsic parameters.
(cx, cy)
is a principal point (that is usually at the image center),
and fx, fy
are focal lengths expressed in pixel-related units.
Thus, if an image from camera is up-sampled/down-sampled by some factor,
all these parameters (fx, fy, cx
and cy
) should be scaled
(multiplied/divided, respectively) by the same factor.
The matrix of intrinsic parameters does not depend on the scene viewed
and, once estimated, can be re-used (as long as the focal length is fixed (in case of zoom lens)).
The joint rotation-translation matrix [R|t]
is called a matrix of extrinsic parameters.
It is used to describe the camera motion around a static scene, or vice versa,
rigid motion of an object in front of still camera. That is, [R|t]
translates coordinates
of a point (X, Y, Z)
to some coordinate system, fixed with respect to the camera.
The transformation above is equivalent to the following (when z≠0):
[x] [X]
[y] = R*[Y] + t
[z] [Z]
x' = x/z
y' = y/z
u = fx*x' + cx
v = fy*y' + cy
Real lens usually have some distortion, which major components are radial distorion
and slight tangential distortion. So, the above model is extended as:
[x] [X]
[y] = R*[Y] + t
[z] [Z]
x' = x/z
y' = y/z
x" = x'*(1 + k1r2 + k2r4) + 2*p1x'*y' + p2(r2+2*x'2)
y" = y'*(1 + k1r2 + k2r4) + p1(r2+2*y'2) + 2*p2*x'*y'
where r2 = x'2+y'2
u = fx*x" + cx
v = fy*y" + cy
k1, k2 are radial distortion coefficients,
p1, p2 are tangential distortion coefficients.
Higher-order coefficients are not considered in OpenCV.
The distortion coefficients also do not depend on the scene viewed,
thus they are intrinsic camera parameters.
And they remain the same regardless of the captured image resolution.
The functions below use the above model to
- Project 3D points to the image plane given intrinsic and extrinsic parameters
- Compute extrinsic parameters given intrinsic parameters, a few 3D points and their projections.
- Estimate intrinsic and extrinsic camera parameters from several views of a known calibration pattern
(i.e. every view is described by several 3D-2D point correspodences).
Camera Calibration
ProjectPoints2
Projects 3D points to image plane
void cvProjectPoints2( const CvMat* object_points, const CvMat* rotation_vector,
const CvMat* translation_vector, const CvMat* intrinsic_matrix,
const CvMat* distortion_coeffs, CvMat* image_points,
CvMat* dpdrot=NULL, CvMat* dpdt=NULL, CvMat* dpdf=NULL,
CvMat* dpdc=NULL, CvMat* dpddist=NULL );
- object_points
- The array of object points, 3xN or Nx3,
where N is the number of points in the view.
- rotation_vector
- The rotation vector, 1x3 or 3x1.
- translation_vector
- The translation vector, 1x3 or 3x1.
- intrinsic_matrix
- The camera matrix (A) [fx 0 cx; 0 fy cy; 0 0 1].
- distortion_coeffs
- The vector of distortion coefficients, 4x1 or 1x4
[k1, k2, p1, p2].
If it is NULL, all distortion coefficients are considered 0's.
- image_points
- The output array of image points, 2xN or Nx2,
where N is the total number of points in the view.
- dpdrot
- Optional Nx3 matrix of derivatives of image points with respect to components of the rotation vector.
- dpdt
- Optional Nx3 matrix of derivatives of image points w.r.t. components of the translation vector.
- dpdf
- Optional Nx2 matrix of derivatives of image points w.r.t. fx and fy.
- dpdc
- Optional Nx2 matrix of derivatives of image points w.r.t. cx and cy.
- dpddist
- Optional Nx4 matrix of derivatives of image points w.r.t. distortion coefficients.
The function cvProjectPoints2
computes projections of 3D points to the image plane given
intrinsic and extrinsic camera parameters. Optionally, the function computes jacobians - matrices of
partial derivatives of image points as functions of all the input parameters w.r.t. the particular parameters,
intrinsic and/or extrinsic. The jacobians are used during the global optimization in
cvCalibrateCamera2 and
cvFindExtrinsicCameraParams2.
The function itself is also used to compute back-projection error for with current
intrinsic and extrinsic parameters.
Note, that with intrinsic and/or extrinsic parameters set to special values,
the function can be used to compute just extrinsic transformation or just intrinsic
transformation (i.e. distortion of a sparse set of points).
FindHomography
Finds perspective transformation between two planes
void cvFindHomography( const CvMat* src_points,
const CvMat* dst_points,
CvMat* homography );
- src_points
- Point coordinates in the original plane, 2xN, Nx2, 3xN or Nx3 array
(the latter two are for representation in homogenious coordinates),
where N is the number of points.
- dst_points
- Point coordinates in the destination plane, 2xN, Nx2, 3xN or Nx3 array
(the latter two are for representation in homogenious coordinates)
- homography
- Output 3x3 homography matrix.
The function cvFindHomography
finds perspective transformation H=||hij||
between the source
and the destination planes:
[x'i] [xi]
si[y'i]~H*[yi]
[1 ] [ 1]
So that the back-projection error is minimized:
sum_i((x'i-(h11*xi + h12*yi + h13)/(h31*xi + h32*yi + h33))2+
(y'i-(h21*xi + h22*yi + h23)/(h31*xi + h32*yi + h33))2) -> min
The function is used to find initial intrinsic and extrinsic matrices.
Homography matrix is determined up to a scale, thus it is normalized to make h33=1.
CalibrateCamera2
Finds intrinsic and extrinsic camera parameters using calibration pattern
void cvCalibrateCamera2( const CvMat* object_points, const CvMat* image_points,
const CvMat* point_counts, CvSize image_size,
CvMat* intrinsic_matrix, CvMat* distortion_coeffs,
CvMat* rotation_vectors=NULL, CvMat* translation_vectors=NULL,
int flags=0 );
- object_points
- The joint matrix of object points, 3xN or Nx3,
where N is the total number of points in all views.
- image_points
- The joint matrix of corresponding image points, 2xN or Nx2,
where N is the total number of points in all views.
- point_counts
- Vector containing numbers of points in each particular view,
1xM or Mx1, where M is the number of a scene views.
- image_size
- Size of the image, used only to initialize intrinsic camera matrix.
- intrinsic_matrix
- The output camera matrix (A) [fx 0 cx; 0 fy cy; 0 0 1].
If
CV_CALIB_USE_INTRINSIC_GUESS
and/or
CV_CALIB_FIX_ASPECT_RATION
are specified, some or all
of fx, fy, cx, cy
must be initialized.
- distortion_coeffs
- The output 4x1 or 1x4 vector of distortion coefficients
[k1, k2, p1, p2].
- rotation_vectors
- The output 3xM or Mx3 array of rotation vectors
(compact representation of rotation matrices,
see cvRodrigues2).
- translation_vectors
- The output 3xM or Mx3 array of translation vectors.
- flags
- Different flags, may be 0 or combination of the following values:
CV_CALIB_USE_INTRINSIC_GUESS
- intrinsic_matrix
contains
valid initial values of fx, fy, cx, cy
that are optimized further.
Otherwise, (cx, cy)
is initially set to the image center
(image_size
is used here),
and focal distances are computed in some least-squares fashion.
Note, that if intrinsic parameters are known, there is no need to use this function.
Use cvFindExtrinsicCameraParams2 instead.
CV_CALIB_FIX_PRINCIPAL_POINT
- The principal point is not changed during the global
optimization, it stays at the center and at the other location specified (when
CV_CALIB_USE_INTRINSIC_GUESS
is set as well).
CV_CALIB_FIX_ASPECT_RATIO
- The optimization procedure consider only
one of fx
and fy
as independent variable and keeps the aspect ratio
fx/fy
the same as it was set initially in intrinsic_matrix
.
In this case the actual initial values of (fx, fy)
are either taken from the matrix
(when CV_CALIB_USE_INTRINSIC_GUESS
is set) or estimated somehow (in the latter case
fx, fy
may be set to arbitrary values, only their ratio is used).
CV_CALIB_ZERO_TANGENT_DIST
- Tangential distortion coefficients are set to
zeros and do not change during the optimization.
The function cvCalibrateCamera2
estimates intrinsic camera parameters and extrinsic parameters
for each of the views.
The coordinates of 3D object points and their correspondent 2D projections in each view
must be specified. That may be achieved by using an object with known geometry and easily detectable
feature points. Such an object is called a calibration rig or calibration pattern, and OpenCV has built-in
support for a chessboard as a calibration rig
(see cvFindChessboardCorners).
Currently, initialization of inrtrinsic parameters (when CV_CALIB_USE_INTRINSIC_GUESS
is not set) is only implemented for planar calibration rigs (z-coordinates of object points
must be all 0's or all 1's). 3D rigs can still be used as long as initial intrinsic_matrix
is provided. After the initial values of intrinsic and extrinsic parameters are computed, they are
optimized to minimize the total back-projection error - the sum of squared differences between the
actual coordinates of image points and the ones computed using
cvProjectPoints2.
FindExtrinsicCameraParams2
Finds extrinsic camera parameters for particular view
void cvFindExtrinsicCameraParams2( const CvMat* object_points,
const CvMat* image_points,
const CvMat* intrinsic_matrix,
const CvMat* distortion_coeffs,
CvMat* rotation_vector,
CvMat* translation_vector );
- object_points
- The array of object points, 3xN or Nx3,
where N is the number of points in the view.
- image_points
- The array of corresponding image points, 2xN or Nx2,
where N is the number of points in the view.
- intrinsic_matrix
- The camera matrix (A) [fx 0 cx; 0 fy cy; 0 0 1].
- distortion_coeffs
- The vector of distortion coefficients, 4x1 or 1x4
[k1, k2, p1, p2].
If it is NULL, all distortion coefficients are considered 0's.
- rotation_vector
- The output 3x1 or 1x3 rotation vector
(compact representation of a rotation matrix,
see cvRodrigues2).
- translation_vector
- The output 3x1 or 1x3 translation vector.
The function cvFindExtrinsicCameraParams2
estimates extrinsic camera parameters
using known intrinsic parameters and and extrinsic parameters
for each view. The coordinates of 3D object points and their correspondent 2D projections
must be specified. This function also minimizes back-projection error.
Rodrigues2
Converts rotation matrix to rotation vector or vice versa
int cvRodrigues2( const CvMat* src, CvMat* dst, CvMat* jacobian=0 );
- src
- The input rotation vector (3x1 or 1x3) or rotation matrix (3x3).
- dst
- The output rotation matrix (3x3) or rotation vector (3x1 or 1x3), respectively.
- jacobian
- Optional output Jacobian matrix, 3x9 or 9x3 - partial derivatives of
the output array components w.r.t the input array components.
The function cvRodrigues2
converts a rotation vector to rotation matrix or
vice versa. Rotation vector is a compact representation of rotation matrix.
Direction of the rotation vector is the rotation axis and the length of the vector is the rotation
angle around the axis.
The rotation matrix R
, corresponding to the rotation vector r
,
is computed as following:
theta <- norm(r)
r <- r/theta
[0 -rz ry]
R = cos(theta)*I + (1-cos(theta))*rrT + sin(theta)*[rz 0 -rx]
[ry rx 0]
Inverse transformation can also be done easily as
[0 -rz ry]
sin(theta)*[rz 0 -rx] = (R - RT)/2
[ry rx 0]
Rotation vector is a convenient representation of a rotation matrix as a matrix with only 3 degrees of freedom.
The representation is used in the global optimization procedures inside
cvFindExtrinsicCameraParams2 and
cvCalibrateCamera2.
Undistort2
Transforms image to compensate lens distortion
void cvUndistort2( const CvArr* src, CvArr* dst,
const CvMat* intrinsic_matrix,
const CvMat* distortion_coeffs );
- src
- The input (distorted) image.
- dst
- The output (corrected) image.
- intrinsic_matrix
- The camera matrix (A) [fx 0 cx; 0 fy cy; 0 0 1].
- distortion_coeffs
- The vector of distortion coefficients, 4x1 or 1x4
[k1, k2, p1, p2].
The function cvUndistort2
transforms the image to compensate radial and tangential lens distortion.
The camera matrix and distortion parameters can be determined using
cvCalibrateCamera2.
For every pixel in the output image the function computes coordinates of the corresponding location in the input
image using the formulae in the section beginning. Then, the pixel value is computed using bilinear interpolation.
If the resolution of images is different from what was used at the calibration stage,
fx, fy, cx
and cy
need to be adjusted appropriately, while
the distortion coefficients remain the same.
InitUndistortMap
Computes undistorion map
void cvInitUndistortMap( const CvMat* intrinsic_matrix,
const CvMat* distortion_coeffs,
CvArr* mapx, CvArr* mapy );
- intrinsic_matrix
- The camera matrix (A) [fx 0 cx; 0 fy cy; 0 0 1].
- distortion_coeffs
- The vector of distortion coefficients, 4x1 or 1x4
[k1, k2, p1, p2].
- mapx
- The output array of x-coordinates of the map.
- mapy
- The output array of y-coordinates of the map.
The function cvInitUndistortMap
pre-computes the undistortion map
- coordinates of the corresponding pixel in the distorted image for every pixel in the corrected image.
Then, the map (together with input and output images) can be passed
to cvRemap function.
FindChessboardCorners
Finds positions of internal corners of the chessboard
int cvFindChessboardCorners( const void* image, CvSize pattern_size,
CvPoint2D32f* corners, int* corner_count=NULL,
int flags=CV_CALIB_CB_ADAPTIVE_THRESH );
- image
- Source chessboard view; it must be 8-bit grayscale or color image.
- pattern_size
- The number of inner corners per chessboard row and column.
- corners
- The output array of corners detected.
- corner_count
- The output corner counter. If it is not NULL, the function stores
there the number of corners found.
- flags
- Various operation flags, can be 0 or a combination of the following values:
CV_CALIB_CB_ADAPTIVE_THRESH
- use adaptive thresholding to convert the
image to black-n-white, rather than a fixed threshold level (computed from the average image brightness).
CV_CALIB_CB_NORMALIZE_IMAGE
- normalize the image using
cvNormalizeHist before applying fixed or adaptive thresholding.
CV_CALIB_CB_FILTER_QUADS
- use additional criteria (like contour area, perimeter,
square-like shape) to filter out false quads that are extracted at the contour retrieval stage.
The function cvFindChessboardCorners
attempts to determine whether the input
image is a view of the chessboard pattern and locate internal chessboard
corners. The function returns non-zero value if all the corners have been found
and they have been placed in a certain order (row by row, left to right in every
row), otherwise, if the function fails to find all the corners or reorder them,
it returns 0. For example, a regular chessboard has 8 x 8 squares and 7
x 7 internal corners, that is, points, where the black squares touch each other.
The coordinates detected are approximate, and to determine their position more accurately,
the user may use the function cvFindCornerSubPix.
DrawChessBoardCorners
Renders the detected chessboard corners
void cvDrawChessboardCorners( CvArr* image, CvSize pattern_size,
CvPoint2D32f* corners, int count,
int pattern_was_found );
- image
- The destination image; it must be 8-bit color image.
- pattern_size
- The number of inner corners per chessboard row and column.
- corners
- The array of corners detected.
- count
- The number of corners.
- pattern_was_found
- Indicates whether the complete board was found (≠0) or not (=0). One may just
pass the return value cvFindChessboardCorners here.
The function cvDrawChessboardCorners
draws the individual chessboard corners detected (as red circles)
in case if the board was not found (pattern_was_found
=0) or the colored corners connected with lines
when the board was found (pattern_was_found
≠0).
Pose Estimation
CreatePOSITObject
Initializes structure containing object information
CvPOSITObject* cvCreatePOSITObject( CvPoint3D32f* points, int point_count );
- points
- Pointer to the points of the 3D object model.
- point_count
- Number of object points.
The function cvCreatePOSITObject
allocates memory for the object structure and
computes the object inverse matrix.
The preprocessed object data is stored in the structure CvPOSITObject, internal
for OpenCV, which means that the user cannot directly access the structure data.
The user may only create this structure and pass its pointer to the function.
Object is defined as a set of points given in a coordinate system. The function
cvPOSIT computes a vector that begins at a camera-related coordinate system center
and ends at the points[0]
of the object.
Once the work with a given object is finished, the function
cvReleasePOSITObject
must be called to free memory.
POSIT
Implements POSIT algorithm
void cvPOSIT( CvPOSITObject* posit_object, CvPoint2D32f* image_points, double focal_length,
CvTermCriteria criteria, CvMatr32f rotation_matrix, CvVect32f translation_vector );
- posit_object
- Pointer to the object structure.
- image_points
- Pointer to the object points projections on the 2D image plane.
- focal_length
- Focal length of the camera used.
- criteria
- Termination criteria of the iterative POSIT algorithm.
- rotation_matrix
- Matrix of rotations.
- translation_vector
- Translation vector.
The function cvPOSIT
implements POSIT algorithm. Image coordinates are given in a
camera-related coordinate system. The focal length may be retrieved using camera
calibration functions. At every iteration of the algorithm new perspective
projection of estimated pose is computed.
Difference norm between two projections is the maximal distance between
corresponding points. The parameter criteria.epsilon
serves to stop the
algorithm if the difference is small.
ReleasePOSITObject
Deallocates 3D object structure
void cvReleasePOSITObject( CvPOSITObject** posit_object );
- posit_object
- Double pointer to
CvPOSIT
structure.
The function cvReleasePOSITObject
releases memory previously allocated by the
function cvCreatePOSITObject.
CalcImageHomography
Calculates homography matrix for oblong planar object (e.g. arm)
void cvCalcImageHomography( float* line, CvPoint3D32f* center,
float* intrinsic, float* homography );
- line
- the main object axis direction (vector (dx,dy,dz)).
- center
- object center ((cx,cy,cz)).
- intrinsic
- intrinsic camera parameters (3x3 matrix).
- homography
- output homography matrix (3x3).
The function cvCalcImageHomography
calculates the homography matrix for the initial
image transformation from image plane to the plane, defined by 3D oblong object line (See
Figure 6-10 in OpenCV Guide 3D Reconstruction Chapter).
Epipolar Geometry
FindFundamentalMat
Calculates fundamental matrix from corresponding points in two images
int cvFindFundamentalMat( const CvMat* points1,
const CvMat* points2,
CvMat* fundamental_matrix,
int method=CV_FM_RANSAC,
double param1=1.,
double param2=0.99,
CvMat* status=NULL);
- points1
- Array of the first image points of
2xN, Nx2, 3xN
or Nx3
size
(where N
is number of points).
Multi-channel 1xN
or Nx1
array is also acceptable.
The point coordinates should be floating-point (single or double precision)
- points2
- Array of the second image points of the same size and format as
points1
- fundamental_matrix
- The output fundamental matrix or matrices. The size should be 3x3 or 9x3
(7-point method may return up to 3 matrices).
- method
- Method for computing the fundamental matrix
- CV_FM_7POINT - for 7-point algorithm. N == 7
- CV_FM_8POINT - for 8-point algorithm. N >= 8
- CV_FM_RANSAC - for RANSAC algorithm. N >= 8
- CV_FM_LMEDS - for LMedS algorithm. N >= 8
- param1
- The parameter is used for RANSAC or LMedS methods only.
It is the maximum distance from point to epipolar line in pixels,
beyond which the point is considered an outlier and is not used
for computing the final fundamental matrix.
Usually it is set to 0.5 or 1.0.
- param2
- The parameter is used for RANSAC or LMedS methods only.
It denotes the desirable level of confidence that the matrix
is correct.
- status
- The optional output array of N elements,
every element of which is set to 0 for outliers
and to 1 for the other points.
The array is computed only in RANSAC and LMedS methods.
For other methods it is set to all 1s.
The epipolar geometry is described by the following equation:
p2T*F*p1=0,
where F
is fundamental matrix, p1
and p2
are corresponding
points in the first and the second images, respectively.
The function cvFindFundamentalMat
calculates fundamental matrix using one of four
methods listed above and returns the number of fundamental matrices found (1 or 3) and 0,
if no matrix is found.
The calculated fundamental matrix may be passed further to cvComputeCorrespondEpilines
that finds epipolar lines corresponding to the specified points.
Example. Estimation of fundamental matrix using RANSAC algorithm
int point_count = 100;
CvMat* points1;
CvMat* points2;
CvMat* status;
CvMat* fundamental_matrix;
points1 = cvCreateMat(1,point_count,CV_32FC2);
points2 = cvCreateMat(1,point_count,CV_32FC2);
status = cvCreateMat(1,point_count,CV_8UC1);
/* Fill the points here ... */
for( i = 0; i < point_count; i++ )
{
points1->data.db[i*2] = <x1,i>;
points1->data.db[i*2+1] = <y1,i>;
points2->data.db[i*2] = <x2,i>;
points2->data.db[i*2+1] = <y2,i>;
}
fundamental_matrix = cvCreateMat(3,3,CV_32FC1);
int fm_count = cvFindFundamentalMat( points1,points2,fundamental_matrix,
CV_FM_RANSAC,1.0,0.99,status );
ComputeCorrespondEpilines
For points in one image of stereo pair computes the corresponding epilines in the other image
void cvComputeCorrespondEpilines( const CvMat* points,
int which_image,
const CvMat* fundamental_matrix,
CvMat* correspondent_lines);
- points
- The input points.
2xN, Nx2, 3xN
or Nx3
array (where N
number of points).
Multi-channel 1xN
or Nx1
array is also acceptable.
- which_image
- Index of the image (1 or 2) that contains the
points
- fundamental_matrix
- Fundamental matrix
- correspondent_lines
- Computed epilines,
3xN
or Nx3
array
For every point in one of the two images of stereo-pair the function
cvComputeCorrespondEpilines
finds equation of a line that contains
the corresponding point (i.e. projection of the same 3D point) in the other image.
Each line is encoded by a vector of 3 elements l=[a,b,c]T
, so that:
lT*[x, y, 1]T=0, or
a*x + b*y + c = 0
From the fundamental matrix definition (see cvFindFundamentalMatrix
discussion), line l2
for a point p1
in the first image (which_image
=1) can be computed as:
l2=F*p1
and the line l1
for a point p2
in the second image (which_image
=1) can be computed as:
l1=FT*p2
Line coefficients are defined up to a scale.
They are normalized (a2+b2=1
)
are stored into correspondent_lines
.
ConvertPointsHomogenious
Convert points to/from homogenious coordinates
void cvConvertPointsHomogenious( const CvMat* src, CvMat* dst );
- src
- The input point array,
2xN, Nx2, 3xN, Nx3, 4xN or Nx4
(where N
is the number of points).
Multi-channel 1xN
or Nx1
array is also acceptable.
- dst
- The output point array, must contain the same number of points as the input;
The dimensionality must be the same, 1 less or 1 more than the input, and
also within 2..4.
The function cvConvertPointsHomogenious
converts 2D or 3D points
from/to homogenious coordinates, or simply copies or transposes the array.
In case if the input array dimensionality is larger than the output,
each point coordinates are divided by the last coordinate:
(x,y[,z],w) -> (x',y'[,z']):
x' = x/w
y' = y/w
z' = z/w (if output is 3D)
If the output array dimensionality is larger, an extra 1 is appended to each point.
(x,y[,z]) -> (x,y[,z],1)
Otherwise, the input array is simply copied (with optional tranposition) to the output.
Note that, because the function accepts a large variety of array layouts, it
may report an error when input/output array dimensionality is ambiguous.
It is always safe to use the function with number of points N
>=5, or
to use multi-channel Nx1
or 1xN
arrays.
Alphabetical List of Functions
2
2DRotationMatrix
A
Acc
ApproxChains
ArcLength
AdaptiveThreshold
ApproxPoly
B
BoundingRect
BoxPoints
C
D
Dilate
DistTransform
DrawChessBoardCorners
E
EndFindContours
EqualizeHist
Erode
F
Filter2D
FindExtrinsicCameraParams2
FindNextContour
FindChessboardCorners
FindFundamentalMat
FitEllipse
FindContours
FindHomography
FitLine2D
FindCornerSubPix
FindNearestPoint2D
FloodFill
G
H
HaarDetectObjects
HoughCircles
HoughLines2
I
InitUndistortMap
Inpaint
Integral
K
KalmanCorrect
KalmanPredict
L
Laplace
LoadHaarClassifierCascade
LogPolar
M
MakeHistHeaderForArray
MaxRect
Moments
MatchContourTrees
MeanShift
MorphologyEx
MatchShapes
MinAreaRect2
MultiplyAcc
MatchTemplate
MinEnclosingCircle
N
NormalizeHist
P
POSIT
PreCornerDetect
PyrMeanShiftFiltering
PointPolygonTest
ProjectPoints2
PyrSegmentation
PointSeqFromMat
PyrDown
PyrUp
Q
QueryHistValue_*D
R
ReadChainPoint
ReleaseKalman
Resize
ReleaseConDensation
ReleasePOSITObject
Rodrigues2
ReleaseHaarClassifierCascade
ReleaseStructuringElement
RunHaarClassifierCascade
ReleaseHist
Remap
RunningAvg
S
T
ThreshHist
Threshold
U
Undistort2
UpdateMotionHistory
W
WarpAffine
WarpPerspective
Watershed
Bibliography
This bibliography provides a list of publications that were might be useful to
the OpenCV users. This list is not complete; it serves only
as a starting point.
- [Borgefors86]
Gunilla Borgefors, "Distance Transformations in Digital Images". Computer Vision, Graphics and Image Processing 34, 344-371 (1986).
- [Bouguet00]
Jean-Yves Bouguet. Pyramidal Implementation of the Lucas Kanade Feature Tracker.
The paper is included into OpenCV distribution (algo_tracking.pdf)
- [Bradski98]
G.R. Bradski. Computer vision face tracking as a component of a perceptual
user interface. In Workshop on Applications of Computer Vision, pages 214–219,
Princeton, NJ, Oct. 1998.
Updated version can be found at
http://www.intel.com/technology/itj/q21998/articles/art_2.htm.
Also, it is included into OpenCV distribution (camshift.pdf)
- [Bradski00] G. Bradski and J. Davis. Motion Segmentation and Pose Recognition
with Motion History Gradients. IEEE WACV'00, 2000.
- [Burt81] P. J. Burt, T. H. Hong, A. Rosenfeld. Segmentation and Estimation of
Image Region Properties Through Cooperative Hierarchical Computation. IEEE Tran.
On SMC, Vol. 11, N.12, 1981, pp. 802-809.
- [Canny86] J. Canny. A Computational Approach to Edge Detection, IEEE Trans. on
Pattern Analysis and Machine Intelligence, 8(6), pp. 679-698 (1986).
- [Davis97] J. Davis and Bobick. The Representation and Recognition of Action
Using Temporal Templates. MIT Media Lab Technical Report 402, 1997.
- [DeMenthon92] Daniel F. DeMenthon and Larry S. Davis. Model-Based Object Pose in
25 Lines of Code. In Proceedings of ECCV '92, pp. 335-343, 1992.
- [Felzenszwalb04]
Pedro F. Felzenszwalb and Daniel P. Huttenlocher.
Distance Transforms of Sampled Functions.
Cornell Computing and Information Science TR2004-1963.
- [Fitzgibbon95] Andrew W. Fitzgibbon, R.B.Fisher. A Buyers Guide to Conic
Fitting. Proc.5th British Machine Vision Conference, Birmingham, pp. 513-522,
1995.
- [Ford98] Adrian Ford, Alan Roberts. Colour Space Conversions.
http://www.poynton.com/PDFs/coloureq.pdf
- [Horn81]
Berthold K.P. Horn and Brian G. Schunck. Determining Optical Flow.
Artificial Intelligence, 17, pp. 185-203, 1981.
- [Hu62] M. Hu. Visual Pattern Recognition by Moment Invariants, IRE Transactions
on Information Theory, 8:2, pp. 179-187, 1962.
- [Iivarinen97]
Jukka Iivarinen, Markus Peura, Jaakko Srel, and Ari Visa.
Comparison of Combined Shape Descriptors for Irregular Objects, 8th British Machine Vision Conference, BMVC'97.
http://www.cis.hut.fi/research/IA/paper/publications/bmvc97/bmvc97.html
- [Jahne97] B. Jahne. Digital Image Processing. Springer, New York, 1997.
- [Lucas81]
Lucas, B., and Kanade, T. An Iterative Image
Registration Technique with an Application to Stereo
Vision, Proc. of 7th International Joint Conference on
Artificial Intelligence (IJCAI), pp. 674-679.
- [Kass88] M. Kass, A. Witkin, and D. Terzopoulos. Snakes: Active Contour Models,
International Journal of Computer Vision, pp. 321-331, 1988.
- [Lienhart02]
Rainer Lienhart and Jochen Maydt.
An Extended Set of Haar-like Features for Rapid Object Detection.
IEEE ICIP 2002, Vol. 1, pp. 900-903, Sep. 2002.
This paper, as well as the extended technical report, can be retrieved at
http://www.lienhart.de/Publications/publications.html
- [Matas98] J.Matas, C.Galambos, J.Kittler. Progressive Probabilistic Hough
Transform. British Machine Vision Conference, 1998.
- [Meyer92]
Meyer, F. (1992). Color image segmentation. In Proceedings of the International Conference on Image Processing and its Applications, pages 303--306.
- [Rosenfeld73] A. Rosenfeld and E. Johnston. Angle Detection on Digital Curves.
IEEE Trans. Computers, 22:875-878, 1973.
- [RubnerJan98] Y. Rubner. C. Tomasi, L.J. Guibas. Metrics for Distributions with
Applications to Image Databases. Proceedings of the 1998 IEEE International
Conference on Computer Vision, Bombay, India, January 1998, pp. 59-66.
- [RubnerSept98]
Y. Rubner. C. Tomasi, L.J. Guibas. The Earth Movers Distance as a
Metric for Image Retrieval. Technical Report STAN-CS-TN-98-86,
Department of Computer Science, Stanford University, September
1998.
- [RubnerOct98] Y. Rubner. C. Tomasi. Texture Metrics. Proceeding of the IEEE
International Conference on Systems, Man, and Cybernetics, San-Diego, CA,
October 1998, pp. 4601-4607.
http://robotics.stanford.edu/~rubner/publications.html
- [Serra82] J. Serra. Image Analysis and Mathematical Morphology. Academic Press,
1982.
- [Schiele00] Bernt Schiele and James L. Crowley. Recognition without
Correspondence Using Multidimensional Receptive Field Histograms. In
International Journal of Computer Vision 36 (1), pp. 31-50, January 2000.
- [Suzuki85] S. Suzuki, K. Abe. Topological Structural Analysis of Digital Binary
Images by Border Following. CVGIP, v.30, n.1. 1985, pp. 32-46.
- [Teh89] C.H. Teh, R.T. Chin. On the Detection of Dominant Points on Digital
Curves. - IEEE Tr. PAMI, 1989, v.11, No.8, p. 859-872.
- [Telea04]
A. Telea, "An image inpainting technique based on the fast marching method,"
J. Graphics Tools, vol.9, no.1, pp.25–36, 2004.
- [Trucco98] Emanuele Trucco, Alessandro Verri. Introductory Techniques for 3-D
Computer Vision. Prentice Hall, Inc., 1998.
- [Viola01]
Paul Viola and Michael J. Jones.
Rapid Object Detection using a Boosted Cascade of Simple Features. IEEE CVPR, 2001.
The paper is available online at
http://www.ai.mit.edu/people/viola/
- [Welch95]
Greg Welch, Gary Bishop. An Introduction To the Kalman Filter.
Technical Report TR95-041, University of North Carolina at Chapel Hill, 1995.
Online version is available at
http://www.cs.unc.edu/~welch/kalman/kalmanIntro.html
- [Williams92] D. J. Williams and M. Shah. A Fast Algorithm for Active Contours
and Curvature Estimation. CVGIP: Image Understanding, Vol. 55, No. 1, pp. 14-26,
Jan., 1992. http://www.cs.ucf.edu/~vision/papers/shah/92/WIS92A.pdf.
- [Yuen03]
H.K. Yuen, J. Princen, J. Illingworth and J. Kittler.
Comparative study of Hough Transform methods for circle finding.
http://www.sciencedirect.com/science/article/B6V09-48TCV4N-5Y/2/91f551d124777f7a4cf7b18325235673
- [Yuille89] A.Y.Yuille, D.S.Cohen, and P.W.Hallinan. Feature Extraction from
Faces Using Deformable Templates in CVPR, pp. 104-109, 1989.
- [Zhang96] Z. Zhang. Parameter Estimation Techniques: A Tutorial with Application
to Conic Fitting, Image and Vision Computing Journal, 1996.
- [Zhang99] Z. Zhang. Flexible Camera Calibration By Viewing a Plane From Unknown
Orientations. International Conference on Computer Vision (ICCV'99), Corfu,
Greece, pages 666-673, September 1999.
- [Zhang00] Z. Zhang. A Flexible New Technique for Camera Calibration. IEEE
Transactions on Pattern Analysis and Machine Intelligence, 22(11):1330-1334,
2000.


Minor programming endproject January 2019; Eefje Roelfsema, 10993673
Most of the countries in the Europian Union have the euro as their currency. Having this many countries using the same currency brings risks; a dicision of 1 country may instabilize the euro, which is a problem for the whole of Europe. Therefore the 28 members of the Europian Union signed the Stability and Growth pact, which is an agreement to acilitate and maintain the stability of the Economic and Monetary Union (EMU). In this agreement there are strict rules on how much a country is allowed to spend. One of the main rules of this agreement, and also the most debated rule, is that EU-countries are not allowed to spend more of 3% of their Gross Domestic Product (GDP) each year. That means that if your budget deficit is smaller than -3%, you're following this rule of the Stability and Growth pact.
Due to the financial crisis that hit Europe in the end of 2008, it became too difficult for most countries to maintain the rules of the Stability and Growth pact. Countries spended too much to get their economy out of this recession. Countries who usually did not violate the pact, came under special supervision of the EU. Since then there is a lot of uncertainty about the budget deficits of Europian Union countries. On this website I try to create clarity on this topic.
On my homepage their is a Europian Union map, that shows the budget deficit of each country via the colour. Via the slider below this map, you can change the year you are interested in. Next to the worldmap there is a legend, which explains which colour corresponds to which budget deficit percentage. In short:
- Green colour : a country has a positive budget deficit, they're following the rules of the Europian Union. A positive budget deficit also means that they're spending less than they're receving. This is also positive.
- Yellow colour : a country has a negative budget deficit, but it is between 0% and -3%. They are following the rules of the Europian Union, nevertheless they are still spending more than they are receiving.
- Red colour : a country has a negative budget deficit and it is lower than -3%. This means that a country is not following the rules of the Europian Union. The more red a country is the bigger the higher their budget deficit, which is a bad thing.
If you are interested in the budget deficits of Europian Union countries over the year, there is a historical linegraph. You can look at all the countries together, but it is also possible to focus on one country in particular when you push the button.
A budget deficit is caused by spending too much money. Therefore I made it visible for each country in each year what they're spending. You can also see to which sectors the governemnt is spending the money to.
In the piechart is shown which percentage of the total spendings is spend to a specific sector
In the barchart is visible how many percent of the GDP is spend to certain sectors. The sectors have the same colour in the piechart and in the barchart
I got all my data from the OECD database: https://data.oecd.org/gga/general-government-deficit.htm#indicator-chart


projects
Cortical thinning in epileptic disorders
We use
automated software developed at the BIC to measure thickness across the entire neocortex. The figure below shows areas of significantly decreased cortical thickness in patients with temporal lobe epilepsy (TLE) compared to healthy controls.
Statistical analysis was carried out using Keith Worsley's
SurfStat toolbox for Matlab. An example of using SurfStat to generate a group contrast is shown below.
fact = term(Fact);
X = 1 + fact;
slm = SurfStatLinMod( Y, X, avsurf );
contrast= fact.HC - fact.LTLE;
slm = SurfStatT( slm, contrast );
We then used the random field correction that comes with the SurfStat toolbox to detect significant clusters.
[ pval, peak, clus ] = SurfStatP( slm, mask )
Besides linear models, subject-specific individual analyses can be used.
Figure showing the individual analysis of atrophic TLE patients. Displayed are the proportions of atrophic (thickness z-score less than -2) patients at each vertex.
Connectivity in epileptic disorders
We are mapping connectivity between cortical regions using morphometric correlation analysis.
Figure showing inferred entorhinal cortex connections in healthy controls. Connections were inferred using cortical thickness correlations and correspond well to known anatomical tract tracing data from non-human primates.
data visualization
Some visualizations using
Blender.
The two surfaces generated by the cortical thickness extraction pipeline.
Manual segmentation of the entorhinal cortex in the mesiotemporal lobe region.


The Ontario Gaming Con (OGC) is an event that focuses on all things gaming! TGC’s, console games, PC games, board games, cosplay, art, special guest panels, and so much more! This year’s event will span over three full days of fun, so there’s something for everyone!
Tournaments including but not limited to:
-Smash Melee
-Smash 4
-CS:GO
-League of Legends
-Hero's of the Storm
-Hearthstone
Check out our Facebook page and Twitter for special news updates and to get the scoop on special guests that will be attending!


The numbers created with this tool are estimates only. Feel free to use them as a starting point for your own creations!
The suggested price is derived straight from the table on page 198 of the Genesys core rulebook.
The suggested hard points is derived from the attachments rules found on page 206 of the Genesys core rulebook.
The suggested encumbrance was derived by studying the existing armors as well as the text on page 198 of the Genesys core rulebook.
Specifically, "When you choose a soak value, you should consider a value between 0 and 3…" as well as, "We recommend giving armor an encumbrance value between 2 and 5…"


| Pedigree of : |
| Ch. Lindenhall's McIlwain Protégé (a.k.a. Mac) |
| Born: March 27, 1994 |
|
Can Ch Kingsdale's Goodtyme Charlie |
Heldercrest Max Of Kingsdale |
Am Ch Dickendall's Moorwood Tiger
|
Am Eng Ch Reciever of Cranspire
|
|
Am Ch Dickendall's Moorwood Token
|
|||
|
Am Can Ch Ebonylane's Heldercrest Heidi
|
Can Ch Elden's Duke of Ebonylane CD
|
||
|
Can Ch Brimbelle
|
|||
|
Can Ch Lindenhall's Legacy Of Gold
|
Am Can Ch Ebonylane's Buccaneer Gold
CD
|
Am Can Ch Ebonylane's Aslan
|
|
|
Am Can Ch Ebonylane's Cotton Candy
|
|||
|
Lindenhall's Tallahassee Lass
|
Can Ch Jomadoc Briary Dan CD
|
||
|
Am Can Ch Lindenhall's Savannah Gold
|
|
Parents
|
Grand Parents
|
Great Grand Parents
|
Great Great Grand Parents
|
|
Lindenhall's Hanna |
Can Ch Jomadoc Briary Dan CD
|
Am Can Ch Finchingfield Ivan Of Oaklea
|
Am Ch Briary Brendan of Rainell
|
|
Am Ch Briary Bustle
|
|||
|
Can Ch Jomadoc Silver Shelby Dandy
|
Can Ch Tamarack's Silver Crispin
|
||
|
Selemat's Shaughna
|
|||
|
Can Ch Romillars
Brookehaven Nell CD
|
Am Can Ch Ebonylane's Buccaneer Gold
CD
|
Am Can Ch Ebonylane's Aslan
|
|
|
Am Can Ch Ebonylane's Cotton Candy
|
|||
|
Can Ch Romillars Gamereaper Marsha CD
|
Can Ch Takkawan's Peter at Wimberway
CDX WC
|
||
|
Can Ch Romillars Chelsea CD
|
Copyright © 2000 - 2001 Harold
deGroot - Last Update :
April 6, 2003
All Rights Reserved
Webmaster: hdegroot@staghorn-labs.com