www.gusucode.com > robotics 案例源码程序 matlab代码 > robotics/ReadAndWriteCompressedImageMessagesExample.m

    %% Read and Write |CompressedImage| Messages
% Read and write a sample ROS |CompressedImage| message by converting
% it
%%
% Load sample ROS messages and inspect the image message. |imgcomp| is a
% sample ROS |CompressedImage| message object.
exampleHelperROSLoadMessages
imgcomp
%%
% Create a MATLAB image from the |CompressedImage| message using |readImage| and display it.
I = readImage(imgcomp);
imshow(I)