public class AiliaFeatureExtractor
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DISTANCE_L2NORM
Deprecated.
Prease use
AiliaFeatureExtractorDistanceType.L2NORM |
| Constructor and Description |
|---|
AiliaFeatureExtractor() |
| Modifier and Type | Method and Description |
|---|---|
static void |
Compute(long handle,
float[] dst,
int dstSize,
byte[] src,
int srcStride,
int srcWidth,
int srcHeight,
int srcFormat)
Performs feature extraction.
|
static long |
Create(long netHandle,
int format,
int channel,
int range,
java.lang.String layerName)
Creates a feature extraction instance.
|
static void |
Destroy(long handle)
It destroys the feature extraction instance.
|
static float |
Match(long handle,
int distanceType,
float[] feature1,
int feature1Size,
float[] feature2,
int feature2Size)
Computes distances in feature space.
|
@Deprecated public static final int DISTANCE_L2NORM
AiliaFeatureExtractorDistanceType.L2NORMpublic static long Create(long netHandle,
int format,
int channel,
int range,
java.lang.String layerName)
throws AiliaException
netHandle - A network instance handleformat - The network image format (AiliaNetworkImageFormat)channel - The network image channel (AiliaNetworkImageChannel)range - The network image range (AiliaNetworkImageRange)layerName - The name of the layer corresponding to the feature (fc1 for VGG16 and NULL for the last layer)AiliaException - Exceptionpublic static void Destroy(long handle)
handle - A feature extraction instance handlepublic static void Compute(long handle,
float[] dst,
int dstSize,
byte[] src,
int srcStride,
int srcWidth,
int srcHeight,
int srcFormat)
throws AiliaException
handle - A feature extraction instance handledst - The feature datadstSize - The size of the dst (in byte)src - Image data (32 bpp)srcStride - The number of bytes in 1 linesrcWidth - Image widthsrcHeight - Image heightsrcFormat - Image format (AiliaImageFormat)AiliaException - Exceptionpublic static float Match(long handle,
int distanceType,
float[] feature1,
int feature1Size,
float[] feature2,
int feature2Size)
throws AiliaException
handle - A feature extraction instance handledistanceType - The type of the distance in feature space AiliaFeatureExtractorDistanceTypefeature1 - The featurefeature1Size - The size of the feature1 (in bytes)feature2 - The other featurefeature2Size - The size of the feature2 (in bytes)AiliaException - Exception