View License

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

» Watch video

Highlights from
Soft thresholding for image segmentation

4.7 | 7 ratings Rate this file 39 Downloads (last 30 days) File Size: 14.5 KB File ID: #36918 Version: 4.0
image thumbnail

Soft thresholding for image segmentation



29 May 2012 (Updated )

Image segmentation based on histogram soft thresholding

| Watch this File

File Information

FTH is a fuzzy thresholding method for image segmentation. The method is based on relating each pixel in the image to the different regions via a membership function, rather than through hard decisions. The membership function of each of the regions is derived from a fuzzy c-means centroid search. As a consequence, each pixel will belong to different regions with a different level of membership. This feature is exploited through spatial processing to make the thresholding robust to noisy environments.
Method proposed in:
Aja-Fernández, S., A. Hernán Curiale, and G. Vegas-Sánchez-Ferrero, "A local fuzzy thresholding methodology for multiregion image segmentation", Knowledge-Based Systems, vol. 83, pp. 1-12, 07/2015.
DOI 10.1016/j.knosys.2015.02.029

This new version is highly improved.

New Version, 4.0


Elmat+ 2.2 inspired this file.

Required Products MATLAB
MATLAB release MATLAB 7 (R14)
MATLAB Search Path
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (19)
31 Jul 2016 paramveer sran

would you please tell me how you show the threshold image after running the code?

Comment only
28 Jul 2016 Peps Reynoso

Hello, Santiago. This code is helping me immensely. I'm still trying to understand the code and paper, but I wanted to thank you for sharing this.

16 Dec 2015 Khaing Zin Htwe

13 Apr 2014 DaDu

DaDu (view profile)

04 Apr 2014 Martin

Martin (view profile)


Answer to Arnold: Your output will strongly depend on the input image. COntact me by mail and I can check where it is failing.

Comment only
27 Jan 2014 arnold

arnold (view profile)

doesn't work for me. Gives 'S' and 'MG' which contains just ones.

Comment only
18 Jan 2014 Muhammad Bilal

Kindly tell me the steps to follow run this code

Comment only
17 Oct 2013 Xidian NO.1

22 Jul 2013 Ramkumar

thank u for sharing

08 Jul 2013 Omar Al Okashi

Dear Sir..
Thanx alot about sharing... I can not run it because of this error:

??? Error using ==> shiftmat
Too many input arguments.

Error in ==> seg_fuzzy at 207
M_tmp = shiftmat(Mx,i,1);

can you explain us how to implement it..
with my Regards...

Comment only
14 Mar 2013 Edwin

Edwin (view profile)

Thanks for your sharing. would you please tell me how you show the threshold image after running the code?

Thanks for your help in advanced!

Comment only
30 Aug 2012 Darlis Herumurti

Thank you so much for your sharing code, it is very impressive.
I've read your paper and I would like to ask about the median MG (step 6). I confuse the use of MG and about calculating the MX in step 5 and step 6, since in your code, you didn't do anything about MG.
Thank you very much for your kind response.


Modify anything you want, of course. It should be easy. I cannot say when next version will be ready, sorry. I'll try to do it along these months.

Comment only
22 Jun 2012 leila

leila (view profile)

thank you. I want to try it on 3d US images, can I change it? when the next version will be written?

Comment only

The function is a basic implementation thought for 2D, but with very small changes it could work for 3D. The square neighborhoods used for smoothing and aggregation must be replaced by 3D neighborhoods. (I'll do it for the next version...)

Comment only
15 Jun 2012 leila

leila (view profile)

does the function support 3d images?

Comment only

The original file lacks of a control for more than 5 output sets. New version with problem corrected is added.

Comment only
31 May 2012 Sven

Sven (view profile)

Your example itself fails with an error:

>> [S,MG,Nmax]=seg_fuzzy(I,1,2)

Undefined function or variable "Mx".

Error in seg_fuzzy (line 196)

Comment only
01 Jun 2012 1.2

Bug corrected for more than 5 maxima in smoothed histogram

08 May 2013 1.3

Version 3: It admits 3D data and rgb images. It has no limit of number of output sets. Some minor bugs were corrected

09 Jul 2013 1.4

A bug in shiftmat is corrected

11 Jul 2013 1.5

Small change to correct a bug in 3D

18 Feb 2014 1.6

- The centroids are now searched by a fuzzy c-means.
- 5 different spatial aggregations are considered.
- The optimization step has been avoided.
- A threshold to prune output sets has been added.

09 Jun 2015 4.0

Reference to the published paper added.

Contact us