prominenceai / deepstream-services-library

A shared library of on-demand DeepStream Pipeline Services for Python and C/C++
MIT License
288 stars 66 forks source link

Implement Dewarper Component and integrate with refactored Base Source #904

Closed rjhowell44 closed 1 year ago

rjhowell44 commented 1 year ago

This issue supersedes "Implement Dewarper #109"

Implement new Dewarper Component with the following API

New symbolic constants

/**
 * Dewarper API Return Values
 */
#define DSL_RESULT_DEWARPER_RESULT                                  0x00090000
#define DSL_RESULT_DEWARPER_NAME_NOT_UNIQUE                         0x00090001
#define DSL_RESULT_DEWARPER_NAME_NOT_FOUND                          0x00090002
#define DSL_RESULT_DEWARPER_NAME_BAD_FORMAT                         0x00090003
#define DSL_RESULT_DEWARPER_THREW_EXCEPTION                         0x00090004
#define DSL_RESULT_DEWARPER_CONFIG_FILE_NOT_FOUND                   0x00090005
#define DSL_RESULT_DEWARPER_SET_FAILED                              0x00090006

New Services

/**
 * @brief Creates a new, uniquely named Dewarper component
 * @param[in] name unique name for the new Dewarper component
 * @param[in] config_file absolute or relative path to Dewarper config text file
 * @param[in] 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.
 * @return DSL_RESULT_SUCCESS on success, one of DSL_RESULT_DEWARPER otherwise.
 */
DslReturnType dsl_dewarper_new(const wchar_t* name, 
    const wchar_t* config_file, uint camera_id);

/**
 * @brief Gets the current Config File in use by the named Dewarper
 * @param[in] name unique name of Dewarper to query
 * @param[out] config_file Config file currently in use
 * @return DSL_RESULT_SUCCESS on success, one of DSL_RESULT_DEWARPER otherwise.
 */
DslReturnType dsl_dewarper_config_file_get(const wchar_t* name, 
    const wchar_t** config_file);

/**
 * @brief Sets the Config File to use by the named Dewarper
 * @param[in] name unique name of Dewarper to update.
 * @param[in] config_file absolute or relative pathspec to new Config file to use.
 * @return DSL_RESULT_SUCCESS on success, one of DSL_RESULT_DEWARPER otherwise.
 */
DslReturnType dsl_dewarper_config_file_set(const wchar_t* name, 
    const wchar_t* config_file);

/**
 * @brief Gets the current camera-id for the named Dewarper.
 * @param[in] name name of the Dewarper to query.
 * @param[out] 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.
 * @return DSL_RESULT_SUCCESS on success, one of DSL_RESULT_DEWARPER otherwise..
 */
DslReturnType dsl_dewarper_camera_id_get(const wchar_t* name, uint* camera_id);

/**
 * @brief Sets the source-id for the named Dewarper to use.
 * @param[in] name name of the Dewarper to update.
 * @param[in] 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.
 * @return DSL_RESULT_SUCCESS on success, one of DSL_RESULT_DEWARPER otherwise.
 */
DslReturnType dsl_dewarper_camera_id_set(const wchar_t* name, uint camera_id);

/**
 * @brief Gets the number of dewarped output surfaces per frame buffer
 * for the named Dewarper.
 * @param[in] name name of the Dewarper to query.
 * @param[out] num number of dewarped output surfaces per buffer, i.e., batch-size 
 * of the buffer.
 * @return DSL_RESULT_SUCCESS on success, one of DSL_RESULT_DEWARPER otherwise.
 */
DslReturnType dsl_dewarper_num_batch_buffers_get(const wchar_t* name, uint* num);

/**
 * @brief Sets the number of dewarped output surfaces per frame buffer
 * for the named Dewarper.
 * @param[in] name name of the Dewarper to update
 * @param[in] num number of dewarped output surfaces per buffer, i.e., batch-size 
 * of the buffer [1..4]. 
 * @return DSL_RESULT_SUCCESS on success, one of DSL_RESULT_DEWARPER otherwise.
 */
DslReturnType dsl_dewarper_num_batch_buffers_set(const wchar_t* name, uint num);
rjhowell44 commented 1 year ago

Complete and merged into v0.26.alpha