iterative global thresholding to images

I am doing lung vessel segmentation.So I need to perform ITERATIVE GLOBAL THRESHOLDING according to the algorithm given below.
Please help me by providing the Matlab code for the algorithm given below.
a) Block 1: Take the i th (i= 1, 2,…, I) lung CT image
b) Block 2: Calculate the histogram of pixel intensity values of the ith (i=1, 2, …, I) lung CT image.
c) Block 3: The pixel intensity value corresponding to the peak of histogram is chosen as the threshold value. This value is used to separate vessels from the background. The global thresholding operation will be applied to obtain results in the following blocks.
d) Block 4: Initialize the value of z=1.
e) Block 5: Average pixel intensity value is calculated using (1).
t(z)=hist(i)/255 (1)
For example; for the ith lung CT, is calculated.
f) Block 6: If z=1, it means that t(z) is calculated for the first time and there is no t(z-1) value for comparison. So, it is necessary to go to Block 8.
g) Block 7: In this block, t(z) and t(z-1) values are compared. If t(z) value is 'b' times greater than t(z-1) value, then go to Block 8. Else the flow chart is finished.'b' is used for decision making according to following formula. (2)
t(z)-t(z-1) <= t(z-1)*b (2)
If (2) is true, global thresholding is continued, else thresholding is finished.
h) Block 8: The value of t(z) is considered as threshold value and thresholding is performed.
i) Block 9: The value of z is increased by 1. To continue global thresholding, it is necessary to go to Block 5.
After applying Blocks 1-9 to all I lung CTs the iterative global thresholding will be finished.

Answers (0)

Asked:

on 5 Mar 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!