MATLAB: How to apply region growing for candidates

digital image processingimage processingmachine learning

I have been working on the diabetic retinopathy and currently implementing a paper named " Detection of microaneurysms using multi-scale correlation coefficients " by Bob Zhang and others.The link for the paper is :https://www.sciencedirect.com/science/article/abs/pii/S003132031000004X
I have to apply region growing for the candidates(the white spots present in the above image) so that the output should look like the below image where the candidates shape and size are grown by region growing.
In the paper, It is mentioned that In the region growing, the background image Ibg can be obtained by applying a median filter of size 25×25 to green channel image Igreen. A threshold 't' is calculated using the equation
t = Idarkest – 0.5(Idarkest – ibg)
where Idarkest denotes the lowest intensity for each candidate region in the Igreen, ibg is its background intensity at the same location.
Region growing starts from the point of Idarkest in each candidate region and continues until no more connected pixels are higher than threshold. Considering the size of MA is less than 120 pixels if the area of every resultant connected component is larger than 120 pixels, it will be discarded.
Can somebody help me with this?
I have attached the green channel image Igreen as 'green_sample.jpg'.

Best Answer

See my attached regiongrowing program. Adapt as needed.