Operator SampleUp

Operator Library: Base

Library: Base

SampleUp operator 會透過對輸入影像進行升頻取樣來增加影像大小。 影像大小的升頻取樣倍數可以針對寬度和高度分別以 1、2、4、8 和 16 為步長進行定義。 升頻取樣倍數是透過參數 Expand_X 和 Expand_Y 來定義。 輸出像素是透過複製像素(最近鄰方法)來計算。

operator 輸出的說明請參閱下圖。 在此範例中,x 方向執行了 4 倍升頻取樣,y 方向執行了 2 倍升頻取樣。

請注意,即使鏈路上必須傳輸更多像素,輸出的 Parallelism 也不會增加。 因此,此 operator 無法在其 Parallelism 下處理輸入影像資料。

算子限制

  • 每個輸入影像的行必須具有相同的長度。因此不允許行長度不同的影像。

  • 不允許空白影像或包含空白行的影像。

I/O Properties

Property Value
Operator Type M
Input Link I, data input
Output Link O, data output

支援的 Link 格式

Link Parameter Input Link I Output Link O
Bit Width [1, 64]1 as I
Arithmetic {unsigned, signed} as I
Parallelism {1, 2, 4, 8, 16, 32, 64, 128} as I
Kernel Columns 1 as I
Kernel Rows 1 as I
Img Protocol {VALT_IMAGE2D, VALT_LINE1D} as I
Color Format any as I
Color Flavor any as I
Max. Img Width any 自動2
Max. Img Height any 自動3

1

針對無符號數值,輸入 Bit Width 的範圍是 [1, 64]。 針對有符號輸入,範圍是 [2, 64]。 針對無符號彩色輸入為 [3, 63],針對有符號彩色輸入則為 [6, 63]。

2

輸出影像寬度不得超過 2^31 - 1。

3

輸出影像高度不得超過 2^31 - 1。

參數

Expand_X
Type static parameter
Default UpSampleXBy1
Range {UpSampleXBy1, UpSampleXBy2, UpSampleXBy4, UpSampleXBy8, UpSampleXBy16}

此參數定義影像寬度的升頻取樣倍數。

Expand_Y
Type static parameter
Default UpSampleYBy1
Range {UpSampleYBy1, UpSampleYBy2, UpSampleYBy4, UpSampleYBy8, UpSampleYBy16}

此參數定義影像高度的升頻取樣倍數。

使用範例

SampleUp operator 的使用方式如以下範例所示: