Ask Your Question
1

Difference between Point and Point2f

asked 2016-03-26 08:50:12 -0600

Giorgos_ts gravatar image

Hello I am new to opencv and I want to understand the difference of use of Point and Point2f .Can anyone please explain that and also give an example ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2016-03-26 09:02:58 -0600

LBerger gravatar image

updated 2016-03-26 09:03:36 -0600

in file types.hpp you can find :

typedef Point_<int> Point2i;
typedef Point_<float> Point2f;
typedef Point_<double> Point2d;
typedef Point2i Point;

Point is for integer coordinates and Point2f for floating point values

edit flag offensive delete link more

Comments

Ok thank you ! For example when i use : Mat A ; A.at<point2f>(y,x); what result do i get ?

Giorgos_ts gravatar imageGiorgos_ts ( 2016-03-26 09:32:19 -0600 )edit

Just try this small example :

Mat m(10,10,CV_32FC2);

vector<Mat> x;
split(m,x);
x[0].at<float>(2,5)=3.14;
x[1].at<float>(2,5)=2.718;
merge(x,m);

cout<<m.at<Point2f>(2,5);
LBerger gravatar imageLBerger ( 2016-03-26 10:54:02 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-03-26 08:50:12 -0600

Seen: 14,506 times

Last updated: Mar 26 '16