2017-02-06 19 views
0

我知道如何根據示例使用此函數,我只是想知道是否有任何方法可以解釋這一點。爲什麼在尖括號中有兩個參數,Emgu庫中的一個類:Image <TColor,TDepth>

[SerializableAttribute] 
public class Image<TColor, TDepth> : CvArray<TDepth>, 
    IImage, IDisposable, ICloneable, IEquatable<Image<TColor, TDepth>> 
where TColor : new(), ColorType 


Image<Bgr, Byte> img = 
      new Image<Bgr, byte>(fileNameTextBox.Text) 
      .Resize(400, 400, Emgu.CV.CvEnum.Inter.Linear, true); 

我無法提供關於此的更多信息,謝謝!

+0

閱讀有關[C#泛型(https://msdn.microsoft.com/en-us/library/512aeb7t.aspx) –

+0

,然後按[ '圖像文件](http://www.emgu.com/wiki/files/3.1.0-r16.12/document/html/a8929aab-99c5-79cf-385c-dcc7769fea1.htm),它描述了這些類型參數。 –

+0

對不起,使用過時的鏈接,用這個更新我的評論:https://msdn.microsoft.com/en-us/library/512aeb7t.aspx –

回答

0

看起來像更基礎相關qustion。 定義類時,可以使用多個泛型類型。所以List<T>使用一個,Image<T1,T2>使用兩個和Tuple<T1,T2,...,T7,Trest>在不同的步驟中使用多達八(你也可以只用Tuple<T1,T2,T3>只有三個通用項目)。有很多關於泛型的知識 - 例如this

但實際上,這個問題是不是真的EmguCV相關..

相關問題