To use the engines, include the header file 'C_API.h' and add 'EvoCAPI.lib' import library on Windows or 'libEvoCAPI.so' shared library on Linux when linked together. For their paths, refer to SDK contents.
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
int main(int argc, char *argv[])
{
const char *imgPath = NULL;
const char *dataDir = NULL;
if (argc < 2)
{
fprintf(stderr, "%s [sdk_data_dir] image_file\n", argv[0]);
return EXIT_FAILURE;
}
else if (argc == 2)
{
imgPath = argv[1];
}
else
{
dataDir = argv[1];
imgPath = argv[2];
}
unsigned numDev;
int idSSE;
assert(rc == EVORC_OK);
assert(rc == EVORC_OK);
fprintf(stdout, "<< Supported DNN Devices >>\n");
for (unsigned i = 0; i < numDev; i++)
{
char buf[128] = { 0 };
assert(rc == EVORC_OK);
assert(rc == EVORC_OK);
fprintf(stdout, " ID: %s\n", buf);
assert(rc == EVORC_OK);
fprintf(stdout, " Full Name: %s\n", buf);
if (i < (numDev - 1U))
fprintf(stdout, " --------------------------------------------\n");
}
assert(idDDI < 0);
assert(idSSE >= 0);
assert(rc == EVORC_OK);
{
assert(rc == EVORC_OK);
assert(rc == EVORC_OK);
}
int idLPI;
assert(rc == EVORC_OK);
if (idLPI >= 0)
{
unsigned numLPs;
assert(rc == EVORC_OK);
for (unsigned i = 0; i < numLPs; i++)
{
char bufCP[512] = { 0 };
char bufUTF8[512] = { 0 };
assert(rc == EVORC_OK);
assert(rc == EVORC_OK);
#ifdef _WIN64
assert (rc == EVORC_OK);
fprintf(stdout, "\n%s\n", bufCP);
#else
fprintf(stdout, "\n%s\n", bufUTF8);
#endif
assert(rc == EVORC_OK);
fprintf(stdout,
" --> Position: %d, %d, %d, %d\n", bbox.
x, bbox.
y, bbox.
width, bbox.
height);
float confidence;
assert(rc == EVORC_OK);
fprintf(stdout, " --> Type: %d (%.2f%%)\n", type, confidence);
}
assert(idLPI < 0);
}
assert(idSSE < 0);
return EXIT_SUCCESS;
}
EvoRC
Return Codes.
Definition Basic.h:59
int EvoLPT
License Plate Type.
Definition Basic.h:598
C header file common to all type of engines and functionalities.
EvoRC EvoLPI_GetStr(EvoObjID idLPI, char *buf, unsigned len)
void EvoSSE_Deinit(EvoObjID idSSE)
EvoRC Evo_CvtUTF8ToCP(const char *utf8, char *cpBuf, unsigned bufLen)
EvoRC EvoEng_GetParam_SearchRect(EvoObjID idEngine, EvoRect *rect)
EvoRC Evo_GetLastRC(void)
EvoRC EvoDDI_SelectDev(EvoObjID idDDI, unsigned idx)
EvoRC EvoDDI_GetNumDev(EvoObjID idDDI, unsigned *num)
#define EVO_INV_OBJ_ID
Definition C_API.h:30
EvoRC EvoLPI_GetNumLP(EvoObjID idLPI, unsigned *num)
EvoRC EvoSSE_Init(EvoObjID idSSE, const char *ccode, const char *dnnDevDesc)
EvoRC EvoLPI_SelectLP(EvoObjID idLPI, unsigned idx)
EvoRC EvoDDI_GetDevID(EvoObjID idDDI, char *buf, unsigned len)
EvoRC EvoLPI_GetPos(EvoObjID idLPI, EvoRect *rect)
EvoRC EvoLPI_GetType(EvoObjID idLPI, EvoLPT *type, float *confidence)
EvoRC EvoEng_SetParam_SearchRect(EvoObjID idEngine, const EvoRect *rect)
EvoRC EvoDDI_GetFullName(EvoObjID idDDI, char *buf, unsigned len)
EvoObjID EvoSSE_Create(void)
void Evo_FreeObj(EvoObjID *idObj)
EvoObjID EvoSSE_Run_ImgFile(EvoObjID idSSE, const char *imgPath)
EvoRC Evo_Initialize(const char *dnnRunMode, const char *dataDir, EvoObjID *idDDI)
Rectangle Descriptor.
Definition Basic.h:463
int height
Height Size.
Definition Basic.h:467
int x
X Coordinate of Top-Left.
Definition Basic.h:464
int y
Y Coordinate of Top-Left.
Definition Basic.h:465
int width
Width Size.
Definition Basic.h:466
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
static void Trigger(int idTSSE, const char *imgDir, int num)
{
int idLPI;
char buf[1024] = { 0 };
assert(rc == EVORC_OK);
if (idLPI >= 0)
{
unsigned numLPs;
assert(rc == EVORC_OK);
for (unsigned i = 0; i < numLPs; i++)
{
float confidence;
char bufCP[512] = { 0 };
char bufUTF8[512] = { 0 };
assert(rc == EVORC_OK);
assert(rc == EVORC_OK);
#ifdef _WIN64
assert(rc == EVORC_OK);
printf("\n%s\n", bufCP);
#else
printf("\n%s\n", bufUTF8);
#endif
assert(rc == EVORC_OK);
printf(
" --> Position: %d, %d, %d, %d\n", bbox.
x, bbox.
y, bbox.
width, bbox.
height);
assert(rc == EVORC_OK);
printf(" --> Type: %d (%.2f%%)\n", type, confidence);
}
assert(idLPI < 0);
}
assert(idPic >= 0);
#ifdef _WIN64
sprintf(buf, "%s\\%d.jpg", imgDir, num);
#else
sprintf(buf, "%s/%d.jpg", imgDir, num);
#endif
assert(idPic < 0);
}
int main(int argc, char *argv[])
{
const char *dataDir = NULL;
const char *imgDir = NULL;
const char *url = NULL;
unsigned numDev;
int idTSSE;
if (argc < 3)
{
printf("%s [sdk_data_dir] video_source_url image_dir\n", argv[0]);
return EXIT_FAILURE;
}
else if (argc == 3)
{
url = argv[1];
imgDir = argv[2];
}
else
{
dataDir = argv[1];
url = argv[2];
imgDir = argv[3];
}
assert(rc == EVORC_OK && idDDI >= 0);
assert(rc == EVORC_OK);
printf("<< Supported DNN Devices >>\n");
for (unsigned i = 0; i < numDev; i++)
{
unsigned numDMDF;
char buf[512] = { 0 };
assert(rc == EVORC_OK);
assert(rc == EVORC_OK);
fprintf(stdout, " ID: %s\n", buf);
assert(rc == EVORC_OK);
fprintf(stdout, " Full Name: %s\n", buf);
if (i < (numDev - 1U))
fprintf(stdout, " --------------------------------------------\n");
}
assert(idDDI < 0);
assert(idTSSE >= 0);
assert(rc == EVORC_OK);
assert(rc == EVORC_OK);
assert(rc == EVORC_OK);
int num = 1;
time_t baseTime = time(NULL);
while (difftime(time(NULL), baseTime) <= 5.0)
{
if ((time_t)difftime(time(NULL), baseTime) == (time_t)num)
{
Trigger(idTSSE, imgDir, num++);
}
}
assert(idTSSE < 0);
return EXIT_SUCCESS;
}
EvoRC EvoPic_SaveInJPEG(EvoObjID idPic, const char *path, int quality)
EvoRC EvoTSSE_Init_IPP(EvoObjID idTSSE, const char *ccode, const char *dnnDevDesc, const char *url)
void EvoTSSE_Deinit(EvoObjID idTSSE)
EvoObjID EvoTSSE_Create(void)
EvoObjID EvoTSSE_Trigger(EvoObjID idTSSE, EvoObjID *idPic)
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
static void HandleResult(int idLPI, int idGOP, const char *imgDir)
{
unsigned numPic;
float confidence;
unsigned numLPs = 0;
char buf[1024] = { 0 };
char bufCP[512] = { 0 };
char bufUTF8[512] = { 0 };
assert(rc == EVORC_OK && numLPs == 1U);
assert(rc == EVORC_OK);
#ifdef _WIN64
assert(rc == EVORC_OK);
printf("String: %s\n", bufCP);
#else
printf("String: %s\n", bufUTF8);
#endif
assert(rc == EVORC_OK);
printf("Type: %d (%.2f%%)\n", type, confidence);
assert(rc == EVORC_OK);
for (unsigned i = 0; i < numPic; i++)
{
time_t timeRaw;
int64_t timeUTC, timeMS;
struct tm *timeInfo = NULL;
assert(rc == EVORC_OK);
assert(rc == EVORC_OK);
printf(
"Position: %d, %d, %d, %d\n", bbox.
x, bbox.
y, bbox.
width, bbox.
height);
assert(rc == EVORC_OK);
timeMS = timeUTC % 1000;
timeRaw = (time_t)(timeUTC / 1000);
timeInfo = localtime(&timeRaw);
printf("Time: %d-%d-%d %d:%d:%d.%d\n",
timeInfo->tm_year + 1900,
timeInfo->tm_mon + 1,
timeInfo->tm_mday,
timeInfo->tm_hour,
timeInfo->tm_min,
timeInfo->tm_sec,
(int)timeMS);
}
assert(rc == EVORC_OK);
printf("Heading Direction: %d\n", heading);
printf("\n");
#ifdef _WIN64
if (numPic < 2U)
sprintf(buf, "%s\\%s.jpg", imgDir, bufCP);
else
sprintf(buf, "%s\\%s.tiff", imgDir, bufCP);
#else
if (numPic < 2U)
sprintf(buf, "%s/%s.jpg", imgDir, bufUTF8);
else
sprintf(buf, "%s/%s.tiff", imgDir, bufUTF8);
#endif
if (numPic < 2U)
else
}
int main(int argc, char *argv[])
{
const char *viType = NULL;
const char *dataDir = NULL;
const char *imgDir = NULL;
const char *url = "F:\\Temp1\\2014-11-24_.mkv";
unsigned numDev;
int idFave;
struct {
int idAdmin;
int idDev;
if (argc < 3)
{
printf("%s [SDK_Data_Dir] Video_Input_Type Image_Dir\n", argv[0]);
return EXIT_FAILURE;
}
else if (argc == 3)
{
viType = argv[1];
imgDir = argv[2];
}
else
{
dataDir = argv[1];
viType = argv[2];
imgDir = argv[3];
}
assert(rc == EVORC_OK);
assert(rc == EVORC_OK);
printf("<< Supported DNN Devices >>\n");
for (unsigned i = 0; i < numDev; i++)
{
char buf[256] = { 0 };
assert(rc == EVORC_OK);
assert(rc == EVORC_OK);
fprintf(stdout, " ID: %s\n", buf);
assert(rc == EVORC_OK);
fprintf(stdout, " Full Name: %s\n", buf);
if (i < (numDev - 1U))
fprintf(stdout, " --------------------------------------------\n");
}
printf("\n");
assert(idDDI < 0);
if (!strcmp(viType, "GenICam"))
{
assert(gic.idAdmin >= 0);
assert(rc == EVORC_OK);
assert(rc == EVORC_OK);
if (numDev <= 0)
return EXIT_FAILURE;
else
{
unsigned numDS;
for (unsigned i = 0; i < numDev; i++)
{
char buf[100] = { 0 };
assert(rc == EVORC_OK);
printf("[Current Device: %u]\n", i);
assert(rc == EVORC_OK);
printf("Interface: %s\n", buf);
assert(rc == EVORC_OK);
printf("Vendor: %s\n", buf);
assert(rc == EVORC_OK);
printf("Model: %s\n", buf);
assert(rc == EVORC_OK);
printf("SerialNo: %s\n", buf);
assert(rc == EVORC_OK);
printf("ID: %s\n", buf);
}
printf("\n");
assert(rc == EVORC_OK);
assert(gic.idDev >= 0);
assert(rc == EVORC_OK);
if (numDS > 0)
printf("Number of data streams: %u\n", numDS);
else
return EXIT_FAILURE;
}
}
assert(idFave >= 0);
if (!strcmp(viType, "IPProto"))
else
assert(rc == EVORC_OK);
assert(rc == EVORC_OK);
assert(rc == EVORC_OK);
for (int num = 0; num < 3; num++)
{
int idLPI;
if (idLPI < 0 && idGOP < 0)
{
printf("The video stream closed.\n");
break;
}
assert(idLPI >= 0 && idGOP >= 0);
HandleResult(idLPI, idGOP, imgDir);
assert(idLPI < 0);
assert(idGOP < 0);
}
assert(idFave < 0);
if (!strcmp(viType, "GenICam"))
{
assert(gic.idDev < 0);
assert(gic.idAdmin < 0);
}
return EXIT_SUCCESS;
}
EvoHeadDir
Automobile's Heading Directions.
Definition Basic.h:277
@ EVOTU_MS
Definition Basic.h:425
EvoRC EvoGIC_Admin_GetNumDev(EvoObjID idAdmin, unsigned *num)
void EvoFAVE_Deinit(EvoObjID idFAVE)
EvoObjID EvoGIC_Admin_Get(void)
EvoRC EvoGIC_Admin_UpdateDevList(EvoObjID idAdmin)
EvoObjID EvoFAVE_PopLPI(EvoObjID idFAVE, EvoObjID *idGOP)
EvoRC EvoEng_GetParam_Output(EvoObjID idEngine, EvoOutput *output)
EvoObjID EvoFAVE_Create(void)
EvoRC EvoGIC_Dev_GetNumDataStreams(EvoObjID idDev, unsigned *num)
EvoRC EvoGIC_Admin_SelectDev(EvoObjID idAdmin, unsigned idx)
EvoRC EvoGIC_Admin_GetDevIfc(EvoObjID idAdmin, char *buf, unsigned len)
EvoRC EvoGIC_Admin_GetDevID(EvoObjID idAdmin, char *buf, unsigned len)
EvoRC EvoGOP_SelectPic(EvoObjID idGOP, unsigned idx)
EvoRC EvoGOP_SaveAllInTIFF(EvoObjID idGOP, const char *path, int quality)
EvoRC EvoGOP_GetPosInPic(EvoObjID idGOP, EvoRect *rect)
EvoRC EvoGOP_GetPicTime(EvoObjID idGOP, int64_t *time, EvoTimeUnit unit)
EvoRC EvoGIC_Admin_GetDevVendor(EvoObjID idAdmin, char *buf, unsigned len)
EvoObjID EvoGIC_Admin_OpenDev(EvoObjID idAdmin)
EvoRC EvoEng_SetParam_Output(EvoObjID idEngine, const EvoOutput *output)
EvoRC EvoGOP_SavePicInJPEG(EvoObjID idGOP, const char *path, int quality)
EvoRC EvoFAVE_Init_IPP(EvoObjID idFAVE, const char *ccode, const char *dnnDevDesc, const char *url)
EvoRC EvoGIC_Admin_GetDevModel(EvoObjID idAdmin, char *buf, unsigned len)
EvoRC EvoGOP_GetNumPic(EvoObjID idGOP, unsigned *num)
EvoRC EvoGOP_GetHeadDir(EvoObjID idGOP, EvoHeadDir *heading)
EvoRC EvoFAVE_Init_GIC(EvoObjID idFAVE, const char *ccode, const char *dnnDevDesc, EvoObjID idDev, unsigned idxDS)
EvoRC EvoGIC_Admin_GetDevSerialNo(EvoObjID idAdmin, char *buf, unsigned len)
Engine's Output Configurations.
Definition Basic.h:301
EvoBool headDir
Definition Basic.h:305
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
int main(int argc, char *argv[])
{
const char *imgPath = NULL;
const char *calibName = NULL;
const char *dataDir = NULL;
if (argc < 3)
{
fprintf(stderr, "%s [sdk_data_dir] camera_calib_name image_file\n", argv[0]);
return EXIT_FAILURE;
}
else if (argc == 3)
{
calibName = argv[1];
imgPath = argv[2];
}
else
{
dataDir = argv[1];
calibName = argv[2];
imgPath = argv[3];
}
int idSSE;
int idFisheyeModel;
assert(rc == EVORC_OK);
assert(idFisheyeModel >= 0);
assert(idSSE >= 0);
assert(rc == EVORC_OK);
int idLPI;
int idPic;
assert(idPic >= 0);
assert(rc == EVORC_OK);
assert(rc == EVORC_OK);
if (idLPI >= 0)
{
unsigned numLPs;
assert(rc == EVORC_OK);
for (unsigned i = 0; i < numLPs; i++)
{
char bufCP[512] = { 0 };
char bufUTF8[512] = { 0 };
assert(rc == EVORC_OK);
assert(rc == EVORC_OK);
#ifdef _WIN64
assert (rc == EVORC_OK);
fprintf(stdout, "\n%s\n", bufCP);
#else
fprintf(stdout, "\n%s\n", bufUTF8);
#endif
assert(rc == EVORC_OK);
fprintf(stdout,
" --> Position: %d, %d, %d, %d\n", bbox.
x, bbox.
y, bbox.
width, bbox.
height);
float confidence;
assert(rc == EVORC_OK);
fprintf(stdout, " --> Type: %d (%.2f%%)\n", type, confidence);
}
assert(idLPI < 0);
}
assert(rc == EVORC_OK);
assert(idPic < 0);
assert(idSSE < 0);
assert(idFisheyeModel < 0);
return EXIT_SUCCESS;
}
EvoObjID EvoSSE_Run_ImgData(EvoObjID idSSE, const EvoImage *data)
EvoObjID EvoCC_Fisheye_Create(const char *calibName)
EvoRC EvoPic_GetImage(EvoObjID idPic, EvoImage *img)
EvoObjID EvoCC_Fisheye_Rectify_ImgFile(EvoObjID idFisheye, const char *imgPath)
Image Descriptor.
Definition Basic.h:510