当前位置:网站首页>[image segmentation] retinal vessel segmentation based on morphology with matlab code

[image segmentation] retinal vessel segmentation based on morphology with matlab code

2022-06-24 07:21:00 Matlab scientific research studio

1 brief introduction

Purpose Segmentation and feature extraction of blood vessels in images , It is of great significance for the early diagnosis of diseases . For many retinal blood vessel extraction algorithms, the segmentation accuracy is not high , The method of high hat transformation in mathematical morphology is proposed to detect it . Method First , Select the structure element as " Disc shaped " High hat transformation of the image based on morphology , The image after high hat transform smoothes the background of the image , At the same time, the contrast of blood vessels in the image is enhanced . secondly , Use the transformed image Otsu's The automatic segmentation method performs threshold segmentation on the image to obtain the binary image of the blood vessel . Again , According to the structural and geometric information of blood vessels in the image , Using the method based on connected domain measurement , Set the " area " and " Aspect ratio " Two thresholds , Remove false targets . Last , To maintain the continuity of blood vessels , Perform an expansion operation on the image , It can connect the broken blood vessels , The experimental error is reduced . result Through the above steps, the extraction of blood vessels is realized . Conclusion It turns out that , This algorithm can effectively extract the vascular network of retinal fundus images , It has strong segmentation accuracy .​

2 Part of the code

%%clearclcim=imread('Retina_drive_1.tif');bw_mask=imread('Retina_drive_1_mask.gif');bw_mask=logical(bw_mask);ref_im=imread('Retina_drive_1_Ref.gif');%im=im(:,:,2);im=mat2gray(im).*mat2gray(bw_mask);im=imcomplement(im);% Assume vessels are lighter than backgroundim=im2double(im);ref_bw=im2bw(ref_im,0.5);%%DEG_NUM=12;LEN_c=11;LEN_o=11;LEN_diff=7;%ic1=reconstruction_by_dilation(im,LEN_c,DEG_NUM);io1=min_openings(im,LEN_o,DEG_NUM);iv=mat2gray(ic1-io1);imDiff=smooth_cross_section(iv,LEN_diff,LEN_c);imL=reconstruction_by_dilation(imDiff,LEN_c,DEG_NUM);imF=reconstruction_by_erosion(imL,LEN_c,DEG_NUM);% figure,imshow(iv);title('iv');figure,imshow(imDiff);title('imDiff');figure,imshow(imL);title('imL');figure,imshow(imF);title('imF');%% Hysteresis thresholdingTH_LOW=30;TH_HIGH=40;min_obj=180;min_hole=10;%mask=im2bw(imF,TH_LOW/255);marker=im2bw(imF,TH_HIGH/255);bw_result=imreconstruct(marker,mask);%% some extra cleaning on the result.bw_result=bw_result& bw_mask;bw_result = clear_bw(bw_result, min_obj, min_hole);%figure,imshow(bw_result);title('result');r=eval_metrics(bw_result,ref_bw,bw_mask);fprintf('TPR=%g\n FPR=%g\n accuracy=%g\n precision=%g\n',...    r(1),r(2),r(3),r(4));

3 Simulation results

4 reference

[1] Li Lihua , Wang Kai . Retinal vessel extraction algorithm based on mathematical morphology [J]. Beijing Biomedical Engineering , 2014, 33(5):5.

About bloggers : Good at intelligent optimization algorithms 、 Neural networks predict 、 signal processing 、 Cellular automata 、 The image processing 、 Path planning 、 UAV and other fields Matlab Simulation , relevant matlab Code problems can be exchanged by private letter .

Some theories cite network literature , If there is infringement, contact the blogger to delete .

原网站

版权声明
本文为[Matlab scientific research studio]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206240116294225.html