cv::Vec3f vs cv::Point3f
May sound like a stupid question. I have always wondered if there is an important difference between the two ?
May sound like a stupid question. I have always wondered if there is an important difference between the two ?
The way you access thelements. cv::Vec3f is a vector of 3 float elements and hence belongs to the class Vector. You access each element by dereferencing the index.
Point3f is more intuitive, because you access the elements using a struct that is made of 3 floats. So the first element is accessed using point.x, the second is accessed using point.y and the third by point.z. The Point class also gives access to other coordinate related stuffs such as cross and dot product.
The class vector where in is primarily used to store and access data.
I am not sure, about the speed difference between the two. But as an end user, Point makes life pretty simple.
Asked: 2017-02-22 09:28:42 -0600
Seen: 6,967 times
Last updated: Jan 21 '18