This block constructs an SVM kernel on two sets of segment ids or segment ids and superpixel ids.

BK = BLOCK_KER() Initializes the block with the default options.

BK = BLOCK_KER(BK) Executes the block with options and inputs BK.

Required Inputs:

- hist
Histograms or superpixel histograms.

Options:

- bk.kernel
The type of kernel to use. The following are supported:

L2 - k(x,y) = sum x .* y L1 - k(p,q) = sum min(p,q) CHI2 - k(p,q) = sum 2 (p.*q) / (p+q) HELL - k(p,q) = sum sqrt(p.*q) / 4

DL2 - k(x,y) = sum (x-y).^2 DL1 - k(p,q) = sum |p-q| DCHI2 - k(p,q) = sum (p-q).^2 / (p+q) DHELL - k(p,q) = sum (p.^.5 - q.^.5).^2 / 4

Here p,q denote non-negative vectors, usually l1 normalized (histograms). Notice that DL2, DL1, DCHI2 and DHELL are not kernels, but the corresponding metrics (this is useful to construct RBF kernels). See also KERNEL_FUNCTION() and VL_ALLDIST2(). This parameter is required and there is no default.

- bk.normalize
Normalize the data by the specified norm (L1, L2, ...) before computing the kernel. See also KERNEL_FUNCTION(). This parameter is required and there is no default.

- bk.row_seg_ids
The seg_ids of the rows of the kernel matrix. If use_segs and seg_neighbors are set, row_seg_ids is a Nx2 matrx, where the first column denotes the seg_id and the second column denotes the superpixel.

- bk.col_seg_ids
The seg_ids of the columns of the kernel matrix. If use_segs and seg_neighbors are set, col_seg_ids is a Nx2 matrx, where the first column denotes the seg_id and the second column denotes the superpixel.

- bk.use_segs
Use superpixel neighborhoods.

- bk.seg_neighbors
The size of the neighborhood to use. If this parameter is ommited, even if bk.use_segs is true, segs will not be used.

- bk.split
Split the job into a number of subtasks. 0 disables splitting.