Anonymizer  7.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 *, const AnConfig *, 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 int(* fcn_anAnonymizeJpegBuffer) (AnBuffer, AnParams *, ANState, AnBuffer *)
 anAnonymizeJpegBuffer function pointer More...
 
typedef void(* fcn_anFreeBuffer) (AnBuffer buffer)
 anFreeBuffer function pointer More...
 
typedef int(* fcn_anGetDefaultParams) (AnParams *)
 anGetDefaultParams function pointer More...
 
typedef int(* fcn_anPlotLayouts) (ANState, const char *, AnObjectType)
 anGetErrorMsg function pointer More...
 

Functions

ER_FUNCTION_PREFIX int anInit (const char *sdk_directory, const char *ini_filename, const AnConfig *config, 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)
 Anonymization function for image file to jpeg file. More...
 
ER_FUNCTION_PREFIX int anAnonymizeImageBuffer (AnBuffer src_buffer, unsigned int width, unsigned int height, AnParams *params, ANState state, AnBuffer *dst_buffer)
 Anonymization function for RAW image buffer to RAW image buffer. More...
 
ER_FUNCTION_PREFIX int anAnonymizeJpegBuffer (AnBuffer src_buffer, AnParams *params, ANState state, AnBuffer *dst_buffer)
 JPEG buffer anonymization API function. More...
 
ER_FUNCTION_PREFIX void anFreeBuffer (AnBuffer buffer)
 Frees the image buffer filled by Anonymizer SDK functions. More...
 
ER_FUNCTION_PREFIX int anGetDefaultParams (AnParams *parameters)
 Fill AnParams structure with default values. More...
 
const ER_FUNCTION_PREFIX char * anVersion (int verbose)
 Get Anonymizer version string. More...
 
const ER_FUNCTION_PREFIX char * anGetErrorMsg (int ern)
 Return error message for suplied error code. More...
 
ER_FUNCTION_PREFIX int anPlotLayouts (ANState state, const char *image_filename, AnObjectType type)
 Print colorized tiles for current layouts into an image. More...
 

Variables

const typedef char *(* fcn_anVersion )(int)
 anVersion function pointer More...
 
const typedef char *(* fcn_anGetErrorMsg )(int)
 anGetErrorMsg function pointer 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 171 of file Anonymizer.h.

◆ fcn_anAnonymizeImageBuffer

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

anAnonymizeImageBuffer function pointer

See also
anAnonymizeImageBuffer
Examples
example-buffers.cpp.

Definition at line 198 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 220 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 150 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 233 of file Anonymizer.h.

◆ fcn_anGetDefaultParams

typedef int(* fcn_anGetDefaultParams) (AnParams *)

anGetDefaultParams function pointer

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

Definition at line 249 of file Anonymizer.h.

◆ fcn_anInit

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

anInit function pointer

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

Definition at line 140 of file Anonymizer.h.

◆ fcn_anPlotLayouts

typedef int(* fcn_anPlotLayouts) (ANState, const char *, AnObjectType)

anGetErrorMsg function pointer

See also
anGetErrorMsg

Definition at line 286 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 
)

Anonymization function for image file to jpeg file.

Main function for anonymization. Function loads image from a file, run anonymization engine and save the anonymized image as jpeg file.

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  src_buffer,
unsigned int  width,
unsigned int  height,
AnParams params,
ANState  state,
AnBuffer dst_buffer 
)

Anonymization function for RAW image buffer to RAW image buffer.

Main function for anonymization. This function takes as an input parameter raw image data aligned row by row and runs the anonymization engine. The anonymized image is returned in the output parameter in the format of the input data. The output data buffer (dst_buffer) must be freed by calling anFreeBuffer(dst_buffer) when done.

Parameters
[in]src_bufferInput 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 initialization, see anInit function.
[out]dst_bufferAnonymized data buffer (BGR). Call anFreeBuffer to free the buffer.
Returns
Zero on success, or an error code on failure.
See also
example-buffers.cpp

◆ anAnonymizeJpegBuffer()

ER_FUNCTION_PREFIX int anAnonymizeJpegBuffer ( AnBuffer  src_buffer,
AnParams params,
ANState  state,
AnBuffer dst_buffer 
)

JPEG buffer anonymization API function.

This function processes a JPEG image buffer by detecting and blurring faces and license plates. The input is a JPEG image buffer (compressed data), and the anonymized image is returned in the output parameter, also as a JPEG image buffer.

Parameters
[in]src_bufferAn AnBuffer structure containing the input JPEG buffer.
[in]paramsPointer to anonymization parameters. If NULL, default values are used.
[in]stateAnonymizer state. For state initialization, see anInit function.
[out]dst_bufferPointer to an AnBuffer structure that will be filled with the anonymized JPEG buffer. Call anFreeBuffer to free the buffer data.
Returns
Zero on success, or an 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.

This function frees memory previously allocated by the anAnonymizeImageBuffer or anAnonymizeJpegBuffer functions.

Parameters
bufferAn AnBuffer structure containing the buffer to be freed.

◆ anGetDefaultParams()

ER_FUNCTION_PREFIX int anGetDefaultParams ( AnParams parameters)

Fill AnParams structure with default values.

This function initializes an AnParams structure with default values. The caller must provide a pointer to an AnParams structure, which can be either statically or dynamically allocated.

Parameters
[out]parametersPointer to an AnParams structure that will be filled with default values.
Returns
Zero on success, or an error code on failure.

◆ anGetErrorMsg()

const ER_FUNCTION_PREFIX 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.

◆ anInit()

ER_FUNCTION_PREFIX int anInit ( const char *  sdk_directory,
const char *  ini_filename,
const AnConfig config,
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)
[in]configConfiguration structure for Anonymizer detection modules initialization (if NULL defaults from *.ini are used)
[out]statepointer to ANState module handle.
Returns
Zero on success, error code on failure.

◆ anPlotLayouts()

ER_FUNCTION_PREFIX int anPlotLayouts ( ANState  state,
const char *  image_filename,
AnObjectType  type 
)

Print colorized tiles for current layouts into an image.

For a given detection object, this function prints colorized tiles used for detection. Saved images are named by object type and suffixed with the name of the detection module detecting the object (as defined in the .ini files) and layout parameters. Multiple images per object can be saved, depending on the configuration.

Parameters
[in]stateAnonymizer state. For state initialization, see anInit function.
[in]image_filenameInput image filename.
[in]typeDetection object type.
See also
AnObjectType
Returns
Zero on success, or an error code on failure.

◆ anVersion()

const ER_FUNCTION_PREFIX char* anVersion ( int  verbose)

Get Anonymizer version string.

Parameters
verboseVerbosity flag.

Variable Documentation

◆ fcn_anGetErrorMsg

const typedef char*(* fcn_anGetErrorMsg) (int)

anGetErrorMsg function pointer

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

Definition at line 268 of file Anonymizer.h.

◆ fcn_anVersion

const typedef char*(* fcn_anVersion) (int)

anVersion function pointer

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

Definition at line 258 of file Anonymizer.h.