Anonymizer  6.0.1
SDK for anonymization of human faces and licence plates in images.
Anonymizer API

Anonymizer library interface for image anonymization. More...

Typedefs

typedef int(* fcn_anInit) (const char *, const char *, ANState *)
 anInit function pointer More...
 
typedef void(* fcn_anFree) (ANState)
 anFree function pointer More...
 
typedef int(* fcn_anAnonymize) (const char *, const char *, AnParams *, ANState)
 anAnonymize function pointer More...
 
typedef int(* fcn_anAnonymizeImageBuffer) (AnBuffer, int, int, AnParams *, ANState, AnBuffer *)
 anAnonymizeImageBuffer function pointer More...
 
typedef void(* fcn_anFreeBuffer) (AnBuffer buffer)
 anFreeBuffer function pointer More...
 
typedef int(* fcn_anAnonymizeJpegBuffer) (AnBuffer, AnParams *, ANState, AnBuffer *)
 anAnonymizeJpegBuffer function pointer More...
 
typedef void(* fcn_anGetDefaultParams) (AnParams *)
 anGetDefaultParams function pointer More...
 
typedef const char *(* fcn_anVersion) (int)
 anVersion function pointer More...
 
typedef const char *(* fcn_anGetErrorMsg) (int)
 anGetErrorMsg function pointer More...
 

Functions

ER_FUNCTION_PREFIX int anInit (const char *sdk_directory, const char *ini_filename, ANState *state)
 Initializes/loads Anonymizer engine. More...
 
ER_FUNCTION_PREFIX void anFree (ANState state)
 Frees engine state structure. More...
 
ER_FUNCTION_PREFIX int anAnonymize (const char *src_image_filename, const char *dst_image_filename, AnParams *params, ANState state)
 Load image from image file and process the anonymization. Result save as a jpeg image. More...
 
ER_FUNCTION_PREFIX int anAnonymizeImageBuffer (AnBuffer srcBuffer, unsigned int width, unsigned int height, AnParams *params, ANState state, AnBuffer *dstBuffer)
 Processes image data buffer, i.e. detects and blurs faces and license plates. More...
 
ER_FUNCTION_PREFIX void anFreeBuffer (AnBuffer buffer)
 Frees the image buffer filled by Anonymizer SDK functions. More...
 
ER_FUNCTION_PREFIX int anAnonymizeJpegBuffer (AnBuffer srcBuffer, AnParams *params, ANState state, AnBuffer *dstBuffer)
 Processes the JPEG image buffer, i.e. detects and blurs faces and license plates. More...
 
ER_FUNCTION_PREFIX int anGetDefaultParams (AnParams *parameters)
 Fill AnParams structure with default values. More...
 
ER_FUNCTION_PREFIX const char * anVersion (int verbose)
 Get Anonymizer version string. More...
 
ER_FUNCTION_PREFIX const char * anGetErrorMsg (int ern)
 Return error message for suplied error code. More...
 

Detailed Description

Anonymizer library interface for image anonymization.

Anonymizer library is secured by Sentinel HASP secure solution and thus can't be linked implicitly (via MSVC project, Makefile) in client's software. The library must be linked explicitly at runtime. Thus all library functions has also its function pointers type definitions for easier implementation on a client side.

See Explicit linking, example-files.cpp, example-buffers.cpp

Typedef Documentation

typedef int(* fcn_anAnonymize) (const char *, const char *, AnParams *, ANState)

anAnonymize function pointer

See also
anAnonymize
Examples:
example-files.cpp.

Definition at line 151 of file Anonymizer.h.

typedef int(* fcn_anAnonymizeImageBuffer) (AnBuffer, int, int, AnParams *, ANState, AnBuffer *)

anAnonymizeImageBuffer function pointer

See also
anAnonymizeImageBuffer
Examples:
example-buffers.cpp.

Definition at line 175 of file Anonymizer.h.

typedef int(* fcn_anAnonymizeJpegBuffer) (AnBuffer, AnParams *, ANState, AnBuffer *)

anAnonymizeJpegBuffer function pointer

See also
anAnonymizeJpegBuffer
Examples:
example-buffers.cpp.

Definition at line 206 of file Anonymizer.h.

typedef void(* fcn_anFree) (ANState)

anFree function pointer

See also
anFree
Examples:
example-buffers.cpp, and example-files.cpp.

Definition at line 130 of file Anonymizer.h.

typedef void(* fcn_anFreeBuffer) (AnBuffer buffer)

anFreeBuffer function pointer

See also
anFreeBuffer
Examples:
example-buffers.cpp.

Definition at line 186 of file Anonymizer.h.

typedef void(* fcn_anGetDefaultParams) (AnParams *)

anGetDefaultParams function pointer

See also
anGetDefaultParams
Returns
Zero on success, error code on failure.

Definition at line 220 of file Anonymizer.h.

typedef const char*(* fcn_anGetErrorMsg) (int)

anGetErrorMsg function pointer

See also
anGetErrorMsg
Examples:
example-buffers.cpp, and example-files.cpp.

Definition at line 239 of file Anonymizer.h.

typedef int(* fcn_anInit) (const char *, const char *, ANState *)

anInit function pointer

See also
anInit
Examples:
example-buffers.cpp, and example-files.cpp.

Definition at line 120 of file Anonymizer.h.

typedef const char*(* fcn_anVersion) (int)

anVersion function pointer

See also
anVersion
Examples:
example-buffers.cpp, and example-files.cpp.

Definition at line 229 of file Anonymizer.h.

Function Documentation

ER_FUNCTION_PREFIX int anAnonymize ( const char *  src_image_filename,
const char *  dst_image_filename,
AnParams params,
ANState  state 
)

Load image from image file and process the anonymization. Result save as a jpeg image.

Main function for anonymization. Function loads image from a file, run anonymization engine and save the anonymized image as jpeg file. Function return 0 on success or error code.

Parameters
[in]src_image_filenameInput image filename.
[in]dst_image_filenameOutput image filename (jpeg).
[in]paramsPointer to anonymization parameters, if NULL default values are used.
[in]stateAnonymizer state, for state initalization see anInit function.
Returns
Zero on success, error code on failure.
See also
example-files.cpp
ER_FUNCTION_PREFIX int anAnonymizeImageBuffer ( AnBuffer  srcBuffer,
unsigned int  width,
unsigned int  height,
AnParams params,
ANState  state,
AnBuffer dstBuffer 
)

Processes image data buffer, i.e. detects and blurs faces and license plates.

Main function for anonymization. Function takes as an input parameter raw image data aligned row by row and run anonymization engine. The anonymized image is returned in ouput parmeter in format of input data. Output data buffer (dstBuffer) has to be freed! Call anFreeBuffer(dstBuffer) when you finish job.

Parameters
[in]srcBufferInput structure with BGR data buffer - row-wise, 3 bytes (uchar) per pixel; index = 3*col + row*3*width
[in]widthImage width
[in]heightImage height
[in]paramsPointer to anonymization parameters, if NULL default values are used.
[in]stateAnonymizer state, for state initalization see anInit function.
[out]dstBufferAnonymized data buffer (BGR). Call anFreeBuffer() to free buffer.
Returns
Zero on success, error code on failure.
See also
example-buffers.cpp
ER_FUNCTION_PREFIX int anAnonymizeJpegBuffer ( AnBuffer  srcBuffer,
AnParams params,
ANState  state,
AnBuffer dstBuffer 
)

Processes the JPEG image buffer, i.e. detects and blurs faces and license plates.

Main function for anonymization. Function takes as an input parameter JPEG image buffer (compressed data) which anonymize. The anonymized image is returned in ouput parameter also as JPEG image buffer. Function return 0 on success or error code.

Parameters
[in]srcBufferAnBuffer structure with input JPEG buffer.
[in]paramsPointer to anonymization parameters, if NULL default values are used.
[in]stateAnonymizer state, for state initalization see anInit function.
[out]dstBufferPointer to AnBuffer structure full filled with anonymized JPEG buffer. Call anFreeBuffer() to free the buffer data.
Returns
Zero on success, error code on failure.
See also
example-buffers.cpp
ER_FUNCTION_PREFIX void anFree ( ANState  state)

Frees engine state structure.

Parameters
[in]stateAnonymizer state, for state initalization see anInit function.
ER_FUNCTION_PREFIX void anFreeBuffer ( AnBuffer  buffer)

Frees the image buffer filled by Anonymizer SDK functions.

Frees memory previously allocated by anAnonymizeImageBuffer or anAnonymizeJpegBuffer functions.

Parameters
bufferAnBuffer structure.
ER_FUNCTION_PREFIX int anGetDefaultParams ( AnParams parameters)

Fill AnParams structure with default values.

Fill AnParams structure with default values. Pass pointer to static or dynamically allocated AnParams structure to be filled with default values.

Parameters
[out]parametersPointer to AnParams structure.
Returns
Zero on success, error code on failure.
ER_FUNCTION_PREFIX const char* anGetErrorMsg ( int  ern)

Return error message for suplied error code.

Note
anGetErrorMsg function is not thread safe. Concurrent call can lead to missinterpreted error codes.
ER_FUNCTION_PREFIX int anInit ( const char *  sdk_directory,
const char *  ini_filename,
ANState state 
)

Initializes/loads Anonymizer engine.

anInit is the initialization function which loads and set-ups all detections models. Input parameters of the function are path to "modules" directory of Anonymizer SDK which contains configuration files and directory detection models and config filename. Function returns zero on success or error code otherwise.

Parameters
[in]sdk_directoryPath of the AnonymizeSDK.
[in]ini_filenameConfig file name (if NULL, default "config.ini" is used)
[out]statepointer to ANState module handle.
Returns
Zero on success, error code on failure.
ER_FUNCTION_PREFIX const char* anVersion ( int  verbose)

Get Anonymizer version string.

Parameters
verboseVerbosity flag.