calculate the eigen values and eigen vectors of an image.

3 views (last 30 days)
hi, this is my code for: -converting the rgb image to hsv image -obtain the blob -obtain the eigen values
clear all;
i=imread('A.jpg');
x =imresize(i,[100 100]);
j=rgb2hsv(x);
s=j(:,:,2);
sthres=s>0.2;
sthres=imfill(sthres,'holes');
%figure(1), imshow(sthres);
CC=bwconncomp(sthres);
numPixels = cellfun(@numel,CC.PixelIdxList);
[biggest,idx] = max(numPixels);
sthres(CC.PixelIdxList{idx}) = 1;
%figure(1), imshow(sthres);
M=mean2(sthres);
C=(sthres-M)*(sthres-M)';
lamda=eig(C);
[V,D] = eig(C);
i m not sure if my code is correct. Could someone please tell me how to obtain the eigen vectors. V,D,W]=eig(__) is showing error. please let me know if my code is wrong.

Answers (0)

Categories

Find more on Convert Image Type in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!