简体   繁体   中英

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?

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 ), ie 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM