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 27 28 29 30 31 32 33 34 35 36 37 38
| int main ()
{
CvCapture* capture=cvCaptureFromAVI("C:\\samplevideo.avi");
cvNamedWindow("Capture Video", CV_WINDOW_AUTOSIZE); //j'en aurais besoin plus tard
cvNamedWindow("Lissage Gaussien", CV_WINDOW_AUTOSIZE);//j'en aurais besoin plus tard
cvNamedWindow("Capture Rouge", CV_WINDOW_AUTOSIZE);//j'en aurais besoin plus tard
if(capture)
{
IplImage* frame=cvQueryFrame(capture);//déclaration des variables ...
int width = (int)cvGetCaptureProperty( capture, CV_CAP_PROP_FRAME_WIDTH );
int height= (int)cvGetCaptureProperty( capture, CV_CAP_PROP_FRAME_HEIGHT);
IplImage* Probability = cvCreateImage(cvSize(width,height), IPL_DEPTH_8U ,1);
IplImage* HSV = cvCreateImage(cvSize(width,height), IPL_DEPTH_8U ,3);
IplImage* HUE = cvCreateImage(cvSize(width,height), IPL_DEPTH_8U ,1);
IplImage* imgHistogram = 0;
CvHistogram* hist;
int bins = 180;
int hsize[] = {bins};
float max_value = 0, min_value = 0;
//value and normalized value
float value;
int normalized;
//ranges - grayscale 0 to 256
float xranges[] = { 0, 180 };
float* ranges[] = { xranges };
for (int k=0;k< 1000; k++) frame=cvQueryFrame(capture); // j'avance de 1000 frames (au pif) pour etre sur que la foto n'est pas uniforme
cvShowImage( "Capture Video", frame ); // j'affiche l'image et la ya probleme , tout est gris
cvWaitKey(); |
Partager