Operator SampleUp

Operator Library: Base

Library: Base

「SampleUp」運算子透過對輸入影像進行上採樣來增加影像尺寸。 影像尺寸的上採樣係數可針對寬度與高度分別設定為 1、2、4、8 及 16。 上採樣係數透過參數Expand_X和Expand_Y 來定義。 輸出像素是透過複製像素(最近鄰法)來計算的。

關於此運算子的輸出說明,請參閱下圖。 在此範例中,執行了 x 方向 4 倍、y 方向 2 倍的升採樣。

請注意,即使必須透過鏈路傳輸更多的像素,輸出端的並行度也不會因此增加。 因此,此運算子無法以其並行度來處理輸入影像資料。

Operator Restrictions

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

  • 不允許使用空白圖片或含有空白行的圖片。

I/O Properties

Property Value
Operator Type M
Input Link I,資料輸入
Output Link O,資料輸出

Supported Link Format

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 auto2
Max. Img Height any auto3

1

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

2

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

3

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

Parameters

Expand_X
Type 靜態參數
Default UpSampleXBy1
Range {UpSampleXBy1, UpSampleXBy2, UpSampleXBy4, UpSampleXBy8, UpSampleXBy16}

此參數用以定義影像寬度的上採樣係數。

Expand_Y
Type 靜態參數
Default UpSampleYBy1
Range {UpSampleYBy1、UpSampleYBy2、UpSampleYBy4、UpSampleYBy8、UpSampleYBy16}

此參數用於定義影像高度的升採樣係數。

Examples of Use

以下範例展示了運算子 SampleUp 的用法: