How to rearrange pixels into a new matrix form
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
sadiqa ilyas
le 17 Août 2019
Commenté : sadiqa ilyas
le 19 Août 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
0 commentaires
Réponse acceptée
KALYAN ACHARJYA
le 17 Août 2019
Modifié(e) : KALYAN ACHARJYA
le 17 Août 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!
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!