Image matrix dimensions flipped compared to original image
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Punnag Chatterjee
am 4 Dez. 2020
Kommentiert: Bjorn Gustavsson
am 4 Dez. 2020
img1 = rgb2gray(imread('Image1.png'));
size(img1)
ans =
384 512
When I apply this command to load the image the matrix 384x512. However, the original png image has 512x384 pixels. What am I missing here that the image matrix in MATLAB looked flipped. I was expecting MATLAB to create a 512x384 matrix.
0 Kommentare
Akzeptierte Antwort
Ameer Hamza
am 4 Dez. 2020
Bearbeitet: Ameer Hamza
am 4 Dez. 2020
Commonly image resolution is expressed as width x height. However, in MATLAB the size() returns "number of rows (height)" x "number of columns (width)". However, it should not look flipped due to this. imshow() should show the same image as shown outside MATLAB.
2 Kommentare
Bjorn Gustavsson
am 4 Dez. 2020
Then you'll have to "learn to accept" the matlab-indexing-notation/convention:
I_xy = Img(row_idx_y,col_idx_x);
Weitere Antworten (0)
Siehe auch
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!