qt creator convert

asked 2014-07-28 04:44:26 -0500

Dante gravatar image

updated 2014-07-28 09:30:38 -0500

hi,

i record with rosbag a viedeo. I want to viaualize the video in a gui, with a qt creator, but rosbag records only in the Format Mono_8, buti need a rgb format to play the video. How can i decode the video? I try with this:

QImage temp(&( qnode.getThermalImage().data[0]), 320, 240, QImage::Format_Mono);
QImage image;
image = temp;

image = temp.convertToFormat(QImage::Format_RGB32);


 ui.lbl_video->setPixmap(QPixmap::fromImage(image));

 ui.lbl_video->update();
edit retag flag offensive close merge delete

Comments

A mono video stream does not contain color data. It looks like you're working with thermal image data; perhaps you're trying to create a false-color image from your thermal data? If so, you should update your question to make that more explicit.

ahendrix gravatar image ahendrix  ( 2014-07-28 12:46:38 -0500 )edit

yes, thats true. i work with thermal data. How can i change the format mono_8 to an rgb format, because in qt i cant visualize it.

Dante gravatar image Dante  ( 2014-07-29 04:36:49 -0500 )edit

There's still a lot of data missing here. Why can't you visualize it in QT? Do you get a compile error?Which sensor are you recording data from? What does the actual output look like? What do you expect it to look like?

ahendrix gravatar image ahendrix  ( 2014-07-29 13:05:37 -0500 )edit

how can i write theora subscriber. i dont find any example, how it should look. Some one an idea? I work with the variocam. My Topics name is /robotair/apache/thermal/image_resized_mono8/theora and the name of the type is theora_image_transport/Packet. At the moment my subscriber looks thus: thermoDataSubscriber = it.subscribe("/robotair/apache/thermal/image_resized_mono8/theora ", 1, &QNode::thermodataSubscriber_cb, this); This is my class thermodatasubscriber void QNode::thermodataSubscriber_cb(const sensor_msgs::ImageConstPtr& msg){ try { newThermalImg = cv_bridge::toCvCopy(msg, sensor_msgs::image_encodings::MONO8); } catch (cv_bridge::Exception& e) { ROS_ERROR("cv_bridge exception: %s", e.what()); } Q_EMIT signalThermoDataUpdated(); }

Dante gravatar image Dante  ( 2014-07-30 04:36:58 -0500 )edit

I'm sorry; if you change the topic and don't clearly explain your problem, I can't help you.

ahendrix gravatar image ahendrix  ( 2014-07-30 12:08:36 -0500 )edit