VS2017 debug时传递参数

传递参数有两种方法:一、使用VS中的属性页配置;二、使用cmd命令行执行程序并设置传递的参数

一、使用vs中的属性页配置

项目--> 右键“属性”--> 调试--> 命令参数,中输入需要的参数信息,每个参数之间以空格隔开,如图。

 需要注意的一点是配置选项中一定要是"Debug"。

 传递的参数总共是5个,其中argv[0]默认为当前执行的程序路径,argv[1] , argv[2] , argv[3],argv[4]这四个参数便是我们在上面的“命令参数”中填入的参数,这里分别是待配准的两片点云路径和 输出配准之后的点云的路径,以及选定的icp方法为point-to-point icp。

二、使用cmd命令执行程序并传递参数

如下是输入参数的提示信息:

Help :
==============================================================================================
Short_name  Long_name              Description                                  Default_value
==============================================================================================
-h          --help                 show option help                             false
-d          --demo                 demo mode (uses integrated media)            false
-i1         --input_1              Path to first input obj file (REQUIRED)
-i2         --input_2              Path to second input obj file (REQUIRED)
-o          --output               Path to the output directory (REQUIRED)
-n          --name                 Name of the output file                      output
-k          --k_normals            knn parameter for normals computation        10
-n1         --n_iterations_1       Nb of iterations for the algorithm           25
-n2         --n_iterations_2       Nb of iterations for the algorithm's step 2  2
-mu         --mu                   Parameter for step 2.1                       10
-ns         --n_iterations_shrink  Number of iterations for shrink step (2.1)   3
-p          --p_norm               Use of norm L_p                              0.5
-po         --point_to_point       Use point to point variant                   false
-pl         --point_to_plane       Use point to plane variant                   false
-v          --verbose              Verbosity trigger                            false
==============================================================================================

可以看到-i1 , -i2 , -o这3个参数是必须要设置的,同时还要通过参数 -p0, -p1, 选择是使用point-to-point icp or point-to-plane icp 。

输入的命令如下:

E:\PROJECT\C++Projects\icpSparse\Debug>icpSparse.exe --input_1 E:\media\bunny_side1.obj  --input_2 E:\media\bunny_side2.obj --output E:\media\output --point_to_point

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值