How to store RGB values of multiple images with separate variables?

1 回表示 (過去 30 日間)
varuna watwe
varuna watwe 2021 年 8 月 14 日
回答済み: Image Analyst 2021 年 8 月 14 日
I have specified a folder location which contains jpg images. I am getting all images but now i want RGB values of each iage separately in workapace to process them further. Please can someone help me. Thank you for reading this question. I am attaching my code for your reference below.

回答 (2 件)

Matt J
Matt J 2021 年 8 月 14 日
編集済み: Matt J 2021 年 8 月 14 日
Something like this perhaps.
RGB=rand(256,256,3,10); %Images
tmp=cellfun(@squeeze, num2cell(RGB,[1,2,4]) , 'uni' ,0);
[R,G,B]=deal(tmp{:}); %separate channels
whos R G B
Name Size Bytes Class Attributes B 256x256x10 5242880 double G 256x256x10 5242880 double R 256x256x10 5242880 double

Image Analyst
Image Analyst 2021 年 8 月 14 日
My attached demo does this very nicely. Adapt as needed.

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by