convert serial into parallel
Afficher commentaires plus anciens
while converting from serial to parallel , i encountered with some dependency variable related problems. the variables initiated outside the parfor loop cant use inside the loop. variables like row_counter, column_counter and r causing problem, am new to matlab so please help. my code is below !!!!
myfile=dir('path\*.jpg'); % the folder inwhich ur images exists
myfile2=dir('path\*.jpg'); % the folder inwhich ur centroid images exists
row_counter=1;
column_counter= 1;
r=0;
parfor i = 1 : length(myfile)
filename = strcat('path:',myfile(i).name);
img= imread(filename);
k=datafilename;
L1=load (k,'data'); % Making it a structure
label=L1.data(:,5);
for j=1: size(L1.data,1)
C1 = image()
for h = 1 : length(myfile2) %%OPening the centroid Image
filename2 = strcat('D:path\',myfile2(h).name);
C2=imread(filename2);
im_A=rgb2gray(C1);
im_B=rgb2gray(C2);
r(row_counter,column_counter)=corr2(im_A,im_B);
Parsave(r);
column_counter=1+column_counter;
end
r(row_counter,column_counter)=L1.data(j,5);% Assigning label in the end
row_counter=row_counter+1;
column_counter=1; % col counter reset
end
end
Réponses (0)
Catégories
En savoir plus sur Startup and Shutdown dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!