opencv入門Vec3f

來源:互聯網
上載者:User
Vec3f表示的是3通道float類型的 Vect,就相當於3通道float類型的映像(這是其中一個具體化),解釋可以從原始碼中看出來。
下面給出一個具體的例子:
Vec3f point = Vec3f(10,10,3.2);//Float, 3 components
Mat mat(3,3,CV_32FC3,);//3 channel matrix
Vec3f v3f = mat.at<Vec3f>(y, x);//read color values for pixel (y,x)
這裡注釋一下:Vec3f是一種資料類型,其是3通道的float,後面的mat.at<Vec3f>(y, x)是訪問映像的一種方式。(可以從定義形式上看出來 int a=....)

對於mat的理解,可以認為mat.at<Vec3f>是mat的一種訪問形式,其有點類似vector。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.