Documentation>C API
quickshift.c File Reference

Quick shift - Definition. More...

#include "quickshift.h"
#include "mathop.h"
#include <string.h>
#include <math.h>
#include <stdio.h>

Functions

vl_qs_type vl_quickshift_distance (vl_qs_type const *I, int N1, int N2, int K, int i1, int i2, int j1, int j2)
 Computes the accumulated channel L2 distance between i,j + the distance between i,j. More...
 
vl_qs_type vl_quickshift_inner (vl_qs_type const *I, int N1, int N2, int K, int i1, int i2, int j1, int j2)
 Computes the accumulated channel inner product between i,j + the distance between i,j. More...
 
VlQSvl_quickshift_new (vl_qs_type const *image, int height, int width, int channels)
 Create a quick shift object. More...
 
void vl_quickshift_process (VlQS *q)
 Create a quick shift objet. More...
 
void vl_quickshift_delete (VlQS *q)
 Delete quick shift object. More...
 

Detailed Description

Author
Brian Fulkerson
Andrea Vedaldi

Function Documentation

◆ vl_quickshift_delete()

void vl_quickshift_delete ( VlQS q)
Parameters
qquick shift object.

◆ vl_quickshift_distance()

vl_qs_type vl_quickshift_distance ( vl_qs_type const *  I,
int  N1,
int  N2,
int  K,
int  i1,
int  i2,
int  j1,
int  j2 
)
inline
Parameters
Iinput image buffer
N1size of the first dimension of the image
N2size of the second dimension of the image
Knumber of channels
i1first dimension index of the first pixel to compare
i2second dimension of the first pixel
j1index of the second pixel to compare
j2second dimension of the second pixel

Takes the L2 distance between the values in I at pixel i and j, accumulating along K channels and adding in the distance between i,j in the image.

Returns
the distance as described above

◆ vl_quickshift_inner()

vl_qs_type vl_quickshift_inner ( vl_qs_type const *  I,
int  N1,
int  N2,
int  K,
int  i1,
int  i2,
int  j1,
int  j2 
)
inline
Parameters
Iinput image buffer
N1size of the first dimension of the image
N2size of the second dimension of the image
Knumber of channels
i1first dimension index of the first pixel to compare
i2second dimension of the first pixel
j1index of the second pixel to compare
j2second dimension of the second pixel

Takes the channel-wise inner product between the values in I at pixel i and j, accumulating along K channels and adding in the inner product between i,j in the image.

Returns
the inner product as described above

◆ vl_quickshift_new()

VlQS* vl_quickshift_new ( vl_qs_type const *  image,
int  height,
int  width,
int  channels 
)
Parameters
imagethe image.
heightthe height (number of rows) of the image.
widththe width (number of columns) of the image.
channelsthe number of channels of the image.
Returns
new quick shift object.

The image is an array of vl_qs_type values with three dimensions (respectively widht, height, and channels). Typically, a color (e.g, RGB) image has three channels. The linear index of a pixel is computed with: channels * width* height + row + height * col.

◆ vl_quickshift_process()

void vl_quickshift_process ( VlQS q)
Parameters
qquick shift object.