SET(TC_SOURCES
ITs-media-vision-common.c
- ITs-media-vision-face.c
- ITs-media-vision-image.c
- ITs-media-vision-surveillance.c
ITs-media-vision-barcode.c
ITs-media-vision-3d.c
)
return true;
}
-/**
- * @function ImageUtilGetError
- * @description Maps error enums to string values
- * @parameter nRet : error code returned
- * @return error string
- */
-char *ImageUtilGetError(int nRet)
-{
- char *szErrorVal = NULL;
- switch (nRet) {
- case IMAGE_UTIL_ERROR_INVALID_PARAMETER:
- szErrorVal = "IMAGE_UTIL_ERROR_INVALID_PARAMETER";
- break;
- case IMAGE_UTIL_ERROR_OUT_OF_MEMORY:
- szErrorVal = "IMAGE_UTIL_ERROR_OUT_OF_MEMORY";
- break;
- case IMAGE_UTIL_ERROR_NO_SUCH_FILE:
- szErrorVal = "IMAGE_UTIL_ERROR_NO_SUCH_FILE";
- break;
- case IMAGE_UTIL_ERROR_INVALID_OPERATION:
- szErrorVal = "IMAGE_UTIL_ERROR_INVALID_OPERATION";
- break;
- case IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT:
- szErrorVal = "IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT";
- break;
- case IMAGE_UTIL_ERROR_NONE:
- szErrorVal = "IMAGE_UTIL_ERROR_NONE";
- break;
- default:
- szErrorVal = "Unknown Error";
- break;
- }
- return szErrorVal;
-}
-
int image_load(const char *file_path, mv_source_h source)
{
if (NULL == file_path || NULL == source) {
// Add test package related defines here
#define API_NAMESPACE "MEDIA_VISION_ITC"
#define TIMEOUT_CB 15000
-#define FACERECOGFEATURE "http://tizen.org/feature/vision.face_recognition"
-#define IMAGERECOGFEATURE "http://tizen.org/feature/vision.image_recognition"
#define BARCODEDETFEATURE "http://tizen.org/feature/vision.barcode_detection"
#define BARCODEGENFEATURE "http://tizen.org/feature/vision.barcode_generation"
} \
}
-#define START_TEST_FACE \
- { \
- FPRINTF("[Line : %d][%s] Starting test : %s\n", __LINE__, API_NAMESPACE, __FUNCTION__); \
- if (g_bMismatch) { \
- FPRINTF("[Line : %d][%s] mv_face_recognition_model_create and " \
- "TCTCheckSystemInfoFeatureSupported returned different feature " \
- "for media-vision so leaving test\n", \
- __LINE__, API_NAMESPACE); \
- return 1; \
- } \
- if (g_bIsFaceRecognitionFeatureSupported == false) { \
- FPRINTF("[Line : %d][%s] Face recognition feature is not supported and " \
- "api also returned not supported so leaving test\n", \
- __LINE__, API_NAMESPACE); \
- return 0; \
- } \
- if (g_bMediavisionFaceRecognitionModelCreation == false) { \
- FPRINTF("[Line : %d][%s] Precondition of media-vision failed so " \
- "leaving test\n", \
- __LINE__, API_NAMESPACE); \
- return 1; \
- } \
- }
#define START_TEST \
{ \
FPRINTF("[Line : %d][%s] Starting test : %s\n", __LINE__, API_NAMESPACE, __FUNCTION__); \
}
-#define START_TEST_IMAGE \
- { \
- FPRINTF("[Line : %d][%s] Starting test : %s\n", __LINE__, API_NAMESPACE, __FUNCTION__); \
- if (g_bIsImageRecognitionFeatureSupported == false) { \
- FPRINTF("[Line : %d][%s] Image recognition feature is not supported " \
- "and api also returned not supported so leaving test\n", \
- __LINE__, API_NAMESPACE); \
- return 0; \
- } \
- }
-#define START_TEST_SURVEILLANCE \
- { \
- FPRINTF("[Line : %d][%s] Starting test : %s\n", __LINE__, API_NAMESPACE, __FUNCTION__); \
- if (!(g_bIsImageRecognitionFeatureSupported && g_bIsFaceRecognitionFeatureSupported)) { \
- FPRINTF("[Line : %d][%s] Image ,Face recognition feature is not supported " \
- "and api also returned not supported so leaving test\n", \
- __LINE__, API_NAMESPACE); \
- return 0; \
- } \
- }
-
#define START_TEST_ROI_TRACKER \
{ \
FPRINTF("[Line : %d][%s] Starting test : %s\n", __LINE__, API_NAMESPACE, __FUNCTION__); \
bool g_CallBackHit;
int g_nTimeoutId;
GMainLoop *g_pMainLoop;
-mv_face_recognition_model_h g_hRecognitionModel;
mv_source_h g_hMvSource;
bool g_bMismatch;
bool checkModelFile(const char *fSrcPath, const char *fDstPath);
int image_load(const char *file_path, mv_source_h source);
-bool g_bIsFaceRecognitionFeatureSupported;
-bool g_bMediavisionFaceRecognitionModelCreation;
-bool g_bIsImageRecognitionFeatureSupported;
bool g_bIsDetectionFeatureSupported;
bool g_bIsGenerationFeatureSupported;
bool g_bIsVisionROITrackerFeatureSupported;
bool CreateMediaPacket(void);
bool DestroyMediaPacket(void);
bool CreateFilledMediaSource(void);
-char *ImageUtilGetError(int nRet);
int image_load(const char *file_path, mv_source_h source);
/** @} */
+++ /dev/null
-//
-// Copyright (c) 2014 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
- * @{
- */
-
-static mv_face_tracking_model_h hTrackingModel = NULL;
-static bool lost_flag = false;
-static char *track_seq_path = "NULL";
-static char *track_prep_frame_path = "NULL";
-static char *pInternalStoragePath = NULL;
-
-static bool storage_device_cb(int storage_id, storage_type_e type, storage_state_e state, const char *path,
- void *user_data)
-{
- if (type == STORAGE_TYPE_INTERNAL) {
- pInternalStoragePath = (char *) calloc(strlen(path) + 1, sizeof(char));
- if (pInternalStoragePath == NULL) {
- FPRINTF("[Line : %d][%s] Memory allocation of pInternalStoragePath failed\n", __LINE__, API_NAMESPACE);
- return false;
- }
- snprintf(pInternalStoragePath, strlen(path) + 1, "%s", path);
-
- track_seq_path = (char *) calloc(strlen(path) + strlen("/res/track/sequence") + 1, sizeof(char));
- if (track_seq_path == NULL) {
- FPRINTF("[Line : %d][%s] Memory allocation of track_seq_path failed\n", __LINE__, API_NAMESPACE);
- return false;
- }
- snprintf(track_seq_path, strlen(path) + strlen("/res/track/sequence") + 1, "%s/res/track/sequence", path);
-
- track_prep_frame_path = (char *) calloc(strlen(path) + strlen("/res/track/sequence/01.jpg") + 1, sizeof(char));
- if (track_prep_frame_path == NULL) {
- FPRINTF("[Line : %d][%s] Memory allocation of track_prep_frame_path "
- "failed\n",
- __LINE__, API_NAMESPACE);
- return false;
- }
- snprintf(track_prep_frame_path, strlen(path) + strlen("/res/track/sequence/01.jpg") + 1,
- "%s/res/track/sequence/01.jpg", path);
-
- return false;
- }
- return true;
-}
-
-/****************************************************Callback
- * Start****************************************************/
-/**
- * @function MvFaceDetectedCB
- * @description Callback Function
- * @parameter mv_source_h source, mv_engine_config_h engine_cfg,
- * mv_rectangle_s *faces_locations, int number_of_faces, void *user_data
- * @return NA
- */
-static void MvFaceDetectedCB(mv_source_h source, mv_engine_config_h engine_cfg, mv_rectangle_s *faces_locations,
- int number_of_faces, void *user_data)
-{
-#if DEBUG
- FPRINTF("[Line : %d][%s] Callback Invoked\n", __LINE__, API_NAMESPACE, "MvFaceDetectedCB");
-#endif
-
- if (user_data == NULL) {
- FPRINTF("[Line : %d][%s] User Data not correct in callback\n", __LINE__, API_NAMESPACE);
- QuitGmainLoop();
- return;
- }
-
- g_CallBackHit = true;
- QuitGmainLoop();
- return;
-}
-
-/**
- * @function MvFaceRecognizedCB
- * @description Callback Function
- * @parameter mv_source_h source, mv_face_recognition_model_h
- * recognition_model, mv_engine_config_h engine_cfg, mv_rectangle_s
- * *face_location,const int *face_label, double confidence, void *user_data
- * @return NA
- */
-static void MvFaceRecognizedCB(mv_source_h source, mv_face_recognition_model_h recognition_model,
- mv_engine_config_h engine_cfg, mv_rectangle_s *face_location, const int *face_label,
- double confidence, void *user_data)
-{
-#if DEBUG
- FPRINTF("[Line : %d][%s] Callback Invoked\n", __LINE__, API_NAMESPACE, "MvFaceDetectedCB");
-#endif
- if (user_data != NULL) {
- bool *is_called = (bool *) user_data;
- *is_called = true;
- }
- if (face_location) {
- FPRINTF("[Line : %d][%s] Face has been recognized as face [%i] with "
- "confidence %.2f\n",
- __LINE__, API_NAMESPACE, *face_label, confidence);
- } else {
- FPRINTF("[Line : %d][%s] Face wasn't recognized\n", __LINE__, API_NAMESPACE);
- }
-}
-
-/**
- * @function MvTrackCB
- * @description Callback Function
- * @parameter mv_source_h source, mv_face_tracking_model_h
- * tracking_model, mv_engine_config_h engine_cfg, mv_quadrangle_s *location,
- * double confidence, void *user_data
- * @return NA
- */
-static void MvTrackCB(mv_source_h source, mv_face_tracking_model_h tracking_model, mv_engine_config_h engine_cfg,
- mv_quadrangle_s *location, double confidence, void *user_data)
-{
-#if DEBUG
- FPRINTF("[Line : %d][%s] Callback Invoked\n", __LINE__, API_NAMESPACE, "MvTrackCB");
-#endif
- if (NULL != user_data) {
- FPRINTF("[Line : %d][%s] Track on %s\n", __LINE__, API_NAMESPACE, (char *) user_data);
- } else {
- return;
- }
-
- if (NULL != location) {
- FPRINTF("[Line : %d][%s] Face tracked to the location bounded by "
- "(%i, %i)-(%i, %i)-(%i, %i)-(%i, %i); confidence: %f\n",
- __LINE__, API_NAMESPACE, location->points[0].x, location->points[0].y, location->points[1].x,
- location->points[1].y, location->points[2].x, location->points[2].y, location->points[3].x,
- location->points[3].y, confidence);
- } else if (!lost_flag) {
- FPRINTF("[Line : %d][%s] Tracker has lost the face\n", __LINE__, API_NAMESPACE);
- lost_flag = true;
- }
-}
-
-/**
- * @function MvEyeConditionCB
- * @description Callback Function
- * @parameter mv_source_h source, mv_engine_config_h engine_cfg,
- * mv_rectangle_s face_location, mv_face_eye_condition_e eye_condition, void
- * *user_data
- * @return NA
- */
-static void MvEyeConditionCB(mv_source_h source, mv_engine_config_h engine_cfg, mv_rectangle_s face_location,
- mv_face_eye_condition_e eye_condition, void *user_data)
-{
-#if DEBUG
- FPRINTF("[Line : %d][%s]Callback Invoked\n", __LINE__, API_NAMESPACE, "MvEyeConditionCB");
-#endif
- mv_face_eye_condition_e *expected = (mv_face_eye_condition_e *) user_data;
-
- if (*expected != MV_FACE_EYES_NOT_FOUND || *expected != MV_FACE_EYES_OPEN) {
- FPRINTF("[Line : %d][%s] Wrong value of variable expected\n", __LINE__, API_NAMESPACE);
- return;
- }
-}
-
-/**
- * @function MvFaceExpressionCB
- * @description Callback Function
- * @parameter mv_source_h source, mv_engine_config_h engine_cfg,
- * mv_rectangle_s face_location, mv_face_facial_expression_e facial_expression,
- * void *user_data
- * @return NA
- */
-static void MvFaceExpressionCB(mv_source_h source, mv_engine_config_h engine_cfg, mv_rectangle_s face_location,
- mv_face_facial_expression_e facial_expression, void *user_data)
-{
-#if DEBUG
- FPRINTF("[Line : %d][%s] Callback Invoked\n", __LINE__, API_NAMESPACE, "MvFaceExpressionCB");
-#endif
- mv_face_facial_expression_e *expected = (mv_face_facial_expression_e *) user_data;
- if (*expected != MV_FACE_NEUTRAL) {
- FPRINTF("[Line : %d][%s] Wrong value of variable expected\n", __LINE__, API_NAMESPACE);
- return;
- }
-}
-/*****************************************************Callback
- * End*****************************************************/
-
-static int strCompare(const void *p1, const void *p2)
-{
- return strcmp((char *const) p1, (char *const) p2);
-}
-
-void MediaVisionCreateModel()
-{
- int nRet = mv_face_recognition_model_create(&g_hRecognitionModel);
- if (false == g_bIsFaceRecognitionFeatureSupported) {
- if (nRet != MEDIA_VISION_ERROR_NOT_SUPPORTED) {
- FPRINTF("\n [Line : %d] [%s] mv_face_recognition_model_create failed, "
- "expected return = MEDIA_VISION_ERROR_NOT_SUPPORTED, value "
- "returned = %s ",
- __LINE__, API_NAMESPACE, MediaVisionGetError(nRet));
- g_bMismatch = true;
- return;
- }
- return;
- } else {
- FPRINTF("\n [Line : %d] [%s] mv_face_recognition_model_create, value "
- "returned = %s ",
- __LINE__, API_NAMESPACE, MediaVisionGetError(nRet));
- CHECK_HANDLE_NONE(g_hRecognitionModel, "mv_face_recognition_model_create");
- }
-
- g_bMediavisionFaceRecognitionModelCreation = true;
-}
-
-/**
- * @function ITs_media_vision_face_startup
- * @description Called before each test
- * @parameter NA
- * @return NA
- */
-void ITs_media_vision_face_startup(void)
-{
- struct stat stBuff;
- if (stat(ERR_LOG, &stBuff) == 0) {
- remove(ERR_LOG);
- }
-
- g_bMediavisionFaceRecognitionModelCreation = false;
- g_bMismatch = false;
- g_bIsFaceRecognitionFeatureSupported = TCTCheckSystemInfoFeatureSupported(FACERECOGFEATURE, API_NAMESPACE);
- g_bIsBarcodeGenerationFeatureSupported = TCTCheckSystemInfoFeatureSupported(BARCODEGENFEATURE, API_NAMESPACE);
- g_bIsBarcodeDetectionFeatureSupported = TCTCheckSystemInfoFeatureSupported(BARCODEDETFEATURE, API_NAMESPACE);
-
- storage_foreach_device_supported(storage_device_cb, NULL);
-
- return;
-}
-
-/**
- * @function ITs_media_vision_face_cleanup
- * @description Called after each test
- * @parameter NA
- * @return NA
- */
-void ITs_media_vision_face_cleanup(void)
-{
- if (g_hRecognitionModel != NULL) {
- mv_face_recognition_model_destroy(g_hRecognitionModel);
- g_hRecognitionModel = NULL;
- }
-
- if (pInternalStoragePath) {
- free(pInternalStoragePath);
- pInternalStoragePath = NULL;
- }
-
- if (track_seq_path) {
- free(track_seq_path);
- track_seq_path = NULL;
- }
-
- if (track_prep_frame_path) {
- free(track_prep_frame_path);
- track_prep_frame_path = NULL;
- }
-
- return;
-}
-
-/** @addtogroup itc-media-vision-testcases
- * @brief Integration testcases for module media-vision
- * @ingroup itc-media-vision
- * @{
- */
-
-/**
- * @testcase
- * ITc_mv_face_recognition_model_create_destroy_p
- * @author SRID(avinash.a)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_face_recognition_model_create
- * and mv_face_recognition_model_destroy
- * @scenario Call mv_face_recognition_model_create,
- * mv_face_recognition_model_destroy
- * @apicovered mv_face_recognition_model_create,
- * mv_face_recognition_model_destroy
- * @passcase If mv_face_recognition_model_create and
- * mv_face_recognition_model_destroy returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_face_recognition_model_create and
-// mv_face_recognition_model_destroy
-int ITc_mv_face_recognition_model_create_destroy_p(void)
-{
- MediaVisionCreateModel();
- START_TEST_FACE;
-
- int nRet = -1;
-
- nRet = mv_face_recognition_model_destroy(g_hRecognitionModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_recognition_model_destroy", MediaVisionGetError(nRet));
-
- nRet = mv_face_recognition_model_create(&g_hRecognitionModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_recognition_model_create", MediaVisionGetError(nRet));
- CHECK_HANDLE(g_hRecognitionModel, "mv_face_recognition_model_create");
-
- nRet = mv_face_recognition_model_destroy(g_hRecognitionModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_recognition_model_destroy", MediaVisionGetError(nRet));
-
- nRet = mv_face_recognition_model_create(&g_hRecognitionModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_recognition_model_create", MediaVisionGetError(nRet));
- CHECK_HANDLE(g_hRecognitionModel, "mv_face_recognition_model_create");
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_face_recognition_model_clone_p
- * @author SRID(avinash.a)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_face_recognition_model_clone
- * @scenario Call mv_face_recognition_model_clone
- * @apicovered mv_face_recognition_model_clone
- * @passcase If mv_face_recognition_model_clone
- * returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition mv_face_recognition_model_create
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_face_recognition_model_clone
-int ITc_mv_face_recognition_model_clone_p(void)
-{
- MediaVisionCreateModel();
- START_TEST_FACE;
-
- int nRet = -1;
- mv_face_recognition_model_h hCloned;
-
- nRet = mv_face_recognition_model_clone(g_hRecognitionModel, &hCloned);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_recognition_model_clone", MediaVisionGetError(nRet));
- CHECK_HANDLE(hCloned, "mv_face_recognition_model_clone");
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_face_detect_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test _mv_face_detect
- * @scenario Call mv_source_fill_by_buffer and
- * _mv_face_detect
- * @apicovered mv_face_detect,mv_source_fill_by_buffer
- * @passcase If _mv_face_detect returns
- * MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_face_detect
-int ITc_mv_face_detect_p(void)
-{
- START_TEST;
-
- if (!(g_bIsFaceRecognitionFeatureSupported &&
- (g_bIsBarcodeGenerationFeatureSupported || g_bIsBarcodeDetectionFeatureSupported))) {
- FPRINTF("[Line : %d][%s] Bar code, face and barcode feature is not "
- "supported and api also returned not supported so leaving test\n",
- __LINE__, API_NAMESPACE);
- return 0;
- }
- int nRet = -1, number_of_faces_on_image = -1;
-
- nRet = mv_create_source(&g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet));
- CHECK_HANDLE(g_hMvSource, "mv_create_source");
-
- g_pBufferData = calloc(1, BUFFERSIZE);
- CHECK_HANDLE(g_pBufferData, "calloc");
-
- nRet = mv_source_fill_by_buffer(g_hMvSource, (unsigned char *) g_pBufferData, BUFFERSIZE, 20, 10,
- MEDIA_VISION_COLORSPACE_RGB888);
- PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_source_fill_by_buffer", MediaVisionGetError(nRet),
- FREE_MEMORY(g_pBufferData));
-
- nRet = mv_face_detect(g_hMvSource, NULL, MvFaceDetectedCB, &number_of_faces_on_image);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_detect", MediaVisionGetError(nRet));
-
- FREE_MEMORY(g_pBufferData)
-
- nRet = mv_destroy_source(g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_source", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_face_recognition_model_save_load_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_face_recognition_model_save
- * and mv_face_recognition_model_load
- * @scenario Call mv_face_recognition_model_add,
- * mv_face_recognition_model_load, mv_face_recognition_model_learn and
- * mv_face_recognition_model_save
- * @apicovered mv_face_recognition_model_add,
- * mv_face_recognition_model_load, mv_face_recognition_model_learn and
- * mv_face_recognition_model_save
- * @passcase If mv_face_recognition_model_save and
- * mv_face_recognition_model_load returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition mv_face_recognition_model_create
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_face_recognition_model_save and
-// mv_face_recognition_model_load
-int ITc_mv_face_recognition_model_save_load_p(void)
-{
- MediaVisionCreateModel();
- START_TEST_FACE;
-
- if (!(g_bIsBarcodeGenerationFeatureSupported || g_bIsBarcodeDetectionFeatureSupported)) {
- FPRINTF("[Line : %d][%s] Bar code feature is not supported\n", __LINE__, API_NAMESPACE);
- return 0;
- }
- int nRet = -1;
-
- nRet = mv_create_source(&g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet));
- CHECK_HANDLE(g_hMvSource, "mv_create_source");
-
- g_pBufferData = calloc(1, BUFFERSIZE);
- CHECK_HANDLE(g_pBufferData, "calloc");
-
- nRet = mv_source_fill_by_buffer(g_hMvSource, (unsigned char *) g_pBufferData, BUFFERSIZE, 20, 10,
- MEDIA_VISION_COLORSPACE_RGB888);
- PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_source_fill_by_buffer", MediaVisionGetError(nRet),
- FREE_MEMORY(g_pBufferData));
-
- nRet = mv_face_recognition_model_add(g_hMvSource, g_hRecognitionModel, NULL, 1);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_recognition_model_add", MediaVisionGetError(nRet));
-
- nRet = mv_face_recognition_model_learn(NULL, g_hRecognitionModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_recognition_model_learn", MediaVisionGetError(nRet));
-
- FREE_MEMORY(g_pBufferData);
-
- nRet = mv_destroy_source(g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_source", MediaVisionGetError(nRet));
-
- char pszFilePath[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath(PATHPFXTREC, pszFilePath)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_face_recognition_model_save(pszFilePath, g_hRecognitionModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_recognition_model_save", MediaVisionGetError(nRet));
-
- nRet = mv_face_recognition_model_load(pszFilePath, &g_hRecognitionModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_recognition_model_load", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_face_recognition_model_add_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_face_recognition_model_add
- * @scenario Call mv_face_recognition_model_add
- * @apicovered mv_face_recognition_model_add
- * @passcase If mv_face_recognition_model_add returns
- * MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition mv_face_recognition_model_create
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_face_recognition_model_add
-int ITc_mv_face_recognition_model_add_p(void)
-{
- MediaVisionCreateModel();
- START_TEST_FACE;
-
- if (!(g_bIsBarcodeGenerationFeatureSupported || g_bIsBarcodeDetectionFeatureSupported)) {
- FPRINTF("[Line : %d][%s] Bar code is not supported \n", __LINE__, API_NAMESPACE);
- return 0;
- }
- int nRet = -1;
-
- mv_rectangle_s location;
- unsigned int width = 0;
- unsigned int height = 0;
- location.point.x = 0;
- location.point.y = 0;
-
- char pszFilePath[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath(PATHPFXNEUT, pszFilePath)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_create_source(&g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet));
- CHECK_HANDLE(g_hMvSource, "mv_create_source");
-
- nRet = image_load(pszFilePath, g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "image_load", MediaVisionGetError(nRet));
-
- nRet = mv_source_get_width(g_hMvSource, &width);
- location.width = (int) width;
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_source_get_width", MediaVisionGetError(nRet));
-
- nRet = mv_source_get_height(g_hMvSource, &height);
- location.height = (int) height;
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_source_get_height", MediaVisionGetError(nRet));
-
- nRet = mv_face_recognition_model_add(g_hMvSource, g_hRecognitionModel, &location, 1);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_recognition_model_add", MediaVisionGetError(nRet));
-
- FREE_MEMORY(g_pBufferData);
-
- nRet = mv_destroy_source(g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_source", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_face_recognition_model_reset_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_face_recognition_model_reset
- * @scenario Call mv_face_recognition_model_add and
- * mv_face_recognition_model_reset
- * @apicovered mv_face_recognition_model_reset,
- * mv_face_recognition_model_add
- * @passcase If mv_face_recognition_model_reset
- * returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition mv_face_recognition_model_create
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_face_recognition_model_reset
-int ITc_mv_face_recognition_model_reset_p(void)
-{
- MediaVisionCreateModel();
- START_TEST_FACE;
-
- if (!(g_bIsBarcodeGenerationFeatureSupported || g_bIsBarcodeDetectionFeatureSupported)) {
- FPRINTF("[Line : %d][%s] Bar code, face feature is not supported and api "
- "also returned not supported so leaving test\n",
- __LINE__, API_NAMESPACE);
- return 0;
- }
- int nRet = -1, reset_label = 1;
-
- char pszFilePath[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath(PATHPFX01, pszFilePath)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_create_source(&g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet));
- CHECK_HANDLE(g_hMvSource, "mv_create_source");
-
- nRet = image_load(pszFilePath, g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "image_load", MediaVisionGetError(nRet));
-
- nRet = mv_face_recognition_model_add(g_hMvSource, g_hRecognitionModel, NULL, 1);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_recognition_model_add", MediaVisionGetError(nRet));
-
- nRet = mv_face_recognition_model_reset(g_hRecognitionModel, &reset_label);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_recognition_model_reset", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_face_recognition_model_learn_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_face_recognition_model_learn
- * @scenario Call mv_face_recognition_model_learn
- * @apicovered mv_face_recognition_model_learn
- * @passcase If mv_face_recognition_model_learn
- * returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_face_recognition_model_learn
-int ITc_mv_face_recognition_model_learn_p(void)
-{
- MediaVisionCreateModel();
- START_TEST_FACE;
-
- if (!(g_bIsBarcodeGenerationFeatureSupported || g_bIsBarcodeDetectionFeatureSupported)) {
- FPRINTF("[Line : %d][%s] Bar code feature is not supported\n", __LINE__, API_NAMESPACE);
- return 0;
- }
- int nRet = -1;
-
- nRet = mv_create_source(&g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet));
- CHECK_HANDLE(g_hMvSource, "mv_create_source");
-
- g_pBufferData = calloc(1, BUFFERSIZE);
- CHECK_HANDLE(g_pBufferData, "calloc");
-
- nRet = mv_source_fill_by_buffer(g_hMvSource, (unsigned char *) g_pBufferData, BUFFERSIZE, 20, 10,
- MEDIA_VISION_COLORSPACE_RGB888);
- PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_source_fill_by_buffer", MediaVisionGetError(nRet),
- FREE_MEMORY(g_pBufferData));
-
- nRet = mv_face_recognition_model_add(g_hMvSource, g_hRecognitionModel, NULL, 1);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_recognition_model_add", MediaVisionGetError(nRet));
-
- nRet = mv_create_engine_config(&g_hMvEngineConfig);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_engine_config", MediaVisionGetError(nRet));
- CHECK_HANDLE(g_hMvEngineConfig, "mv_create_engine_config");
-
- nRet = mv_face_recognition_model_learn(g_hMvEngineConfig, g_hRecognitionModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_recognition_model_learn", MediaVisionGetError(nRet));
-
- FREE_MEMORY(g_pBufferData);
-
- if (g_hMvEngineConfig != NULL) {
- nRet = mv_destroy_engine_config(g_hMvEngineConfig);
- g_hMvEngineConfig = NULL;
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_engine_config", MediaVisionGetError(nRet));
- }
-
- nRet = mv_destroy_source(g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_source", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_face_recognition_model_query_labels_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test
- * mv_face_recognition_model_query_labels
- * @scenario Call
- * mv_face_recognition_model_query_labels
- * @apicovered mv_face_recognition_model_query_labels
- * @passcase If
- * mv_face_recognition_model_query_labels returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_face_recognition_model_query_labels
-int ITc_mv_face_recognition_model_query_labels_p(void)
-{
- MediaVisionCreateModel();
- START_TEST_FACE;
-
- if (!(g_bIsBarcodeGenerationFeatureSupported || g_bIsBarcodeDetectionFeatureSupported)) {
- FPRINTF("[Line : %d][%s] Bar code feature is not supported\n", __LINE__, API_NAMESPACE);
- return 0;
- }
- int nRet = -1;
- int *nlabels = NULL;
- unsigned int labels_n = 0;
-
- char pszFilePath[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath(PATHPFX09, pszFilePath)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_create_source(&g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet));
- CHECK_HANDLE(g_hMvSource, "mv_create_source");
-
- nRet = image_load(pszFilePath, g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "image_load", MediaVisionGetError(nRet));
-
- nRet = mv_face_recognition_model_add(g_hMvSource, g_hRecognitionModel, NULL, 1);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_recognition_model_add", MediaVisionGetError(nRet));
-
- nRet = mv_face_recognition_model_query_labels(g_hRecognitionModel, &nlabels, &labels_n);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_recognition_model_query_labels", MediaVisionGetError(nRet));
- if (0 != labels_n) {
- FPRINTF("[Line : %d][%s] mv_face_recognition_model_query_labels failed\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_face_tracking_model_create_destroy_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_face_tracking_model_create
- * and mv_face_tracking_model_destroy
- * @scenario Call mv_face_tracking_model_create and
- * mv_face_tracking_model_destroy
- * @apicovered mv_face_tracking_model_create and
- * mv_face_tracking_model_destroy
- * @passcase If mv_face_tracking_model_create and
- * mv_face_tracking_model_destroy returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_face_tracking_model_create and
-// mv_face_tracking_model_destroy
-int ITc_mv_face_tracking_model_create_destroy_p(void)
-{
- START_TEST;
-
- if (g_bIsFaceRecognitionFeatureSupported == false) {
- FPRINTF("[Line : %d][%s] Face recognition feature is not supported and api "
- "also returned not supported so leaving test\n",
- __LINE__, API_NAMESPACE);
- return 0;
- }
- int nRet = -1;
- mv_face_tracking_model_h hTestTrackingModel = NULL;
-
- nRet = mv_face_tracking_model_create(&hTestTrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_tracking_model_create", MediaVisionGetError(nRet));
- CHECK_HANDLE(hTestTrackingModel, "mv_face_tracking_model_h");
-
- nRet = mv_face_tracking_model_destroy(hTestTrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_tracking_model_destroy", MediaVisionGetError(nRet));
- hTestTrackingModel = NULL;
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_face_tracking_model_prepare_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_face_tracking_model_prepare
- * @scenario Call mv_face_tracking_model_create,
- * mv_face_tracking_model_prepare
- * @apicovered mv_face_tracking_model_create,
- * mv_face_tracking_model_prepare
- * @passcase If mv_face_tracking_model_prepare
- * returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_face_tracking_model_prepare
-int ITc_mv_face_tracking_model_prepare_p(void)
-{
- START_TEST;
-
- if (!(g_bIsFaceRecognitionFeatureSupported &&
- (g_bIsBarcodeGenerationFeatureSupported || g_bIsBarcodeDetectionFeatureSupported))) {
- FPRINTF("[Line : %d][%s] face and barcode feature is not supported and api "
- "also returned not supported so leaving test\n",
- __LINE__, API_NAMESPACE);
- return 0;
- }
- int nRet = mv_create_source(&g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet));
- CHECK_HANDLE(g_hMvSource, "mv_create_source");
-
- char pszValue[CONFIG_VALUE_LEN_MAX] = {
- 0,
- };
- snprintf(pszValue, strlen(pInternalStoragePath) + strlen("/res/track/sequence/01.jpg") + 1,
- "%s/res/track/sequence/01.jpg", pInternalStoragePath);
- nRet = image_load(pszValue, g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "image_load", MediaVisionGetError(nRet));
-
- nRet = mv_face_tracking_model_create(&hTrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_tracking_model_create", MediaVisionGetError(nRet));
-
- mv_quadrangle_s roi;
- roi.points[0].x = 440;
- roi.points[0].y = 130;
- roi.points[1].x = 530;
- roi.points[1].y = 130;
- roi.points[2].x = 530;
- roi.points[2].y = 240;
- roi.points[3].x = 440;
- roi.points[3].y = 240;
-
- nRet = mv_create_engine_config(&g_hMvEngineConfig);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_engine_config", MediaVisionGetError(nRet));
- CHECK_HANDLE(g_hMvEngineConfig, "mv_create_engine_config");
-
- nRet = mv_face_tracking_model_prepare(hTrackingModel, g_hMvEngineConfig, g_hMvSource, &roi);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_tracking_model_prepare", MediaVisionGetError(nRet));
-
- if (g_hMvEngineConfig != NULL) {
- nRet = mv_destroy_engine_config(g_hMvEngineConfig);
- g_hMvEngineConfig = NULL;
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_engine_config", MediaVisionGetError(nRet));
- }
-
- nRet = mv_face_tracking_model_destroy(hTrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_tracking_model_destroy", MediaVisionGetError(nRet));
-
- nRet = mv_destroy_source(g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_source", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_face_tracking_model_clone_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_face_tracking_model_clone
- * @scenario Call mv_face_tracking_model_clone
- * @apicovered mv_face_tracking_model_clone
- * @passcase If mv_face_tracking_model_clone returns
- * MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_face_tracking_model_clone
-int ITc_mv_face_tracking_model_clone_p(void)
-{
- START_TEST;
-
- if (g_bIsFaceRecognitionFeatureSupported == false) {
- FPRINTF("[Line : %d][%s] Face recognition feature is not supported and api "
- "also returned not supported so leaving test\n",
- __LINE__, API_NAMESPACE);
- return 0;
- }
- int nRet = -1;
- mv_face_tracking_model_h hTestTrackingModel = NULL;
- mv_face_tracking_model_h hDestModel = NULL;
-
- nRet = mv_face_tracking_model_create(&hTestTrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_tracking_model_create", MediaVisionGetError(nRet));
- CHECK_HANDLE(hTestTrackingModel, "mv_face_tracking_model_h");
-
- nRet = mv_face_tracking_model_clone(hTestTrackingModel, &hDestModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_tracking_model_clone", MediaVisionGetError(nRet));
-
- char pszFilePath_s[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath("test_src_model", pszFilePath_s)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_face_tracking_model_save(pszFilePath_s, hTestTrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_tracking_model_save", MediaVisionGetError(nRet));
-
- char pszFilePath_d[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath("test_dst_model", pszFilePath_d)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_face_tracking_model_save(pszFilePath_d, hDestModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_tracking_model_save", MediaVisionGetError(nRet));
-
- bool bCompareModels = checkModelFile(pszFilePath_s, pszFilePath_d);
- if (!bCompareModels) {
- FPRINTF("[Line : %d][%s] models are not same\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_face_tracking_model_destroy(hTestTrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_tracking_model_destroy", MediaVisionGetError(nRet));
-
- nRet = mv_face_tracking_model_destroy(hDestModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_tracking_model_destroy", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_face_tracking_model_save_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_face_tracking_model_save
- * @scenario Call mv_face_tracking_model_create and
- * mv_face_tracking_model_save
- * @apicovered mv_face_tracking_model_create and
- * mv_face_tracking_model_save
- * @passcase If mv_face_tracking_model_create and
- * mv_face_tracking_model_save returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_face_tracking_model_save
-int ITc_mv_face_tracking_model_save_p(void)
-{
- START_TEST;
-
- if (!(g_bIsFaceRecognitionFeatureSupported &&
- (g_bIsBarcodeGenerationFeatureSupported || g_bIsBarcodeDetectionFeatureSupported))) {
- FPRINTF("[Line : %d][%s] Bar code, face and barcode feature is not "
- "supported and api also returned not supported so leaving test\n",
- __LINE__, API_NAMESPACE);
- return 0;
- }
- int nRet = -1;
-
- char pszFilePath[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath(PATHPFX01, pszFilePath)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_create_source(&g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet));
- CHECK_HANDLE(g_hMvSource, "mv_create_source");
-
- nRet = mv_face_tracking_model_create(&hTrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_tracking_model_create", MediaVisionGetError(nRet));
-
- nRet = mv_face_tracking_model_save("/tmp/test_trk_model", hTrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_tracking_model_save", MediaVisionGetError(nRet));
-
- nRet = mv_face_tracking_model_destroy(hTrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_tracking_model_destroy", MediaVisionGetError(nRet));
-
- nRet = mv_destroy_source(g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_source", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_face_tracking_model_load_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_face_tracking_model_load
- * @scenario Call mv_face_tracking_model_load
- * @apicovered mv_face_tracking_model_load
- * @passcase If mv_face_tracking_model_load returns
- * MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_face_tracking_model_load
-int ITc_mv_face_tracking_model_load_p(void)
-{
- START_TEST;
-
- if (g_bIsFaceRecognitionFeatureSupported == false) {
- FPRINTF("[Line : %d][%s] Face recognition feature is not supported and api "
- "also returned not supported so leaving test\n",
- __LINE__, API_NAMESPACE);
- return 0;
- }
- int nRet = -1;
-
- char pszFilePath[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath("test_trk_model", pszFilePath)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_face_tracking_model_load(pszFilePath, &g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_tracking_model_load", MediaVisionGetError(nRet));
-
- nRet = mv_face_tracking_model_destroy(g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_tracking_model_destroy", MediaVisionGetError(nRet));
- g_hMvSource = NULL;
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_face_recognize_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_face_recognize
- * @scenario Call mv_face_recognize
- * @apicovered mv_face_recognize
- * @passcase If mv_face_recognize returns
- * MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_face_recognize
-int ITc_mv_face_recognize_p(void)
-{
- START_TEST;
-
- if (!(g_bIsFaceRecognitionFeatureSupported &&
- (g_bIsBarcodeGenerationFeatureSupported || g_bIsBarcodeDetectionFeatureSupported))) {
- FPRINTF("[Line : %d][%s] Bar code, face and barcode feature is not "
- "supported and api also returned not supported so leaving test\n",
- __LINE__, API_NAMESPACE);
- return 0;
- }
- int nRet = -1;
- mv_face_recognition_model_h recognition_model = NULL;
- bool is_called = false;
- mv_source_h source = NULL;
-
- char pszFilePath[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath(PATHPFXTREC, pszFilePath)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_face_recognition_model_load(pszFilePath, &recognition_model);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_recognition_model_load", MediaVisionGetError(nRet));
-
- nRet = mv_create_source(&source);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet));
-
- char pszValue[CONFIG_VALUE_LEN_MAX] = {
- 0,
- };
- snprintf(pszValue, strlen(pInternalStoragePath) + strlen("/P1/09.jpg") + 1, "%s/P1/09.jpg", pInternalStoragePath);
- nRet = image_load(pszValue, source);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "image_load", MediaVisionGetError(nRet));
-
- nRet = mv_face_recognize(source, recognition_model, NULL, NULL, MvFaceRecognizedCB, &is_called);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_recognize", MediaVisionGetError(nRet));
- if (false == is_called) {
- FPRINTF("[Line : %d][%s] unable to recognize face\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_destroy_source(source);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_source", MediaVisionGetError(nRet));
-
- nRet = mv_face_recognition_model_destroy(recognition_model);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_recognition_model_destroy", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_face_track_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_face_track
- * @scenario Call
- * mv_face_tracking_model_create,mv_face_tracking_model_prepare and
- * mv_face_track
- * @apicovered mv_face_tracking_model_create,mv_face_tracking_model_prepare and
- * mv_face_track
- * @passcase If mv_face_track returns
- * MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_face_track
-int ITc_mv_face_track_p(void)
-{
- START_TEST;
-
- if (!(g_bIsFaceRecognitionFeatureSupported &&
- (g_bIsBarcodeGenerationFeatureSupported || g_bIsBarcodeDetectionFeatureSupported))) {
- FPRINTF("[Line : %d][%s] Bar code, face and barcode feature is not "
- "supported and api also returned not supported so leaving test\n",
- __LINE__, API_NAMESPACE);
- return 0;
- }
- int nRet = -1, frames_counter = 0, idx = 1;
- ;
-
- nRet = mv_face_tracking_model_create(&hTrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_tracking_model_create", MediaVisionGetError(nRet));
-
- nRet = mv_create_source(&g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet));
- CHECK_HANDLE(g_hMvSource, "mv_create_source");
-
- char pszValue[CONFIG_VALUE_LEN_MAX] = {
- 0,
- };
- snprintf(pszValue, strlen(pInternalStoragePath) + strlen("/res/track/sequence/01.jpg") + 1,
- "%s/res/track/sequence/01.jpg", pInternalStoragePath);
- nRet = image_load(pszValue, g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "image_load", MediaVisionGetError(nRet));
-
- mv_quadrangle_s roi;
- roi.points[0].x = 440;
- roi.points[0].y = 130;
- roi.points[1].x = 530;
- roi.points[1].y = 130;
- roi.points[2].x = 530;
- roi.points[2].y = 240;
- roi.points[3].x = 440;
- roi.points[3].y = 240;
-
- nRet = mv_face_tracking_model_prepare(hTrackingModel, NULL, g_hMvSource, &roi);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_tracking_model_prepare", MediaVisionGetError(nRet));
-
- char(*frames)[1024] = (char **) malloc(0);
- struct dirent *ent;
- DIR *dir = opendir(track_seq_path);
- if (NULL != dir) {
- while (NULL != (ent = readdir(dir))) {
- if ('.' == ent->d_name[0] || 0 != strcmp(".jpg", ent->d_name + strlen(ent->d_name) - 4)) {
- continue;
- }
-
- frames = (char **) realloc(frames, ++frames_counter * 1024);
-
- snprintf(frames[frames_counter - 1], strlen(track_seq_path) + strlen("/") + strlen(ent->d_name) + 1,
- "%s/%s", track_seq_path, ent->d_name);
- }
- closedir(dir);
- }
-
- if (1 >= frames_counter) {
- FPRINTF("[Line : %d][%s] Value is not lower than %d \n", __LINE__, API_NAMESPACE, frames_counter);
- free(frames);
- return 1;
- }
-
- FPRINTF("[Line : %d][%s] frames_counter %i\n", __LINE__, API_NAMESPACE, frames_counter);
- qsort(&frames[0], frames_counter, 1024, strCompare);
-
- for (; idx < frames_counter; ++idx) {
- nRet = image_load(frames[idx], g_hMvSource);
- PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "image_load", MediaVisionGetError(nRet), free(frames));
-
- nRet = mv_face_track(g_hMvSource, hTrackingModel, NULL, MvTrackCB, true, frames[idx]);
- PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_track", MediaVisionGetError(nRet), free(frames));
- }
-
- free(frames);
- frames = NULL;
-
- nRet = mv_face_tracking_model_destroy(hTrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_tracking_model_destroy", MediaVisionGetError(nRet));
-
- nRet = mv_destroy_source(g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_source", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_face_eye_condition_recognize_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_face_eye_condition_recognize
- * @scenario Call mv_face_eye_condition_recognize
- * @apicovered mv_face_eye_condition_recognize
- * @passcase If mv_face_eye_condition_recognize
- * returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition mv_face_recognition_model_create
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_face_eye_condition_recognize
-int ITc_mv_face_eye_condition_recognize_p(void)
-{
- START_TEST;
-
- if (!(g_bIsFaceRecognitionFeatureSupported &&
- (g_bIsBarcodeGenerationFeatureSupported || g_bIsBarcodeDetectionFeatureSupported))) {
- FPRINTF("[Line : %d][%s] Bar code, face and barcode feature is not "
- "supported and api also returned not supported so leaving test\n",
- __LINE__, API_NAMESPACE);
- return 0;
- }
- mv_rectangle_s location;
- mv_face_eye_condition_e eye_condition;
- int nRet = -1;
- location.point.x = 177;
- location.point.y = 87;
- location.width = 157;
- location.height = 157;
-
- eye_condition = MV_FACE_EYES_OPEN;
-
- char pszFilePath[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath(PATHPFX01, pszFilePath)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_create_source(&g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet));
-
- nRet = image_load(pszFilePath, g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "image_load", MediaVisionGetError(nRet));
-
- nRet = mv_face_eye_condition_recognize(g_hMvSource, NULL, location, MvEyeConditionCB, &eye_condition);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_eye_condition_recognize", MediaVisionGetError(nRet));
-
- nRet = mv_destroy_source(g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_source", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_face_facial_expression_recognize_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test
- * mv_face_facial_expression_recognize
- * @scenario Call mv_face_facial_expression_recognize
- * @apicovered mv_face_facial_expression_recognize
- * @passcase If mv_face_facial_expression_recognize
- * returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_face_facial_expression_recognize
-int ITc_mv_face_facial_expression_recognize_p(void)
-{
- START_TEST;
-
- if (!(g_bIsFaceRecognitionFeatureSupported &&
- (g_bIsBarcodeGenerationFeatureSupported || g_bIsBarcodeDetectionFeatureSupported))) {
- FPRINTF("[Line : %d][%s] Bar code, face and barcode feature is not "
- "supported and api also returned not supported so leaving test\n",
- __LINE__, API_NAMESPACE);
- return 0;
- }
-
- unsigned int width = 0;
- unsigned int height = 0;
- mv_rectangle_s location;
- location.point.x = 0;
- location.point.y = 0;
- mv_face_facial_expression_e face_expression = MV_FACE_NEUTRAL;
- int nRet = -1;
-
- char pszFilePath[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath(PATHPFXNEUT, pszFilePath)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_create_source(&g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet));
-
- nRet = image_load(pszFilePath, g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "image_load", MediaVisionGetError(nRet));
-
- nRet = mv_source_get_width(g_hMvSource, &width);
- location.width = (int) width;
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_source_get_width", MediaVisionGetError(nRet));
-
- nRet = mv_source_get_height(g_hMvSource, &height);
- location.height = (int) height;
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_source_get_height", MediaVisionGetError(nRet));
-
- nRet = mv_face_facial_expression_recognize(g_hMvSource, NULL, location, MvFaceExpressionCB, &face_expression);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_face_facial_expression_recognize", MediaVisionGetError(nRet));
-
- nRet = mv_destroy_source(g_hMvSource);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_source", MediaVisionGetError(nRet));
-
- return 0;
-}
-/** @} */
-/** @} */
+++ /dev/null
-//
-// Copyright (c) 2014 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 *image_object_serizalization_path = "image_object.txt";
-/**
- * @function MvRecognizedCB
- * @description Callback Function
- * @parameter mv_source_h source,mv_engine_config_h engine_cfg,const
- * mv_image_object_h *image_objects, mv_quadrangle_s **locations, unsigned int
- * number_of_objects, void *user_data
- * @return NA
- */
-static void MvRecognizedCB(mv_source_h source, mv_engine_config_h engine_cfg, const mv_image_object_h *image_objects,
- mv_quadrangle_s **locations, unsigned int number_of_objects, void *user_data)
-{
-#if DEBUG
- FPRINTF("[Line : %d][%s]Callback Invoked\n", __LINE__, API_NAMESPACE, "MvRecognizedCB");
-#endif
- if (NULL == user_data) {
- FPRINTF("[Line : %d][%s] USer data is null\n", __LINE__, API_NAMESPACE);
- return;
- }
-}
-/**
- * @function MvTrackedCB
- * @description Callback Function
- * @parameter mv_source_h source, mv_image_tracking_model_h
- * tracking_model, mv_engine_config_h engine_cfg,mv_quadrangle_s *location,void
- * *user_data
- * @return NA
- */
-void MvTrackedCB(mv_source_h source, mv_image_tracking_model_h tracking_model, mv_engine_config_h engine_cfg,
- mv_quadrangle_s *location, void *user_data)
-{
-#if DEBUG
- FPRINTF("[Line : %d][%s]Callback Invoked\n", __LINE__, API_NAMESPACE, "MvTrackedCB");
-#endif
- if (NULL == user_data) {
- FPRINTF("[Line : %d][%s] User Data not correct in callback\n", __LINE__, API_NAMESPACE);
- return;
- }
-}
-
-/**
- * @function ITs_media_vision_image_startup
- * @description Called before each test
- * @parameter NA
- * @return NA
- */
-void ITs_media_vision_image_startup(void)
-{
- struct stat stBuff;
- if (stat(ERR_LOG, &stBuff) == 0) {
- remove(ERR_LOG);
- }
-
- g_bIsImageRecognitionFeatureSupported = TCTCheckSystemInfoFeatureSupported(IMAGERECOGFEATURE, API_NAMESPACE);
- g_bIsBarcodeGenerationFeatureSupported = TCTCheckSystemInfoFeatureSupported(BARCODEGENFEATURE, API_NAMESPACE);
- g_bIsBarcodeDetectionFeatureSupported = TCTCheckSystemInfoFeatureSupported(BARCODEDETFEATURE, API_NAMESPACE);
-
- return;
-}
-
-/**
- * @function ITs_media_vision_image_cleanup
- * @description Called after each test
- * @parameter NA
- * @return NA
- */
-void ITs_media_vision_image_cleanup(void)
-{
- return;
-}
-
-/**
- * @testcase ITc_mv_image_object_create_destroy_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_image_object_create and
- * mv_image_object_destroy
- * @scenario Call mv_image_object_create,
- * mv_image_object_destroy
- * @apicovered mv_image_object_create,
- * mv_image_object_destroy
- * @passcase If mv_image_object_create and
- * mv_image_object_destroy returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_image_object_create and mv_image_object_destroy
-int ITc_mv_image_object_create_destroy_p(void)
-{
- START_TEST_IMAGE;
-
- int nRet = -1;
- mv_image_object_h hImageObject;
-
- nRet = mv_image_object_create(&hImageObject);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_create", MediaVisionGetError(nRet));
- CHECK_HANDLE(hImageObject, "mv_image_object_create");
-
- nRet = mv_image_object_destroy(hImageObject);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_destroy", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_image_object_fill_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_image_object_fill
- * @scenario Call mv_source_fill_by_buffer,
- * mv_image_object_create and mv_image_object_fill
- * @apicovered mv_source_fill_by_buffer,
- * mv_image_object_create and mv_image_object_fill
- * @passcase If mv_image_object_fill returns
- * MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_image_object_fill
-int ITc_mv_image_object_fill_p(void)
-{
- START_TEST_IMAGE;
-
- if (!(g_bIsBarcodeGenerationFeatureSupported || g_bIsBarcodeDetectionFeatureSupported)) {
- FPRINTF("[Line : %d][%s] Bar code feature is not supported\n", __LINE__, API_NAMESPACE);
- return 0;
- }
- int nRet = -1;
- mv_source_h hTargetImage;
- mv_image_object_h htarget;
-
- nRet = mv_create_source(&hTargetImage);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet));
-
- g_pBufferData = calloc(1, BUFFERSIZE);
- CHECK_HANDLE(g_pBufferData, "calloc");
-
- nRet = mv_source_fill_by_buffer(hTargetImage, (unsigned char *) g_pBufferData, BUFFERSIZE, 20, 10,
- MEDIA_VISION_COLORSPACE_RGB888);
- PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_source_fill_by_buffer", MediaVisionGetError(nRet),
- FREE_MEMORY(g_pBufferData));
-
- nRet = mv_image_object_create(&htarget);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_create", MediaVisionGetError(nRet));
-
- nRet = mv_create_engine_config(&g_hMvEngineConfig);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_engine_config", MediaVisionGetError(nRet));
- CHECK_HANDLE(g_hMvEngineConfig, "mv_create_engine_config");
-
- nRet = mv_image_object_fill(htarget, g_hMvEngineConfig, hTargetImage, NULL);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_fill", MediaVisionGetError(nRet));
-
- FREE_MEMORY(g_pBufferData);
-
- if (g_hMvEngineConfig != NULL) {
- nRet = mv_destroy_engine_config(g_hMvEngineConfig);
- g_hMvEngineConfig = NULL;
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_engine_config", MediaVisionGetError(nRet));
- }
-
- nRet = mv_image_object_destroy(htarget);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_destroy", MediaVisionGetError(nRet));
-
- nRet = mv_destroy_source(hTargetImage);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_source", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_image_object_get_recognition_rate_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test
- * mv_image_object_get_recognition_rate
- * @scenario Call mv_image_object_create,
- * mv_image_object_get_recognition_rate
- * @apicovered mv_image_object_create,
- * mv_image_object_get_recognition_rate
- * @passcase If mv_image_object_get_recognition_rate
- * returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_image_object_get_recognition_rate
-int ITc_mv_image_object_get_recognition_rate_p(void)
-{
- START_TEST_IMAGE;
-
- int nRet = -1;
- mv_image_object_h hImageObject;
- double recognition_rate = 0;
-
- nRet = mv_image_object_create(&hImageObject);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_create", MediaVisionGetError(nRet));
-
- nRet = mv_image_object_get_recognition_rate(hImageObject, &recognition_rate);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_get_recognition_rate", MediaVisionGetError(nRet));
- if (0 != recognition_rate) {
- FPRINTF("[Line : %d][%s] recognition_rate not valid!!!\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- nRet = mv_image_object_destroy(hImageObject);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_destroy", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_image_object_set_get_label_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_image_object_set_label and
- * mv_image_object_get_label
- * @scenario Call mv_image_object_set_label and
- * mv_image_object_get_label
- * @apicovered mv_image_object_set_label and
- * mv_image_object_get_label
- * @passcase If mv_image_object_set_label and
- * mv_image_object_get_label returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_image_object_set_label and mv_image_object_get_label
-int ITc_mv_image_object_set_get_label_p(void)
-{
- START_TEST_IMAGE;
-
- int nRet = -1;
- mv_image_object_h hImageObject;
- const int test_label = 24;
- int label = 0;
-
- nRet = mv_image_object_create(&hImageObject);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_create", MediaVisionGetError(nRet));
-
- nRet = mv_image_object_set_label(hImageObject, test_label);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_set_label", MediaVisionGetError(nRet));
-
- nRet = mv_image_object_get_label(hImageObject, &label);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_get_label", MediaVisionGetError(nRet));
- if (test_label != label) {
- FPRINTF("[Line : %d][%s] Values of set get not matched!!!\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_image_object_destroy(hImageObject);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_destroy", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_image_object_clone_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_image_object_clone
- * @scenario Call mv_image_object_create,
- * mv_image_object_clone
- * @apicovered mv_image_object_create,
- * mv_image_object_clone
- * @passcase If mv_image_object_clone returns
- * MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_image_object_clone
-int ITc_mv_image_object_clone_p(void)
-{
- START_TEST_IMAGE;
-
- int nRet = -1;
- mv_image_object_h hImageObject1 = NULL, hImageObject2 = NULL;
-
- nRet = mv_image_object_create(&hImageObject1);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_create", MediaVisionGetError(nRet));
-
- nRet = mv_image_object_create(&hImageObject2);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_create", MediaVisionGetError(nRet));
-
- nRet = mv_image_object_clone(hImageObject1, &hImageObject2);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_clone", MediaVisionGetError(nRet));
-
- char pszFilePath_s[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath("test_src_model", pszFilePath_s)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_image_object_save(pszFilePath_s, hImageObject1);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_save", MediaVisionGetError(nRet));
-
- char pszFilePath_d[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath("test_src_model", pszFilePath_d)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_image_object_save(pszFilePath_d, hImageObject2);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_save", MediaVisionGetError(nRet));
-
- bool compare_models = checkModelFile(pszFilePath_s, pszFilePath_d);
- if (!compare_models) {
- FPRINTF("[Line : %d][%s] model not matches\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_image_object_destroy(hImageObject1);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_destroy", MediaVisionGetError(nRet));
-
- nRet = mv_image_object_destroy(hImageObject2);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_destroy", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_image_object_save_load_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_image_object_save and
- * mv_image_object_load
- * @scenario Call mv_image_object_save and
- * mv_image_object_load
- * @apicovered mv_image_object_save and
- * mv_image_object_load
- * @passcase If mv_image_object_save and
- * mv_image_object_load returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_image_object_save and mv_image_object_load
-int ITc_mv_image_object_save_load_p(void)
-{
- START_TEST_IMAGE;
-
- int nRet = -1;
- mv_image_object_h hImageObject;
-
- nRet = mv_image_object_create(&hImageObject);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_create", MediaVisionGetError(nRet));
-
- char pszFilePath[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath(image_object_serizalization_path, pszFilePath)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_image_object_save(pszFilePath, hImageObject);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_save", MediaVisionGetError(nRet));
-
- nRet = mv_image_object_destroy(hImageObject);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_destroy", MediaVisionGetError(nRet));
-
- hImageObject = NULL;
- nRet = mv_image_object_load(pszFilePath, &hImageObject);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_load", MediaVisionGetError(nRet));
-
- nRet = mv_image_object_destroy(hImageObject);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_destroy", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_image_tracking_model_create_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_image_tracking_model_create
- * @scenario Call mv_image_tracking_model_create
- * @apicovered mv_image_tracking_model_create
- * @passcase If mv_image_tracking_model_create
- * returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_image_tracking_model_create
-int ITc_mv_image_tracking_model_create_p(void)
-{
- START_TEST_IMAGE;
-
- int nRet = -1;
- mv_image_tracking_model_h tracking_model;
-
- nRet = mv_image_tracking_model_create(&tracking_model);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_create", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_image_tracking_model_set_target_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test
- * mv_image_tracking_model_set_target
- * @scenario Call mv_source_fill_by_buffer,
- * mv_image_tracking_model_set_target
- * @apicovered mv_source_fill_by_buffer,
- * mv_image_tracking_model_set_target
- * @passcase If mv_image_tracking_model_set_target
- * returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_image_tracking_model_set_target
-int ITc_mv_image_tracking_model_set_target_p(void)
-{
- START_TEST_IMAGE;
-
- if (!(g_bIsBarcodeGenerationFeatureSupported || g_bIsBarcodeDetectionFeatureSupported)) {
- FPRINTF("[Line : %d][%s] Bar code feature is not supported\n", __LINE__, API_NAMESPACE);
- return 0;
- }
- int nRet = -1;
- mv_source_h hTargetImage;
- mv_image_tracking_model_h hTargetTrackingModel;
- mv_image_object_h hTarget;
-
- nRet = mv_create_source(&hTargetImage);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet));
-
- char pszFilePath[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath(PATHPFXTAR, pszFilePath)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_image_object_create(&hTarget);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_create", MediaVisionGetError(nRet));
-
- nRet = image_load(pszFilePath, hTargetImage);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "image_load", MediaVisionGetError(nRet));
-
- nRet = mv_image_object_fill(hTarget, NULL, hTargetImage, NULL);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_fill", MediaVisionGetError(nRet));
-
- nRet = mv_image_tracking_model_create(&hTargetTrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_create", MediaVisionGetError(nRet));
-
- nRet = mv_image_tracking_model_set_target(hTarget, hTargetTrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_set_target", MediaVisionGetError(nRet));
-
- nRet = mv_image_tracking_model_destroy(hTargetTrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_destroy", MediaVisionGetError(nRet));
-
- nRet = mv_destroy_source(hTargetImage);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_source", MediaVisionGetError(nRet));
-
- nRet = mv_image_object_destroy(hTarget);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_destroy", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_image_tracking_model_destroy_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_image_tracking_model_destroy
- * @scenario Call mv_image_tracking_model_create and
- * mv_image_tracking_model_destroy
- * @apicovered mv_image_tracking_model_create and
- * mv_image_tracking_model_destroy
- * @passcase If mv_image_tracking_model_destroy
- * returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_image_tracking_model_destroy
-int ITc_mv_image_tracking_model_destroy_p(void)
-{
- START_TEST_IMAGE;
-
- int nRet = -1;
- mv_image_tracking_model_h hTrackingModel;
-
- nRet = mv_image_tracking_model_create(&hTrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_create", MediaVisionGetError(nRet));
-
- nRet = mv_image_tracking_model_destroy(hTrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_destroy", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_image_tracking_model_refresh_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_image_tracking_model_refresh
- * @scenario Call mv_image_tracking_model_set_target,
- * mv_image_tracking_model_refresh
- * @apicovered mv_image_tracking_model_set_target,
- * mv_image_tracking_model_refresh
- * @passcase If mv_image_tracking_model_refresh
- * returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_image_tracking_model_refresh
-int ITc_mv_image_tracking_model_refresh_p(void)
-{
- START_TEST_IMAGE;
-
- if (!(g_bIsBarcodeGenerationFeatureSupported || g_bIsBarcodeDetectionFeatureSupported)) {
- FPRINTF("[Line : %d][%s] Bar code feature is not supported\n", __LINE__, API_NAMESPACE);
- return 0;
- }
- int nRet = -1;
- mv_source_h hTargetImage;
- mv_image_tracking_model_h hTrackingModel;
- mv_image_object_h hTarget;
-
- char pszFilePath[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath(PATHPFXTAR, pszFilePath)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_create_source(&hTargetImage);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet));
-
- nRet = image_load(pszFilePath, hTargetImage);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "image_load", MediaVisionGetError(nRet));
-
- nRet = mv_image_object_create(&hTarget);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_create", MediaVisionGetError(nRet));
-
- nRet = mv_create_engine_config(&g_hMvEngineConfig);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_engine_config", MediaVisionGetError(nRet));
- CHECK_HANDLE(g_hMvEngineConfig, "mv_create_engine_config");
-
- nRet = mv_image_object_fill(hTarget, g_hMvEngineConfig, hTargetImage, NULL);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_fill", MediaVisionGetError(nRet));
-
- nRet = mv_image_tracking_model_create(&hTrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_create", MediaVisionGetError(nRet));
-
- nRet = mv_image_tracking_model_set_target(hTarget, hTrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_set_target", MediaVisionGetError(nRet));
-
- nRet = mv_image_tracking_model_refresh(hTrackingModel, NULL);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_refresh", MediaVisionGetError(nRet));
-
- nRet = mv_image_tracking_model_destroy(hTrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_destroy", MediaVisionGetError(nRet));
-
- if (g_hMvEngineConfig != NULL) {
- nRet = mv_destroy_engine_config(g_hMvEngineConfig);
- g_hMvEngineConfig = NULL;
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_engine_config", MediaVisionGetError(nRet));
- }
-
- nRet = mv_image_object_destroy(hTarget);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_destroy", MediaVisionGetError(nRet));
-
- nRet = mv_destroy_source(hTargetImage);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_source", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_image_tracking_model_clone_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_image_tracking_model_clone
- * @scenario Call mv_image_tracking_model_create,
- * mv_image_tracking_model_clone and mv_image_tracking_model_save
- * @apicovered mv_image_tracking_model_create,
- * mv_image_tracking_model_clone and mv_image_tracking_model_save
- * @passcase If mv_image_tracking_model_clone and
- * mv_image_tracking_model_save returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_image_tracking_model_clone
-int ITc_mv_image_tracking_model_clone_p(void)
-{
- START_TEST_IMAGE;
-
- int nRet = -1;
- mv_image_tracking_model_h hTrackingModelSrc = NULL;
- mv_image_tracking_model_h hTrackingModelDst = NULL;
-
- nRet = mv_image_tracking_model_create(&hTrackingModelSrc);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_create", MediaVisionGetError(nRet));
-
- nRet = mv_image_tracking_model_clone(hTrackingModelSrc, &hTrackingModelDst);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_clone", MediaVisionGetError(nRet));
-
- char pszFilePath_s[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath("test_img_s", pszFilePath_s)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_image_tracking_model_save(pszFilePath_s, hTrackingModelSrc);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_save", MediaVisionGetError(nRet));
-
- char pszFilePath_d[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath("test_img_d", pszFilePath_d)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_image_tracking_model_save(pszFilePath_d, hTrackingModelDst);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_save", MediaVisionGetError(nRet));
-
- bool compare_models = checkModelFile(pszFilePath_s, pszFilePath_d);
- if (TRUE != compare_models) {
- FPRINTF("[Line : %d][%s] model not matches\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_image_tracking_model_destroy(hTrackingModelSrc);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_destroy", MediaVisionGetError(nRet));
-
- nRet = mv_image_tracking_model_destroy(hTrackingModelDst);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_destroy", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_image_tracking_model_save_load_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_image_tracking_model_load and
- * mv_image_tracking_model_save
- * @scenario Call mv_image_tracking_model_create,
- * mv_image_tracking_model_save,mv_image_tracking_model_load
- * @apicovered mv_image_tracking_model_create,
- * mv_image_tracking_model_save,mv_image_tracking_model_load
- * @passcase If mv_image_tracking_model_load and
- * mv_image_tracking_model_save returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_image_tracking_model_load and
-// mv_image_tracking_model_save
-int ITc_mv_image_tracking_model_save_load_p(void)
-{
- START_TEST_IMAGE;
-
- int nRet = -1;
- mv_image_tracking_model_h hSourceModel = NULL;
-
- nRet = mv_image_tracking_model_create(&hSourceModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_create", MediaVisionGetError(nRet));
-
- char pszFilePath[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath("tracking_model.txt", pszFilePath)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_image_tracking_model_save(pszFilePath, hSourceModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_save", MediaVisionGetError(nRet));
-
- nRet = mv_image_tracking_model_destroy(hSourceModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_destroy", MediaVisionGetError(nRet));
-
- nRet = mv_image_tracking_model_load(pszFilePath, &hSourceModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_load", MediaVisionGetError(nRet));
-
- nRet = mv_image_tracking_model_destroy(hSourceModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_destroy", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_image_recognize_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_image_recognize
- * @scenario Call mv_image_object_create,
- * mv_image_recognize
- * @apicovered mv_image_object_create,
- * mv_image_recognize
- * @passcase If mv_image_recognize returns
- * MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition mv_image_object_create
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_image_recognize
-int ITc_mv_image_recognize_p(void)
-{
- START_TEST_IMAGE;
-
- if (!(g_bIsBarcodeGenerationFeatureSupported || g_bIsBarcodeDetectionFeatureSupported)) {
- FPRINTF("[Line : %d][%s] Bar code feature is not supported\n", __LINE__, API_NAMESPACE);
- return 0;
- }
- int nRet = -1;
- mv_source_h hTargetImage;
- mv_image_object_h target;
- mv_source_h scene_image;
-
- char pszFilePath[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath(PATHPFXTAR, pszFilePath)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- char pszFilePathImage[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath(PATHPFXSCENE, pszFilePathImage)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_create_source(&hTargetImage);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet));
- CHECK_HANDLE(hTargetImage, "mv_create_source");
-
- nRet = image_load(pszFilePath, hTargetImage);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "image_load", MediaVisionGetError(nRet));
-
- nRet = mv_image_object_create(&target);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_create", MediaVisionGetError(nRet));
-
- nRet = mv_create_engine_config(&g_hMvEngineConfig);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_engine_config", MediaVisionGetError(nRet));
- CHECK_HANDLE(g_hMvEngineConfig, "mv_create_engine_config");
-
- nRet = mv_image_object_fill(target, g_hMvEngineConfig, hTargetImage, NULL);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_fill", MediaVisionGetError(nRet));
-
- nRet = mv_create_source(&scene_image);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet));
-
- nRet = image_load(pszFilePathImage, scene_image);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "image_load", MediaVisionGetError(nRet));
-
- nRet = mv_image_recognize(scene_image, &target, 1, g_hMvEngineConfig, MvRecognizedCB, "scene_image");
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_recognize", MediaVisionGetError(nRet));
-
- nRet = mv_destroy_source(scene_image);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_source", MediaVisionGetError(nRet));
-
- if (g_hMvEngineConfig != NULL) {
- nRet = mv_destroy_engine_config(g_hMvEngineConfig);
- g_hMvEngineConfig = NULL;
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_engine_config", MediaVisionGetError(nRet));
- }
-
- nRet = mv_image_object_destroy(target);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_destroy", MediaVisionGetError(nRet));
-
- nRet = mv_destroy_source(hTargetImage);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_source", MediaVisionGetError(nRet));
-
- return 0;
-}
-
-/**
- * @testcase ITc_mv_image_track_p
- * @author SRID(nibha.sharma)
- * @reviewer SRID(gupta.sanjay)
- * @type auto
- * @since_tizen 3.0
- * @description To test mv_image_track
- * @scenario Call mv_source_fill_by_buffer,
- * mv_image_object_create,mv_image_tracking_model_create,mv_image_tracking_model_set_target,mv_image_track
- * @apicovered mv_source_fill_by_buffer,
- * mv_image_object_create,mv_image_tracking_model_create,mv_image_tracking_model_set_target,mv_image_track
- * @passcase If mv_image_track returns
- * MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition mv_source_fill_by_buffer
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To test mv_image_track
-int ITc_mv_image_track_p(void)
-{
- START_TEST_IMAGE;
-
- if (!(g_bIsBarcodeGenerationFeatureSupported || g_bIsBarcodeDetectionFeatureSupported)) {
- FPRINTF("[Line : %d][%s] Bar code feature is not supported\n", __LINE__, API_NAMESPACE);
- return 0;
- };
-
- int nRet = -1;
-
- mv_source_h hTargetImage;
- mv_image_object_h hTarget;
- mv_source_h hFrameImage;
- mv_image_tracking_model_h hImageTtrackingModel;
- int frame_num = 0;
-
- nRet = mv_create_source(&hTargetImage);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet));
-
- char pszFilePath[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath(PATHPFXTAR, pszFilePath)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- char pszFilePathImage[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath(PATHPFXSCENE, pszFilePathImage)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- nRet = mv_image_object_create(&hTarget);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_create", MediaVisionGetError(nRet));
-
- nRet = image_load(pszFilePath, hTargetImage);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "image_load", MediaVisionGetError(nRet));
-
- nRet = mv_create_engine_config(&g_hMvEngineConfig);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_engine_config", MediaVisionGetError(nRet));
- CHECK_HANDLE(g_hMvEngineConfig, "mv_create_engine_config");
-
- nRet = mv_image_object_fill(hTarget, g_hMvEngineConfig, hTargetImage, NULL);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_fill", MediaVisionGetError(nRet));
-
- nRet = mv_image_tracking_model_create(&hImageTtrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_create", MediaVisionGetError(nRet));
-
- nRet = mv_image_tracking_model_set_target(hTarget, hImageTtrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_set_target", MediaVisionGetError(nRet));
-
- nRet = mv_create_source(&hFrameImage);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet));
-
- nRet = image_load(pszFilePathImage, hFrameImage);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "image_load", MediaVisionGetError(nRet));
-
- nRet = mv_image_track(hFrameImage, hImageTtrackingModel, g_hMvEngineConfig, MvTrackedCB, &frame_num);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_track", MediaVisionGetError(nRet));
-
- nRet = mv_destroy_source(hFrameImage);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_source", MediaVisionGetError(nRet));
-
- nRet = mv_image_tracking_model_destroy(hImageTtrackingModel);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_tracking_model_destroy", MediaVisionGetError(nRet));
-
- nRet = mv_image_object_destroy(hTarget);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_image_object_destroy", MediaVisionGetError(nRet));
-
- nRet = mv_destroy_source(hTargetImage);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_source", MediaVisionGetError(nRet));
-
- return 0;
-}
-/** @} */
-/** @} */
+++ /dev/null
-//
-// Copyright (c) 2014 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
- * @{
- */
-/**
- * @function movement_detected_cb
- * @description Called when transform is finished just before returning
- * the output.
- * @parameter[IN] The error code of
- * @parameter[IN] Media packet handle
- * @parameter[IN] The user data passed from the for each function
- * @return NA
- */
-void movement_detected_cb(mv_surveillance_event_trigger_h event_trigger, mv_source_h source, int video_stream_id,
- mv_surveillance_result_h event_result, void *user_data)
-{
- int number_of_movement_regions = 0;
- int nRet = mv_surveillance_get_result_value(event_result, MV_SURVEILLANCE_MOVEMENT_NUMBER_OF_REGIONS,
- &number_of_movement_regions);
- if (nRet == MEDIA_VISION_ERROR_NONE) {
- FPRINTF("[Line : %d][%s] %s passed\n", __LINE__, API_NAMESPACE, "mv_surveillance_get_result_value");
- } else {
- FPRINTF("[Line : %d][%s] %s failed, error returned = %s [%d]\n", __LINE__, API_NAMESPACE,
- "mv_surveillance_get_result_value", MediaVisionGetError(nRet), nRet);
- }
- FPRINTF("\nNumber of movement regions is %d \n", number_of_movement_regions);
-
- mv_rectangle_s *movement_regions = malloc(sizeof(mv_rectangle_s) * number_of_movement_regions);
- // target api
- nRet = mv_surveillance_get_result_value(event_result, MV_SURVEILLANCE_MOVEMENT_REGIONS, movement_regions);
- if (nRet == MEDIA_VISION_ERROR_NONE) {
- FPRINTF("[Line : %d][%s] %s passed\n", __LINE__, API_NAMESPACE, "mv_surveillance_get_result_value");
- FREE_MEMORY(movement_regions);
- } else {
- FPRINTF("[Line : %d][%s] %s failed, error returned = %s [%d]\n", __LINE__, API_NAMESPACE,
- "mv_surveillance_get_result_value", MediaVisionGetError(nRet), nRet);
- FREE_MEMORY(movement_regions);
- }
-}
-
-/**
- * @function ITs_media_vision_surveillance_startup
- * @description Called before each test
- * @parameter NA
- * @return NA
- */
-void ITs_media_vision_surveillance_startup(void)
-{
- struct stat stBuff;
- if (stat(ERR_LOG, &stBuff) == 0) {
- remove(ERR_LOG);
- }
-
- g_bIsFaceRecognitionFeatureSupported = TCTCheckSystemInfoFeatureSupported(FACERECOGFEATURE, API_NAMESPACE);
- g_bIsImageRecognitionFeatureSupported = TCTCheckSystemInfoFeatureSupported(IMAGERECOGFEATURE, API_NAMESPACE);
-
- return;
-}
-
-/**
- * @function ITs_media_vision_surveillance_cleanup
- * @description Called after each test
- * @parameter NA
- * @return NA
- */
-void ITs_media_vision_surveillance_cleanup(void)
-{
- return;
-}
-
-/**
- * @testcase
- * ITc_mv_surveillance_event_trigger_create_destroy_p
- * @author SRID(manu.tiwari)
- * @reviewer SRID(parshant.v)
- * @type auto
- * @since_tizen 3.0
- * @description To Create surveillance event trigger
- * handle
- * @scenario Call
- * mv_surveillance_event_trigger_create,mv_surveillance_event_trigger_destroy
- * @apicovered mv_surveillance_event_trigger_create,
- * mv_surveillance_event_trigger_destroy
- * @passcase If mv_surveillance_event_trigger_create
- * and mv_surveillance_event_trigger_destroy returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: To Create surveillance event trigger handle
-int ITc_mv_surveillance_event_trigger_create_destroy_p(void)
-{
- START_TEST_SURVEILLANCE;
- int nRet = -1;
- mv_surveillance_event_trigger_h handle = NULL;
- static const char *EVENT_TYPES_NAMES[] = { MV_SURVEILLANCE_EVENT_TYPE_MOVEMENT_DETECTED,
- MV_SURVEILLANCE_EVENT_TYPE_PERSON_APPEARED_DISAPPEARED,
- MV_SURVEILLANCE_EVENT_TYPE_PERSON_RECOGNIZED };
-
- int enum_size = sizeof(EVENT_TYPES_NAMES) / sizeof(EVENT_TYPES_NAMES[0]);
- int enum_counter = 0;
- for (enum_counter = 0; enum_counter < enum_size; enum_counter++) {
- // target api
- nRet = mv_surveillance_event_trigger_create(EVENT_TYPES_NAMES[enum_counter], &handle);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillance_event_trigger_create", MediaVisionGetError(nRet));
- CHECK_HANDLE(handle, "mv_surveillance_event_trigger_create");
- // target api
- nRet = mv_surveillance_event_trigger_destroy(handle);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillance_event_trigger_destroy", MediaVisionGetError(nRet));
- }
- return 0;
-}
-
-/**
- * @testcase ITc_mv_surveillance_get_event_trigger_type_p
- * @author SRID(manu.tiwari)
- * @reviewer SRID(parshant.v)
- * @type auto
- * @since_tizen 3.0
- * @description Gets the surveillance event trigger type
- * as character string
- * @scenario Call
- * mv_surveillance_event_trigger_create,mv_surveillance_get_event_trigger_type,mv_surveillance_event_trigger_destroy
- * @apicovered
- * mv_surveillance_event_trigger_create,mv_surveillance_get_event_trigger_type,mv_surveillance_event_trigger_destroy
- * @passcase If
- * mv_surveillance_get_event_trigger_type returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: Gets the surveillance event trigger type as character string
-int ITc_mv_surveillance_get_event_trigger_type_p(void)
-{
- START_TEST_SURVEILLANCE;
-
- int nRet = -1;
- mv_surveillance_event_trigger_h handle = NULL;
- char *event_type = NULL;
-
- nRet = mv_surveillance_event_trigger_create(MV_SURVEILLANCE_EVENT_TYPE_MOVEMENT_DETECTED, &handle);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillance_event_trigger_create", MediaVisionGetError(nRet));
- CHECK_HANDLE(handle, "mv_surveillance_event_trigger_create");
- // target api
- nRet = mv_surveillance_get_event_trigger_type(handle, &event_type);
- PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillance_get_event_trigger_type",
- MediaVisionGetError(nRet), FREE_MEMORY(event_type));
-
- if (strncmp(event_type, MV_SURVEILLANCE_EVENT_TYPE_MOVEMENT_DETECTED, MAX_EVENT_TYPE_LEN) != 0) {
- FPRINTF("event_type != MV_SURVEILLANCE_EVENT_TYPE_MOVEMENT_DETECTED \n");
- nRet = mv_surveillance_event_trigger_destroy(handle);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillance_event_trigger_destroy", MediaVisionGetError(nRet));
- free(event_type);
- return 1;
- }
- nRet = mv_surveillance_event_trigger_destroy(handle);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillance_event_trigger_destroy", MediaVisionGetError(nRet));
- free(event_type);
-
- return 0;
-}
-
-/**
- * @testcase
- * ITc_mv_surveillance_set_get_event_trigger_roi_p
- * @author SRID(manu.tiwari)
- * @reviewer SRID(parshant.v)
- * @type auto
- * @since_tizen 3.0
- * @description Sets and Gets ROI (Region Of Interest) to
- * the event trigger
- * @scenario Call
- * mv_surveillance_event_trigger_create,mv_surveillance_set_event_trigger_roi,mv_surveillance_get_event_trigger_roi,mv_surveillance_event_trigger_destroy
- * @apicovered
- * mv_surveillance_set_event_trigger_roi,mv_surveillance_get_event_trigger_roi
- * @passcase If api returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: Sets and Gets ROI (Region Of Interest) to the event trigger
-int ITc_mv_surveillance_set_get_event_trigger_roi_p(void)
-{
- START_TEST_SURVEILLANCE;
-
- int nRet = -1;
- mv_surveillance_event_trigger_h handle = NULL;
- const int nRoiPoints = 5;
- int nGetRoiPoints = 0;
- int xRoi = 5, yRoi = 4, i = 0;
- mv_point_s *nGetRoi = NULL;
-
- nRet = mv_surveillance_event_trigger_create(MV_SURVEILLANCE_EVENT_TYPE_MOVEMENT_DETECTED, &handle);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillance_event_trigger_create", MediaVisionGetError(nRet));
- CHECK_HANDLE(handle, "mv_surveillance_event_trigger_create");
-
- mv_point_s *nRoi = (mv_point_s *) malloc(sizeof(mv_point_s) * nRoiPoints);
- for (; i < nRoiPoints; ++i) {
- nRoi[i].x = xRoi;
- nRoi[i].y = yRoi;
- }
- // target api
- nRet = mv_surveillance_set_event_trigger_roi(handle, nRoiPoints, nRoi);
- PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillance_set_event_trigger_roi",
- MediaVisionGetError(nRet), FREE_MEMORY(nRoi));
-
- // target api
- nRet = mv_surveillance_get_event_trigger_roi(handle, &nGetRoiPoints, &nGetRoi);
- PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillance_get_event_trigger_roi",
- MediaVisionGetError(nRet), FREE_MEMORY(nGetRoi);
- FREE_MEMORY(nRoi));
-
- if (nRoiPoints != nGetRoiPoints) {
- FPRINTF("[Line : %d][%s] Values of set get not matched!!!\n", __LINE__, API_NAMESPACE);
- nRet = mv_surveillance_event_trigger_destroy(handle);
- PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillance_event_trigger_destroy",
- MediaVisionGetError(nRet), FREE_MEMORY(nGetRoi);
- FREE_MEMORY(nRoi));
- FREE_MEMORY(nGetRoi);
- FREE_MEMORY(nRoi);
- return 1;
- }
- nRet = mv_surveillance_event_trigger_destroy(handle);
- PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillance_event_trigger_destroy",
- MediaVisionGetError(nRet), FREE_MEMORY(nGetRoi);
- FREE_MEMORY(nRoi));
-
- FREE_MEMORY(nGetRoi);
- FREE_MEMORY(nRoi);
-
- return 0;
-}
-/**
- * @testcase ITc_mv_surveillance_push_source_p
- * @author SRID(manu.tiwari)
- * @reviewer SRID(parshant.v)
- * @type auto
- * @since_tizen 3.0
- * @description Pushes source to the surveillance system
- * to detect events
- * @scenario Call mv_surveillance_push_source
- * @apicovered mv_surveillance_push_source
- * @passcase If mv_surveillance_push_source returns
- * MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: Pushes source to the surveillance system to detect events
-int ITc_mv_surveillance_push_source_p(void)
-{
- START_TEST_SURVEILLANCE;
-
- int video_stream_id = 0;
- mv_source_h source1;
- mv_surveillance_event_trigger_h handle = NULL;
-
- char pszFilePath[PATHLEN] = {
- 0,
- };
- if (false == MediaVisionAppendToAppDataPath(PATHPFX, pszFilePath)) {
- FPRINTF("[Line : %d][%s] unable to get the app data path\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- int nRet = mv_surveillance_event_trigger_create(MV_SURVEILLANCE_EVENT_TYPE_MOVEMENT_DETECTED, &handle);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillance_event_trigger_create", MediaVisionGetError(nRet));
- CHECK_HANDLE(handle, "mv_surveillance_event_trigger_create");
-
- nRet = mv_surveillance_subscribe_event_trigger(handle, video_stream_id, NULL, movement_detected_cb, NULL);
- PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillance_subscribe_event_trigger",
- MediaVisionGetError(nRet), mv_surveillance_event_trigger_destroy(handle));
-
- nRet = mv_create_source(&source1);
- PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_create_source", MediaVisionGetError(nRet),
- mv_surveillance_event_trigger_destroy(handle));
-
- nRet = image_load(pszFilePath, source1);
- PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "image_load", MediaVisionGetError(nRet),
- mv_surveillance_event_trigger_destroy(handle);
- mv_destroy_source(source1));
- // target api
- nRet = mv_surveillance_push_source(source1, video_stream_id);
- PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillance_push_source", MediaVisionGetError(nRet),
- mv_surveillance_event_trigger_destroy(handle);
- mv_destroy_source(source1));
-
- nRet = mv_destroy_source(source1);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_destroy_source", MediaVisionGetError(nRet));
- nRet = mv_surveillance_unsubscribe_event_trigger(handle, video_stream_id);
- PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillance_unsubscribe_event_trigger",
- MediaVisionGetError(nRet), mv_surveillance_event_trigger_destroy(handle));
-
- nRet = mv_surveillance_event_trigger_destroy(handle);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillance_event_trigger_destroy", MediaVisionGetError(nRet));
-
- return 0;
-}
-/**
- * @testcase
- * ITc_mv_surveillance_subscribe_unsubscribe_event_get_result_value_p
- * @author SRID(manu.tiwari)
- * @reviewer SRID(parshant.v)
- * @type auto
- * @since_tizen 3.0
- * @description Gets result value
- * @scenario Call mv_surveillance_get_result_value
- * @apicovered mv_surveillance_get_result_value
- * @passcase If mv_surveillance_get_result_value
- * returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: Gets result value
-int ITc_mv_surveillance_subscribe_unsubscribe_event_get_result_value_p(void)
-{
- START_TEST_SURVEILLANCE;
-
- mv_surveillance_event_trigger_h handle = NULL;
- char *event_type = NULL;
- int video_stream_id = 2;
-
- int nRet = mv_surveillance_event_trigger_create(MV_SURVEILLANCE_EVENT_TYPE_MOVEMENT_DETECTED, &handle);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillance_event_trigger_create", MediaVisionGetError(nRet));
- CHECK_HANDLE(handle, "mv_surveillance_event_trigger_create");
-
- nRet = mv_surveillance_get_event_trigger_type(handle, &event_type);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillance_get_event_trigger_type", MediaVisionGetError(nRet));
-
- if (strncmp(event_type, MV_SURVEILLANCE_EVENT_TYPE_MOVEMENT_DETECTED, MAX_EVENT_TYPE_LEN) == 0) {
- // traget api
- nRet = mv_surveillance_subscribe_event_trigger(handle, video_stream_id, NULL, movement_detected_cb, NULL);
- PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillance_subscribe_event_trigger",
- MediaVisionGetError(nRet), mv_surveillance_event_trigger_destroy(handle));
- }
- nRet = mv_surveillance_unsubscribe_event_trigger(handle, video_stream_id);
- PRINT_RESULT_CLEANUP(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillance_unsubscribe_event_trigger",
- MediaVisionGetError(nRet), mv_surveillance_event_trigger_destroy(handle));
-
- nRet = mv_surveillance_event_trigger_destroy(handle);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillance_event_trigger_destroy", MediaVisionGetError(nRet));
-
- return 0;
-}
-/**
- * @function foreach_event_result_value_name_cb
- * @description Called when transform is finished just before returning
- * the output.
- * @parameter[IN] The error code of
- * @parameter[IN] Media packet handle
- * @parameter[IN] The user data passed from the for each function
- * @return NA
- */
-bool foreach_event_result_value_name_cb(const char *value_name, void *user_data)
-{
- g_bforeach_event_result_value_nameCompletedCallback = true;
-
- if (NULL == value_name) {
- return true;
- }
- return true;
-}
-/**
- * @function foreach_event_type_cb
- * @description Called when transform is finished just before returning
- * the output.
- * @parameter[IN] The error code of
- * @parameter[IN] Media packet handle
- * @parameter[IN] The user data passed from the for each function
- * @return NA
- */
-bool foreach_event_type_cb(const char *event_type, void *user_data)
-{
- g_bforeach_event_typeCompletedCallback = true;
-
- if (NULL == event_type) {
- return true;
- }
-
- g_bforeach_event_result_value_nameCompletedCallback = false;
- // target api
- const int nRet =
- mv_surveillance_foreach_event_result_name(event_type, foreach_event_result_value_name_cb, user_data);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillance_foreach_event_result_name", MediaVisionGetError(nRet));
- if (!g_bforeach_event_result_value_nameCompletedCallback) {
- return false;
- }
-
- return true;
-}
-/**
- * @testcase
- * ITc_mv_surveillance_foreach_supported_event_type_p
- * @author SRID(manu.tiwari)
- * @reviewer SRID(parshant.v)
- * @type auto
- * @since_tizen 3.0
- * @description Gets result value
- * @scenario Call mv_surveillance_get_result_value
- * @apicovered mv_surveillance_get_result_value
- * @passcase If mv_surveillance_get_result_value
- * returns MEDIA_VISION_ERROR_NONE
- * @failcase If Precondition API or Target API Fails
- * @precondition NA
- * @postcondition NA
- * */
-//& type: auto
-//& purpose: Gets result value
-int ITc_mv_surveillance_foreach_supported_event_type_p(void)
-{
- START_TEST_SURVEILLANCE;
-
- g_bforeach_event_typeCompletedCallback = false;
- const int nRet = mv_surveillance_foreach_supported_event_type(foreach_event_type_cb, NULL);
- PRINT_RESULT(MEDIA_VISION_ERROR_NONE, nRet, "mv_surveillanc_foreach_supported_event_type",
- MediaVisionGetError(nRet));
- if (!g_bforeach_event_typeCompletedCallback) {
- FPRINTF("[Line : %d][%s] foreach_event_type_cb failed, error returned = "
- "callback not invoked\n",
- __LINE__, API_NAMESPACE);
- return 1;
- } else {
-#if DEBUG
- FPRINTF("[Line : %d][%s] mv_surveillance_foreach_supported_event_type is "
- "successful\n",
- __LINE__, API_NAMESPACE);
-#endif
- }
- return 0;
-}
-/** @} */
-/** @} */
#include "tct_common.h"
#include "testcase.h"
-extern void ITs_media_vision_face_startup(void);
-extern void ITs_media_vision_face_cleanup(void);
-extern void ITs_media_vision_image_startup(void);
-extern void ITs_media_vision_image_cleanup(void);
-extern void ITs_media_vision_surveillance_startup(void);
-extern void ITs_media_vision_surveillance_cleanup(void);
extern void ITs_media_vision_barcode_startup(void);
extern void ITs_media_vision_barcode_cleanup(void);
extern void ITs_media_vision_roi_tracker_startup(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);
-extern int ITc_mv_face_detect_p(void);
-extern int ITc_mv_face_recognition_model_save_load_p(void);
-extern int ITc_mv_face_recognition_model_add_p(void);
-extern int ITc_mv_face_recognition_model_reset_p(void);
-extern int ITc_mv_face_recognition_model_learn_p(void);
-extern int ITc_mv_face_recognition_model_query_labels_p(void);
-extern int ITc_mv_face_tracking_model_create_destroy_p(void);
-extern int ITc_mv_face_tracking_model_prepare_p(void);
-extern int ITc_mv_face_tracking_model_clone_p(void);
-extern int ITc_mv_face_tracking_model_save_p(void);
-extern int ITc_mv_face_tracking_model_load_p(void);
-extern int ITc_mv_face_recognize_p(void);
-extern int ITc_mv_face_track_p(void);
-extern int ITc_mv_face_eye_condition_recognize_p(void);
-extern int ITc_mv_face_facial_expression_recognize_p(void);
-extern int ITc_mv_image_object_create_destroy_p(void);
-extern int ITc_mv_image_object_fill_p(void);
-extern int ITc_mv_image_object_get_recognition_rate_p(void);
-extern int ITc_mv_image_object_set_get_label_p(void);
-extern int ITc_mv_image_object_clone_p(void);
-extern int ITc_mv_image_object_save_load_p(void);
-extern int ITc_mv_image_tracking_model_create_p(void);
-extern int ITc_mv_image_tracking_model_set_target_p(void);
-extern int ITc_mv_image_tracking_model_destroy_p(void);
-extern int ITc_mv_image_tracking_model_refresh_p(void);
-extern int ITc_mv_image_tracking_model_clone_p(void);
-extern int ITc_mv_image_tracking_model_save_load_p(void);
-extern int ITc_mv_image_recognize_p(void);
-extern int ITc_mv_image_track_p(void);
-extern int ITc_mv_surveillance_event_trigger_create_destroy_p(void);
-extern int ITc_mv_surveillance_get_event_trigger_type_p(void);
-extern int ITc_mv_surveillance_set_get_event_trigger_roi_p(void);
-extern int ITc_mv_surveillance_push_source_p(void);
-extern int ITc_mv_surveillance_subscribe_unsubscribe_event_get_result_value_p(void);
-extern int ITc_mv_surveillance_foreach_supported_event_type_p(void);
extern int ITc_mv_barcode_generate_source_p(void);
extern int ITc_mv_barcode_generate_image_p(void);
extern int ITc_mv_barcode_detect_p(void);
extern int ITc_media_vision_mv_source_set_get_timestamp_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 },
- { "ITc_mv_face_detect_p", ITc_mv_face_detect_p, ITs_media_vision_face_startup, ITs_media_vision_face_cleanup },
- { "ITc_mv_face_recognition_model_save_load_p", ITc_mv_face_recognition_model_save_load_p,
- ITs_media_vision_face_startup, ITs_media_vision_face_cleanup },
- { "ITc_mv_face_recognition_model_add_p", ITc_mv_face_recognition_model_add_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_recognition_model_reset_p", ITc_mv_face_recognition_model_reset_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_recognition_model_learn_p", ITc_mv_face_recognition_model_learn_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_recognition_model_query_labels_p", ITc_mv_face_recognition_model_query_labels_p,
- ITs_media_vision_face_startup, ITs_media_vision_face_cleanup },
- { "ITc_mv_face_tracking_model_create_destroy_p", ITc_mv_face_tracking_model_create_destroy_p,
- ITs_media_vision_face_startup, ITs_media_vision_face_cleanup },
- { "ITc_mv_face_tracking_model_prepare_p", ITc_mv_face_tracking_model_prepare_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_tracking_model_clone_p", ITc_mv_face_tracking_model_clone_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_tracking_model_save_p", ITc_mv_face_tracking_model_save_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_tracking_model_load_p", ITc_mv_face_tracking_model_load_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_recognize_p", ITc_mv_face_recognize_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_track_p", ITc_mv_face_track_p, ITs_media_vision_face_startup, ITs_media_vision_face_cleanup },
- { "ITc_mv_face_eye_condition_recognize_p", ITc_mv_face_eye_condition_recognize_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_facial_expression_recognize_p", ITc_mv_face_facial_expression_recognize_p,
- ITs_media_vision_face_startup, ITs_media_vision_face_cleanup },
- { "ITc_mv_image_object_create_destroy_p", ITc_mv_image_object_create_destroy_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_object_fill_p", ITc_mv_image_object_fill_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_object_get_recognition_rate_p", ITc_mv_image_object_get_recognition_rate_p,
- ITs_media_vision_image_startup, ITs_media_vision_image_cleanup },
- { "ITc_mv_image_object_set_get_label_p", ITc_mv_image_object_set_get_label_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_object_clone_p", ITc_mv_image_object_clone_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_object_save_load_p", ITc_mv_image_object_save_load_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_tracking_model_create_p", ITc_mv_image_tracking_model_create_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_tracking_model_set_target_p", ITc_mv_image_tracking_model_set_target_p,
- ITs_media_vision_image_startup, ITs_media_vision_image_cleanup },
- { "ITc_mv_image_tracking_model_destroy_p", ITc_mv_image_tracking_model_destroy_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_tracking_model_refresh_p", ITc_mv_image_tracking_model_refresh_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_tracking_model_clone_p", ITc_mv_image_tracking_model_clone_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_tracking_model_save_load_p", ITc_mv_image_tracking_model_save_load_p,
- ITs_media_vision_image_startup, ITs_media_vision_image_cleanup },
- { "ITc_mv_image_recognize_p", ITc_mv_image_recognize_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_track_p", ITc_mv_image_track_p, ITs_media_vision_image_startup, ITs_media_vision_image_cleanup },
- { "ITc_mv_surveillance_event_trigger_create_destroy_p", ITc_mv_surveillance_event_trigger_create_destroy_p,
- ITs_media_vision_surveillance_startup, ITs_media_vision_surveillance_cleanup },
- { "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_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,
#include "tct_common.h"
#include "testcase.h"
-extern void ITs_media_vision_face_startup(void);
-extern void ITs_media_vision_face_cleanup(void);
-extern void ITs_media_vision_image_startup(void);
-extern void ITs_media_vision_image_cleanup(void);
-extern void ITs_media_vision_surveillance_startup(void);
-extern void ITs_media_vision_surveillance_cleanup(void);
extern void ITs_media_vision_barcode_startup(void);
extern void ITs_media_vision_barcode_cleanup(void);
extern void ITs_media_vision_roi_tracker_startup(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);
-extern int ITc_mv_face_detect_p(void);
-extern int ITc_mv_face_recognition_model_save_load_p(void);
-extern int ITc_mv_face_recognition_model_add_p(void);
-extern int ITc_mv_face_recognition_model_reset_p(void);
-extern int ITc_mv_face_recognition_model_learn_p(void);
-extern int ITc_mv_face_recognition_model_query_labels_p(void);
-extern int ITc_mv_face_tracking_model_create_destroy_p(void);
-extern int ITc_mv_face_tracking_model_prepare_p(void);
-extern int ITc_mv_face_tracking_model_clone_p(void);
-extern int ITc_mv_face_tracking_model_save_p(void);
-extern int ITc_mv_face_tracking_model_load_p(void);
-extern int ITc_mv_face_recognize_p(void);
-extern int ITc_mv_face_track_p(void);
-extern int ITc_mv_face_eye_condition_recognize_p(void);
-extern int ITc_mv_face_facial_expression_recognize_p(void);
-extern int ITc_mv_image_object_create_destroy_p(void);
-extern int ITc_mv_image_object_fill_p(void);
-extern int ITc_mv_image_object_get_recognition_rate_p(void);
-extern int ITc_mv_image_object_set_get_label_p(void);
-extern int ITc_mv_image_object_clone_p(void);
-extern int ITc_mv_image_object_save_load_p(void);
-extern int ITc_mv_image_tracking_model_create_p(void);
-extern int ITc_mv_image_tracking_model_set_target_p(void);
-extern int ITc_mv_image_tracking_model_destroy_p(void);
-extern int ITc_mv_image_tracking_model_refresh_p(void);
-extern int ITc_mv_image_tracking_model_clone_p(void);
-extern int ITc_mv_image_tracking_model_save_load_p(void);
-extern int ITc_mv_image_recognize_p(void);
-extern int ITc_mv_image_track_p(void);
-extern int ITc_mv_surveillance_event_trigger_create_destroy_p(void);
-extern int ITc_mv_surveillance_get_event_trigger_type_p(void);
-extern int ITc_mv_surveillance_set_get_event_trigger_roi_p(void);
-extern int ITc_mv_surveillance_push_source_p(void);
-extern int ITc_mv_surveillance_subscribe_unsubscribe_event_get_result_value_p(void);
-extern int ITc_mv_surveillance_foreach_supported_event_type_p(void);
extern int ITc_mv_barcode_generate_source_p(void);
extern int ITc_mv_barcode_generate_image_p(void);
extern int ITc_mv_barcode_detect_p(void);
extern int ITc_media_vision_mv_source_set_get_timestamp_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 },
- { "ITc_mv_face_detect_p", ITc_mv_face_detect_p, ITs_media_vision_face_startup, ITs_media_vision_face_cleanup },
- { "ITc_mv_face_recognition_model_save_load_p", ITc_mv_face_recognition_model_save_load_p,
- ITs_media_vision_face_startup, ITs_media_vision_face_cleanup },
- { "ITc_mv_face_recognition_model_add_p", ITc_mv_face_recognition_model_add_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_recognition_model_reset_p", ITc_mv_face_recognition_model_reset_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_recognition_model_learn_p", ITc_mv_face_recognition_model_learn_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_recognition_model_query_labels_p", ITc_mv_face_recognition_model_query_labels_p,
- ITs_media_vision_face_startup, ITs_media_vision_face_cleanup },
- { "ITc_mv_face_tracking_model_create_destroy_p", ITc_mv_face_tracking_model_create_destroy_p,
- ITs_media_vision_face_startup, ITs_media_vision_face_cleanup },
- { "ITc_mv_face_tracking_model_prepare_p", ITc_mv_face_tracking_model_prepare_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_tracking_model_clone_p", ITc_mv_face_tracking_model_clone_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_tracking_model_save_p", ITc_mv_face_tracking_model_save_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_tracking_model_load_p", ITc_mv_face_tracking_model_load_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_recognize_p", ITc_mv_face_recognize_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_track_p", ITc_mv_face_track_p, ITs_media_vision_face_startup, ITs_media_vision_face_cleanup },
- { "ITc_mv_face_eye_condition_recognize_p", ITc_mv_face_eye_condition_recognize_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_facial_expression_recognize_p", ITc_mv_face_facial_expression_recognize_p,
- ITs_media_vision_face_startup, ITs_media_vision_face_cleanup },
- { "ITc_mv_image_object_create_destroy_p", ITc_mv_image_object_create_destroy_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_object_fill_p", ITc_mv_image_object_fill_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_object_get_recognition_rate_p", ITc_mv_image_object_get_recognition_rate_p,
- ITs_media_vision_image_startup, ITs_media_vision_image_cleanup },
- { "ITc_mv_image_object_set_get_label_p", ITc_mv_image_object_set_get_label_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_object_clone_p", ITc_mv_image_object_clone_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_object_save_load_p", ITc_mv_image_object_save_load_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_tracking_model_create_p", ITc_mv_image_tracking_model_create_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_tracking_model_set_target_p", ITc_mv_image_tracking_model_set_target_p,
- ITs_media_vision_image_startup, ITs_media_vision_image_cleanup },
- { "ITc_mv_image_tracking_model_destroy_p", ITc_mv_image_tracking_model_destroy_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_tracking_model_refresh_p", ITc_mv_image_tracking_model_refresh_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_tracking_model_clone_p", ITc_mv_image_tracking_model_clone_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_tracking_model_save_load_p", ITc_mv_image_tracking_model_save_load_p,
- ITs_media_vision_image_startup, ITs_media_vision_image_cleanup },
- { "ITc_mv_image_recognize_p", ITc_mv_image_recognize_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_track_p", ITc_mv_image_track_p, ITs_media_vision_image_startup, ITs_media_vision_image_cleanup },
- { "ITc_mv_surveillance_event_trigger_create_destroy_p", ITc_mv_surveillance_event_trigger_create_destroy_p,
- ITs_media_vision_surveillance_startup, ITs_media_vision_surveillance_cleanup },
- { "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_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,
#include "tct_common.h"
#include "testcase.h"
-extern void ITs_media_vision_face_startup(void);
-extern void ITs_media_vision_face_cleanup(void);
-extern void ITs_media_vision_image_startup(void);
-extern void ITs_media_vision_image_cleanup(void);
-extern void ITs_media_vision_surveillance_startup(void);
-extern void ITs_media_vision_surveillance_cleanup(void);
extern void ITs_media_vision_barcode_startup(void);
extern void ITs_media_vision_barcode_cleanup(void);
extern void ITs_media_vision_roi_tracker_startup(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);
-extern int ITc_mv_face_detect_p(void);
-extern int ITc_mv_face_recognition_model_save_load_p(void);
-extern int ITc_mv_face_recognition_model_add_p(void);
-extern int ITc_mv_face_recognition_model_reset_p(void);
-extern int ITc_mv_face_recognition_model_learn_p(void);
-extern int ITc_mv_face_recognition_model_query_labels_p(void);
-extern int ITc_mv_face_tracking_model_create_destroy_p(void);
-extern int ITc_mv_face_tracking_model_prepare_p(void);
-extern int ITc_mv_face_tracking_model_clone_p(void);
-extern int ITc_mv_face_tracking_model_save_p(void);
-extern int ITc_mv_face_tracking_model_load_p(void);
-extern int ITc_mv_face_recognize_p(void);
-extern int ITc_mv_face_track_p(void);
-extern int ITc_mv_face_eye_condition_recognize_p(void);
-extern int ITc_mv_face_facial_expression_recognize_p(void);
-extern int ITc_mv_image_object_create_destroy_p(void);
-extern int ITc_mv_image_object_fill_p(void);
-extern int ITc_mv_image_object_get_recognition_rate_p(void);
-extern int ITc_mv_image_object_set_get_label_p(void);
-extern int ITc_mv_image_object_clone_p(void);
-extern int ITc_mv_image_object_save_load_p(void);
-extern int ITc_mv_image_tracking_model_create_p(void);
-extern int ITc_mv_image_tracking_model_set_target_p(void);
-extern int ITc_mv_image_tracking_model_destroy_p(void);
-extern int ITc_mv_image_tracking_model_refresh_p(void);
-extern int ITc_mv_image_tracking_model_clone_p(void);
-extern int ITc_mv_image_tracking_model_save_load_p(void);
-extern int ITc_mv_image_recognize_p(void);
-extern int ITc_mv_image_track_p(void);
-extern int ITc_mv_surveillance_event_trigger_create_destroy_p(void);
-extern int ITc_mv_surveillance_get_event_trigger_type_p(void);
-extern int ITc_mv_surveillance_set_get_event_trigger_roi_p(void);
-extern int ITc_mv_surveillance_push_source_p(void);
-extern int ITc_mv_surveillance_subscribe_unsubscribe_event_get_result_value_p(void);
-extern int ITc_mv_surveillance_foreach_supported_event_type_p(void);
extern int ITc_mv_barcode_generate_source_p(void);
extern int ITc_mv_barcode_generate_image_p(void);
extern int ITc_mv_barcode_detect_p(void);
extern int ITc_media_vision_mv_source_set_get_timestamp_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 },
- { "ITc_mv_face_detect_p", ITc_mv_face_detect_p, ITs_media_vision_face_startup, ITs_media_vision_face_cleanup },
- { "ITc_mv_face_recognition_model_save_load_p", ITc_mv_face_recognition_model_save_load_p,
- ITs_media_vision_face_startup, ITs_media_vision_face_cleanup },
- { "ITc_mv_face_recognition_model_add_p", ITc_mv_face_recognition_model_add_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_recognition_model_reset_p", ITc_mv_face_recognition_model_reset_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_recognition_model_learn_p", ITc_mv_face_recognition_model_learn_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_recognition_model_query_labels_p", ITc_mv_face_recognition_model_query_labels_p,
- ITs_media_vision_face_startup, ITs_media_vision_face_cleanup },
- { "ITc_mv_face_tracking_model_create_destroy_p", ITc_mv_face_tracking_model_create_destroy_p,
- ITs_media_vision_face_startup, ITs_media_vision_face_cleanup },
- { "ITc_mv_face_tracking_model_prepare_p", ITc_mv_face_tracking_model_prepare_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_tracking_model_clone_p", ITc_mv_face_tracking_model_clone_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_tracking_model_save_p", ITc_mv_face_tracking_model_save_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_tracking_model_load_p", ITc_mv_face_tracking_model_load_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_recognize_p", ITc_mv_face_recognize_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_track_p", ITc_mv_face_track_p, ITs_media_vision_face_startup, ITs_media_vision_face_cleanup },
- { "ITc_mv_face_eye_condition_recognize_p", ITc_mv_face_eye_condition_recognize_p, ITs_media_vision_face_startup,
- ITs_media_vision_face_cleanup },
- { "ITc_mv_face_facial_expression_recognize_p", ITc_mv_face_facial_expression_recognize_p,
- ITs_media_vision_face_startup, ITs_media_vision_face_cleanup },
- { "ITc_mv_image_object_create_destroy_p", ITc_mv_image_object_create_destroy_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_object_fill_p", ITc_mv_image_object_fill_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_object_get_recognition_rate_p", ITc_mv_image_object_get_recognition_rate_p,
- ITs_media_vision_image_startup, ITs_media_vision_image_cleanup },
- { "ITc_mv_image_object_set_get_label_p", ITc_mv_image_object_set_get_label_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_object_clone_p", ITc_mv_image_object_clone_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_object_save_load_p", ITc_mv_image_object_save_load_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_tracking_model_create_p", ITc_mv_image_tracking_model_create_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_tracking_model_set_target_p", ITc_mv_image_tracking_model_set_target_p,
- ITs_media_vision_image_startup, ITs_media_vision_image_cleanup },
- { "ITc_mv_image_tracking_model_destroy_p", ITc_mv_image_tracking_model_destroy_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_tracking_model_refresh_p", ITc_mv_image_tracking_model_refresh_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_tracking_model_clone_p", ITc_mv_image_tracking_model_clone_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_tracking_model_save_load_p", ITc_mv_image_tracking_model_save_load_p,
- ITs_media_vision_image_startup, ITs_media_vision_image_cleanup },
- { "ITc_mv_image_recognize_p", ITc_mv_image_recognize_p, ITs_media_vision_image_startup,
- ITs_media_vision_image_cleanup },
- { "ITc_mv_image_track_p", ITc_mv_image_track_p, ITs_media_vision_image_startup, ITs_media_vision_image_cleanup },
- { "ITc_mv_surveillance_event_trigger_create_destroy_p", ITc_mv_surveillance_event_trigger_create_destroy_p,
- ITs_media_vision_surveillance_startup, ITs_media_vision_surveillance_cleanup },
- { "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_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,