From: Shobhit Verma Date: Thu, 6 Oct 2022 09:13:44 +0000 (+0530) Subject: [ITC][media-vision][ACR-1720] Added ITC for new media vision 3D APIs X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=300d32d11e9bd7f1538bb4cb54fe049dba45671a;p=test%2Ftct%2Fnative%2Fapi.git [ITC][media-vision][ACR-1720] Added ITC for new media vision 3D APIs Change-Id: Iaf814312c64e54bdca0f6ae0f0ff27ab8bbd0bbc Signed-off-by: Shobhit Verma --- diff --git a/src/itc/media-vision/CMakeLists.txt b/src/itc/media-vision/CMakeLists.txt old mode 100644 new mode 100755 index def99a4ef..99a8c74c6 --- a/src/itc/media-vision/CMakeLists.txt +++ b/src/itc/media-vision/CMakeLists.txt @@ -10,14 +10,15 @@ SET(TC_SOURCES ITs-media-vision-face.c ITs-media-vision-image.c ITs-media-vision-surveillance.c - ITs-media-vision-barcode.c + ITs-media-vision-barcode.c ITs-media-vision-inference.c + ITs-media-vision-3d.c ) IF( DEFINED TIZENIOT || DEFINED MOBILE || DEFINED WEARABLE) SET(TC_SOURCES ITs-media-vision-roi-tracker.c - ITs-media-vision-face-recognition.c + ITs-media-vision-face-recognition.c ) ENDIF() diff --git a/src/itc/media-vision/ITs-media-vision-3d.c b/src/itc/media-vision/ITs-media-vision-3d.c new file mode 100755 index 000000000..d4aa61fdb --- /dev/null +++ b/src/itc/media-vision/ITs-media-vision-3d.c @@ -0,0 +1,631 @@ +// +// Copyright (c) 2022 Samsung Electronics Co., Ltd. +// +// 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. +// +#include "ITs-media-vision-common.h" + +//& set: MediaVision + +/** @addtogroup itc-media-vision +* @ingroup itc +* @{ +*/ + +const char *g_Mv3dExampleDir = NULL; +static bool g_IsMv3dDepthSupported = false; +static bool g_IsMv3dPointCloudSupported = false; +static int g_StartupError; + +static mv_engine_config_h g_EngineConfigHandle = NULL; +static mv_source_h g_BaseSourceHandle = NULL; +static mv_source_h g_ExtraSourceHandle = NULL; +static bool g_Mv3dDepthCallBackInvoked = false; +static bool g_Mv3dPointCloudCallBackInvoked = false; +static int g_Mv3dPcdWriteResultErr; +static mv_3d_h g_Mv3d_handle = NULL; +static bool g_WriteToFile = false; + +static int Set3dEngineConfig(mv_engine_config_h engine_cfg) +{ + int nRet; + + nRet = mv_engine_config_set_int_attribute(engine_cfg, MV_3D_DEPTH_MODE, MV_3D_DEPTH_MODE_STEREO); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_engine_config_set_int_attribute", MediaVisionGetError(nRet)); + + nRet = mv_engine_config_set_int_attribute(engine_cfg, MV_3D_DEPTH_WIDTH, MV3D_DEPTH_WIDTH); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_engine_config_set_int_attribute", MediaVisionGetError(nRet)); + + nRet = mv_engine_config_set_int_attribute(engine_cfg, MV_3D_DEPTH_HEIGHT, MV3D_DEPTH_HEIGHT); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_engine_config_set_int_attribute", MediaVisionGetError(nRet)); + + nRet = mv_engine_config_set_int_attribute(engine_cfg, MV_3D_DEPTH_MIN_DISPARITY, MV3D_MINIMUN_DISPARITY); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_engine_config_set_int_attribute", MediaVisionGetError(nRet)); + + nRet = mv_engine_config_set_int_attribute(engine_cfg, MV_3D_DEPTH_MAX_DISPARITY, MV3D_MAXIMUM_DISPARITY); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_engine_config_set_int_attribute", MediaVisionGetError(nRet)); + + char calibFilename[PATHLEN]; + snprintf(calibFilename, PATHLEN, "%s/%s", g_Mv3dExampleDir, MV3D_CALIBRATION_FILENAME); + nRet = mv_engine_config_set_string_attribute(engine_cfg, MV_3D_DEPTH_STEREO_CONFIG_FILE_PATH, calibFilename); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_engine_config_set_string_attribute", MediaVisionGetError(nRet)); + + nRet = mv_engine_config_set_double_attribute(engine_cfg, MV_3D_POINTCLOUD_SAMPLING_RATIO, MV3D_SAMPLING_RATIO); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_engine_config_set_double_attribute", MediaVisionGetError(nRet)); + + nRet = mv_engine_config_set_int_attribute(engine_cfg, MV_3D_POINTCLOUD_OUTLIER_REMOVAL_POINTS, MV3D_OUTLIER_REMOVAL_POINTS); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_engine_config_set_int_attribute", MediaVisionGetError(nRet)); + + nRet = mv_engine_config_set_double_attribute(engine_cfg, MV_3D_POINTCLOUD_OUTLIER_REMOVAL_RADIUS, MV3D_OUTLIER_REMOVAL_RAIDUS); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_engine_config_set_double_attribute", MediaVisionGetError(nRet)); + + char mediaFilename[PATHLEN]; + snprintf(mediaFilename, PATHLEN, "%s", "/tmp"); + nRet = mv_engine_config_set_string_attribute(engine_cfg, MV_3D_POINTCLOUD_OUTPUT_FILE_PATH, mediaFilename); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_engine_config_set_string_attribute", MediaVisionGetError(nRet)); + + return nRet; +} + + +static void MvDepthCB(mv_source_h source, unsigned short* depth, unsigned int width, unsigned int height, void* user_data) +{ + g_Mv3dDepthCallBackInvoked = true; + FPRINTF("[Line : %d][%s] Callback Invoked: MvDepthCB\\n", __LINE__, API_NAMESPACE, "MvDepthCB"); + if (!g_WriteToFile) + QuitGmainLoop(); +} + +static void MvPointcloudCB(mv_source_h source, mv_3d_pointcloud_h pointcloud, void *user_data) +{ + g_Mv3dPointCloudCallBackInvoked = true; + FPRINTF("[Line : %d][%s] Callback Invoked: MvPointcloudCB\\n", __LINE__, API_NAMESPACE, "MvDepthCB"); + if (g_WriteToFile) + { + mv_3d_h mv3d_handle = (mv_3d_h)user_data; + char outfilename[PATHLEN]; + snprintf(outfilename, 1024, "/tmp/%s", g_Mv3dExampleDir, MV3D_POINTCLOUD_OUT_FILENAME); + g_Mv3dPcdWriteResultErr = mv_3d_pointcloud_write_file(mv3d_handle, pointcloud, MV_3D_POINTCLOUD_TYPE_PCD_BIN, MV3D_POINTCLOUD_OUT_FILENAME); + } +} + +/** + * @function ITs_media_vision_3d_startup + * @description Called before each test + * @parameter NA + * @return NA + */ +void ITs_media_vision_3d_startup(void) +{ + struct stat stBuff; + if ( stat(ERR_LOG, &stBuff) == 0 ) + { + remove(ERR_LOG); + } + + g_IsMv3dSupported = false; + g_IsMv3dCreated = true; + g_bMismatch = false; + g_WriteToFile = false; + g_IsMv3dDepthSupported = TCTCheckSystemInfoFeatureSupported(MV3D_DEPTH_FEATURE, API_NAMESPACE); + g_IsMv3dPointCloudSupported = TCTCheckSystemInfoFeatureSupported(MV3D_POINTCLOUD_FEATURE, API_NAMESPACE); + + + if (g_IsMv3dDepthSupported || g_IsMv3dPointCloudSupported) + g_IsMv3dSupported = true; + else + g_IsMv3dSupported = false; + + int nRet = mv_3d_create(&g_Mv3d_handle); + if (!g_IsMv3dSupported) + { + if ( MEDIA_VISION_ERROR_NOT_SUPPORTED != nRet){ + FPRINTF("[Line : %d][%s] Feature is not supported, mv_3d_create API did not returned NOT_SUPPORTED error code.\\n", __LINE__, API_NAMESPACE); + g_bMismatch = true; + return; + } + } + else{ + if ( MEDIA_VISION_ERROR_NONE != nRet){ + FPRINTF("[Line : %d][%s] Feature is not supported, mv_3d_create API failed. error code: [%s]\\n", __LINE__, API_NAMESPACE, MediaVisionGetError(nRet)); + g_IsMv3dCreated = false; + return; + } + } + + char pszValue[CONFIG_VALUE_LEN_MAX] = {0,}; + if (true == GetValueForTCTSetting("DEVICE_SUITE_TARGET_30", pszValue, API_NAMESPACE)) + { + FPRINTF("[Line : %d][%s] 'DEVICE_SUITE_TARGET_30' Values Received %s\\n", __LINE__, API_NAMESPACE, pszValue); + g_Mv3dExampleDir = (char*)calloc(strlen(pszValue)+strlen("/res/res/3d")+1, sizeof(char)); + snprintf(g_Mv3dExampleDir, strlen(pszValue)+strlen("/res/res/3d")+1, "%s/res/res/3d", pszValue); + + } else { + FPRINTF("[Line : %d][%s] GetValueForTCTSetting returned error for 'DEVICE_SUITE_TARGET_30'\\n", __LINE__, API_NAMESPACE); + } + + g_StartupError = mv_create_engine_config(&g_EngineConfigHandle); + if (MEDIA_VISION_ERROR_NONE != g_StartupError) + { + g_EngineConfigHandle = NULL; + FPRINTF("[Line : %d][%s] mv_create_engine_config failed, returned error: [%s]'\\n", __LINE__, API_NAMESPACE, MediaVisionGetError(nRet)); + return; + } + + return; +} + + +/** + * @function ITs_media_vision_3d_cleanup + * @description Called after each test + * @parameter NA + * @return NA + */ +void ITs_media_vision_3d_cleanup(void) +{ + if (g_EngineConfigHandle) { + mv_destroy_engine_config(g_EngineConfigHandle); + g_EngineConfigHandle = NULL; + } + + if (g_BaseSourceHandle) { + mv_destroy_source(g_BaseSourceHandle); + g_BaseSourceHandle = NULL; + } + + if (g_ExtraSourceHandle) { + mv_destroy_source(g_ExtraSourceHandle); + g_ExtraSourceHandle = NULL; + } + + if (g_Mv3d_handle) + { + mv_3d_destroy(g_Mv3d_handle); + g_Mv3d_handle = NULL; + } + + return; +} + +/** @addtogroup itc-media-vision-testcases +* @brief Integration testcases for module media-vision +* @ingroup itc-media-vision +* @{ +*/ + +//& type: auto +//& purpose: Creates mv3d handle and destroy it +/** + * @testcase ITc_media_vision_mv_3d_create_destroy_p + * @author SRID(shobhit.v) + * @reviewer SRID(ankit.sri1) + * @type auto + * @since_tizen 7.0 + * @description To Creates mv3d handle and destroy it + * @scenario Creates mv 3d handle and destroy it + * @apicovered mv_3d_create and mv_3d_destroy + * @passcase If mv_3d_create and mv_3d_destroy pass + * @failcase If Precondition API or Target API Fails + * @precondition NA + * @postcondition NA + * */ +int ITc_media_vision_mv_3d_create_destroy_p(void) +{ + START_TEST_3D; + + int nRet; + nRet = mv_3d_destroy(g_Mv3d_handle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_destroy", MediaVisionGetError(nRet)); + + nRet = mv_3d_create(&g_Mv3d_handle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_create", MediaVisionGetError(nRet)); + CHECK_HANDLE_NONE(g_Mv3d_handle, "mv_3d_create"); + + nRet = mv_3d_destroy(g_Mv3d_handle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_destroy", MediaVisionGetError(nRet)); + + nRet = mv_3d_create(&g_Mv3d_handle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_create", MediaVisionGetError(nRet)); + CHECK_HANDLE_NONE(g_Mv3d_handle, "mv_3d_create"); + + return 0; +} + + +//& type: auto +//& purpose: To configure mv 3d handle +/** + * @testcase ITc_media_vision_mv_3d_configure_p + * @author SRID(shobhit.v) + * @reviewer SRID(ankit.sri1) + * @type auto + * @since_tizen 7.0 + * @description To configure mv 3d handle + * @scenario To configure mv 3d handle + * @apicovered mv_3d_create, mv_3d_destroy and mv_3d_configure + * @passcase If mv_3d_create, mv_3d_destroy and mv_3d_configure pass + * @failcase If Precondition API or Target API Fails + * @precondition NA + * @postcondition NA + * */ +int ITc_media_vision_mv_3d_configure_p(void) +{ + START_TEST_3D; + int nRet = -1; + + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, g_StartupError, "mv_create_engine_config", MediaVisionGetError(nRet)); + + nRet = Set3dEngineConfig(g_EngineConfigHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "Set3dEngineConfig", MediaVisionGetError(nRet)); + + nRet = mv_3d_configure(g_Mv3d_handle, g_EngineConfigHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_configure", MediaVisionGetError(nRet)); + + return 0; +} + + +//& type: auto +//& purpose: Sets mv_3d_depth_cb() callback +/** + * @testcase ITc_media_vision_mv_3d_set_depth_cb_p + * @author SRID(shobhit.v) + * @reviewer SRID(ankit.sri1) + * @type auto + * @since_tizen 7.0 + * @description Sets mv_3d_depth_cb() callback + * @scenario Sets mv_3d_depth_cb() callback + * @apicovered mv_3d_create, mv_3d_destroy, mv_3d_configure and mv_3d_set_depth_cb + * @passcase If mv_3d_create, mv_3d_destroy, mv_3d_configure and mv_3d_set_depth_cb pass + * @failcase If Precondition API or Target API Fails + * @precondition NA + * @postcondition NA + * */ +int ITc_media_vision_mv_3d_set_depth_cb_p(void) +{ + START_TEST_3D; + int nRet = -1; + + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, g_StartupError, "mv_create_engine_config", MediaVisionGetError(nRet)); + + nRet = Set3dEngineConfig(g_EngineConfigHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "Set3dEngineConfig", MediaVisionGetError(nRet)); + + nRet = mv_3d_configure(g_Mv3d_handle, g_EngineConfigHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_configure", MediaVisionGetError(nRet)); + + nRet = mv_3d_set_depth_cb(g_Mv3d_handle, MvDepthCB, NULL); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_set_depth_cb", MediaVisionGetError(nRet)); + + return 0; +} + + +//& type: auto +//& purpose: Sets mv_3d_depth_cb() callback +/** + * @testcase ITc_media_vision_mv_3d_set_pointcloud_cb_p + * @author SRID(shobhit.v) + * @reviewer SRID(ankit.sri1) + * @type auto + * @since_tizen 7.0 + * @description Sets mv_3d_pointcloud_cb() callback + * @scenario Sets mv_3d_pointcloud_cb() callback + * @apicovered mv_3d_create, mv_3d_destroy, mv_3d_configure and mv_3d_set_pointcloud_cb + * @passcase If mv_3d_create, mv_3d_destroy, mv_3d_configure and mv_3d_set_pointcloud_cb pass + * @failcase If Precondition API or Target API Fails + * @precondition NA + * @postcondition NA + * */ +int ITc_media_vision_mv_3d_set_pointcloud_cb_p(void) +{ + START_TEST_3D; + int nRet = -1; + + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, g_StartupError, "mv_create_engine_config", MediaVisionGetError(nRet)); + + nRet = Set3dEngineConfig(g_EngineConfigHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "Set3dEngineConfig", MediaVisionGetError(nRet)); + + nRet = mv_3d_configure(g_Mv3d_handle, g_EngineConfigHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_configure", MediaVisionGetError(nRet)); + + nRet = mv_3d_set_pointcloud_cb(g_Mv3d_handle, MvPointcloudCB, g_Mv3d_handle); + if (g_IsMv3dPointCloudSupported){ + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_set_pointcloud_cb", MediaVisionGetError(nRet)); + } + else{ + PRINT_RESULT(MEDIA_VISION_ERROR_NOT_SUPPORTED, nRet, "mv_3d_set_pointcloud_cb", MediaVisionGetError(nRet)); + } + + return 0; +} + +//& type: auto +//& purpose: Prepares handle +/** + * @testcase ITc_media_vision_mv_3d_prepare_p + * @author SRID(shobhit.v) + * @reviewer SRID(ankit.sri1) + * @type auto + * @since_tizen 7.0 + * @description Prepares handle to mv 3d + * @scenario Prepares handle to mv 3d + * @apicovered mv_3d_create, mv_3d_destroy, mv_3d_configure and mv_3d_set_pointcloud_cb, mv_3d_prepare + * @passcase If mv_3d_create, mv_3d_destroy, mv_3d_configure, mv_3d_set_pointcloud_cb and mv_3d_prepare pass + * @failcase If Precondition API or Target API Fails + * @precondition NA + * @postcondition NA + * */ +int ITc_media_vision_mv_3d_prepare_p(void) +{ + START_TEST_3D; + int nRet = -1; + + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, g_StartupError, "mv_create_engine_config", MediaVisionGetError(nRet)); + + nRet = Set3dEngineConfig(g_EngineConfigHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "Set3dEngineConfig", MediaVisionGetError(nRet)); + + nRet = mv_3d_configure(g_Mv3d_handle, g_EngineConfigHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_configure", MediaVisionGetError(nRet)); + + nRet = mv_3d_set_depth_cb(g_Mv3d_handle, MvDepthCB, NULL); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_set_depth_cb", MediaVisionGetError(nRet)); + + nRet = mv_3d_set_pointcloud_cb(g_Mv3d_handle, MvPointcloudCB, g_Mv3d_handle); + if (g_IsMv3dPointCloudSupported){ + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_set_pointcloud_cb", MediaVisionGetError(nRet)); + } + else{ + PRINT_RESULT(MEDIA_VISION_ERROR_NOT_SUPPORTED, nRet, "mv_3d_set_pointcloud_cb", MediaVisionGetError(nRet)); + } + + nRet = mv_3d_prepare(g_Mv3d_handle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_prepare", MediaVisionGetError(nRet)); + + return 0; +} + +//& type: auto +//& purpose: Gets depth or pointcloud synchronously from given source +/** + * @testcase ITc_media_vision_mv_3d_run_p + * @author SRID(shobhit.v) + * @reviewer SRID(ankit.sri1) + * @type auto + * @since_tizen 7.0 + * @description Gets depth or pointcloud synchronously from given source + * @scenario Gets depth or pointcloud synchronously from given source + * @apicovered mv_3d_create, mv_3d_destroy, mv_3d_configure and mv_3d_set_pointcloud_cb, mv_3d_run + * @passcase If mv_3d_create, mv_3d_destroy, mv_3d_configure, mv_3d_set_pointcloud_cb and mv_3d_run pass + * @failcase If Precondition API or Target API Fails + * @precondition NA + * @postcondition NA + * */ +int ITc_media_vision_mv_3d_run_p(void) +{ + START_TEST_3D; + + int nRet = -1; + g_Mv3dDepthCallBackInvoked = false; + + char pszImageFileName[PATHLEN]; + snprintf(pszImageFileName, 1024, "%s/%s", g_Mv3dExampleDir, MV3D_BASE_IMAGE_FILENAME); + + nRet = mv_create_source(&g_BaseSourceHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet)); + + nRet = image_load(pszImageFileName, g_BaseSourceHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "image_load", MediaVisionGetError(nRet)); + + char pzsExtraImageFilename[PATHLEN]; + snprintf(pzsExtraImageFilename, 1024, "%s/%s", g_Mv3dExampleDir, MV3D_EXTRA_IMAGE_FILENAME); + + nRet = mv_create_source(&g_ExtraSourceHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet)); + + nRet = image_load(pzsExtraImageFilename, g_ExtraSourceHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "image_load", MediaVisionGetError(nRet)); + + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, g_StartupError, "mv_create_engine_config", MediaVisionGetError(nRet)); + + nRet = Set3dEngineConfig(g_EngineConfigHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "Set3dEngineConfig", MediaVisionGetError(nRet)); + + nRet = mv_3d_configure(g_Mv3d_handle, g_EngineConfigHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_configure", MediaVisionGetError(nRet)); + + nRet = mv_3d_set_depth_cb(g_Mv3d_handle, MvDepthCB, NULL); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_set_depth_cb", MediaVisionGetError(nRet)); + + nRet = mv_3d_set_pointcloud_cb(g_Mv3d_handle, MvPointcloudCB, g_Mv3d_handle); + if (g_IsMv3dPointCloudSupported){ + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_set_pointcloud_cb", MediaVisionGetError(nRet)); + } + else{ + PRINT_RESULT(MEDIA_VISION_ERROR_NOT_SUPPORTED, nRet, "mv_3d_set_pointcloud_cb", MediaVisionGetError(nRet)); + } + + nRet = mv_3d_prepare(g_Mv3d_handle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_prepare", MediaVisionGetError(nRet)); + + nRet = mv_3d_run(g_Mv3d_handle, g_BaseSourceHandle, g_ExtraSourceHandle, NULL); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_run", MediaVisionGetError(nRet)); + if(!g_Mv3dDepthCallBackInvoked) + { + FPRINTF("[Line : %d][%s] Callback not hit\\n", __LINE__, API_NAMESPACE); + return 1; + } + + return 0; +} + +//& type: auto +//& purpose: Gets depth or pointcloud asynchronously from given source +/** + * @testcase ITc_media_vision_mv_3d_run_async_p + * @author SRID(shobhit.v) + * @reviewer SRID(ankit.sri1) + * @type auto + * @since_tizen 7.0 + * @description Gets depth or pointcloud asynchronously from given source + * @scenario Gets depth or pointcloud asynchronously from given source + * @apicovered mv_3d_create, mv_3d_destroy, mv_3d_configure and mv_3d_set_pointcloud_cb, mv_3d_run_async + * @passcase If mv_3d_create, mv_3d_destroy, mv_3d_configure, mv_3d_set_pointcloud_cb and mv_3d_run_async pass + * @failcase If Precondition API or Target API Fails + * @precondition NA + * @postcondition NA + * */ +int ITc_media_vision_mv_3d_run_async_p(void) +{ + START_TEST_3D; + + int nRet = -1; + int nTimeoutId = 0; + g_Mv3dDepthCallBackInvoked = false; + g_Mv3dPointCloudCallBackInvoked = false; + + char pszImageFileName[PATHLEN]; + snprintf(pszImageFileName, 1024, "%s/%s", g_Mv3dExampleDir, MV3D_BASE_IMAGE_FILENAME); + + nRet = mv_create_source(&g_BaseSourceHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet)); + + nRet = image_load(pszImageFileName, g_BaseSourceHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "image_load", MediaVisionGetError(nRet)); + + char pzsExtraImageFilename[PATHLEN]; + snprintf(pzsExtraImageFilename, 1024, "%s/%s", g_Mv3dExampleDir, MV3D_EXTRA_IMAGE_FILENAME); + + nRet = mv_create_source(&g_ExtraSourceHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet)); + + nRet = image_load(pzsExtraImageFilename, g_ExtraSourceHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "image_load", MediaVisionGetError(nRet)); + + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, g_StartupError, "mv_create_engine_config", MediaVisionGetError(nRet)); + + nRet = Set3dEngineConfig(g_EngineConfigHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "Set3dEngineConfig", MediaVisionGetError(nRet)); + + nRet = mv_3d_configure(g_Mv3d_handle, g_EngineConfigHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_configure", MediaVisionGetError(nRet)); + + nRet = mv_3d_set_depth_cb(g_Mv3d_handle, MvDepthCB, NULL); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_set_depth_cb", MediaVisionGetError(nRet)); + + nRet = mv_3d_set_pointcloud_cb(g_Mv3d_handle, MvPointcloudCB, g_Mv3d_handle); + if (g_IsMv3dPointCloudSupported){ + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_set_pointcloud_cb", MediaVisionGetError(nRet)); + } + else{ + PRINT_RESULT(MEDIA_VISION_ERROR_NOT_SUPPORTED, nRet, "mv_3d_set_pointcloud_cb", MediaVisionGetError(nRet)); + } + + nRet = mv_3d_prepare(g_Mv3d_handle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_prepare", MediaVisionGetError(nRet)); + + nRet = mv_3d_run_async(g_Mv3d_handle, g_BaseSourceHandle, g_ExtraSourceHandle, NULL); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_run", MediaVisionGetError(nRet)); + RUN_POLLING_LOOP; + if(!g_Mv3dDepthCallBackInvoked) + { + FPRINTF("[Line : %d][%s] Callback not hit\\n", __LINE__, API_NAMESPACE); + return 1; + } + + return 0; +} + + +//& type: auto +//& purpose: Writes pointcloud data to a file +/** + * @testcase ITc_media_vision_mv_3d_pointcloud_write_file_p + * @author SRID(shobhit.v) + * @reviewer SRID(ankit.sri1) + * @type auto + * @since_tizen 7.0 + * @description Writes pointcloud data to a file + * @scenario Writes pointcloud data to a file + * @apicovered mv_3d_create, mv_3d_destroy, mv_3d_configure and mv_3d_set_pointcloud_cb, mv_3d_run and mv_3d_pointcloud_write_file + * @passcase If mv_3d_create, mv_3d_destroy, mv_3d_configure, mv_3d_set_pointcloud_cb, mv_3d_run and mv_3d_pointcloud_write_file pass + * @failcase If Precondition API or Target API Fails + * @precondition NA + * @postcondition NA + * */ +int ITc_media_vision_mv_3d_pointcloud_write_file_p(void) +{ + START_TEST_3D; + + int nRet = -1; + g_Mv3dDepthCallBackInvoked = false; + g_Mv3dPointCloudCallBackInvoked = false; + g_WriteToFile = true; + + char pszImageFileName[PATHLEN]; + snprintf(pszImageFileName, 1024, "%s/%s", g_Mv3dExampleDir, MV3D_BASE_IMAGE_FILENAME); + + nRet = mv_create_source(&g_BaseSourceHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet)); + + nRet = image_load(pszImageFileName, g_BaseSourceHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "image_load", MediaVisionGetError(nRet)); + + char pzsExtraImageFilename[PATHLEN]; + snprintf(pzsExtraImageFilename, 1024, "%s/%s", g_Mv3dExampleDir, MV3D_EXTRA_IMAGE_FILENAME); + + nRet = mv_create_source(&g_ExtraSourceHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet)); + + nRet = image_load(pzsExtraImageFilename, g_ExtraSourceHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "image_load", MediaVisionGetError(nRet)); + + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, g_StartupError, "mv_create_engine_config", MediaVisionGetError(nRet)); + + nRet = Set3dEngineConfig(g_EngineConfigHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "Set3dEngineConfig", MediaVisionGetError(nRet)); + + nRet = mv_3d_configure(g_Mv3d_handle, g_EngineConfigHandle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_configure", MediaVisionGetError(nRet)); + + nRet = mv_3d_set_depth_cb(g_Mv3d_handle, MvDepthCB, NULL); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_set_depth_cb", MediaVisionGetError(nRet)); + + nRet = mv_3d_set_pointcloud_cb(g_Mv3d_handle, MvPointcloudCB, g_Mv3d_handle); + if (g_IsMv3dPointCloudSupported){ + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_set_pointcloud_cb", MediaVisionGetError(nRet)); + } + else{ + PRINT_RESULT(MEDIA_VISION_ERROR_NOT_SUPPORTED, nRet, "mv_3d_set_pointcloud_cb", MediaVisionGetError(nRet)); + } + + nRet = mv_3d_prepare(g_Mv3d_handle); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_prepare", MediaVisionGetError(nRet)); + + nRet = mv_3d_run(g_Mv3d_handle, g_BaseSourceHandle, g_ExtraSourceHandle, NULL); + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_3d_run", MediaVisionGetError(nRet)); + if(!g_Mv3dDepthCallBackInvoked) + { + FPRINTF("[Line : %d][%s] Callback not hit\\n", __LINE__, API_NAMESPACE); + return 1; + } + PRINT_RESULT(MEDIA_VISION_ERROR_NONE, g_Mv3dPcdWriteResultErr, "mv_3d_pointcloud_write_file", MediaVisionGetError(nRet)); + + return 0; +} + +/** @} */ +/** @} */ diff --git a/src/itc/media-vision/ITs-media-vision-common.h b/src/itc/media-vision/ITs-media-vision-common.h old mode 100644 new mode 100755 index 6cad48f6c..e06b63037 --- a/src/itc/media-vision/ITs-media-vision-common.h +++ b/src/itc/media-vision/ITs-media-vision-common.h @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #include #include @@ -85,6 +87,20 @@ #define TESTBARCODE "TestBarcode.jpg" #define TEST_FILENAME "test_img.jpg" +#define MV3D_BASE_IMAGE_FILENAME "im0.jpeg" +#define MV3D_EXTRA_IMAGE_FILENAME "im1.jpeg" +#define MV3D_CALIBRATION_FILENAME "calibOcv.yaml" +#define MV3D_POINTCLOUD_OUT_FILENAME "test.pcd" +#define MV3D_DEPTH_FEATURE "http://tizen.org/feature/vision.3d.depth" +#define MV3D_POINTCLOUD_FEATURE "http://tizen.org/feature/vision.3d.pointcloud" +#define MV3D_DEPTH_WIDTH 718 +#define MV3D_DEPTH_HEIGHT 496 +#define MV3D_MINIMUN_DISPARITY 8 +#define MV3D_MAXIMUM_DISPARITY 65 +#define MV3D_SAMPLING_RATIO 0.01 +#define MV3D_OUTLIER_REMOVAL_POINTS 3 +#define MV3D_OUTLIER_REMOVAL_RAIDUS 0.5 + bool g_bforeach_event_typeCompletedCallback; bool g_bforeach_event_result_value_nameCompletedCallback; mv_point_s g_sPoint; @@ -183,6 +199,24 @@ mv_point_s g_sPoint; }\ } +#define START_TEST_3D {\ + if (g_IsMv3dSupported == false)\ + {\ + if (g_bMismatch == true)\ + {\ + return 1;\ + }\ + else\ + {\ + return 0;\ + }\ + }\ + if (g_IsMv3dCreated == false)\ + {\ + return 1;\ + }\ +} + #define CHECK_HANDLE_CLEANUP(Handle, API, FreeResource) {\ if ( Handle == NULL )\ {\ @@ -231,6 +265,14 @@ mv_point_s g_sPoint; }\ } +#define RUN_POLLING_LOOP {\ + g_pMainLoop = g_main_loop_new(NULL, false);\ + nTimeoutId = g_timeout_add(TIMEOUT_CB, TimeoutFunction, g_pMainLoop);\ + g_main_loop_run(g_pMainLoop);\ + g_source_remove(nTimeoutId);\ + g_pMainLoop = NULL;\ +} + //Add CallBack function declarations here bool MvSupportedAttributeCallBack(mv_config_attribute_type_e attribute_type, const char *attribute_name, void *user_data); @@ -283,6 +325,8 @@ mv_rectangle_s g_sRectangle; mv_point_s g_sPoint; char g_szBarcodePath[PATHLEN]; +bool g_IsMv3dSupported; +bool g_IsMv3dCreated; bool CreateMediaFormat(void); bool CreateMediaPacket(void); bool DestroyMediaPacket(void); diff --git a/src/itc/media-vision/res/3d/calibOcv.json b/src/itc/media-vision/res/3d/calibOcv.json new file mode 100755 index 000000000..0eb0c60b6 --- /dev/null +++ b/src/itc/media-vision/res/3d/calibOcv.json @@ -0,0 +1,17 @@ +{ + "width" : 718, + "height" : 496, + "intrinsic_matrix" : + [ + 1038.018, + 0, + 0, + 0, + 1038.018, + 0, + 322.034, + 243.393, + 1 + ] +} + diff --git a/src/itc/media-vision/res/3d/calibOcv.yaml b/src/itc/media-vision/res/3d/calibOcv.yaml new file mode 100755 index 000000000..9c08d448b --- /dev/null +++ b/src/itc/media-vision/res/3d/calibOcv.yaml @@ -0,0 +1,37 @@ +%YAML:1.0 +--- +LEFT_CAM_INTRINSIC: !!opencv-matrix + rows: 3 + cols: 3 + dt: d + data: [ 1.0380180000000000e+03, 0., 3.2203699999999998e+02, 0., + 1.0380180000000000e+03, 2.4339300000000000e+02, 0., 0., 1. ] +RIGHT_CAM_INTRINSIC: !!opencv-matrix + rows: 3 + cols: 3 + dt: d + data: [ 1.0380180000000000e+03, 0., 3.7530799999999999e+02, 0., + 1.0380180000000000e+03, 2.4339300000000000e+02, 0., 0., 1. ] +LEFT_CAM_DISTCOEFFS: !!opencv-matrix + rows: 5 + cols: 1 + dt: d + data: [ 0., 0., 0., 0., 0. ] +RIGHT_CAM_DISTCOEFFS: !!opencv-matrix + rows: 5 + cols: 1 + dt: d + data: [ 0., 0., 0., 0., 0. ] +Image_Size: + - 718 + - 496 +STEREO_ROTATION: !!opencv-matrix + rows: 3 + cols: 1 + dt: d + data: [ 0., 0., 0. ] +STEREO_TRANSLATION: !!opencv-matrix + rows: 3 + cols: 1 + dt: d + data: [ 1.7625200000000001e+02, 0., 0. ] diff --git a/src/itc/media-vision/res/3d/im0.jpeg b/src/itc/media-vision/res/3d/im0.jpeg new file mode 100755 index 000000000..cd0e00008 Binary files /dev/null and b/src/itc/media-vision/res/3d/im0.jpeg differ diff --git a/src/itc/media-vision/res/3d/im1.jpeg b/src/itc/media-vision/res/3d/im1.jpeg new file mode 100755 index 000000000..1887b6d9c Binary files /dev/null and b/src/itc/media-vision/res/3d/im1.jpeg differ diff --git a/src/itc/media-vision/tct-media-vision-native_mobile.h b/src/itc/media-vision/tct-media-vision-native_mobile.h old mode 100644 new mode 100755 index 676ed6e71..f7f87be3a --- a/src/itc/media-vision/tct-media-vision-native_mobile.h +++ b/src/itc/media-vision/tct-media-vision-native_mobile.h @@ -33,6 +33,8 @@ extern void ITs_media_vision_roi_tracker_startup(void); extern void ITs_media_vision_roi_tracker_cleanup(void); extern void ITs_media_vision_face_recognition_startup(void); extern void ITs_media_vision_face_recognition_cleanup(void); +extern void ITs_media_vision_3d_startup(void); +extern void ITs_media_vision_3d_cleanup(void); extern int ITc_mv_face_recognition_model_create_destroy_p(void); extern int ITc_mv_face_recognition_model_clone_p(void); @@ -101,6 +103,16 @@ extern int ITc_mv_face_recognition_prepare_p(void); extern int ITc_mv_face_recognition_register_unregister_p(void); extern int ITc_mv_face_recognition_inference_p(void); +extern int ITc_media_vision_mv_3d_create_destroy_p(void); +extern int ITc_media_vision_mv_3d_configure_p(void); +extern int ITc_media_vision_mv_3d_set_depth_cb_p(void); +extern int ITc_media_vision_mv_3d_set_pointcloud_cb_p(void); +extern int ITc_media_vision_mv_3d_prepare_p(void); +extern int ITc_media_vision_mv_3d_run_p(void); +extern int ITc_media_vision_mv_3d_run_async_p(void); +extern int ITc_media_vision_mv_3d_pointcloud_write_file_p(void); + + testcase tc_array[] = { {"ITc_mv_face_recognition_model_create_destroy_p",ITc_mv_face_recognition_model_create_destroy_p,ITs_media_vision_face_startup,ITs_media_vision_face_cleanup}, {"ITc_mv_face_recognition_model_clone_p",ITc_mv_face_recognition_model_clone_p,ITs_media_vision_face_startup,ITs_media_vision_face_cleanup}, @@ -166,6 +178,14 @@ testcase tc_array[] = { {"ITc_mv_face_recognition_prepare_p",ITc_mv_face_recognition_prepare_p,ITs_media_vision_face_recognition_startup,ITs_media_vision_face_recognition_cleanup}, {"ITc_mv_face_recognition_register_unregister_p",ITc_mv_face_recognition_register_unregister_p,ITs_media_vision_face_recognition_startup,ITs_media_vision_face_recognition_cleanup}, {"ITc_mv_face_recognition_inference_p",ITc_mv_face_recognition_inference_p,ITs_media_vision_face_recognition_startup,ITs_media_vision_face_recognition_cleanup}, + {"ITc_media_vision_mv_3d_create_destroy_p",ITc_media_vision_mv_3d_create_destroy_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_configure_p",ITc_media_vision_mv_3d_configure_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_set_depth_cb_p",ITc_media_vision_mv_3d_set_depth_cb_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_set_pointcloud_cb_p",ITc_media_vision_mv_3d_set_pointcloud_cb_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_prepare_p",ITc_media_vision_mv_3d_prepare_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_run_p",ITc_media_vision_mv_3d_run_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_run_async_p",ITc_media_vision_mv_3d_run_async_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_pointcloud_write_file_p",ITc_media_vision_mv_3d_pointcloud_write_file_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, {NULL, NULL} }; diff --git a/src/itc/media-vision/tct-media-vision-native_tizeniot.h b/src/itc/media-vision/tct-media-vision-native_tizeniot.h old mode 100644 new mode 100755 index b9177f8e1..3a723a7f2 --- a/src/itc/media-vision/tct-media-vision-native_tizeniot.h +++ b/src/itc/media-vision/tct-media-vision-native_tizeniot.h @@ -33,6 +33,8 @@ extern void ITs_media_vision_roi_tracker_startup(void); extern void ITs_media_vision_roi_tracker_cleanup(void); extern void ITs_media_vision_face_recognition_startup(void); extern void ITs_media_vision_face_recognition_cleanup(void); +extern void ITs_media_vision_3d_startup(void); +extern void ITs_media_vision_3d_cleanup(void); extern int ITc_mv_face_recognition_model_create_destroy_p(void); extern int ITc_mv_face_recognition_model_clone_p(void); @@ -102,6 +104,15 @@ extern int ITc_mv_face_recognition_prepare_p(void); extern int ITc_mv_face_recognition_register_unregister_p(void); extern int ITc_mv_face_recognition_inference_p(void); +extern int ITc_media_vision_mv_3d_create_destroy_p(void); +extern int ITc_media_vision_mv_3d_configure_p(void); +extern int ITc_media_vision_mv_3d_set_depth_cb_p(void); +extern int ITc_media_vision_mv_3d_set_pointcloud_cb_p(void); +extern int ITc_media_vision_mv_3d_prepare_p(void); +extern int ITc_media_vision_mv_3d_run_p(void); +extern int ITc_media_vision_mv_3d_run_async_p(void); +extern int ITc_media_vision_mv_3d_pointcloud_write_file_p(void); + testcase tc_array[] = { {"ITc_mv_face_recognition_model_create_destroy_p",ITc_mv_face_recognition_model_create_destroy_p,ITs_media_vision_face_startup,ITs_media_vision_face_cleanup}, {"ITc_mv_face_recognition_model_clone_p",ITc_mv_face_recognition_model_clone_p,ITs_media_vision_face_startup,ITs_media_vision_face_cleanup}, @@ -167,6 +178,14 @@ testcase tc_array[] = { {"ITc_mv_face_recognition_prepare_p",ITc_mv_face_recognition_prepare_p,ITs_media_vision_face_recognition_startup,ITs_media_vision_face_recognition_cleanup}, {"ITc_mv_face_recognition_register_unregister_p",ITc_mv_face_recognition_register_unregister_p,ITs_media_vision_face_recognition_startup,ITs_media_vision_face_recognition_cleanup}, {"ITc_mv_face_recognition_inference_p",ITc_mv_face_recognition_inference_p,ITs_media_vision_face_recognition_startup,ITs_media_vision_face_recognition_cleanup}, + {"ITc_media_vision_mv_3d_create_destroy_p",ITc_media_vision_mv_3d_create_destroy_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_configure_p",ITc_media_vision_mv_3d_configure_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_set_depth_cb_p",ITc_media_vision_mv_3d_set_depth_cb_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_set_pointcloud_cb_p",ITc_media_vision_mv_3d_set_pointcloud_cb_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_prepare_p",ITc_media_vision_mv_3d_prepare_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_run_p",ITc_media_vision_mv_3d_run_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_run_async_p",ITc_media_vision_mv_3d_run_async_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_pointcloud_write_file_p",ITc_media_vision_mv_3d_pointcloud_write_file_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, {NULL, NULL} }; diff --git a/src/itc/media-vision/tct-media-vision-native_tv.h b/src/itc/media-vision/tct-media-vision-native_tv.h index 72f2f0818..deddd6822 100755 --- a/src/itc/media-vision/tct-media-vision-native_tv.h +++ b/src/itc/media-vision/tct-media-vision-native_tv.h @@ -29,7 +29,8 @@ extern void ITs_media_vision_barcode_startup(void); extern void ITs_media_vision_barcode_cleanup(void); extern void ITs_media_vision_inference_startup(void); extern void ITs_media_vision_inference_cleanup(void); - +extern void ITs_media_vision_3d_startup(void); +extern void ITs_media_vision_3d_cleanup(void); extern int ITc_mv_face_recognition_model_create_destroy_p(void); extern int ITc_mv_face_recognition_model_clone_p(void); @@ -88,6 +89,14 @@ extern int ITc_mediavision_mv_inference_pose_get_label_p(void); extern int ITc_mediavision_mv_pose_create_destroy_p(void); extern int ITc_mediavision_mv_pose_set_from_file_p(void); extern int ITc_mediavision_mv_pose_compare_p(void); +extern int ITc_media_vision_mv_3d_create_destroy_p(void); +extern int ITc_media_vision_mv_3d_configure_p(void); +extern int ITc_media_vision_mv_3d_set_depth_cb_p(void); +extern int ITc_media_vision_mv_3d_set_pointcloud_cb_p(void); +extern int ITc_media_vision_mv_3d_prepare_p(void); +extern int ITc_media_vision_mv_3d_run_p(void); +extern int ITc_media_vision_mv_3d_run_async_p(void); +extern int ITc_media_vision_mv_3d_pointcloud_write_file_p(void); testcase tc_array[] = { {"ITc_mv_face_recognition_model_create_destroy_p",ITc_mv_face_recognition_model_create_destroy_p,ITs_media_vision_face_startup,ITs_media_vision_face_cleanup}, @@ -125,7 +134,7 @@ testcase tc_array[] = { {"ITc_mv_surveillance_get_event_trigger_type_p",ITc_mv_surveillance_get_event_trigger_type_p,ITs_media_vision_surveillance_startup,ITs_media_vision_surveillance_cleanup}, {"ITc_mv_surveillance_set_get_event_trigger_roi_p",ITc_mv_surveillance_set_get_event_trigger_roi_p,ITs_media_vision_surveillance_startup,ITs_media_vision_surveillance_cleanup}, {"ITc_mv_surveillance_push_source_p",ITc_mv_surveillance_push_source_p,ITs_media_vision_surveillance_startup,ITs_media_vision_surveillance_cleanup}, -{"ITc_mv_surveillance_subscribe_unsubscribe_event_get_result_value_p",ITc_mv_surveillance_subscribe_unsubscribe_event_get_result_value_p,ITs_media_vision_surveillance_startup,ITs_media_vision_surveillance_cleanup}, + {"ITc_mv_surveillance_subscribe_unsubscribe_event_get_result_value_p",ITc_mv_surveillance_subscribe_unsubscribe_event_get_result_value_p,ITs_media_vision_surveillance_startup,ITs_media_vision_surveillance_cleanup}, {"ITc_mv_surveillance_foreach_supported_event_type_p",ITc_mv_surveillance_foreach_supported_event_type_p,ITs_media_vision_surveillance_startup,ITs_media_vision_surveillance_cleanup}, {"ITc_mv_barcode_generate_source_p",ITc_mv_barcode_generate_source_p,ITs_media_vision_barcode_startup,ITs_media_vision_barcode_cleanup}, {"ITc_mv_barcode_generate_image_p",ITc_mv_barcode_generate_image_p,ITs_media_vision_barcode_startup,ITs_media_vision_barcode_cleanup}, @@ -147,6 +156,14 @@ testcase tc_array[] = { {"ITc_mediavision_mv_pose_create_destroy_p",ITc_mediavision_mv_pose_create_destroy_p,ITs_media_vision_inference_startup,ITs_media_vision_inference_cleanup}, {"ITc_mediavision_mv_pose_set_from_file_p",ITc_mediavision_mv_pose_set_from_file_p,ITs_media_vision_inference_startup,ITs_media_vision_inference_cleanup}, {"ITc_mediavision_mv_pose_compare_p",ITc_mediavision_mv_pose_compare_p,ITs_media_vision_inference_startup,ITs_media_vision_inference_cleanup}, + {"ITc_media_vision_mv_3d_create_destroy_p",ITc_media_vision_mv_3d_create_destroy_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_configure_p",ITc_media_vision_mv_3d_configure_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_set_depth_cb_p",ITc_media_vision_mv_3d_set_depth_cb_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_set_pointcloud_cb_p",ITc_media_vision_mv_3d_set_pointcloud_cb_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_prepare_p",ITc_media_vision_mv_3d_prepare_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_run_p",ITc_media_vision_mv_3d_run_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_run_async_p",ITc_media_vision_mv_3d_run_async_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_pointcloud_write_file_p",ITc_media_vision_mv_3d_pointcloud_write_file_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, {NULL, NULL} }; diff --git a/src/itc/media-vision/tct-media-vision-native_wearable.h b/src/itc/media-vision/tct-media-vision-native_wearable.h old mode 100644 new mode 100755 index b9177f8e1..3a723a7f2 --- a/src/itc/media-vision/tct-media-vision-native_wearable.h +++ b/src/itc/media-vision/tct-media-vision-native_wearable.h @@ -33,6 +33,8 @@ extern void ITs_media_vision_roi_tracker_startup(void); extern void ITs_media_vision_roi_tracker_cleanup(void); extern void ITs_media_vision_face_recognition_startup(void); extern void ITs_media_vision_face_recognition_cleanup(void); +extern void ITs_media_vision_3d_startup(void); +extern void ITs_media_vision_3d_cleanup(void); extern int ITc_mv_face_recognition_model_create_destroy_p(void); extern int ITc_mv_face_recognition_model_clone_p(void); @@ -102,6 +104,15 @@ extern int ITc_mv_face_recognition_prepare_p(void); extern int ITc_mv_face_recognition_register_unregister_p(void); extern int ITc_mv_face_recognition_inference_p(void); +extern int ITc_media_vision_mv_3d_create_destroy_p(void); +extern int ITc_media_vision_mv_3d_configure_p(void); +extern int ITc_media_vision_mv_3d_set_depth_cb_p(void); +extern int ITc_media_vision_mv_3d_set_pointcloud_cb_p(void); +extern int ITc_media_vision_mv_3d_prepare_p(void); +extern int ITc_media_vision_mv_3d_run_p(void); +extern int ITc_media_vision_mv_3d_run_async_p(void); +extern int ITc_media_vision_mv_3d_pointcloud_write_file_p(void); + testcase tc_array[] = { {"ITc_mv_face_recognition_model_create_destroy_p",ITc_mv_face_recognition_model_create_destroy_p,ITs_media_vision_face_startup,ITs_media_vision_face_cleanup}, {"ITc_mv_face_recognition_model_clone_p",ITc_mv_face_recognition_model_clone_p,ITs_media_vision_face_startup,ITs_media_vision_face_cleanup}, @@ -167,6 +178,14 @@ testcase tc_array[] = { {"ITc_mv_face_recognition_prepare_p",ITc_mv_face_recognition_prepare_p,ITs_media_vision_face_recognition_startup,ITs_media_vision_face_recognition_cleanup}, {"ITc_mv_face_recognition_register_unregister_p",ITc_mv_face_recognition_register_unregister_p,ITs_media_vision_face_recognition_startup,ITs_media_vision_face_recognition_cleanup}, {"ITc_mv_face_recognition_inference_p",ITc_mv_face_recognition_inference_p,ITs_media_vision_face_recognition_startup,ITs_media_vision_face_recognition_cleanup}, + {"ITc_media_vision_mv_3d_create_destroy_p",ITc_media_vision_mv_3d_create_destroy_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_configure_p",ITc_media_vision_mv_3d_configure_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_set_depth_cb_p",ITc_media_vision_mv_3d_set_depth_cb_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_set_pointcloud_cb_p",ITc_media_vision_mv_3d_set_pointcloud_cb_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_prepare_p",ITc_media_vision_mv_3d_prepare_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_run_p",ITc_media_vision_mv_3d_run_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_run_async_p",ITc_media_vision_mv_3d_run_async_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, + {"ITc_media_vision_mv_3d_pointcloud_write_file_p",ITc_media_vision_mv_3d_pointcloud_write_file_p,ITs_media_vision_3d_startup,ITs_media_vision_3d_cleanup}, {NULL, NULL} };