Hello I have problems detecting the edges of carotid artery in the image .Please help
조회 수: 6 (최근 30일)
이전 댓글 표시
%Carotid Artery Segmentation and Interpolation
%Read an image
fullname = get_full_filemane(C:\Users\Min\Desktop\Clinical data\Normal(Age20)\1.KIMJEONGMIN\1);
I = imread('Image_1.jpg');
%Convert the image into grayscale and histogram equalization
grayimage = I(200:399, 450:699);
nbins = 25;
grayimage = adapthisteq(grayimage,'clipLimit',0.02,'Distribution','rayleigh');
%Apply contrast adjustment & median filtering
L = imadjust(grayimage); % enhance contrast
M = medfilt2(L, [5 5]); % apply median filter to reduce noise
%apply Guassian filter to the image and difussion filtering
N = imgaussfilt(M,[9 9]);
K = imdiffusefilt(N, "NumberOfIterations",200);
% Detect edges using Canny edge detection
BW = edge(K, 'canny', 0.6);
% Select the ROI
[J,rectout] = imcrop(BW);
figure, imagesc(J)
% Remove small objects from the image
BWs = bwareaopen(rectout, 600);
% Dilate the edges to connect any disconnected regions
se = strel('arbitrary', 160);
BWs = imdilate(BWs, se);
% Fill in any holes in the edges
BWs = imfill(BWs, "holes");
% Detect edges using Hough transform
[H,T,R] = hough(BWs);
P = houghpeaks(H,100,'Threshold',ceil(0.3*max(H(:))));
lines = houghlines(BW,T,R,P,'FillGap',5,'MinLength',7);
BW = zeros(size(BW));
for k = 1:length(lines)
xy = [lines(k).point1; lines(k).point2];
BW = insertShape(BW,'Line',xy,'LineWidth',1,'Color','white');
end
답변 (1개)
Image Analyst
2023년 4월 14일
댓글 수: 5
Image Analyst
2023년 4월 14일
Instead of this
fullname = get_full_filemane(C:\Users\Min\Desktop\Clinical data\Normal(Age20)\1.KIMJEONGMIN\1);
you'd probably do this
fullname = get_full_filenane('C:\Users\Min\Desktop\Clinical data\Normal(Age20)\1.KIMJEONGMIN\1');
Now I'm not sure what get_full_filemane or get_full_filename is, but I bet they want a folder name as a string or character array and then it will return a filename from within that folder.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!