vector <vector <Point2f> > to Mat? [closed]

asked 2014-08-13 05:08:59 -0600

konstunn gravatar image

updated 2018-01-13 18:10:19 -0600

I've got vector of vectors of Point2f's. I need to:

  1. subtract a predefined point from all of them with opposite sign
  2. calculate element-wise L2 norm of each result point
  3. find minimal norm indexes then

I'm confused and stuck with cv:Mat and std::vector. What is the best way to store and process my data...?

Couldn't you, please, suggest an easy and simple way to perform actions listed above?

Thanks in advance.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2017-09-05 10:43:41.398604

Comments

3

you can't make a proper Mat from that, since all the row-vecs have different size. also, 2. and 3. don't exist for cv::Mat.

bite the apple and iterate the vectors.

berak gravatar imageberak ( 2014-08-13 05:38:12 -0600 )edit