Mehdi Sajjadi
Mehdi Sajjadi

Reputation: 7

Vector<Vec3b> difference with Vector<int> in OpenCV

My project is about the moving puck detection and location finding on hockey table. I need to use HoughCircles to detect the circular form of the puck. But for this hough alghoritm I need to make a Vector. I am familiar with Vector concept and how it is working ( basic), but there is problem of differentiating for example Vector<int> Vec and Vector<Vec3b> Vec.

Is it possible to somebody let me know what is their difference in meaning and application?

Upvotes: 0

Views: 3102

Answers (1)

Miki
Miki

Reputation: 41775

Pay attention that Vector and vector are different. vector is std::vector, while Vector is cv::Vector. Even if in practice the difference is minimal, they are really different things.

I'll assume you meant std::vector, but in this context this is valid also for cv::Vector.


A vector<int> is a vector of integers. Nothing fancy about this.

A vector<Vec3b> is a vector of cv::Vec3b, which is an OpenCV structure that holds 3 uchar (unsigned char), i.e. a type with 8 bit that can contain data from 0 to 255. It is in fact defined as a cv::Vec_<uchar, 3>. cv::Vec is a template class that represents short numerical vectors, up to 4 elements, but this is not important here.

A Vec3b is usually used in OpenCV to store the color for a pixel, usually a B,G,R triplet.

Upvotes: 3

Related Questions