コード例 #1
0
int capKinect::saveDepthAsPointCloud(int index, std::string prefix)
{
	cv::Mat depth,mask;
	load_depth(index,prefix,depth,mask);
	int pcs=0;
	if(!depth.empty())
	{
		std::string paths[] = { "firstViewDepth", "secondViewDepth", "thirdViewDepth",
		"forthViewDepth", "fifthViewDepth", "sixthViewDepth", "seventhViewDepth" };
		std::string curpath=prefix;
		curpath.append(paths[index]);
		curpath.append(".txt");
		pcs = getPointCloud(depth,world);
		world.save(curpath);
		printf("PointCloud saved in %s!\n",curpath.c_str());
	}
	return pcs;	
}
コード例 #2
0
ファイル: main.c プロジェクト: behnam/lfptools
int
main(
    int argc,
    char **argv)
{
    const char *input = "input.jpg";

    if (argc < 3) {
        printf("Usage: lfpview basefilename N\n");
        printf("  basefilename_00.jpg, basefilename_01.jpg, ... basefilename_N.jpg and basename_depth.txt will be loaded.\n");
        exit(1);
    }

    input = argv[1];
    gNumLayers = atoi(argv[2]);

    glutInit(&argc, argv);
    glutInitWindowSize(512, 512);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH | GLUT_RGBA);

    init();

    glutCreateWindow("lfp view");

    setup_textures(input);
    load_depth(input);

    glutReshapeFunc(reshape);
    glutDisplayFunc(display);
    glutKeyboardFunc(keyboard);
    glutMouseFunc(mouse);
    glutMotionFunc(motion);
    glutMainLoop();

    return 0;
}