Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Dans cet exercice, le produit de convolution est utilisé sur des images très petites, afin de pouvoir vérifier les résultats par le calcul. On considère l’image 2 × 6 :

g=(111000111000)g = \begin{pmatrix} 1 & 1 & 1 & 0 & 0 & 0 \\ 1 & 1 & 1 & 0 & 0 & 0 \end{pmatrix}

et les trois PSF ci-dessous, dont l’origine (le pixel de coordonnées (0,0)(0,0)) est indiqué en rouge :

h1=(1−1),h2=(1−1),h3=(121).h_1 = \begin{pmatrix} {\color{red}1} & -1 \end{pmatrix}, \qquad h_2 = \begin{pmatrix} {\color{red}1} \\ -1 \end{pmatrix}, \qquad h_3 = \begin{pmatrix} 1 & {\color{red}2} & 1 \end{pmatrix}.
  • Calculez le résultat des convolutions de l’image gg avec chacune des trois PSF.

  • Vérifiez le résultat avec Python (scipy.ndimage.convolve). Une image ff de taille M×NM \times N peut être définie comme un tableau Numpy à deux dimensions :

    f = np.array([
      [f00, f01, f02, ..., f0N],
      [f10, f11, f12, ..., f1N],
      [...]
      [fM0, fM1, fM2, ..., fMN],
    ])

    où chaque variable fmn est la valeur du pixel (m,n)(m,n).