Code for performing image segmentation (object boundary detection) using the PC/BC-DIM model of V1 with lateral connections.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mwspratling 3f277bd7b5
1st release Oct 2012
2 months ago
LICENSE 1st release Oct 2012 2 months ago
README.md 1st release Oct 2012 2 months ago
berkeley_benchmark.m 1st release Oct 2012 2 months ago
berkeley_benchmark_multicore.m 1st release Oct 2012 2 months ago
berkeley_benchmark_multicore_task.m 1st release Oct 2012 2 months ago
berkeley_benchmark_multiscale_multicore.m 1st release Oct 2012 2 months ago
berkeley_benchmark_multiscale_multicore_task.m 1st release Oct 2012 2 months ago
berkeley_benchmark_postprocess.m 1st release Oct 2012 2 months ago
compare_gabor_and_dim.m 1st release Oct 2012 2 months ago
dim_activation_conv_recurrent.m 1st release Oct 2012 2 months ago
filter_definitions_LGN.m 1st release Oct 2012 2 months ago
filter_definitions_V1_edge_recon.m 1st release Oct 2012 2 months ago
filter_definitions_V1_recurrent.m 1st release Oct 2012 2 months ago
filter_definitions_V1_simple_diffGauss.m 1st release Oct 2012 2 months ago
gabor2D.m 1st release Oct 2012 2 months ago
gauss2D.m 1st release Oct 2012 2 months ago
global_parameters.m 1st release Oct 2012 2 months ago
iszero.m 1st release Oct 2012 2 months ago
maxsubplot.m 1st release Oct 2012 2 months ago
odd.m 1st release Oct 2012 2 months ago
plot_cropped_image.m 1st release Oct 2012 2 months ago
plot_integration_field.m 1st release Oct 2012 2 months ago
preprocess_V1_input.m 1st release Oct 2012 2 months ago
reconstruct_edges.m 1st release Oct 2012 2 months ago
reconstruct_edges_multiscale.m 1st release Oct 2012 2 months ago
test_edge_detection.m 1st release Oct 2012 2 months ago
test_edge_detection_multiscale.m 1st release Oct 2012 2 months ago
test_edge_detection_temporal.m 1st release Oct 2012 2 months ago
v1_edge_detection.m 1st release Oct 2012 2 months ago

README.md

This code implements the simulation results reported in:

M. W. Spratling (2013) Image Segmentation Using a Sparse Coding Model of Cortical Area V1. IEEE Transactions on Image Processing, 22(4):1631-43.

Please cite this paper if this code is used in, or to motivate, any publications.


USAGE


This code requires MATLAB and the Image Processing Toolbox. It was tested with MATLAB Version 7.8 (R2009a) and Image Processing Toolbox Version 6.3 (R2009a).

Simulations will run much faster if you install the MATLAB function convnfft written by Bruno Luong, which is available here: http://www.mathworks.com/matlabcentral/fileexchange/24504-fft-based-convolution

To apply the PC/BC model to an image, do the following:

%LOAD THE IMAGE
I=im2single(imread('file.pgm'));

%PRE-PROCESS IMAGE TO GENERATE INPUT TO V1 MODEL
X=preprocess_V1_input(I);

%APPLY PC/BC OF V1 TO THE IMAGE
[y,s,r]=v1_edge_detection(X);

The outputs are a cell array, y, containing the activations of the prediction neurons; a scalar, s, giving Hoyer's sparsity index for the prediction neuron activations; and, a reconstruction, r, of the boundary edges in the image.

To apply the algorithm to the BSDS300 dataset, you will need to install the images and code for performing this benchmark, both of which are available here: http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/segbench/

Function berkeley_benchmark.m (with the paths edited appropriately) will apply the PC/BC algorithm to this benchmark. Alternatively, to speed things up benchmarking can be performed in parallel across multiple CPU cores using the function berkeley_benchmark_multicore.m together with the code written by Markus Buehren, which is available here: http://www.mathworks.com/matlabcentral/fileexchange/13775-multicore-parallel-processing-on-multiple-cores