Example #1
0
int main()
{
    printf("Visual Cortex %s !\n",VisCortx_Version());

    VisCortx_Start(320,240);

         FillRandom();
        //FillPATCHColor(0,0,30,30,255);
        //FillPATCHColor(0,30,30,30,212);
        //FillPATCHColor(30,0,30,30,123);

        VisCortx_WriteToVideoRegister(LEFT_EYE,320,240,3,(unsigned char * ) &vid);
        VisCortx_SelfCheck();

    VisCortx_Stop();
    return 0;
}
Example #2
0
int main(int argc, const char* argv[])
{
    printf("Visual Cortex %s !\n",VisCortx_Version());


   if ( argc > 3 )
     {
       strcpy(filename0,argv[1]);
       strcpy(filename1,argv[2]);
       strcpy(out_filename,argv[3]); strcat(out_filename2nd,(char*)"_gddg_2nd");
       strcpy(out_filename2nd,argv[3]); strcat(out_filename2nd,(char*)"_gddg_2nd");
       strcpy(out_filenameedges,argv[3]); strcat(out_filenameedges,(char*)"_gddg_edges");
       strcpy(out_filenamedepthedges,argv[3]); strcat(out_filenamedepthedges,(char*)"_gddg_edges_depth");


       strcpy(opencv_filename,argv[3]);           strcat(opencv_filename,(char*)"_opencv");
       strcpy(opencv_filenamedepthedges,argv[3]); strcat(opencv_filenamedepthedges,(char*)"_opencv_edges_depth");

      if ( argc >= 4 )
       {
         strcpy(disparity_ground_truth_filename,argv[4]); we_have_a_disparity_ground_truth=1;
         printf("Ground Truth file is %s \n",disparity_ground_truth_filename);
       }


     } else
     {
        fprintf(stderr,"Usage : VisCortx_Tester RESOLUTIONX RESOLUTIONY left_image.ppm right_image.ppm output.ppm\n");
        fprintf(stderr,"ie : VisCortx_Tester imageLEFT.ppm imageRIGHT.ppm depth.ppm\n");
        return 1;
     }


    vid0 = LoadRegisterFromFileInternal(filename0,&resolution_width,&resolution_height);
    if (vid0==0) { fprintf(stderr,"Could not load image %s ",filename0); return 1; }
    vid1 = LoadRegisterFromFileInternal(filename1,&resolution_width,&resolution_height);
    if (vid1==0) { fprintf(stderr,"Could not load image %s ",filename1); return 1; }


    if (we_have_a_disparity_ground_truth)
     { ground =LoadRegisterFromFileInternal(disparity_ground_truth_filename,&resolution_width,&resolution_height); }
    if (ground==0) { fprintf(stderr,"Could not load a ground truth image\n");  }



    VisCortx_Start(resolution_width,resolution_height,"./");

    //DISABLE STUFF THAT ARE NOT NEEDED FOR DISPARITY MAPPING..
    VisCortx_SetSetting(PASS_TO_FACE_DETECTOR,0);
    VisCortx_SetSetting(PASS_TO_FEATURE_DETECTOR,0);
    VisCortx_SetSetting(DEPTHMAP_USE_OPENCV,0);
    VisCortx_SetSetting(USE_OPENCV,0);
    VisCortx_SetSetting(DEPTHMAP_OPENCV_LIKE_OUTPUT,1);
    VisCortx_SetSetting(CALCULATE_MOVEMENT_FLOW,0);

    VisCortx_SetSetting(DEPTHMAP_VERT_SHIFT_UP,0);
    VisCortx_SetSetting(DEPTHMAP_VERT_SHIFT_DOWN,0);
    VisCortx_SetSetting(DEPTHMAP_VERT_OFFSET_UP,0);
    VisCortx_SetSetting(DEPTHMAP_VERT_OFFSET_DOWN,0);

    VisCortx_SetTime(10);

    VisCortX_NewFrame(LEFT_EYE,resolution_width,resolution_height,3,(unsigned char * ) vid0);

    VisCortX_NewFrame(RIGHT_EYE,resolution_width,resolution_height,3,(unsigned char * ) vid1);


    //Fire Depth map one time to get edges .. etc
    VisCortx_FullDepthMap(0);
    ExecutePipeline();
    VisCortX_SaveVideoRegisterToFile(DEPTH_LEFT_VIDEO,out_filename);
    //Store edge count
    rgb_edges = VisCortx_CountEdges(EDGES_LEFT,0,0,VisCortx_GetMetric(LEFT_EYE),VisCortx_GetMetric(RIGHT_EYE));



    //Frames Are loaded and ready for our processing ..
    DisparityOpenCV(); //This is used as a guide

    DisparityMappingSettingsBenchmark();

    //Our processing is done ....

    VisCortx_Stop();

    free(vid0);
    free(vid1);
    return 0;
}