Code covered by the BSD License  

Highlights from
Efficient Graph based image segmentation

Be the first to rate this file! 64 Downloads (last 30 days) File Size: 172.1 KB File ID: #29299
image thumbnail

Efficient Graph based image segmentation

by Su Dongcai

 

07 Nov 2010 (Updated 06 Dec 2010)

A new version of previous program, support color image.

| Watch this File

File Information
Description

This is an implementation of [1]. The result is slightly different from website[1], because we apply adjacent neighborhood rather than K nearest neighborhood. The following is an example usage:
%complie:(only once)
GraphSeg_complie
%Read an image
img = imread('images\rice.jpg');
%segmentation
[L, contour] = graph_segment(img, 1, 3, 100);
%display result
subplot(2, 1, 1), imshow(img), title('original image'); subplot(2, 1, 2), imshow(label2rgb(L)),title('segmented result');

[1]Efficient Graph-Based Image Segmentation
Pedro F. Felzenszwalb and Daniel P. Huttenlocher
International Journal of Computer Vision, Volume 59, Number 2, September 2004
http://people.cs.uchicago.edu/~pff/segment/

MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
08 Dec 2010 Sara

Hello,
 
You write on the updates that your version on 06 Dec 2010
"supply compling m-file make it independent to the operating systems". I work with a macos operating system and i tried to compile GraphSeg_complie, but it doesn't work:

>> GraphSeg_complie
In file included from Graph_seg_gray.cpp:4:
stdafx.h:17:21: error: windows.h: No such file or directory
public_functions_lib.h:19: error: ISO C++ forbids declaration of 'num_pixels' with no type
public_functions_lib.h:22: error: ISO C++ forbids declaration of 'num_pixels' with no type
Graph_seg_gray.h:15: error: expected initializer before 'CGraph_seg_gray'
Graph_seg_gray.h:21: error: expected initializer before 'int'
Graph_seg_gray.h:23: error: expected initializer before 'int'

    mex: compile of ' "Graph_seg_gray.cpp"' failed.

??? Error using ==> mex at 221
Unable to complete successfully.

Error in ==> GraphSeg_complie at 1
mex Graph_seg_gray.cpp c_GraphSeg_gray.cpp public_functions_lib.cpp extract_edges.cpp c_GraphSeg.cpp
Disjoint_set.cpp disjoint_elt.cpp

What i have to do to do it works?
Your work would be a great help to me if i could run it...

Thanks a lot,

Sara

07 Oct 2011 bailjung

i have the same problem

20 Dec 2011 Su Dongcai

Sorry folks:
  I made a mistake.This code is compiled on msvc6++, windows xp system.

Please login to add a comment or rating.
Updates
06 Dec 2010

supply compling m-file make it independent to the operating systems

Tag Activity for this File
Tag Applied By Date/Time
image processing Su Dongcai 08 Nov 2010 12:16:05

Contact us at files@mathworks.com