Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % load floating and fix image
- %% image segmentation using k-mean clustring.
- idx_fix = kmeans(double(fix(:)),4);
- idx_float = kmeans(double(float(:)),4);
- %% display image segmentation
- mat1 = reshape(idx_fix,[],500);%besed on your image size
- mat2 = reshape(idx_float,[],500);
- imshow(mat1/max(mat1(:))); title('Fix image class');
- figure;
- imshow(mat2/max(mat2(:))); title('Float image class');
- %% Joint class histogram
- joint = zeros(5,5);%besed on number of class
- for i=1:length(idx_fix)
- c1 = idx_fix(i) + 1;%offset matrix by 1 because index start by 1
- c2 = idx_float(i) + 1;
- joint(c1, c2) = joint(c1,c2) + 1;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement