mirror of
https://github.com/AntoineHX/LivingMachine.git
synced 2025-05-04 05:40:46 +02:00
suivi moteur et presentation html
This commit is contained in:
parent
81ea78a32d
commit
166879222f
62 changed files with 3196 additions and 0 deletions
49
Test-opencv/main.c~
Normal file
49
Test-opencv/main.c~
Normal file
|
@ -0,0 +1,49 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <opencv/highgui.h>
|
||||
/*
|
||||
Commandes :
|
||||
opencv :
|
||||
gcc opencv.c -o opencv `pkg-config --libs --cflags opencv` -ldl -lm
|
||||
|
||||
*/
|
||||
|
||||
int main (int argc, char* argv[])
|
||||
{
|
||||
IplImage* img = NULL;
|
||||
const char* window_title = "Hello, OpenCV!";
|
||||
|
||||
/* Vérification: au moins un argument doit être passé au programme.*/
|
||||
if (argc < 2)
|
||||
{
|
||||
fprintf (stderr, "usage: %s IMAGE\n", argv[0]);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
/* Chargement de l'image passée en argument */
|
||||
img = cvLoadImage(argv[1], CV_LOAD_IMAGE_UNCHANGED);
|
||||
|
||||
if (!img)
|
||||
{
|
||||
fprintf (stderr, "couldn't open image file: %s\n", argv[1]);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
/* Création d'une fenêtre intitulée "Hello, OpenCV!" */
|
||||
cvNamedWindow (window_title, CV_WINDOW_AUTOSIZE);
|
||||
|
||||
/* Affichage de l'image */
|
||||
cvShowImage (window_title, img);
|
||||
|
||||
/* Pause le temps que l'utilisateur appuie sur une touche */
|
||||
cvWaitKey (0);
|
||||
|
||||
/* Destruction de la fenêtre */
|
||||
cvDestroyAllWindows ();
|
||||
|
||||
|
||||
/* Libération de la mémoire */
|
||||
cvReleaseImage (&img);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue