1

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 // <------- ?
1
  • Vec4i is a type, CV_8UC1 looks like a macro Commented Feb 4, 2013 at 2:19

2 Answers 2

4

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.

Sign up to request clarification or add additional context in comments.

4 Comments

Thank you so much great just wont i need to know and wonted
@Tomazi Just for future reference, what and wanted are spelt with an 'a' and not an 'o'. Also nice answer Walfie, +1
Hey again just one quick question C1 single channel means the stored image will be Grayscale or black an white where C3 would be used for color images...?#
@Tomazi Yes, single-channel matrices are suitable for storing greyscale images, and three-channel matrices for colored images (the three channels being red, green, and blue)
1
  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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.