Matx Data-Type Short-Hand Rules? [closed]

asked 2013-11-28 19:30:33 -0600

dmcenan gravatar image

Hi Guys, I was reviewing the various OpenCV data types and have a question about the Matx data type (the question also applies to the Vec data type).

We know that you can declare a Matx object using regular notation and short hand notation as below (to define a 2x2 matrix):

Matx<float,2,2> m1 = {1.1,2.2,3.3,4.4};     //regular notation

Matx22f m2 = {1.1,2.2,3.3,4.4};         //shorthand notation

From testing I can see that there are limitations on what size dimensions can be used for short hand notation. For example we can write Matx43f but not Matx42f to define a 4x2 matrix of floats.

Why is this and is there some standard rule for determining what dimensions can be used when defining Vec's or Matx's? Also why can't we use short-hand notation to declare a Matx of int's using Matx22i? It seems really confusing and I wish it was somehow standardized.

Thanks!

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2020-10-07 06:08:42.655381

Comments

don't worry too long about it (those shorthand typedefs were obviously added as they were needed)

just make your own:

typedef Matx<float,4,2> Mat42f;

typedef Matx<int,2,2> Mat22i;

berak gravatar imageberak ( 2013-11-29 04:28:47 -0600 )edit