Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/multi/SRC/multiTestPerformance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'multi/SRC/multiTestPerformance.cpp')
-rw-r--r--multi/SRC/multiTestPerformance.cpp224
1 files changed, 0 insertions, 224 deletions
diff --git a/multi/SRC/multiTestPerformance.cpp b/multi/SRC/multiTestPerformance.cpp
deleted file mode 100644
index b252c22..0000000
--- a/multi/SRC/multiTestPerformance.cpp
+++ /dev/null
@@ -1,224 +0,0 @@
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <GL/gl.h>
-#include <GL/glut.h>
-#include <AR/gsub.h>
-#include <AR/video.h>
-#include <AR/param.h>
-#include <AR/ar.h>
-#include <AR/arMulti.h>
-#include <opencv/cv.h>
-#include <opencv/cxcore.h>
-#include <opencv/highgui.h>
-#include <OpenCVCamera.h>
-#include <TimeUtils.h>
-
-/* set up the video format globals */
-
-#ifdef _WIN32
-char *vconf = "Data\\WDM_camera_flipV.xml";
-#else
-char *vconf = "";
-#endif
-
-int xsize, ysize;
-int thresh = 100;
-int count = 0;
-
-char *cparam_name = "Data/camera_para.dat";
-ARParam cparam;
-
-char *config_name = "Data/multi/marker.dat";
-ARMultiMarkerInfoT *config;
-
-static void init(void);
-static void cleanup(void);
-static void keyEvent( unsigned char key, int x, int y);
-static void mainLoop(void);
-static void draw( double trans1[3][4], double trans2[3][4], int mode );
-
-
-int main(int argc, char **argv)
-{
- xsize=320;
- ysize=240;
- init();
-
- OpenCVCamera* camera = new OpenCVCamera();
- if(argc<3){
- fprintf(stderr, "Uso: multiTestOriginal [file|camera] [--debug|--release] [--show|--notshow]");
- exit(0);
- }
- if(!strcmp(argv[1],"camera")){
- printf("Se capturaran las imagenes de la camara\n");
- camera->initCamera(OpenCVCamera::READ_FROM_CAM,NULL,320,240);
- }else{
- printf("Se usara el archivo %s\n",argv[1]);
- printf(" OpenCVCamera info> ");
- camera->getInfo();
- if(!camera->initCamera(OpenCVCamera::READ_FROM_FILE,argv[1],320,240)){
- printf("Error inicializando la captura desde el archivo %s\n!",argv[1]);
- }
- }
-
- int debug = 0;
- int showImage = 0;
- debug = !strcmp(argv[2],"--debug");
- showImage = !strcmp(argv[3],"--show");
-
- int no_detecta=0;
- int detecta1=0;
- int detecta2=0;
- int detecta3=0;
- int detecta4=0;
- int detecta5=0;
- int detecta6=0;
- int detectaOtros=0;
- int error_trans_mat=0;
-
- if(debug){
- for(int multiMarkerCounter = 0; multiMarkerCounter < config->marker_num; multiMarkerCounter++)
- {
- printf("marker %d, id %d:\n", multiMarkerCounter, config->marker[multiMarkerCounter].patt_id);
-
- /*
- * Imprime la matriz*/
- for(int row = 0; row < 3; row++)
- {
- for(int column = 0; column < 4; column++)
- printf("%.2f ", config->marker[multiMarkerCounter].trans[row][column]);
- printf("\n");
- }
- }
- }
-
-
- IplImage* frame = camera->queryFrame();
- if(showImage){
- cvNamedWindow("Image");
- }
- int numDetected = 0;
-
- int count = 0;
- arUtilTimerReset();
- char c;
- int thresh=127;
- ARMarkerInfo *marker_info;
-
- TimeUtils* timeUtils = new TimeUtils();
- timeUtils->utilTimerReset();
- while(frame!=NULL){
-
- if(showImage){
- cvShowImage("Image",frame);
- c=cvWaitKey(2);
- if(c== 27){
- break;
- }else if(c == 't'){
- printf("Ingresar Threshold (actual=%d): ",thresh);
- scanf("%d",&thresh);
- printf("Nuevo Threshold: ",thresh);
-
- arUtilTimerReset();
- count=0;
- }
- }
- // here we go, just one call to find the camera pose
- //int numDetected = tracker->calc(cameraBuffer);
- //numDetected = tracker->calc( (unsigned char*)frame->imageData);
-
- arDetectMarkerLite((unsigned char*)frame->imageData,thresh,&marker_info,&numDetected);
- if(numDetected>0){
- if(arMultiGetTransMat(marker_info,numDetected,config )>=0){
- switch (numDetected) {
- case 0:
- no_detecta++;
- break;
- case 1:
- detecta1++;
- break;
- case 2:
- detecta2++;
- break;
- case 3:
- detecta3++;
- break;
- case 4:
- detecta4++;
- break;
- case 5:
- detecta5++;
- break;
- case 6:
- detecta6++;
- break;
- default:
- detectaOtros++;
- break;
- }
- //printf("\n%d good Markers found and used for pose estimation.\nPose-Matrix:\n ", numDetected);
-
- }else{
- //no_detecta++;
- error_trans_mat++;
- //printf("No detectado (Error trans mat)\n");
- }
- }else{
- no_detecta++;
- //printf("No detectado\n");
- }
-
-
- frame=camera->queryFrame();
- count++;
- //nanosleep(&req,NULL);
- }
-
- printf("*** %f (frame/sec)\n", (double)count/timeUtils->utilTimer());
- printf("Frames No Detecta = %d\n",no_detecta);
- printf("Frames Detecta pero hay error en getTransMat = %d\n",error_trans_mat);
- printf("Frames Detecta 1 = %d\n",detecta1);
- printf("Frames Detecta 2 = %d\n",detecta2);
- printf("Frames Detecta 3 = %d\n",detecta3);
- printf("Frames Detecta 4 = %d\n",detecta4);
- printf("Frames Detecta 5 = %d\n",detecta5);
- printf("Frames Detecta 6 = %d\n",detecta6);
- printf("Frames Detecta Otros (deberia dar 0)= %d\n",detectaOtros);
- return (0);
-}
-
-static void init( void )
-{
- ARParam wparam;
-
- /* set the initial camera parameters */
- if( arParamLoad(cparam_name, 1, &wparam) < 0 ) {
- printf("Camera parameter load error !!\n");
- exit(0);
- }
- arParamChangeSize( &wparam, xsize, ysize, &cparam );
- arInitCparam( &cparam );
- printf("*** Camera Parameter ***\n");
- arParamDisp( &cparam );
-
- if( (config = arMultiReadConfigFile(config_name)) == NULL ) {
- printf("config data load error !!\n");
- exit(0);
- }
-
- /* open the graphics window */
- //argInit( &cparam, 1.0, 0, 2, 1, 0 );
- arFittingMode = AR_FITTING_TO_IDEAL;
- arImageProcMode = AR_IMAGE_PROC_IN_HALF;
- argDrawMode = AR_DRAW_BY_TEXTURE_MAPPING;
- argTexmapMode = AR_DRAW_TEXTURE_HALF_IMAGE;
-}
-
-/* cleanup function called when program exits */
-static void cleanup(void)
-{
- arVideoCapStop();
- arVideoClose();
- argCleanup();
-}