Arash
Arash

Reputation: 3051

Combine RGB Of Different Dimension

I am newbie to Matlab Programming,

i have R , G , B values with different size(for example dimension R is 30000x1 and G is 35000x1) and want to make them same size to use cat(3,RColor , GColor, BColor); to combine them and produce image.

Upvotes: 1

Views: 60

Answers (1)

Rash
Rash

Reputation: 4336

You might resample all your R,G and B vectors to have the same length. You can choose an arbitrary length like m = 4000, to interpolate data by factor of m and decimate it by factor of length(~).

m = 4000;
R = double(R);
G = double(G);
B = double(B);
R = resample(R,m,length(R));
G = resample(G,m,length(G));
B = resample(B,m,length(B));
ImageRGB = cat(3,R,G,B);

Then you could change them back to R = uint8(R);, if you wish.

Upvotes: 2

Related Questions