why m not getting clearer circle edges after performing following operations .plz help
1 view (last 30 days)
Show older comments
clear all;
close all;
[FileName,PathName] = uigetfile('*.*','Select the image file');
nomfich=[PathName,FileName];
ima=imread(nomfich);
%sx=size(ima);
ima = imresize(ima, [400 400]);
HSV=rgb2hsv(ima);
H=HSV(:,:,1);
S=HSV(:,:,2);
V=HSV(:,:,3);
[hca1,hch1,hcv1,hcd1] = dwt2(H,'bior1.3');
[sca1,sch1,scv1,scd1] = dwt2(S,'bior1.3');
[vca1,vch1,vcv1,vcd1] = dwt2(V,'bior1.3');
SE = strel('disk',0);
hch1 = imdilate(hch1,SE,8);
hcv1 = imdilate(hcv1,SE,8);
hcd1 = imdilate(hcd1,SE,8);
sch1 = imdilate(sch1,SE,8);
scv1 = imdilate(scv1,SE,8);
scd1 = imdilate(scd1,SE,8);
vch1 = imdilate(vch1,SE,8);
vcv1 = imdilate(vcv1,SE,8);
vcd1 = imdilate(vcd1,SE,8);
LH=hch1+hcv1+hcd1;
LS=sch1+scv1+scd1;
LV=vch1+vcv1+vcd1;
a=idwt2(LH,hch1,hcv1,hcd1,'bior1.3');
%figure,imshow(a);
b=idwt2(LS,sch1,scv1,scd1,'bior1.3');
%figure,imshow(b);
c=idwt2(LV,vch1,vcv1,vcd1,'bior1.3');
%figure,imshow(c);
%hsvimg=a+b+c;
HSV1(:,:,1)=a;
HSV1(:,:,2)=b;
HSV1(:,:,3)=c;
figure,imshow(HSV1);
title('reconstructed HSV image');
rgbimg=hsv2rgb(HSV1);
%colormap(rgbimg);
figure,imshow(rgbimg);
%imhist(rgbimg);
title('reconstructed rgb image');
grayimg=rgb2gray(rgbimg);
figure,imshow(grayimg);
imhist(grayimg);
level = graythresh(grayimg);
BW = im2bw(grayimg,level);
figure,imshow(BW);
%im3 = im2bw(grayimg, 0.1);
im4 = imclose(BW, strel('disk', 4, 4));
im5 = imfill(im4, 'holes');
figure,imshow(im5);
[centers, radii] = imfindcircles(im5, [180, 200], 'Sensitivity', .99);
viscircles(centers, radii);
1 Comment
DGM
on 2 Feb 2024
Edited: DGM
on 2 Feb 2024
Editor's note: I tried to fix the random broken formatting, but with all the linebreaks stripped and with so many commented lines of dead code in the mix, I had to guess which things were actually commented out. Maybe it's still wrong, but at least it's readable.
Answers (1)
Image Analyst
on 8 Apr 2018
I already answered you in your other post. Here it is again:
Contact the Laboratory of Tree Ring Research at the University of Arizona. http://ltrr.arizona.edu/ They started the field and are probably still the world's leader. They can probably point you to their best publications. You might even be able to obtain code from them.
0 Comments
See Also
Categories
Find more on Image Segmentation and Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!