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

Revision history [back]

click to hide/show revision 1
initial version

The hacky version is to edit the source code in the image_view package named extract_view.cpp [line 105]:

orginal:

image = cv_bridge::toCvShare(msg, "bgr8")->image;

edited:

image = cv_bridge::toCvShare(msg, "mono8")->image;

This way only 8bit grayscale images are extracted. (that was on of the things I wanted.) Of course i had to "catkin_make" my catkin_workspace first before this works!

I think it would be a good idea to add a parameter which makes it possible for every user to extract the images in her/his desired fileformat, e.g.

ros::NodeHandle nh("~");
string the_format;
const string default_format = "bgr8";

nh.param<std::string>();

The hacky version is to edit the source code in the image_view package named extract_view.cpp [line 105]:

orginal:

image = cv_bridge::toCvShare(msg, "bgr8")->image;

edited:

image = cv_bridge::toCvShare(msg, "mono8")->image;

This way only 8bit grayscale images are extracted. (that was on of the things I wanted.) Of course i had to "catkin_make" my catkin_workspace first before this works!

I think it would be a good idea to add a parameter which makes it possible for every user to extract the images in her/his desired fileformat, e.g.

ros::NodeHandle nh("~");
string the_format;
const string default_format = "bgr8";

nh.param<std::string>("file_format", the_format, default_format);
....
image = cv_bridge::toCvShare(msg, "mono8")->image;

nh.param<std::string>();I am not that good with GitHub, otherwise I would send a pull request to the creator of image_view.

The hacky version is to edit the source code in the image_view package named extract_view.cpp [line 105]:

orginal:

image = cv_bridge::toCvShare(msg, "bgr8")->image;

edited:

image = cv_bridge::toCvShare(msg, "mono8")->image;

This way only 8bit grayscale images are extracted. (that was on of the things I wanted.) Of course i had to "catkin_make" my catkin_workspace first before this works!

I think it would be a good idea to add a parameter which makes it possible for every user to extract the images in her/his desired fileformat, e.g.

ros::NodeHandle nh("~");
string the_format;
const string default_format = "bgr8";

nh.param<std::string>("file_format", the_format, default_format);
....
image = cv_bridge::toCvShare(msg, "mono8")->image;
the_format)->image;

I am not that good with GitHub, otherwise I would send a pull request to the creator of image_view.