Code covered by the BSD License  

Highlights from
Pairwise term for Graphcut

Be the first to rate this file! 13 Downloads (last 30 days) File Size: 1.66 KB File ID: #38522
image thumbnail

Pairwise term for Graphcut

by

 

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

| Watch this File

File Information
Description

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

Required Products Image Processing Toolbox
MATLAB
MATLAB release MATLAB 7.14 (R2012a)
Other requirements Intel® Core™ i7-2600 CPU @ 3.40 Ghz
Tags for This File   Please login to tag files.
Please login to add a comment or rating.

Contact us