kylemcdonald / ofxCv

Alternative approach to interfacing with OpenCv from openFrameworks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

import ofxCv.h give error: ‘cv::Size2d’ has not been declared

trixymoon opened this issue · comments

I'm using the last version of master branch of openFramework and the last version of develop branch of ofxCv.
I'm using GNU Make 3.81 under linux Mint 17.1 64bit.

Compiling the project "example-face" give me these errors:

In file included from /home/giulio/git/openFrameworks/addons/ofxCv/src/ofxCv.h:22:0,
                 from /home/giulio/git/openFrameworks/addons/ofxCv/example-face/src/ofApp.h:4,
                 from /home/giulio/git/openFrameworks/addons/ofxCv/example-face/src/ofApp.cpp:1:
/home/giulio/git/openFrameworks/addons/ofxCv/libs/ofxCv/include/ofxCv/Calibration.h:30:67: error: ‘cv::Size2d’ has not been declared
         void setup(float focalLengthMm, cv::Size imageSizePx, cv::Size2d sensorSizeMm, cv::Point2d principalPointPct = cv::Point2d(.5,.5));
                                                                   ^
In file included from /home/giulio/git/openFrameworks/addons/ofxCv/src/ofxCv.h:22:0,
                 from /home/giulio/git/openFrameworks/addons/ofxCv/example-face/src/ofApp.h:4,
                 from /home/giulio/git/openFrameworks/addons/ofxCv/example-face/src/ofApp.cpp:1:
/home/giulio/git/openFrameworks/addons/ofxCv/libs/ofxCv/include/ofxCv/Calibration.h:31:58: error: ‘cv::Size2d’ has not been declared
   void setup(Mat cameraMatrix, cv::Size imageSizePx, cv::Size2d sensorSizeMm = cv::Size2d(0, 0));
                                                          ^
/home/giulio/git/openFrameworks/addons/ofxCv/libs/ofxCv/include/ofxCv/Calibration.h:35:3: error: ‘Size2d’ in namespace ‘cv’ does not name a type
   cv::Size2d getSensorSize() const;
   ^
/home/giulio/git/openFrameworks/addons/ofxCv/libs/ofxCv/include/ofxCv/Calibration.h:45:9: error: ‘Size2d’ in namespace ‘cv’ does not name a type
         cv::Size2d sensorSize;
         ^
/home/giulio/git/openFrameworks/addons/ofxCv/libs/ofxCv/include/ofxCv/Calibration.h:31:80: error: ‘Size2d’ is not a member of ‘cv’
   void setup(Mat cameraMatrix, cv::Size imageSizePx, cv::Size2d sensorSizeMm = cv::Size2d(0, 0));

I'm getting this error, too.
I assume the develop branch uses OpenCv 3. There is no typedef for Size2d in opencv2, only Size2f.

In my case it has to do with the cmake base build system for of: http://github.com/ofnode/of
The build System uses the header files of the Operating System instead of the openFramework provided ones. And the Size2d is not declared in there.

If one of you can push a PR that swaps Point2d for Point2f and fixes this,
I'm happy to merge it!

On Thursday, October 29, 2015, aspeteRakete notifications@github.com
wrote:

I'm getting this error, too.
I assume the develop branch uses OpenCv 3. There is no typedef for Size2d
in opencv2, only Size2f.


Reply to this email directly or view it on GitHub
#166 (comment).

Is this a good solution? I would assume that you used double precision because you needed it in these cases.

@aspeteRakete i used double because i was following examples from other folks. looking at what the data is actually used for, i think it's fine as single precision.