How to rearrange pixels into a new matrix form

6 Ansichten (letzte 30 Tage)
sadiqa ilyas
sadiqa ilyas am 17 Aug. 2019
Kommentiert: sadiqa ilyas am 19 Aug. 2019
I have 64*64 rgb image. I want to reaarange its pixels in matrix form.I.e lowest intensity value comes to the first place (1,1) Second pixel should come to (2,1) and so on till the end of first column. Then move to the next colum. But I dont know how to do it in matlab.Can any one help me

Akzeptierte Antwort

KALYAN ACHARJYA
KALYAN ACHARJYA am 17 Aug. 2019
Bearbeitet: KALYAN ACHARJYA am 17 Aug. 2019
"I have 64*64 rgb image. I want to reaarange its pixels in matrix form.I.e lowest intensity value comes to the first place (1,1) Second pixel should come to (2,1) and so on till the end of first column. Then move to the next colum. But I dont know how to do it in matlab.Can any one help me"
I have done for single gray image (RGB Just having three plane), or you can easily incorparates the same.
image_test=magic(5) % Just for example 5x5 gray image
data1=sort(image_test(:));
final_image=reshape(data1,[5 5])
Command Window:
image_test=
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
final_image =
1 6 11 16 21
2 7 12 17 22
3 8 13 18 23
4 9 14 19 24
5 10 15 20 25
*If you have look for RGB images, just extract the all three plane and do the same and later concanate results again to 3 plane image.
Hope it Helps!

Weitere Antworten (0)

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by