Ask Your Question
2

operations on cv::Point

asked 2012-10-04 13:38:16 -0600

mgb gravatar image

updated 2017-08-24 15:11:08 -0600

There aren't many operations defined on the cv::Point2/3 data type

IS this deliberate? Am I supposed to convert everything to a cv::Mat? Or is there some technical reason?

I'm starting to build a library of; dot & cross product, length, isEmpty() etc but this seems like a duplication of effort

edit retag flag offensive close merge delete

Comments

Sorry missed dot/cross. IIRC =/ and =* didn't work with a scaler. Normalize() and Length() would be useful as would an easy way of converting between cv Point3 and a row/column of a 3x3 Mat. I do a lot of 3D positioning !

mgb gravatar imagemgb ( 2012-10-14 14:23:31 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
6

answered 2012-10-04 14:29:08 -0600

updated 2012-10-04 14:40:31 -0600

Actually you have these functions for Points:

Point a, b;

//...

double dotProduct = a.dot(b);

double crossProduct = a.cross(b);

double length = norm(a);

What do you mean by isEmpty()? cv::Point always contain some data (e.g. zeros by default) so it cannot be empty.

Could you please provide more specific examples of missing functions?

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-10-04 13:38:16 -0600

Seen: 3,438 times

Last updated: Oct 04 '12