File Exchange

image thumbnail

Pairwise term for Graphcut

version 1.0 (1.66 KB) by

Very fast, vectorized code for calculating the pairwise term for algorithms like Graph cuts.

2 Downloads

Updated

View License

This code is inspired by Steve's post on Neighborhood indexing:

http://blogs.mathworks.com/steve/2007/03/28/neighbor-indexing/

Four-connected neighborhood implementing the color difference between adjacent pixels in RGB space as a way to encode to similarity.

1/(norm(I1(:)- I2(:))+1)

Example:

timeit(@() pairwise_term(imread('peppers.png')))

ans =

0.2037

Please obtain the timeit function from here:

http://www.mathworks.com/matlabcentral/fileexchange/18798

Comments and Ratings (0)

MATLAB Release
MATLAB 7.14 (R2012a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video