Anonymizer  5.0.0
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 *)
 anAnonymizeBuffer 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 jpeg 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 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. 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

◆ fcn_anAnonymize

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

anAnonymize function pointer

See also
anAnonymize
Examples:
example-files.cpp.

Definition at line 150 of file Anonymizer.h.

◆ fcn_anAnonymizeImageBuffer

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

anAnonymizeBuffer function pointer

See also
anAnonymizeBuffer
Examples:
example-buffers.cpp.

Definition at line 174 of file Anonymizer.h.

◆ fcn_anAnonymizeJpegBuffer

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

anAnonymizeJpegBuffer function pointer

See also
anAnonymizeJpegBuffer
Examples:
example-buffers.cpp.

Definition at line 205 of file Anonymizer.h.

◆ fcn_anFree

typedef void(* fcn_anFree) (ANState)

anFree function pointer

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

Definition at line 129 of file Anonymizer.h.

◆ fcn_anFreeBuffer

typedef void(* fcn_anFreeBuffer) (AnBuffer buffer)

anFreeBuffer function pointer

See also
anFreeBuffer
Examples:
example-buffers.cpp.

Definition at line 185 of file Anonymizer.h.

◆ fcn_anGetDefaultParams

typedef void(* fcn_anGetDefaultParams) (AnParams *)

anGetDefaultParams function pointer

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

Definition at line 219 of file Anonymizer.h.

◆ fcn_anGetErrorMsg

typedef const char*(* fcn_anGetErrorMsg) (int)

anGetErrorMsg function pointer

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

Definition at line 238 of file Anonymizer.h.

◆ fcn_anInit

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 119 of file Anonymizer.h.

◆ fcn_anVersion

typedef const char*(* fcn_anVersion) (int)

anVersion function pointer

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

Definition at line 228 of file Anonymizer.h.

Function Documentation

◆ anAnonymize()

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

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

Main function for anonymization. Function loads a jpeg 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

◆ anAnonymizeImageBuffer()

ER_FUNCTION_PREFIX int anAnonymizeImageBuffer ( AnBuffer  srcBuffer,
unsigned int  width,
unsigned int  height,
AnParams params,
ANState  state,
AnBuffer dstBuffer 
)

Processes image 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 (ppDstData) has to be freed! Call anFreeBuffer(*ppDstData) 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

◆ anAnonymizeJpegBuffer()

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

◆ anFree()

ER_FUNCTION_PREFIX void anFree ( ANState  state)

Frees engine state structure.

Parameters
[in]stateAnonymizer state, for state initalization see anInit function.

◆ anFreeBuffer()

ER_FUNCTION_PREFIX void anFreeBuffer ( AnBuffer  buffer)

Frees the image buffer filled by Anonymizer SDK functions.

Frees memory previously allocated by anAnonymizeBuffer or anAnonymizeJpegBuffer functions.

Parameters
bufferAnBuffer structure.

◆ anGetDefaultParams()

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.

◆ anGetErrorMsg()

ER_FUNCTION_PREFIX const char* anGetErrorMsg ( int  ern)

Return error message.

Note
anGetErrorMsg function is not thread safe. Concurrent call can lead to missinterpreted error codes.

◆ anInit()

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. Function return a pointer to the Anonymizer state or NULL on failure. Function sets the errno variable.

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.

◆ anVersion()

ER_FUNCTION_PREFIX const char* anVersion ( int  verbose)

Get Anonymizer version string.

Parameters
verboseVerbosity flag.