if i have number of images (multi spectral images for the same scene), and i want to reduce the dimensional of this images by any dimension reduction techniques where in the result i get one reducing image for 200 as example. how can i do this task? thank you.

 Réponse acceptée

Image Analyst
Image Analyst le 19 Mar 2018

1 vote

See my attached demo for pca. It should be easy for you to adapt it to take any number of spectral bands instead of the 3 visible color (RGB) bands I took. If you want just one single image that represents most of the variation, take the principal components #1 image.

4 commentaires

mohammed abdul wadood
mohammed abdul wadood le 19 Mar 2018
i try your demo sir, and it's work, but if i have more than 9 images how can i applying this demo for it?
Adam
Adam le 19 Mar 2018
A demo is just an example of how the code works, you usually need to adapt the code for your own purposes.
Image Analyst
Image Analyst le 19 Mar 2018
Two code samples for processing multiple files in a folder are shown in the FAQ : http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F
mohammed abdul wadood
mohammed abdul wadood le 20 Mar 2018
ok, thanks all; another question please, i wrote an code for (KLT) techniques for dimension reduction for image (I'm just a beginner in matlab my code maybe is not good enough one or it's want some modification) the result for the code is binary image, is it possible that i reduce the dimensionality without losing the color (can i get colored reducing image as result)
clc, clear all, close all x = imread ('10.bmp'); whos %x2 = imread ('2.bmp'); %x3 = imread ('3.bmp'); %x4 = imread ('4.bmp'); %x5 = imread ('5.bmp'); %x6 = imread ('6.bmp'); %x=[x1 x2 x3 x4 x5 x6]; t=graythresh(x) z=im2bw(x,t); [n m]=size(z);
for j=1:m mu(:,j)=mean(z(:,j)); end for j=1:m xx(:,j)=z(:,j)-mu(j); end xx=xx'; cx=(xx*xx')./(n-1); [M V]=eig(cx);
%my
V; size(V) mm=max(max(V)) ee=sum(diag(V));
%
A=(rot90(M))'; y=A*xx; Ay=A'*y; for j=1:m xhad=Ay+mu(j); end
k=input('k='); for i=1:k for j=1:k xxk(i,j)=xx(i,j); cxk(i,j)=cx(i,j); end end for j=1:k muk(:,k)=mean(xxk(:,k)); end
[M1 V1]=eig(cxk); Ak=(rot90(M1))'; yk=Ak*xxk; Ayk=Ak'*yk; for j=1:k xhadk=Ayk+mu(j); end
figure; imshow(xhadk),title('A=510')
figure; subplot(3,2,1),imshow(x); subplot(3,2,2),imshow(xhad); subplot(3,2,3),imshow(xhadk);

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by