Documentation - C API
liop.h File Reference

Local Intensity Order Pattern descriptor (Local Intensity Order Pattern descriptor) More...

#include "generic.h"
#include "mathop.h"
#include "imopv.h"

Data Structures

struct  VlLiopBin
 LIOP bin A bin of a LIOP descriptor. More...
struct  VlLiopDesc
 LIOP Descriptor settings. More...

Functions

Construct and destroy
VlLiopDescvl_liopdesc_new (vl_int neighbours, vl_int bins, float radius, float threshold, vl_size patchSideLength)
 Create a new object instance.
VlLiopBinvl_liopbin_new (vl_uindex *binIndexes, vl_size binSize, float *binLiop, vl_size binLiopSize)
 Create a new object instance.
void vl_liopdesc_delete (VlLiopDesc *self)
 Delete object instance.
void vl_liopbin_delete (VlLiopBin *bin)
 Delete object instance.
Compute LIOP descriptor
void compute_liop_descriptor (VlLiopDesc *liop, float *patch, float *desc)
 Compute liop descriptor for a patch.
void compute_bin_liop_descriptor (VlLiopDesc *liop, VlLiopBin *bin, float *patch)
 Compute one bin of LIOP descriptor.
void get_intensities_of_neighbours (float *intensities, float *patch, VlLiopDesc *liop, float x, float y)
 Get intensities of neighbours.
Sorting
void stable_indexes_qsort (float *array, vl_uindex *indexes, vl_uindex begin, vl_uindex end)
 Stable quick sort (sort only indexes, not the array of values)
void qsort_swap (vl_uindex *array, vl_uindex index1, vl_uindex index2)
 Quick sort swap (swap only indexes, not array values)
Other functions
vl_int get_permutation_index (vl_uindex *permutation, vl_size size)
 Compute permutation index.
float interpolate (float *patch, vl_int sideLength, float x, float y)
 Compute 4 point linear interpolation.
vl_int factorial (int num)
 Compute factorial of a number.
void get_coordinates (vl_int a, vl_int pos, float *x, float *y)
 Get coordinates (the patch center has coordinates [0,0])
vl_uindex get_vector_position (vl_int a, float x, float y)
 Get position of a point in the patch vector.
void rotate_vector (float alpha, float *x, float *y)
 Rotate vector.
float get_weight (float *intensities, vl_size size, float threshold)
 Get weight of a particular group of intensities.
float find_weight_threshold (float *data, vl_size length)
 Find weight threshold according to data range.
Reshape patch to a circle
vl_intcompute_circle_look_up_table (vl_int radius, vl_int sideLength)
 Compute circle look up table.
void compute_inner_patch_indexes (VlLiopDesc *self, vl_int length, vl_int radius)
 Get indexes that will be used for descriptor computation (inner circle of the patch)

Detailed Description

Author:
Hana Sarbortova

Function Documentation

void compute_bin_liop_descriptor ( VlLiopDesc self,
VlLiopBin bin,
float *  patch 
)
Parameters:
selfobject instance
binobject instance
patchpatch to process
vl_int* compute_circle_look_up_table ( vl_int  radius,
vl_int  sideLength 
)
Parameters:
radiuscircle radius
sideLengthpatch side length
Returns:
array of length sideLength with number of pixels that are outside of the circle but still in the patch. Each alement is for one column of a half of the patch.
void compute_inner_patch_indexes ( VlLiopDesc self,
vl_int  length,
vl_int  radius 
)
Parameters:
lengthpatch side length
radiusradius of the inner circle
void compute_liop_descriptor ( VlLiopDesc self,
float *  patch,
float *  desc 
)
Parameters:
selfobject instance
patchpatch to process
descdescriptor to be computed
vl_int factorial ( int  num)
Parameters:
numnumber
Returns:
factorial of the number
float find_weight_threshold ( float *  data,
vl_size  length 
)
Parameters:
dataintensity values
lengthlength of the data array
Returns:
threshold
void get_coordinates ( vl_int  sideLength,
vl_int  pos,
float *  x,
float *  y 
)
Parameters:
sideLengthpatch side length
posposition in the patch vector
xx coordinate
yy coordinate
void get_intensities_of_neighbours ( float *  intensities,
float *  patch,
VlLiopDesc self,
float  x,
float  y 
)
Parameters:
intensitiesarray of neighbours' intensities
patchpatch to process
selfobject instance
xx coordinate of the point X to be processed
yy coordinate of the point X to be processed
vl_int get_permutation_index ( vl_uindex permutation,
vl_size  size 
)
Parameters:
permutationarray containing all values from 0 to (size - 1)
sizesize of the permutation array
Returns:
permutation index

Compute a unique index of a particular permutation without comparing arrays. Let's consider permutation array containing numbers from 1 to 4. The lowest index 0 has permutation [1 2 3 4], 1 [1 2 4 3], 2 [1 3 2 4], 3 [1 3 4 2] ,... and the highest (size - 1) [4 3 2 1]

vl_uindex get_vector_position ( vl_int  sideLength,
float  x,
float  y 
)
Parameters:
sideLengthpatch side length
xx coordinate
yy coordinate
Returns:
position in the patch vector
float get_weight ( float *  intensities,
vl_size  size,
float  threshold 
)
Parameters:
intensitiesarray of intensities
sizesize of the intensities array
thresholdthreshold (minimum difference between intensities that should be considered as large enough for increasing weight)
Returns:
weight
float interpolate ( float *  patch,
vl_int  sideLength,
float  x,
float  y 
)
Parameters:
patchpatch to process
sideLengthpatch side length
xx coordinate
yy coordinate
Returns:
interpolated intensity value
void qsort_swap ( vl_uindex array,
vl_uindex  index1,
vl_uindex  index2 
)
Parameters:
arrayarray of values
index1first index to be swaped
index2second index to be swaped
void rotate_vector ( float  alpha,
float *  x,
float *  y 
)
Parameters:
alphaangle of rotation
xfirst element of the vector
ysecond element of the vector
void stable_indexes_qsort ( float *  array,
vl_uindex indexes,
vl_uindex  begin,
vl_uindex  end 
)
Parameters:
arrayarray of values
indexesindexes to values of array that should be used for sorting
beginfirst index of the array of indexes
endlast index of the array of indexes
void vl_liopbin_delete ( VlLiopBin bin)
Parameters:
binobject instance
VlLiopBin* vl_liopbin_new ( vl_uindex binIndexes,
vl_size  binSize,
float *  binLiop,
vl_size  binLiopSize 
)
Parameters:
binIndexespatch indexes of points belonging to the bin
binSizenumber of points belonging to the bin
binLiopbin liop descriptor
binLiopSizesize of the bin liop descriptor
Returns:
void vl_liopdesc_delete ( VlLiopDesc self)
Parameters:
selfobject instance
VlLiopDesc* vl_liopdesc_new ( vl_int  neighbours,
vl_int  bins,
float  radius,
float  threshold,
vl_size  sideLength 
)
Parameters:
neighboursnumber of neighbours
binsnumber of bins
radiusradius between a point and it's neighbours
thresholdweighting threshold
sideLengthpatch side length
Returns:
new liop descriptor settings