how to match both the side?
6 ビュー (過去 30 日間)
古いコメントを表示
Sir, If LHS is 3D image and RHS is 2D then how to match both the side
eg.
outimg(:,:,1)=out1img
how to convert the RHS(2D-image) to LHS (3D)
* *outimg* * is rgb image
0 件のコメント
回答 (1 件)
Wayne King
2013 年 11 月 29 日
編集済み: Wayne King
2013 年 11 月 29 日
If it's a simple matter of assigning matrices, then your syntax works.
outimg = zeros(256,256,3);
out1img = ones(256,256);
outimg(:,:,1) = out1img;
or
out2img = randn(256,256);
out3img = randn(256,256);
outimg = cat(3,out1img,out2img,out3img);
But if you are trying to convert a grayscale image into RGB, there's more to it than simply copying images into the 3 pages of a new matrix (unless you've done the work already). You may want to look at this answer:
3 件のコメント
Image Analyst
2013 年 11 月 29 日
Wayne, since he works for the Mathworks, may have the Crystal Ball Toolbox, but I don't , so you'd need to attach your code for me to see what you're doing wrong.
参考
カテゴリ
Help Center および File Exchange で Convert Image Type についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!