output coordinates with conv2

8 visualizaciones (últimos 30 días)
Loic
Loic el 14 de Feb. de 2020
Editada: Ajay Pattassery el 17 de Feb. de 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

Respuesta aceptada

Ajay Pattassery
Ajay Pattassery el 17 de Feb. de 2020
Editada: Ajay Pattassery el 17 de Feb. de 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).

Más respuestas (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by