Skip to content

opencv viz bug#6731

Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom
thecoldviews:viz_sample
Jun 30, 2016
Merged

opencv viz bug#6731
opencv-pushbot merged 1 commit intoopencv:masterfrom
thecoldviews:viz_sample

Conversation

@thecoldviews
Copy link
Copy Markdown
Contributor

In the viz tutorial sample code, it should be Vec3f instead of Point3f.

removed binary

update
@alalek
Copy link
Copy Markdown
Member

alalek commented Jun 27, 2016

What kind of error do you have?
I believe this conversion operator should work fine.

@thecoldviews
Copy link
Copy Markdown
Contributor Author

on running g++ transformations.cpp 'pkg-config --cflags --libs opencv'

I get
transformations.cpp: In function ‘int main(int, char**)’: transformations.cpp:77:80: error: invalid initialization of reference of type ‘const Vec3d& {aka const cv::Vec<double, 3>&}’ from expression of type ‘cv::Point3f {aka cv::Point3_<float>}’ Affine3f cam_pose = viz::makeCameraPose(cam_pos, cam_focal_point, cam_y_dir); ^ In file included from /usr/local/include/opencv2/viz.hpp:52:0, from transformations.cpp:7: /usr/local/include/opencv2/viz/vizcore.hpp:81:29: error: in passing argument 1 of ‘cv::Affine3d cv::viz::makeCameraPose(const Vec3d&, const Vec3d&, const Vec3d&)’ CV_EXPORTS Affine3d makeCameraPose(const Vec3d& position, const Vec3d& focal_point, const Vec3d& y_dir); ^ transformations.cpp:81:132: error: invalid initialization of reference of type ‘const Vec3d& {aka const cv::Vec<double, 3>&}’ from expression of type ‘cv::Point3f {aka cv::Point3_<float>}’ Affine3f transform = viz::makeTransformToGlobal(Vec3f(0.0f,-1.0f,0.0f), Vec3f(-1.0f,0.0f,0.0f), Vec3f(0.0f,0.0f,-1.0f), cam_pos); ^ In file included from /usr/local/include/opencv2/viz.hpp:52:0, from transformations.cpp:7: /usr/local/include/opencv2/viz/vizcore.hpp:70:29: error: in passing argument 4 of ‘cv::Affine3d cv::viz::makeTransformToGlobal(const Vec3d&, const Vec3d&, const Vec3d&, const Vec3d&)’ CV_EXPORTS Affine3d makeTransformToGlobal(const Vec3d& axis_x, const Vec3d& axis_y, const Vec3d& axis_z, const Vec3d& origin = Vec3d::all(0));

Which gets resolved after the change I mentioned. Is there something else I am missing?

@alalek
Copy link
Copy Markdown
Member

alalek commented Jun 30, 2016

Thanks! 👍

P.S. Automatic conversion operator doesn't work here because it can't change data type from float to double during conversion between Point and Vec.

@opencv-pushbot opencv-pushbot merged commit 43dca11 into opencv:master Jun 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants