Borrar filtros
Borrar filtros

A question about Block PCA application

1 visualización (últimos 30 días)
DongDong
DongDong el 24 de Mzo. de 2017
I have a problem in applying PCA method to block pictures.I mean,intending to apply PCA method to SubPictures.as the followed:
allsamples = []; Subs = []; for i = 1:64 for j = 1:10 str = 'C:\Users\liu90\Desktop\FV_sample3\train\s_'; in1 = imread(strcat(str,num2str(i),'_',num2str(j),'.bmp')); r = 6; c= 5; [m n] = size(in1); %计算分区的大小 mPartitionSize = floor(m / r); nPartitionSize = floor(n / c);
for ii = 1:r-1
for jj = 1:c-1
Sub = in1((ii-1)*mPartitionSize+1:ii*mPartitionSize,(jj-1)*nPartitionSize+1:jj*nPartitionSize);
Sub = double(Sub);
b=Sub(1:15*30);
b=double(b);
Subs=[Subs;b];
% allsamples = [allsamples;Subs];
end
end
% Subs = fastfPCA(Subs,5);
% Subs(:) =Subs';
allsamples = [allsamples;Subs];
end
end
the dataset contains 640 pictures,each picture will be divided into 6*5=30 SubPictures,how can I do PCA to each picture and then I want to use the data to train SVM to classify. I want the SubPictures of the same previous Pciture to make up a matrix then do PCA to it and use the results to make up a big matrix contains the main information of the 640 pictures,then classify them by SVM. How can I solve the problem?please help me!

Respuestas (0)

Categorías

Más información sobre Dimensionality Reduction and Feature Extraction en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by