I have a matrix of RGB values as shown below, and entire .txt file is also attached
pixels = [129 108 61;117 96 51;102 77 36;94 64 26;97 59 22; ]
I want to convert this into an image, and I tried like below but it gives 90 degrees rotated image:
new_img = uint8(pixels);new_img = reshape(new_img, 407, 516, 3);
I have tried like below based on the one of the answer
pixels = load("hw4-image.txt");new_img = uint8(pixels);new_img = reshape(new_img, 407, 516, 3);new_img = permute(new_img(end:-1:1,:,:),[2 1 3]);image(new_img);
expected image is:
But I got
Best Answer