diff --git a/Code/KirbyTrack b/Code/KirbyTrack new file mode 100755 index 0000000..fbb3035 Binary files /dev/null and b/Code/KirbyTrack differ diff --git a/Code/KirbyTrack.c b/Code/KirbyTrack.c index 58515fe..063807d 100644 --- a/Code/KirbyTrack.c +++ b/Code/KirbyTrack.c @@ -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); } diff --git a/Code/KirbyTrack.o b/Code/KirbyTrack.o new file mode 100644 index 0000000..c923154 Binary files /dev/null and b/Code/KirbyTrack.o differ diff --git a/Code/Navy b/Code/Navy new file mode 100755 index 0000000..ee11dbb Binary files /dev/null and b/Code/Navy differ diff --git a/Code/Navy.c b/Code/Navy.c index e3fdb66..e1940ab 100644 --- a/Code/Navy.c +++ b/Code/Navy.c @@ -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]); } diff --git a/Code/Navy.o b/Code/Navy.o new file mode 100644 index 0000000..31b1b76 Binary files /dev/null and b/Code/Navy.o differ diff --git a/Code/Stock SFML/temp.jpg b/Code/Stock SFML/temp.jpg index 224da6d..accf57d 100644 Binary files a/Code/Stock SFML/temp.jpg and b/Code/Stock SFML/temp.jpg differ diff --git a/Code/fonction.c b/Code/fonction.c index a090a00..353cc9d 100644 --- a/Code/fonction.c +++ b/Code/fonction.c @@ -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"); } - - - - - - - - - - - - diff --git a/Code/fonction.h b/Code/fonction.h index c046434..9adde3c 100644 --- a/Code/fonction.h +++ b/Code/fonction.h @@ -49,8 +49,8 @@ */ //#define CONFIG #define SFML -#define KIRBY -//#define ETOILE +//#define KIRBY +#define ETOILE #define MAX_FACE 2 diff --git a/Code/fonction.o b/Code/fonction.o new file mode 100644 index 0000000..feec222 Binary files /dev/null and b/Code/fonction.o differ diff --git a/Code/gmon.out b/Code/gmon.out index 0147f24..0bea6aa 100644 Binary files a/Code/gmon.out and b/Code/gmon.out differ diff --git a/Doxy/Doxyfile b/Doxy/Doxyfile index 9d72192..019db6b 100644 --- a/Doxy/Doxyfile +++ b/Doxy/Doxyfile @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = CamAdventure +PROJECT_NAME = "The Camera of Zelda" # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version diff --git a/Doxy/html/_kirby_track_8c.html b/Doxy/html/_kirby_track_8c.html index 52b2675..8c94709 100644 --- a/Doxy/html/_kirby_track_8c.html +++ b/Doxy/html/_kirby_track_8c.html @@ -4,7 +4,7 @@ -