Skip to content

Commit

Permalink
Merge pull request #3257 from changh95/patch-1
Browse files Browse the repository at this point in the history
Replace vec2mat with reshape #2
  • Loading branch information
dorodnic authored Feb 15, 2019
2 parents a3f7179 + 7819d7f commit 0a9d183
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions wrappers/matlab/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function depth_example()
for i = 1:5
fs = pipe.wait_for_frames();
end
% Stop streaming
pipe.stop();
Expand All @@ -55,10 +55,7 @@ function depth_example()
% Get actual data and convert into a format imshow can use
% (Color data arrives as [R, G, B, R, G, B, ...] vector)
data = color.get_data();
channels = vec2mat(data, 3);
img(:,:,1) = vec2mat(channels(:,1), color.get_width());
img(:,:,2) = vec2mat(channels(:,2), color.get_width());
img(:,:,3) = vec2mat(channels(:,3), color.get_width());
img = permute(reshape(data',[3,color.get_width(),color.get_height()]),[3 2 1]);
% Display image
imshow(img);
Expand Down

0 comments on commit 0a9d183

Please sign in to comment.