フィルターのクリア

Assign 3-by-1 matrix to image 3D matrix

2 ビュー (過去 30 日間)
Grega Mocnik
Grega Mocnik 2019 年 9 月 17 日
回答済み: Grega Mocnik 2019 年 9 月 17 日
Hello,
I get color values from loop and impixel function.
Color values is 1x3 matrix.
For my calculate must be color dimension like 3x1, therefoe transponing. Result is 3x1 matrix (LMS).
My question is:
how assign 3x1 (LMS) matrix to new matrix (A_LMS) which will be built (and dimension increase) simultaneously. New matrix (A_LMS) is the same size of original image (A)?
for Z = 1 : Za
for Y = 1 : Ya
for X = 1 : Xa
color = impixel(A, X, Y);
LMS = mapM*(color.');
A_LMS(, , Z) = LMS.';
end
end
end

採用された回答

Grega Mocnik
Grega Mocnik 2019 年 9 月 17 日
I solve this issue:
for Z = 1 : Za
for Y = 1 : Ya
for X = 1 : Xa
color = impixel(A, X, Y);
LMS = mapM*(color.');
[Xlms, Ylms] = size(LMS);
for Y_LMS = 1 : Ylms
for X_LMS = 1 : Xlms
A_LMS(X, Y, Z) = LMS(X_LMS, Y_LMS);
end
end
end
end
end

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by