/*
 * Copyright 2019 Xilinx Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
Important:
  ./test_bin_pointpillars.cpp , ./test_performance_pointpillars, ./test_accuracy_pointpillars first param followed must be with 2 model names.
  first model name is for PointNet, second model name is for RPN
  Valid model name:
    PointNet:  pointpillars_kitti_12000_0_pt
    RPN:       pointpillars_kitti_12000_1_pt

1, compile

    execute the following command:

        sh build.sh

2, copy the compiled executable file and test image to the development board.

   run the executable file.

    sample : env XLNX_POINTPILLARS_PRE_MT=1 ./test_bin_pointpillars  pointpillars_kitti_12000_0_pt pointpillars_kitti_12000_1_pt sample_pointpillars.bin  sample_pointpillars.png 
    output : 
0       18.456533 4.032932 -1.682877 1.771039 4.524079 1.512004 1.671563     0.904651
0       34.541061 1.562399 -1.557331 1.538705 3.495937 1.431536 1.741875     0.904651
1       21.353041 -2.429055 -1.600262 0.590698 1.917939 1.757244 4.656905     0.835484
0       10.950532 4.672932 -1.657603 1.716550 4.384888 1.753955 1.632500     0.798187

    sample : env XLNX_POINTPILLARS_PRE_MT=1 ./test_accuracy_pointpillars pointpillars_kitti_12000_0_pt  pointpillars_kitti_12000_1_pt  test_accuracy_pointpillars_bin.list test_accuracy_pointpillars_rgb.list test_accuracy_pointpillars_calib.list result
    output : 
    result dir holding the detect result files for each data in test_accuracy_pointpillars_bin.list
   
    sample : env XLNX_POINTPILLARS_PRE_MT=1 ./test_performance_pointpillars pointpillars_kitti_12000_0_pt  pointpillars_kitti_12000_1_pt  -t 1 -s 30 test_performance_pointpillars.list
 
    note: env variable  XLNX_POINTPILLARS_PRE_MT means the inner threads num for preprocess. default value=2 (range 1 to 4).
      if it >1, it may cause some random to the result ( usually it becomes better)
      for accuracy test, it's better to set it to 1 to eliminate the random.
      for performance test, the total threads num will be inner_threads_num*test_threads_num,
      if this value is too big, too many threads cause the performance will be dropping instead of raising. 
      so if test threads num is little, XLNX_POINTPILLARS_PRE_MT can be set a little bigger;
      if test threads num is big, XLNX_POINTPILLARS_PRE_MT can be set to 1.
      it's better to do more test with different combination to choose the best value. 
       


* how to set DISPLAY_PARAM

  there are 3 variables in DISPLAY_PARAM: P2 rect Trv2c.
  each of them are float data in 4x4 metrix.
  the last row of the matrixs are all [0,0,0,1].
  
  Trv2c:
    in calib_velo_to_cam.txt, there are R (3x3 ) and T (3x1). 
    R is rotation matrix, T is translation vector.
    R|T takes a point in Velodyne coordinates and transforms it into the
    coordinate system of the left video camera. Likewise it serves as a
    representation of the Velodyne coordinate frame in camera coordinates.
    Reshape R to 3x3 and make R|T be 3x4 matrix. This is the upper 3 rows of Trv2c
  
  P2:
    in calib_cam_to_cam.txt, P_rect_02 ( normally, _02 is used)
    reshape P_rect_02 to 3x4 Matrix, this is the upper 3 rows of P2.
    
  rect:
    in calib_cam_to_cam.txt, reshape R_rect_00 to 3x3 Matrix (called r).
    then reshape r|0 to 3x4 Matrix ( add 0 to each row  as last element )
    this is the upper 3 rows of rect.

