Ask Your Question


asked 2011-07-21 07:44:13 -0500

ros_beginner gravatar image

updated 2011-09-03 15:31:18 -0500

kwc gravatar image


I'm trying to get image information from Image message and make a image data.

I found that there is some guideline to do this by using open cv.

However, I want to create image class defined by myself, which takes image data like matrix format.

I found that message has uint8_t data. how should I convert to image data to double??

Am I understanding image.h header file correctly?

If not, can you give me some comments?


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2011-07-21 07:50:25 -0500

makokal gravatar image

This is a very openCV kinda question, I suggest you look at the very well written documentation given in the wiki Pay special attention to the Mat data structure.

edit flag offensive delete link more


Okay, so what I am thinking is. convert imageMessage into Iplimage format. Then, I want to convert this Iplimage into Mat format. Then, I want to copy this Mat data using memcpy so that I can construct image. Then, I know width and height, but I don't know what is the type of the data Mat data. How should I know the type of Mat data. is it just uint8_t?
ros_beginner gravatar image ros_beginner  ( 2011-07-21 08:31:32 -0500 )edit

answered 2011-07-21 08:33:15 -0500

fergs gravatar image

You may be interested in taking a look at cv_bridge which converts ROS images into OpenCV images.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2011-07-21 07:44:13 -0500

Seen: 171 times

Last updated: Jul 21 '11