This commit is contained in:
AntoineUPMC 2017-05-31 10:13:39 +02:00
parent 25b7096cce
commit 8abf618e5b
37 changed files with 285 additions and 319 deletions

BIN
Code/KirbyTrack Executable file

Binary file not shown.

View file

@ -70,7 +70,7 @@ int main(int argc, char* argv[])
#endif
//Ouverture flux camera
CvCapture* capture = cvCaptureFromCAM( 0 );
CvCapture* capture = cvCaptureFromCAM(1);
if( !capture ){
printf("ERROR: capture is NULL \n" );
@ -260,7 +260,7 @@ sf::Vector2i PosMouse = sf::Mouse::getPosition(window);
maj_angle(ajust_pos(posX-width/2,width), ajust_pos(posY-height/2,height), height*JEU, angle);
controle_moteur(angle);
cvWaitKey(50);
cvWaitKey(200);
}

BIN
Code/KirbyTrack.o Normal file

Binary file not shown.

BIN
Code/Navy Executable file

Binary file not shown.

View file

@ -4,7 +4,7 @@
* \date avril - mai 2017
* \brief Figure Libre
*
* \details Suivie d'un Kirby (Rose) ou d'une étoile (Jaune) par une caméra avec mode interface utilisateur ou configuration
* \details Prototype réalité augmentée inspiré de Navy (The Legend of Zelda) avec détéction faciale
*
* \todo Stabiliser detection faciale
*/
@ -80,7 +80,7 @@ int main(int argc, char* argv[])
return EXIT_FAILURE;
//Ouverture flux camera
CvCapture* capture = cvCaptureFromCAM( 0 );
CvCapture* capture = cvCaptureFromCAM( 1);
if( !capture ){
printf("ERROR: capture is NULL \n" );
@ -101,7 +101,7 @@ int main(int argc, char* argv[])
//Création de la fenetre principale
sf::RenderWindow window(sf::VideoMode(width, height), "KirbyTrack");
sf::RenderWindow window(sf::VideoMode(width, height), "Navy");
while(boucle)
@ -186,9 +186,9 @@ int main(int argc, char* argv[])
hey.play();
rdy[0]=0;
printf("a\n");
get_color(frame, tab_face[0],BGR);
printf("B = %d, G = %d, R = %d\n",BGR[0],BGR[1],BGR[2]);
//printf("B = %d, G = %d, R = %d\n",BGR[0],BGR[1],BGR[2]);
}

BIN
Code/Navy.o Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Before After
Before After

View file

@ -250,7 +250,7 @@ void detect_and_draw( IplImage* img, CvHaarClassifierCascade* cascade, face** ta
tab_face[i]->point.y = (pt1.y + pt2.y)/2;
tab_face[i]->largeur = r->width;
printf("VALEURS FACES n°%d : %d %d %d\n",i, tab_face[i]->point.x,tab_face[i]->point.y,tab_face[i]->largeur);
//printf("VALEURS FACES n°%d : %d %d %d\n",i, tab_face[i]->point.x,tab_face[i]->point.y,tab_face[i]->largeur);
}
}
}
@ -264,32 +264,19 @@ void detect_and_draw( IplImage* img, CvHaarClassifierCascade* cascade, face** ta
//Renvoie la couleur moyenne de rec_face
void get_color(IplImage* image, face* rec_face, int* BGR){
printf("z\n");
CvScalar colors;
int largeur = rec_face->largeur;
printf("e\n");
cvSetImageROI(image,cvRect(rec_face->point.x -largeur/2, rec_face->point.y -largeur/2, largeur,largeur));
printf("r\n");
colors = cvAvg(image);
printf("t\n");
cvResetImageROI(image);
printf("y\n");
BGR[0] = colors.val[0];
BGR[1] = colors.val[1];
BGR[2] = colors.val[2];
printf("u\n");
}

View file

@ -49,8 +49,8 @@
*/
//#define CONFIG
#define SFML
#define KIRBY
//#define ETOILE
//#define KIRBY
#define ETOILE
#define MAX_FACE 2

BIN
Code/fonction.o Normal file

Binary file not shown.

Binary file not shown.