ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I'm a little surprised that ever worked. JPEG doesn't support alpha, which is what that error message is telling you. An easy fix would be to remove the 'a' channel from your image. There may be a clever way to do it without deserializing the data, but the easiest thing would be to use opencv to split the image channels, then merge back the r, g and b channels (leaving out a).
2 | No.2 Revision |
I'm a little surprised that ever worked. JPEG doesn't support alpha, which is what that error message is telling you. An easy fix would be to remove the 'a' channel from your image. There may be a clever way to do it without deserializing the data, but the easiest thing would be to use opencv to split the image channels, then merge back the r, g and b channels (leaving out a).
EDIT - mixChannels will do it: Something like this should work (taken from the example, not tested):
// Mat rgba = input image
Mat rgb( rgba.rows, rgba.cols, CV_8UC3 );
Mat out[] = { rgb };
int from_to[] = { 0,0, 1,1, 2,2 };
mixChannels( &rgba, 1, out, 1, from_to, 3 );