Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

According to the documentation, what you should be doing is

Moments m = moments(imgThreshold, true);

In C++ calling new allocates memory for an object and returns a pointer to that object, i.e. the line

m = new Moments();

implies that m's type is "Moments*" not "Moments"

Also to get the moment values, you just get them from the resulting object directly.. m.m00, m.m01 etc.