output coordinates with conv2

4 ビュー (過去 30 日間)
Loic
Loic 2020 年 2 月 14 日
編集済み: Ajay Pattassery 2020 年 2 月 17 日
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

採用された回答

Ajay Pattassery
Ajay Pattassery 2020 年 2 月 17 日
編集済み: Ajay Pattassery 2020 年 2 月 17 日
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 件)

カテゴリ

Help Center および File ExchangeNaNs についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by