ailia  1.5.0.0
Macros | Functions
ailia_feature_extractor.h File Reference

AILIA feature extraction library. More...

#include "ailia.h"
#include "ailia_format.h"
Include dependency graph for ailia_feature_extractor.h:

Go to the source code of this file.

Macros

#define AILIA_FEATURE_EXTRACTOR_DISTANCE_L2NORM   (0)
 L2 norm. More...
 

Functions

int AILIA_API ailiaCreateFeatureExtractor (struct AILIAFeatureExtractor **fextractor, struct AILIANetwork *net, unsigned int format, unsigned int channel, unsigned int range, const char *layer_name)
 Creates a feature extraction instance. More...
 
void AILIA_API ailiaDestroyFeatureExtractor (struct AILIAFeatureExtractor *fextractor)
 It destroys the feature extraction instance. More...
 
int AILIA_API ailiaFeatureExtractorCompute (struct AILIAFeatureExtractor *fextractor, void *dst, unsigned int dst_size, const void *src, unsigned int src_stride, unsigned int src_width, unsigned int src_height, unsigned int src_format)
 Performs feature extraction. More...
 
int AILIA_API ailiaFeatureExtractorMatch (struct AILIAFeatureExtractor *fextractor, float *distance, unsigned int distance_type, const void *feature1, unsigned int feature1_size, const void *feature2, unsigned int feature2_size)
 Computes distances in feature space. More...
 

Detailed Description

AILIA feature extraction library.

Date
July 28, 2021

Macro Definition Documentation

◆ AILIA_FEATURE_EXTRACTOR_DISTANCE_L2NORM

#define AILIA_FEATURE_EXTRACTOR_DISTANCE_L2NORM   (0)

L2 norm.

Function Documentation

◆ ailiaCreateFeatureExtractor()

int AILIA_API ailiaCreateFeatureExtractor ( struct AILIAFeatureExtractor **  fextractor,
struct AILIANetwork *  net,
unsigned int  format,
unsigned int  channel,
unsigned int  range,
const char *  layer_name 
)

Creates a feature extraction instance.

Parameters
fextractorA feature extraction instance pointer
netA network instance pointer
formatThe network image format (AILIA_NETWORK_IMAGE_FORMAT_*)
channelThe network image channel (AILIA_NETWORK_IMAGE_CHANNEL_*)
rangeThe network image range (AILIA_NETWORK_IMAGE_RANGE_*)
layer_nameThe name of the layer corresponding to the feature (fc1 for VGG16 and NULL for the last layer)
Returns
If this function is successful, it returns AILIA_STATUS_SUCCESS , or an error code otherwise.

◆ ailiaDestroyFeatureExtractor()

void AILIA_API ailiaDestroyFeatureExtractor ( struct AILIAFeatureExtractor *  fextractor)

It destroys the feature extraction instance.

Parameters
fextractorA feature extraction instance pointer

◆ ailiaFeatureExtractorCompute()

int AILIA_API ailiaFeatureExtractorCompute ( struct AILIAFeatureExtractor *  fextractor,
void *  dst,
unsigned int  dst_size,
const void *  src,
unsigned int  src_stride,
unsigned int  src_width,
unsigned int  src_height,
unsigned int  src_format 
)

Performs feature extraction.

Parameters
fextractorA feature extraction instance pointer
dstA pointer to the storage location of the feature (numeric type)
dst_sizeThe size of the dst (bytes)
srcImage data (32 bpp)
src_strideThe number of bytes in 1 line
src_widthImage width
src_heightImage height
src_formatImage format (AILIA_IMAGE_FORMAT_*)
Returns
If this function is successful, it returns AILIA_STATUS_SUCCESS , or an error code otherwise.

◆ ailiaFeatureExtractorMatch()

int AILIA_API ailiaFeatureExtractorMatch ( struct AILIAFeatureExtractor *  fextractor,
float *  distance,
unsigned int  distance_type,
const void *  feature1,
unsigned int  feature1_size,
const void *  feature2,
unsigned int  feature2_size 
)

Computes distances in feature space.

Parameters
fextractorA feature extraction instance pointer
distanceA distance in feature space
distance_typeThe type of the distance in feature space
feature1A pointer to the storage location of one feature (numeric type)
feature1_sizeThe size of the feature1 (bytes)
feature2A pointer to the storage location of the other feature (numeric type)
feature2_sizeThe size of the feature2 (bytes)
Returns
If this function is successful, it returns AILIA_STATUS_SUCCESS , or an error code otherwise.