Tomazi
Tomazi

Reputation: 791

trying to understand some bits i found in Opencv & c++

Hey peeps am studding opencv and running through some tutorials, i came across these attributes well I think they are that the problem really I dont know what they are tried google it but with no luck:

So these are the bits that i have no idea what they are have a look maybe someone can explain these to me so the tutorials will have more sense to me:

vector<Vec4i>() //I know what vector is :) but Vec4i....?
CV_8UC1 // <------- ?

Upvotes: 1

Views: 223

Answers (2)

Fantastic Mr Fox
Fantastic Mr Fox

Reputation: 33864

  1. Vec4i is just a typedef of a a vector:

    typedef Vec<int, 4> Vec4i; from here.

  2. CV_8UC1 is a #Define which helps with initialization of OpenCV matrices:

    e.g.

    CV_8UC1 means 8-bit single-channel matrix,

If you ever need OpnenCV type advice look at the documentation.

It is very helpful.

Upvotes: 1

Walfie
Walfie

Reputation: 3386

The OpenCV basic structures page (under the Vec section) explains that Vec4i is a typedef, equivalent to Vec<int, 4>, a vector of 4 integers.

Additionally, on the same page (under the Mat section), it explains that CV_8UC1 is an 8-bit single-channel matrix. Specifically:

  • 8 indicates the bit depth
  • U indicates that it is unsigned
  • C1 indicates that there is a single channel.

Here's a page with more information about OpenCV naming conventions.

Upvotes: 4

Related Questions