How to rearrange pixels into a new matrix form

조회 수: 2 (최근 30일)
sadiqa ilyas
sadiqa ilyas 2019년 8월 17일
댓글: sadiqa ilyas 2019년 8월 19일
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

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 8월 17일
편집: KALYAN ACHARJYA 2019년 8월 17일
"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!

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by