Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the function CvPoint2D32f in OpenCV

Tags:

opencv

CvPoint2D32f

I want to know what this function does, for example:

CvPoint2D32f center = cvPoint2D32f(src->width/2,src->height/2);
like image 225
mohammed Avatar asked Aug 06 '26 22:08

mohammed


2 Answers

OpenCV has a few different data structures for points (that is, x:y or x:y:z coordinates) and their name tells you what type of point it is.

This particular point is a 2D Point - so it has just X and Y coordinates, and they are 32-bit floating point values. That's what the 32f at the end means. A 3D point that uses 32-bit floating point values would have 3D32f at the end of the data type name.

See this page in the OpenCV reference documentation for more info.

like image 146
Jesse DeGuire Avatar answered Aug 10 '26 19:08

Jesse DeGuire


The code you posted sets the coordinates of a 2D point type as the center coordinates of some src data structure (eg cv::Mat or CvMat).


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!