Operator ImageNumber

Operator Library: Base

運算子 ImageNumber 會在輸出鏈結上提供輸入鏈結目前影像的索引。 因此,輸入處的每個像素都會被影像的索引(也就是影像編號)所取代。 系統不會使用實際的輸入像素值。 此運算子會作為一個 Counter 運作,每當其輸入端有新影像時就會遞增。 Counter會在程序開始時('Multiple Processes')或達到最大值後重設。 第一張影像的影像索引將為 0。

可以透過變更輸出鏈結 O 的 Bit Width 來定義 Counter 寬度。 如果 Counter 達到最大值,它將從零重新開始 = 循環條件(wrap around condition)。 例如,8 bit 的輸出 Bit Width 將會產生介於 0 到 255 之間的 Counter 值。

使用參數 SingleShot 時,運算子將不會在循環條件下重設。 Counter 值輸出將保持在最大值。 因此,對於 8 bit 影像 Counter,Counter 值將保持在最大值 255。

此運算子通常與運算子 RemoveImage 結合使用, 以移除序列的前 N 張影像。

算子限制

  • 此運算子支援空白影像。 運算子將會計算這些空白影像。 然而,對於空白影像,由於空白影格的輸出不包含任何像素,因此無法在輸出端提供 Counter 值。 在下一個非空白影像之後,輸出鏈結將會提供正確的 Counter 值。

I/O Properties

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

支援的 Link 格式

Link Parameter Input Link I Output Link O
Bit Width [1, 64]1 [1, 64]
Arithmetic {unsigned, signed} unsigned
Parallelism any as I
Kernel Columns any 1
Kernel Rows any 1
Img Protocol VALT_IMAGE2D as I
Color Format any VAF_GRAY
Color Flavor any FL_NONE
Max. Img Width any as I
Max. Img Height any as I

1

輸入 Bit Width 的範圍是 [1, 64]。 對於帶號輸入,範圍是 [2, 64]。 對於不帶號彩色輸入,範圍是 [3, 63],對於帶號彩色,範圍是 [6, 63]。

參數

SingleShot
Type static parameter
Default OFF
Range {OFF, ON}

此參數可用於控制循環條件。 當設定為 OFF 時,Counter 將會隨著每個處理過的影像進行無限次計數, 亦即會在由輸出鏈結 Bit Width 所定義的最大可能 Counter 值處發生循環。

當設定為 ON 時,Counter 會持續計數,直到達到最大可能值為止。 Counter 將會在最大值處停止計數。

使用範例

The use of operator ImageNumber is shown in the following examples: