Alot of feature detectors such as the Haar classifier will return rectangular shapes presented as a detected feature. one of the things to do in order to track these, is to find the center of the rectangle. int main( int argc, char** argv ) { atscameraCapture movie; char code = (char)-1; for(;;) { //get camera cv::Mat imgs = movie.ats_getImage(); #define drawCross( center, color, d, img ) \ line( img, Point( center.x - d, center.y - d ), \ Point( center.x + d, center.y + d ), color, 2, CV_AA, 0); \ line( img, Point( center.x + d, center.y - d ), \ Point( center.x - d, center.y + d ), color, 2, CV_AA, 0 ) cv::Point center; //given 2 points representing the rectangle cv::Point topLeft(100,100); cv::Point bottomRight(200,200); cv::rectangle(imgs,topLeft,bottom