| 62 | } |
| 63 | |
| 64 | int |
| 65 | main(int argc, char** argv) |
| 66 | { |
| 67 | int viewport_source, viewport_convolved = 0; |
| 68 | int direction = -1; |
| 69 | int nb_threads = 1; |
| 70 | char border_policy = 'Z'; |
| 71 | double threshold = 0.001; |
| 72 | pcl::filters::Convolution<pcl::PointXYZRGB, pcl::PointXYZRGB> convolution; |
| 73 | Eigen::ArrayXf gaussian_kernel(5); |
| 74 | gaussian_kernel << 1.f / 16, 1.f / 4, 3.f / 8, 1.f / 4, 1.f / 16; |
| 75 | pcl::console::print_info("convolution kernel:"); |
| 76 | for (Eigen::Index i = 0; i < gaussian_kernel.size(); ++i) |
| 77 | pcl::console::print_info(" %f", gaussian_kernel[i]); |
| 78 | pcl::console::print_info("\n"); |
| 79 | |
| 80 | if (argc < 3) { |
| 81 | usage(argv); |
| 82 | return 1; |
| 83 | } |
| 84 | |
| 85 | // check if user is requesting help |
| 86 | std::string arg(argv[1]); |
| 87 | |
| 88 | if (arg == "--help" || arg == "-h") { |
| 89 | usage(argv); |
| 90 | return 1; |
| 91 | } |
| 92 | |
| 93 | // user don't need help find convolving direction |
| 94 | // convolve row |
| 95 | if (pcl::console::find_switch(argc, argv, "-r")) { |
| 96 | direction = 0; |
| 97 | } |
| 98 | else { |
| 99 | // convolve column |
| 100 | if (pcl::console::find_switch(argc, argv, "-c")) { |
| 101 | direction = 1; |
| 102 | } |
| 103 | else |
| 104 | // convolve both |
| 105 | if (pcl::console::find_switch(argc, argv, "-s")) { |
| 106 | direction = 2; |
| 107 | } |
| 108 | else { |
| 109 | // wrong direction given print usage |
| 110 | usage(argv); |
| 111 | return 1; |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | // number of threads if any |
| 116 | if (pcl::console::parse_argument(argc, argv, "-t", nb_threads) != -1) { |
| 117 | if (nb_threads <= 0) |
| 118 | nb_threads = 1; |
| 119 | #ifndef _OPENMP |
| 120 | if (nb_threads > 1) { |
| 121 | pcl::console::print_info("OpenMP not activated. Number of threads: 1\n"); |
nothing calls this directly
no test coverage detected