ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

openCV - imwrite

asked 2012-12-30 04:35:51 -0500

JaRu gravatar image

updated 2012-12-30 04:36:40 -0500

Hi all!

I like to use the imwrite method from opencv to create a bitmap from a matrix.

http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html?highlight=imwrite#bool%20imwrite%28const%20string&%20filename,%20InputArray%20img,%20const%20vector%3Cint%3E&%20params%29

Which package from openCV I have to import in my python file so that I can use "imwrite"? I think opencv2? But how can I use this by ROS electric? Because when I import opencv2 in my python file, I get the message that there is no modul like this.

Thanks for help!

edit retag flag offensive close merge delete

Comments

What exactly are you trying to do with ROS? If this is an opencv question, then suggest you post on the opencv answer forum. If this is a ROS question, then maybe more info on your problem will help. Otherwise @dinamex answer is probably correct.

Kevin gravatar image Kevin  ( 2012-12-31 07:27:27 -0500 )edit

I created a data array for the footstep_planner and I like to make a bitmap file from this data array. I know that I could do this with the imwrite method from opencv, but I could not import the opencv methods in my python file. I do not think that I have to use the opencv bridge, I have no image.

JaRu gravatar image JaRu  ( 2013-01-03 08:03:31 -0500 )edit

Ok ... this is an opencv question and not a ROS question. I use c++ not python, but if you include opencv2 that would give you access to imwrite in c++. However you do that in python should work too.

Kevin gravatar image Kevin  ( 2013-01-03 13:51:07 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-12-30 06:37:10 -0500

dinamex gravatar image

You should consider to use opencv_bridge

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-12-30 04:35:51 -0500

Seen: 1,649 times

Last updated: Dec 30 '12