Code covered by the BSD License  

Highlights from
A Fast Image Segmentation using Delaunay Triangulation

4.5

4.5 | 2 ratings Rate this file 105 Downloads (last 30 days) File Size: 9.91 MB File ID: #28330
image thumbnail

A Fast Image Segmentation using Delaunay Triangulation

by Abbas Cheddad

 

29 Jul 2010 (Updated 06 Aug 2011)

A fully automated process that does not require initial estimate of number of clusters.

| Watch this File

File Information
Description

This function applies the Delaunay-based image segmentation, which is a fully automated process that does not require initial estimate of number of clusters.

The core idea is to apply Delaunay triangulation to the image histogram instead of the image itself. That reduces the sites required to construct the diagram to merely 255 at most (uint8) resulting in a fast image segmentation.

  I don't claim it is the optimal way to segment an image, which is why I will be more than happy receiving constructive comments or reporting any bug in the program for further improvement.

  For a detailed description of the theoretical foundation of the algorithm and for citation purposes please refer to the journal paper -a pre-print copy is included here but it is better to have it in PR layout-:

  - A. Cheddad, D. Mohamad and A. Abd Manaf, "Exploiting Voronoi diagram properties in face segmentation and features extraction," Pattern Recognition, 41 (12)(2008)3842-3859, Elsevier Science.
 - A. Cheddad, J. Condell, K. Curran and P. Mc Kevitt. On Points Geometry for Fast Digital Image Segmentation. The 8th International Conference on Information Technology and Telecommunication IT&T 2008, Ireland 23 – 24 October 2008, pp: 54-61.

 Example:
[Segmented, Array]=DS(Im);
[Segmented, Array]=DS(Im,flag,open,EdHist);

 Inputs,
   Im : The image, class preferable uint8 or uint16, the function
           accepts RGB as well as grayscale images

   flag : (1) segmentation of image complement
            (0) direct segmentation [default]

   open: (1) apply grayscale morphological opening
               (0) don't apply [default]

   EdHist:(1) apply histogram equalization [default]
               (0) don't apply

 Outputs,
   Segmented: the segmented image
   Array: Array containing grayscale values (Delaunay vertices)
   used for segmentation. You can use that to call homogeneous
   regions,

   e.g., imshow(Segmented(:,:,1)==Array(i),[]); %for gray scale

   or Segmented_ntsc=rgb2ntsc(Segmented);
   imshow(Segmented_ntsc(:,:,1)<=Array(i) &
   Segmented_ntsc(:,:,1)>Array(i-1),[]); %for colour images
   Note: NTSC transformation will introduce some changes to
   values in the vector Array.

Required Products Image Processing Toolbox
MATLAB release MATLAB 7.10 (2010a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
30 Jul 2010 Samir  
30 Jul 2010 Samir

Yet another brilliant piece of code from you Abbas! Thank you very much for posting that.

05 Aug 2010 Abbas Cheddad

There is a mistake in counting the colour number. I sent the updated file to Matlabcentral but am not sure when they will update it.
Around line 198, please change the if statement to:

if length(size(Im))==3
Im(:,:,1)=im2double(Orig);
Orig=ntsc2rgb(Im);
[x xx]=imhist(Im(:,:,1));
xx(x==0)=0;
Array=xx(xx>0);

else
    
[x xx]=imhist(im2uint8(Orig(:,:,1)));% Corrected! There was a mistake here since it was written as: [x xx]=imhist(Im(:,:,1));
xx(x==0)=0;
Array=xx(xx>0);

end

%%%Please remove the following line 209
[x xx]=imhist(Im(:,:,1));
xx(x==0)=0;
Array=xx(xx>0);

10 Aug 2010 Priyanka Sharma  
Please login to add a comment or rating.
Updates
29 Jul 2010

Revised the description and added some tags.

05 Aug 2010

Mistake at the end of the script.

if length(size(Im))==3
Im(:,:,1)=im2double(Orig);
Orig=ntsc2rgb(Im);
[x xx]=imhist(Im(:,:,1));
xx(x==0)=0;
Array=xx(xx>0);
else
[x xx]=imhist(im2uint8(Orig(:,:,1)));
xx(x==0)=0;
Array=xx(xx>0);
end

05 Aug 2010

Bug fixed (grayscale count for RGB images) and file script update

06 Aug 2010

- Bug fix (gray colour count in RGB)
- Appended a new screenshot
- Added some useful comments to the script

15 Aug 2010

Update to description and screen shot

15 Aug 2010

Updated screen shot and description

16 Aug 2010

Updated description and screenshot

14 Jun 2011

- A user friendly GUI creation
- Now the programme exports the segmented image as "Segmented.tif"

06 Aug 2011

Some bugs in displaying the values in "Array" have been fixed.

Tag Activity for this File
Tag Applied By Date/Time
image segmentation Abbas Cheddad 29 Jul 2010 14:12:33
delaunay triangulation Abbas Cheddad 29 Jul 2010 14:12:33
graph cut Abbas Cheddad 29 Jul 2010 14:12:33
vertices Abbas Cheddad 29 Jul 2010 14:12:33
histogram Abbas Cheddad 29 Jul 2010 14:12:33
clustering Abbas Cheddad 29 Jul 2010 14:12:33
face detection Abbas Cheddad 30 Jul 2010 10:23:37
knearest neighbor Abbas Cheddad 30 Jul 2010 10:23:37
voronoi diagram Abbas Cheddad 23 Aug 2010 04:53:57
medical imaging Abbas Cheddad 15 Jun 2011 10:28:38
object identification Abbas Cheddad 15 Jun 2011 10:28:38
knearest kmeans neighbor Abbas Cheddad 15 Jun 2011 10:28:38
cell segmentation Abbas Cheddad 15 Jun 2011 10:28:38
object extraction Abbas Cheddad 15 Jun 2011 10:28:38
iris detection Abbas Cheddad 15 Jun 2011 10:28:38
object identificat Abbas Cheddad 08 Aug 2011 12:34:21
object extraction Hazem Alhiary 27 Jan 2012 13:54:55
voronoi diagram Hazem Alhiary 27 Jan 2012 13:55:04
object extraction ramireddy viswa prapurna 23 Feb 2012 12:49:33
cell segmentation wong mit 15 Mar 2012 11:07:04

Contact us at files@mathworks.com