how can thresold the gray scale image manually using canny method for thresholding and get the only object in image
이전 댓글 표시
please tell me how to do thresholding and get only one object projectdir = 'E:\SHIVA BACKUP\THYROID\P1\newcodes\data1\13002'; %y = 72; X = zeros(128, 128, 1, 72,'uint16'); % Read the series of images. % for p=1 p=1; thisfile = sprintf('IM_%d.dcm', p); filename = fullfile( projectdir, thisfile ); imdata = dicomread(filename); imsize = size(imdata); if ~isequal( imsize, [128 128 1 72] ) fprintf('file is unexpected size %s instead of [128 128 1 72], skipping "%s"\n', mat2str(imsize), filename); else X(:, :, :, :,p) = imdata; end figure(); montage(X(:,:,:,:,p), [0 100])
v=zeros(128,128,72);
s=zeros(128,128,72);
sum=0;
THRESH=20;
for i=1:18 v(:,:,i)=X(:,:,:,i); s(:,:,i)=edge(v(:,:,i),'canny',THRESH);%'both',10); figure() imshow(s(:,:,i),[]) end
답변 (2개)
Image Analyst
2016년 12월 10일
0 개 추천
See my interactive/visual thresholding application here: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
댓글 수: 3
andhavarapu lokesh
2016년 12월 21일
Image Analyst
2016년 12월 21일
That's a good suggestion for me to add this line to the OutputFcn. But until then, just after you call the function, use this code to get the binary image:
binaryImage = (lowThreshold <= grayImage) & (grayImage<= highThreshold);
andhavarapu lokesh
2016년 12월 22일
Belie
2018년 5월 7일
0 개 추천
hello image analyst,finding the actual thresold is so challenging..how I find it
댓글 수: 1
Image Analyst
2018년 5월 7일
Just move the sliders in my app until you get something that looks best.
카테고리
도움말 센터 및 File Exchange에서 Images에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!