Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the Vec3b type?

Tags:

types

opencv

I came across the type Vec3b in OpenCV. I just couldn't find a description if this type and why we use it.

Do you know of any reference that describes such type, or, if you can clarify it this would be very much appreciated.

Thanks.

like image 719
Simplicity Avatar asked Aug 24 '15 19:08

Simplicity


People also ask

What is Vec4i?

Vec4i is a structure for representing a vector with 4 dimensions, with each value an int. If you look at the HoughLinesP() documentation you'll see what each dimension in is in this particular case: lines – Output vector of lines.

What is CV_8UC3?

so CV_8UC3 is an 8-bit unsigned integer matrix/image with 3 channels. Although it is most common that this means an RGB (or actually BGR) image, it does not mandate it. It simply means that there are three channels, and how you use them is up to you and your application.

What is OpenCV scalar?

A Scalar is a. Template class for a 4-element vector derived from Vec. Being derived from Vec<Tp, 4> , Scalar and Scalar can be used just as typical 4-element vectors. The type Scalar is widely used in OpenCV to pass pixel values.


2 Answers

Vec3b is the abbreviation for "vector with 3 byte entries"

Here those byte entries are unsigned char values to represent values between 0 .. 255.

Each byte typically represents the intensity of a single color channel, so on default, Vec3b is a single RGB (or better BGR) pixel. So Vec3bVar[0] might be the blue color part, [1] green and [2] red.

But it could be any other 24 bit 3 channel pixel value like HSV.

like image 188
Micka Avatar answered Sep 20 '22 16:09

Micka


vec3b is defined as 3 uchars vec: From OpenCV documentation:

typedef Vec<uchar, 3> Vec3b;
like image 40
zenpoy Avatar answered Sep 17 '22 16:09

zenpoy