Sqeuclidean replicates 3 pixellabels reshape to

Info icon This preview shows pages 13–18. Sign up to view the full content.

View Full Document Right Arrow Icon
'sqEuclidean' , ... 'Replicates' ,3); pixel_labels = reshape(cluster_idx,nrows,ncols); %%reshape to original image pixel_labels=imerode(pixel_labels,strel( 'disk' ,9)); pixel_labels=imdilate(pixel_labels,strel( 'disk' ,16)); figure,imshow(pixel_labels,[]), title( 'image labeled by cluster index' );
Image of page 13

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2. 3. Thresholding on RGB modeled image [fname path]=uigetfile( '*.tif' , 'Select an image' ); % [FILENAME, PATHNAME, FILTERINDEX] = UIGETFILE(FILTERSPEC, TITLE) fname=strcat(path,fname); im=imread(fname); figure subplot(2,2,1) imshow(im); title( 'original retinal image' ); impixelinfo; %% color channel seperation imR=im; imR(:,:,2:3)=0; subplot(2,2,2) imshow(imR); title( 'red channel' ); imG=im; imG(:,:,1:2:3)=0; subplot(2,2,3) imshow(imG) title( 'green channel' ); imB=im; imB(:,:,1:2)=0; subplot(2,2,4) imshow(imB) title( 'blue channel' ); %%takee Green channel and process it imG=imG(:,:,2); figure subplot(2,2,1) imshow(imG); title( 'taking green channel' );
Image of page 14
impixelinfo; %%threshold imD=imG>155; subplot(2,2,2) imshow(imD); title( 'binary disk image' ); impixelinfo; imD=im2double(imD); f=fspecial( 'Average' , [5 5]); imD=imfilter(imD,f); %%morphological processing imD=imerode(imD,strel( 'disk' ,2)); imD=imdilate(imD,strel( 'disk' ,10)); subplot(2,2,3) imshow(imD); title( 'morphological processed binary disk' ); %%segmentation im1=double(im); im2=double(imD); for (i=1:3) im3(:,:,i)=im2.*im1(:,:,i); %scalar multiplication end imDisk=uint8(im3); subplot(2,2,4) imshow(imDisk); title( 'segmented disk image' ); 4. Thresholding on HSI modeled image [fname path]=uigetfile( '*.tif' , 'Select an image' ); % [FILENAME, PATHNAME, FILTERINDEX] = UIGETFILE(FILTERSPEC, TITLE) fname=strcat(path,fname); F=imread(fname); %resizing the image F=imresize(F,[256 256]); %no of rows and columns figure subplot(2,2,1) imshow(F); title( 'original image' ); F=im2double(F);
Image of page 15

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
r=F(:,:,1); g=F(:,:,2); b=F(:,:,3); th=acos((0.5*((r-g)+(r-b)))./((sqrt((r-g).^2+(r-b).*(g-b)))+eps)); if (b>g) imH=2*pi-th; else imH=th; end subplot(2,2,2) imshow(imH) title( 'Hue' ) impixelinfo; imS=1-(3.*(min(min(r,g),b)))./(r+g+b+eps); subplot(2,2,3) imshow(imS) title( 'Saturation' ) impixelinfo; imI=(r+g+b)/3; subplot(2,2,4) imshow(imI) title( 'Intensity' ) impixelinfo; imH=imH>0.5; figure subplot(2,2,1) imshow(imH); title( 'threshold for hue' ); imS=imS>0.55; subplot(2,2,2) imshow(imS); title( 'threshold for saturation' ); imI=imI>0.65; subplot(2,2,3) imshow(imI); title( 'threshold for intensity' ); imH=imerode(imI,strel( 'disk' ,1)); imH=imdilate(imI,strel( 'disk' ,2)); subplot(2,2,4) imshow(imH); title( 'morphological processed binary disk' ); im1=double(F); im2=double(imH);
Image of page 16
im3=im2.*im1(:,:,1); %scalar multiplication imDisk=(im3); figure imshow(imDisk); title(
Image of page 17

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 18
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern