output coordinates with conv2
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Loic
le 14 Fév 2020
Modifié(e) : Ajay Pattassery
le 17 Fév 2020
The are three shape options for the output of a 2D convolution made with conv2: 'full', 'same' and 'valid'. Only 'valid' provides the valid zone of the convolution. Let's say S1 is associated to coordinates or meshgrid arrays X1 and Y1, and S2 to X2 and Y2, let's say S = conv2(S1,S2,'valid). X1, Y1, X2 and Y2 are defined in the same frame. What are the X and Y coordinates of S?
Thank you !
Loic
0 commentaires
Réponse acceptée
Ajay Pattassery
le 17 Fév 2020
Modifié(e) : Ajay Pattassery
le 17 Fév 2020
I assume you want to find the output size after 2D convolution with an argument as ‘valid’.
In the case where
S = conv2(S1, S2, 'valid')
The output size o = (i-k) + 1
Where i is the size of the input matrix. k is the kernel size. (Here i corresponds to S1 and k to S2)
In this case, S1 is of size (X1, Y1) and S2 is of size (X2, Y2)
Hence output size 0 = (X1 - X2 + 1) in the x-direction and similarly
output along the y-direction is (Y1-Y2 + 1)
That is, the output size will be (X1-X2+1, Y1-Y2+1).
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Calculus dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!