Rearrange matrix terms is a challenge
조회 수: 1(최근 30일)
표시 이전 댓글
I am not finding exactly the right parameters to rearrange the terms of a matrix? It starts off as an RGB image I later convert to Lab, and want to store the Lab values to a text file in a particular rows x columns order, such that I end up with 49 rows by 33 columns. This is the code I have so far :
img = imread('Image 8-bit aRGBD65.tif');
imshow(img);
img_double = im2double(img);
img2Lab = rgb2lab(img_double, 'ColorSpace','adobe-rgb-1998', 'WhitePoint','d50');
LabIMG = reshape(permute(img2Lab,[3 1 2]),3,[]); % 3 x 1617
The LabIMG give mes a 3 rows x 1617 columns like this :

What I would like to have is for the data to be rearranged this way :
A1 = 42.29 66.60 0.69
B1 = some data (not shown)
C1 = some other data (not shown either)
... up to column 49 (AW1)
Then, the second row would follow with :
A2 = 47.57 58.15 1.54
B2 = ...
B3 = ...
.... Up to BW1
Third row :
C1 = 53.84 46.90 -0.31
C2 = ...
C3 = ...
... Up to CW1
Until I have 33 rows by 49 data points. I tried Transpose to no avail :
Transposed_CIELab = transpose(LabIMG);
I enclosed the resultant text file.... in case
I'm going in circles... Any help is appreciated.
댓글 수: 5
답변(0개)
참고 항목
범주
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!