• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ demo函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中demo函数的典型用法代码示例。如果您正苦于以下问题:C++ demo函数的具体用法?C++ demo怎么用?C++ demo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了demo函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

int main(int ac, const char *av[])
{
    if (ac == 2) {
        const cv::Mat image = cv::imread(av[1]);
        if (image.data) {
            std::cout << "Press a key to quit." << std::endl;
            DemoDisplay demo(image); demo();
            std::cout << "Initial threshold is: " << demo.threshold()
                      << std::endl;
            cv::waitKey(0);
            std::cout << "Final threshold was: " << demo.threshold()
                      << std::endl;
            return 0;
        }
    }
    std::cerr << av[0] << ": Demonstrate bounding polygonal contours."
              << std::endl << std::endl
              << "Usage: " << av[0] << " <image-file>" << std::endl
              << std::endl
              << "Where: <image-file> is the name of an image file."
              << std::endl << std::endl
              << "Example: " << av[0] << " ../resources/jets.jpg"
              << std::endl << std::endl;
    return 1;
}
开发者ID:tbl3rd,项目名称:opencv-tutorials,代码行数:25,代码来源:bound.cpp


示例2: main

int main(int ac, const char *av[])
{
    if (ac == 2) {
        const cv::Mat image = cv::imread(av[1]);
        if (image.data) {
            std::cout << std::endl << av[0] << ": Press any key to quit."
                      << std::endl << std::endl;
            DemoDisplay demo(image); demo();
            std::cout << av[0] << ": Initial maximum Corners is: "
                      << demo.maxCorners()<< std::endl << std::endl;
            cv::waitKey(0);
            std::cout << av[0] << ": Final maximum Corners was: "
                      << demo.maxCorners() << std::endl << std::endl;
            return 0;
        }
    }
    std::cerr << av[0] << ": Demonstrate Shi-Tomasi corner finding."
              << std::endl << std::endl
              << "Usage: " << av[0] << " <image-file>" << std::endl
              << std::endl
              << "Where: <image-file> has an image with some corners in it."
              << std::endl << std::endl
              << "Example: " << av[0] << " ../resources/building.jpg"
              << std::endl << std::endl;
    return 1;
}
开发者ID:tbl3rd,项目名称:opencv-tutorials,代码行数:26,代码来源:shiTomasiCorners.cpp


示例3: main

int main() {
  test();
  demo(32);
  demo(80);
  demo(512);
  printf("We are feeding ascii so it is always going to be ok.\n");
}
开发者ID:lemire,项目名称:Code-used-on-Daniel-Lemire-s-blog,代码行数:7,代码来源:checkutf8.c


示例4: main

int main() {
  demo(31);
  demo(1500);
  demo(15000);
  demopoweroftwo(32);
  demopoweroftwo(4096);
  demopoweroftwo(65536);
}
开发者ID:lemire,项目名称:Code-used-on-Daniel-Lemire-s-blog,代码行数:8,代码来源:fastrange.c


示例5: main

int main() {
    size_t x ;
    for(x=6; x<2048; x*=2 ) {
        printf("checking input size = %zu \n ",x);
        if(check(x,1024 * 1024)) return -1;
        printf("Ok!\n ");
    }
    demo(1024,1024 * 1024);
    demo(1024 * 1024,1024 * 1024);
    demo(32 * 1024 * 1024,1024 * 1024);
    return 0;
}
开发者ID:hermes47,项目名称:Code-used-on-Daniel-Lemire-s-blog,代码行数:12,代码来源:batchbinary.c


示例6: main

int main()
{
	float p = 0.5F, i = 0.0F, d = 0.0F;

	PIDDemo demo(p, i, d);	
	demo.SetPosition(140);
	demo.SetSetPoint(355);

	for (int i = 0; i < 40; i++)
	{
		if (demo.OnTarget())
			break;

		printf("%2d: Output: %.3f Position: %.3f (error: %.3f, goal: %.3f)\n",
			i,
			demo.GetOutput(), demo.GetPosition(),
			demo.m_controller.GetError(),
			demo.m_controller.GetSetpoint());

		Notifier::Pulse();

		
	}		

	return 0;
}
开发者ID:frc2423,项目名称:2008-2012,代码行数:26,代码来源:main.cpp


示例7: main

int main( int argc, char *argv[])
{
    const char *libdatadir;
    char conjFN[512], verbsFN[512];
    int exit_status;

    if (argc < 2)
    {
        printf("conjugator.c: demo of the C API of Verbiste\n");
        printf("Usage: conjugator VERB\n");
        printf("Note: this program expects Latin-1 and writes Latin-1.\n");
        return EXIT_FAILURE;
    }

    setlocale(LC_CTYPE, "");  // necessary on Solaris
    libdatadir = getenv("LIBDATADIR");
    if (libdatadir == NULL)
        libdatadir = LIBDATADIR;

    snprintf(conjFN, sizeof(conjFN), "%s/conjugation-fr.xml", libdatadir);
    snprintf(verbsFN, sizeof(verbsFN), "%s/verbs-fr.xml", libdatadir);

    if (verbiste_init(conjFN, verbsFN, "fr") != 0)
    {
        printf("conjugator.c: failed to initialize Verbiste.\n");
        return EXIT_FAILURE;
    }

    exit_status = demo(argv[1]);

    verbiste_close();

    return exit_status;
}
开发者ID:MikeBenza,项目名称:conjugation-practice,代码行数:34,代码来源:conjugator.c


示例8: main

int main(const int argc, const char* args[])
{
	gamePtr demo(new Pacman());
	demo->start();

	return 0;
}
开发者ID:TheIllusionistMirage,项目名称:SFML2-Game,代码行数:7,代码来源:main.cpp


示例9: main

int main(void)
{
    configure_teensy();
    configure_LEDs();
    configure_usb();

    int16_t lastcmd = '\0', cmd = '\0';

    while (1)
    {
        wait_for_usb_connection();

        while (1)
        {
            cmd = usb_serial_getchar();

            if(is_valid_control_key(cmd))
            {
                if(cmd == '+') adjust_speed(-10); // Speed up == less time.
                else if(cmd == '-') adjust_speed(10);
            }

            if( is_valid_cmd(cmd) )
            {
                lastcmd = cmd;
            }

            if(lastcmd == 'k') knight_rider();
            else if(lastcmd == 's') step();
            else if(lastcmd == 'f') follow();
            else if(lastcmd == '0') nop();
            else demo();
        }
    }
}
开发者ID:built,项目名称:kitt,代码行数:35,代码来源:kitt.c


示例10: run_yolo

void run_yolo(int argc, char **argv)
{
	int dont_show = find_arg(argc, argv, "-dont_show");
	int http_stream_port = find_int_arg(argc, argv, "-http_port", -1);
	char *out_filename = find_char_arg(argc, argv, "-out_filename", 0);
    char *prefix = find_char_arg(argc, argv, "-prefix", 0);
    float thresh = find_float_arg(argc, argv, "-thresh", .2);
	float hier_thresh = find_float_arg(argc, argv, "-hier", .5);
    int cam_index = find_int_arg(argc, argv, "-c", 0);
    int frame_skip = find_int_arg(argc, argv, "-s", 0);
	int ext_output = find_arg(argc, argv, "-ext_output");
    if(argc < 4){
        fprintf(stderr, "usage: %s %s [train/test/valid] [cfg] [weights (optional)]\n", argv[0], argv[1]);
        return;
    }

    char *cfg = argv[3];
    char *weights = (argc > 4) ? argv[4] : 0;
    char *filename = (argc > 5) ? argv[5]: 0;
    if(0==strcmp(argv[2], "test")) test_yolo(cfg, weights, filename, thresh);
    else if(0==strcmp(argv[2], "train")) train_yolo(cfg, weights);
    else if(0==strcmp(argv[2], "valid")) validate_yolo(cfg, weights);
    else if(0==strcmp(argv[2], "recall")) validate_yolo_recall(cfg, weights);
    else if(0==strcmp(argv[2], "demo")) demo(cfg, weights, thresh, hier_thresh, cam_index, filename, voc_names, 20, frame_skip,
		prefix, out_filename, http_stream_port, dont_show, ext_output);
}
开发者ID:Nuzhny007,项目名称:Multitarget-tracker,代码行数:26,代码来源:yolo.c


示例11: main

int main() {
  info = carp_connect();
  carp_reset();
  demo();
  carp_disconnect();
  return 0;
}
开发者ID:lundal,项目名称:carp-api,代码行数:7,代码来源:demo_stacked.c


示例12: run_coco

void run_coco(int argc, char **argv)
{
    int i;
    for(i = 0; i < 80; ++i){
        char buff[256];
        sprintf(buff, "data/labels/%s.png", coco_classes[i]);
        coco_labels[i] = load_image_color(buff, 0, 0);
    }
    float thresh = find_float_arg(argc, argv, "-thresh", .2);
    int cam_index = find_int_arg(argc, argv, "-c", 0);
    int frame_skip = find_int_arg(argc, argv, "-s", 0);

    if(argc < 4){
        fprintf(stderr, "usage: %s %s [train/test/valid] [cfg] [weights (optional)]\n", argv[0], argv[1]);
        return;
    }

    char *cfg = argv[3];
    char *weights = (argc > 4) ? argv[4] : 0;
    char *filename = (argc > 5) ? argv[5]: 0;
    if(0==strcmp(argv[2], "test")) test_coco(cfg, weights, filename, thresh);
    else if(0==strcmp(argv[2], "train")) train_coco(cfg, weights);
    else if(0==strcmp(argv[2], "valid")) validate_coco(cfg, weights);
    else if(0==strcmp(argv[2], "recall")) validate_coco_recall(cfg, weights);
    else if(0==strcmp(argv[2], "demo")) demo(cfg, weights, thresh, cam_index, filename, coco_classes, coco_labels, 80, frame_skip);
}
开发者ID:isuker,项目名称:darknet,代码行数:26,代码来源:coco.c


示例13: main

int main(){
    int converge = 0;
    int k = 0;
    while(!converge){
        printf("Value Iteration %d ...", k++);
        converge = 1;
        for(unsigned i = 0; i < STATE_SPACE; i++){
            state_t state;
            state.key = i;
            if(!validate_state(state)) continue;
            value_update(state, k);
            if(vnext[state.key] - v[state.key] > error_tolerance || vnext[state.key] - v[state.key] < -error_tolerance) converge = 0;
        }
        printf("\b\b\b\n");
        memcpy(v, vnext, sizeof(v));
    }
    FILE* f = fopen("output.txt", "wb");
    const char* action_name[] = {
        "wait", "bt  ", "rb  ", "ws  ",
    };
    for(unsigned k = 0; k < STATE_SPACE; k++){
        state_t state;
        state.key = k;
        if(!validate_state(state)) continue;
        if(!state.state.gcd)
        fprintf(f, "RBST %d, BSST %d, ERRM %d, BTCD %d, RAGE %d - %s %.3f\r\n",
                state.state.rb_st, state.state.bs_st, state.state.er_rm, state.state.bt_cd, state.state.rage,
                action_name[pi[state.key]], v[state.key]);
    }

    demo();
}
开发者ID:AeanSR,项目名称:maga,代码行数:32,代码来源:mdp.cpp


示例14: main

int main( void )
{
	srand( time( NULL ) );
	setup_screen();
	demo();
	cleanup_screen();
	return 0;
}
开发者ID:NathanRamage,项目名称:CAB202,代码行数:8,代码来源:draw_ellipse_p.c


示例15: main

int main(void)
{
   printf("\nBefore calling demo(), x = %d and y = %d.", x, y);
   demo();
   printf("\nAfter calling demo(), x = %d and y = %d.\n", x, y);
 
   return 0;
}
开发者ID:ewomack,项目名称:C_Lessons,代码行数:8,代码来源:list0403.c


示例16: main

int main(int, char**)
{
     std::unique_ptr<Duck::Base> d1(new Duck::Base(nullptr, nullptr));
     std::unique_ptr<Duck::Behaviour::Quackable>mbehaviour ( new Duck::Behaviour::Squeak());
     demo(d1.get());

     std::cout << std::endl << "... Changing to Mallard ..." << std::endl << std::endl;

     d1.reset(new Duck::Mallard());
     demo(d1.get());
     std::cout << std::endl << "... Changing at runTime behaviour of Mallard ..." << std::endl << std::endl;
     mbehaviour.reset(new Duck::Behaviour::Squeak());
     d1.get()->setQuackBehavior(mbehaviour.get());
     demo(d1.get());

     std::cout << std::endl << "... Changing to CUSTOM Mallard ..." << std::endl << std::endl;

     d1.reset(new Duck::Mallard(new Duck::Behaviour::Squeak()));
     demo(d1.get());
     std::cout << std::endl << "... Changing to Redhead ..." << std::endl << std::endl;

     d1.reset(new Duck::Redhead());
     demo(d1.get());

     std::cout << std::endl << "... Changing to Rubber ..." << std::endl << std::endl;

     d1.reset(new Duck::Rubber());
     demo(d1.get());

     std::cout << std::endl << "... Changing to Decoy ..." << std::endl << std::endl;

     d1.reset(new Duck::Decoy());
     demo(d1.get());
}
开发者ID:lyase,项目名称:joggingthecpppath,代码行数:34,代码来源:ducks.cpp


示例17: main

int main( void )
{
	setup_screen();
	srand( time( NULL ) );
	demo();
	timer_pause( 5000 );
	cleanup_screen();
	return 0;
}
开发者ID:NathanRamage,项目名称:CAB202,代码行数:9,代码来源:fill_rect.c


示例18: GPIO_LED

void GPIO_LED(void)
{
    SystemInit();

	LED_Init();
    while (1) {
        demo();
    }
}
开发者ID:coocox,项目名称:Mplib,代码行数:9,代码来源:GPIO_LED.c


示例19: menu

/**
 * @brief Función para mostrar las opciones del programa
 * 
 */
void menu()
{
	setColor(WHITE);
	hidecursor();
	
	char opcion;
	char texto[] = { "Acerca de este programa : \n\nEl programa que usted esta usando es de tipo estadistico y sirve de herramienta para el analisis de datos obtenidos de alguna encuesta o censo\nUsted obtendra la tabla de frecuencias que incluye la \"Frecuencia\", \"Frecuencia acumulada\", \"Frecuencia relativa\" y \"Frecuencia relativa acumulada\" de una muestra de datos ingresados por usted.\n\nComo usar:\n\nPara comenzar a utilizar el programa, es necesario que usted se dirija al menu principal, y seleccione, \"iniciar\", el sistema le pedira que ingrese el nombre de la variable, solo y unicamente en ese justo momento es posible que usted pueda cancelar la accion presionando la combinacion de telcas \"CONTROL+C\" ya que despues no sera posible, despues usted ingresara los datos uno por uno, despues de haber ingresado un dato el sistema mostrara un mensaje que le dara las opciones de continuar ingresando datos presionando la tecla ENTER, o dejar de ingresar datos presionando la tecla ESCAPE\n\n " };

	system("cls");
	puts("\n\tPrograma de estadistica\n");
	puts("a. Ayuda");
	puts("b. Iniciar");
	puts("c. Demo");
	puts("d. Salir");
	printf(":");
	opcion = _getche();
	fflush(stdin);

	switch (opcion)
	{
	case 'a':
		system("cls");
		puts("\n\tPrograma de estadistica\n\n");
		printf("%s", texto);
		setColor(LIGHTMAGENTA);
		printf("\nAutor: Luis %cngel De Santiago Guerrero\n", A);
		printf("Matricula: ES1611300455\n");
		printf("Contacto:  [email protected]\n");
		printf("Universidad Abierta y a Distancia de M%cxico\n", e);
		printf("Ingenier%ca en Desarrollo de Software\n\n", iacen);
		system("pause");
		main();
		break;

	case 'b':
		ingresoDeDatos();
		break;
	
	case 'c':
		demo();
		break;
	
	case 'd':
		printf("\n\n\t\t\tAdios");
		puntitos(500, 3);
		exit(0);
		break;

	default:
		setColor(RED);
		printf("\nIngrese una opcion valida\n");
		system("pause");
		main();
		break;
	}
}
开发者ID:AngelGuerrero,项目名称:ProgramaDeEstadistica,代码行数:60,代码来源:main.c


示例20: main

int main(int argc, char *argv[]) {
    union REGS regs;
    byte breakout = 0;
    int i,j,f,k=0;
    long oldCount = 0;
    int width = 320;
    int height = 200;
    int comp = 0;
    int req_comp = 0;
    int pixel_pos = 0;

    char str1[] = "hello, synctracker!\n";
    byte *image_pixelbuffer = malloc(320 * 200);
    byte *image_palettebuffer = malloc(256 * 3);


    /* Unbuffer stdout: */
    setbuf(stdout, NULL);

    /* Prevent warnings: */
    argc = argc;
    argv = argv;

    start = *my_clock;

    system("cls");
    printf("Please wait...");
    connectToCOM1();

    loader();

    /* Play the tune */
    if ( (playHandle = MIDASplayModule(module, TRUE)) == 0 ) {
        MIDASerror();
    }
    startTime = 0;
    currentTime = 0;
    prevTime = 0;
    passedTime = 0;

    set_mode(VGA_256_COLOR_MODE);
    while ( !kbhit() ) {
        currentTime = frameCount / 60.0f;
        passedTime = frameCount - prevTime;
        prevTime = currentTime;

        displayImage(background);
        demo();
        wait_for_retrace();
        UpdateInfo();
    }

    midasMagicDies();
    set_mode(TEXT_MODE);
    return 0;
}
开发者ID:unconditionalbranch,项目名称:dosengine,代码行数:56,代码来源:main.c



注:本文中的demo函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ density函数代码示例发布时间:2022-05-30
下一篇:
C++ demangle函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap