A = affine(patch_centers, patch_unitx, patch_unity)
print (f'A = {A}')
visualize_A(timg1, A, color = 'blue')
```
A = tensor([[[ 50., -30., 300.],
[ 10., -50., 200.],
[ 0., 0., 1.]],
[[ 50., 0., 400.],
[ 0., 60., 300.],
[ 0., 0., 1.]],
[[ 50., 0., 600.],
[ 0., 50., 600.],
[ 0., 0., 1.]],
[[ 50., -50., 100.],
[ 50., 50., 100.],
[ 0., 0., 1.]]])
patches.shape = torch.Size([4, 3, 32, 32])

%% Cell type:markdown id: tags:
`extract_affine_patches` is function, which you should implement. `extract_antializased_affine_patches` is the function, which calls your function on the appropriate level of the scale pyramid, in order to perform basic level of [anti-aliasing](https://en.wikipedia.org/wiki/Anti-aliasing_filter).
See in detail in post "[Patch extraction: devil in details](https://ducha-aiki.github.io/wide-baseline-stereo-blog/2020/07/22/patch-extraction.html)"
It is recommended to use `extract_antializased_affine_patches` in the tournames and in general to remember about aliasing effects in practice.
%% Cell type:code id: tags:
``` python
from imagefiltering import extract_affine_patches, extract_antializased_affine_patches