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 39 40 41 42 43 44 45 46 47 48 49 50 51
| int main()
{
#include <stdlib.h>
#include <stdio.h>
#include "bgapi.hpp"
// header opencv
#include "stdafx.h"
#include <cv.h>
#include <highgui.h>
//Variables for first picture
int system_count = 0;
int camera_count = 0;
BGAPI::System * pSystem = NULL;
BGAPI::Camera * pCamera = NULL;
BGAPI::Image * pImage = NULL;
BGAPI_RESULT res = BGAPI_RESULT_FAIL;
//Variables pour opencv
// Image
IplImage *image;
// Capture vidéo
CvCapture *capture;
//CREATING NEW IMAGE OBJECT
res = createImage( &pImage );
//ALLOCATION OF IMAGE OBJECT
res = pCamera->setImage(pImage );
image=res;
//RELEASING CAMERA
res = pSystem->releaseCamera( pCamera );
if( res != BGAPI_RESULT_OK )
{
printf("releaseCamera errorcode: %d\n", res);
return 0;
}
printf(" Camera released!\n");
//RELEASING SYSTEM
res = pSystem->release();
if( res != BGAPI_RESULT_OK )
{
printf("pSystem->release errorcode: %d\n", res);
return 0;
}
printf(" System released!\n");
//LEAVE CMD OPEN
int t=0;
scanf("%d",&t);
} |
Partager