*****************************************************************************
* Copyright (c) 2019 NVIDIA Corporation.  All rights reserved.
*
* NVIDIA Corporation and its licensors retain all intellectual property
* and proprietary rights in and to this software, related documentation
* and any modifications thereto.  Any use, reproduction, disclosure or
* distribution of this software and related documentation without an express
* license agreement from NVIDIA Corporation is strictly prohibited.
*****************************************************************************

Prequisites:

Please follow instructions in the apps/sample_apps/deepstream-app/README on how
to install the prequisites for Deepstream SDK, the DeepStream SDK itself and the
apps.

Compilation Steps:
  $ cd apps/deepstream-dewarper-app/
  $ make
  $ ./deepstream-dewarper-app [<uri1> <camera_id1>] [<uri2> <camera_id2>] ... [<uriN> <camera_idN>]
e.g.
  // Single Stream
  $ ./deepstream-dewarper-app file:///home/nvidia/sample_cam6.mp4 6

  // Multi Stream
  $ ./deepstream-dewarper-app file:///home/nvidia/sample_cam6.mp4 6 file:///home/nvidia/sample_cam6.mp4 6

This document shall describe about the sample deepstream-dewarper-test application.

uri - represents the 360d input video stream

camera_id - refers to the first column of the CSV files (i.e. csv_files/nvaisle_2M.csv & csv_files/nvspot_2M.csv)
The dewarping parameters for the given camera are read from CSV files and used to generate dewarp surfaces
(i.e. multiple aisle and spot surface) from 360d input video stream.

-------------------------------
Description of CSV File Fields:
-------------------------------

--------------
Common Fields
--------------
serial - Serial number for each Aisle or Spot View Camera Entry
sensorId - Sensor ID String
camDesc	- Camera Description String
cameraIDString	- Camera ID String
dewarpTopAngle - Top Field of View Angle, in degrees
dewarpBottomAngle - Bottom Field of View Angle, in degrees
dewarpPitch	- Viewing parameter Pitch, in degrees
dewarpYaw	- Viewing parameter Yaw, in degrees
dewarpRoll - Viewing parameter Roll, in degrees
dewarpFocalLength	- Focal Lenght of camera lens, in pixels per radian
dewarpWidth	- dewarped surface width
dewarpHeight - dewarped surface height

-----------------------------
Aisle View Specific Fields
-----------------------------
aisleId	- Aisle ID
aisleName	- Aisle Name
level	- Parking Level
numROIPoints - Number of ROI co-ordinates
ROI Co-ordinates-
ROI_x0	ROI_y0, ROI_x1	ROI_y1, ROI_x2	ROI_y2, ...., ROI_x7	ROI_y7

Global Co-ordinates
gx0	gy0, gx1	gy1, gx2	gy2, gx3	gy3

Camera Co-ordinates
cx0	cy0, cx1	cy1, cx2	cy2, cx3	cy3

Perspective Transformation Matrix genrated from
Camera and Global Co-ordinates
H0	H1	H2	H3	H4	H5	H6	H7	H8

entry - 0 indicates no entry ROI, 1 indicates valid entry ROI
Entry ROI Co-ordinates-
entry_ROI_x0	entry_ROI_y0, entry_ROI_x1	entry_ROI_y1, entry_ROI_x2	entry_ROI_y2, entry_ROI_x3	entry_ROI_y3

exit - 0 indicates no exit ROI, 1 indicates valid exit ROI
Exit ROI Co-ordinates-
exit_ROI_x0	exit_ROI_y0, exit_ROI_x1	exit_ROI_y1, exit_ROI_x2	exit_ROI_y2, exit_ROI_x3	exit_ROI_y3

-----------------------------
Spot View Specific Fields
-----------------------------
cameraId - Camera ID String
spotId - Unique Spot ID
type	- Level Type
level	- Parking Level
surfaceid	- Surface Index 0,1 corrosponding to Spot View
spot_index - Spot Index

Spot View horizontal line co-ordinates
Horizon_x1	Horizon_y1,	Horizon_x2	Horizon_y2

Spot View ROI co-ordinates
spot_roi_x1	spot_roi_y1,	spot_roi_x2	spot_roi_y2

Global Co-ordinates
x0	y0,	x1	y1,	x2	y2,	x3	y3

