Bonjour;
Je suis en train de faire l'histogramme spatio-temporel pour chaque pixel de l'image. j'ai pris comme taille de la fenêtre spatial w=3 et L=5 pour la fenêtre temporel. Je trouve des difficultés a calculer l'histogramme de chaque pixel dans mon 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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 
    Frame = A(:,:,:,k);
    secondFrame = A(:,:,:,k+1);
    thirdFrame = A(:,:,:,k+2);
    fourthFrame=A(:,:,:,k+3);
    fifthFrame=A(:,:,:,k+4);
    % Convert to grayscale
    I1 = rgb2gray(Frame);
    I1=double(I1);
    I2 = rgb2gray(secondFrame);
    I2=double(I2);
    I3 = rgb2gray(thirdFrame);
    I3=double(I3);
    I4 = rgb2gray(fourthFrame);
    I4=double(I4);
    I5 = rgb2gray(fifthFrame);
    I5=double(I5);
    w=3;
    L=5;
    [n,m]=size(I1);
    for i=2:n-1
        for j=2:m-1
            Y(i,j,:)=[I1(i-1,j-1);I1(i-1,j);I1(i-1,j+1);I1(i,j-1);I1(i,j);I1(i,j+1);I1(i+1,j-1);I1(i+1,j);I1(i+1,j+1);...
                I2(i-1,j-1);I2(i-1,j);I2(i-1,j+1);I1(i,j-1);I2(i,j);I2(i,j+1);I2(i+1,j-1);I2(i+1,j);I2(i+1,j+1);...
                I3(i-1,j-1);I3(i-1,j);I3(i-1,j+1);I3(i,j-1);I3(i,j);I3(i,j+1);I3(i+1,j-1);I3(i+1,j);I3(i+1,j+1);...
                I4(i-1,j-1);I4(i-1,j);I4(i-1,j+1);I4(i,j-1);I4(i,j);I4(i,j+1);I4(i+1,j-1);I4(i+1,j);I4(i+1,j+1);...
                I5(i-1,j-1);I5(i-1,j);I5(i-1,j+1);I5(i,j-1);I5(i,j);I5(i,j+1);I5(i+1,j-1);I5(i+1,j);I5(i+1,j+1)];
 
       end
     end
 
             hst(i,j,:)=hst(i,j,:)/(w*w*L);
 
       for i=2:n-1
        for j=2:m-1
            hst(i,j)=hist(Y(i,j,:));
        end
    end
quelqu’un peut m'aider a calculer ce histogramme spatio-temporel
merci d'avance