1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| CvRect myRect = cvRect ( 10,10, 100,100 ); //j'initialise une première fenetre
while(1)
{
frame = cvQueryFrame(capture); //je capture une image
IplImage* Result = cvCloneImage(frame);// je la duplique
cvShowImage("Capture Video",frame);
cvCvtColor( frame, HSV, CV_BGR2HSV );//j'extraie le canal HUE
cvCvtPixToPlane(HSV,HUE,0,0,0 );
cvCalcBackProject (planes, myBackProjMatrix , hist) ; // je calcule la matrice de back prjection
cvCamShift (myBackProjMatrix, myRect , term,comp, box) ; // j'execute le camshift
myRect = comp->rect; // je réactualise le fenetre ; c'est a ce niveau que j'ai des probleme , comp est Null , alors qu'il devrait etre la fenetre résultatnte
cvRectangle(Result, cvPoint ( myRect.x,myRect.y),cvPoint( myRect.x +myRect.width, myRect.y +myRect.height ), cvScalar (255,0,0),1); // bon , le reste je n'y suis pas arrivé
cvShowImage("Capture Rouge",Result);
if(cvWaitKey(1)==' ')break;
} |