Bonjour,

J'ai besoin de comprendre un petit bout de programme pour réaliser une mozaique de photo dans le cadre d'un tp mais je ne vois pas du tout.
Si quelqu'un pouvait m'expliquer un peu.

Voici le code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
NumLargeur_PR = 40;
NumLongueur_PR = 40;
 
Largeur_PR = round(Largeur_PR / NumLargeur_PR)-1;
Longueur_PR = round(Longueur_PR / NumLongueur_PR)-1;
 
for j = 0:NumLongueur_PR-1,
   for i = 0:NumLargeur_PR-1,
      temp = Img_PR(j*Longueur_PR+1 : (j+1)*Longueur_PR, i*Largeur_PR+1 :     (i+1)*Largeur_PR);      
                Img_PRsmall(j+1, i+1,1) = mean(mean(mean(temp(:, :,: ))));
                Img_PRsmall(j+1, i+1, 2) = mean(mean(mean(temp(:, :, : ))));
                Img_PRsmall(j+1, i+1, 3) = mean(mean(mean(temp(:, :, : ))));
 
   end
end
rmax = max(max(Img_PRsmall(:, :, 1)));
gmax = max(max(Img_PRsmall(:, :, 2)));
bmax = max(max(Img_PRsmall(:, :, 3)));
Img_PRsmall(:, :, 1) = Img_PRsmall(:, :, 1)./rmax;
Img_PRsmall(:, :, 2) = Img_PRsmall(:, :, 2)./gmax;
Img_PRsmall(:, :, 3) = Img_PRsmall(:, :, 3)./bmax;
 
image(Img_PRsmall);
Merci