Getting rows and columns of image
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
anu
am 30 Sep. 2016
Bearbeitet: Walter Roberson
am 10 Jul. 2017
I have color jepg image.
I got the following output for imfinfo
>> I=imfinfo('D:\images\im.jpg');
>> I
I =
Filename: 'D:\images\im.jpg'
FileModDate: '03-Jul-2008 01:10:24'
FileSize: 184721
Format: 'jpg'
FormatVersion: ''
Width: 500
Height: 500
BitDepth: 24
ColorType: 'truecolor'
FormatSignature: ''
NumberOfSamples: 3
CodingMethod: 'Huffman'
CodingProcess: 'Sequential'
Comment: {}
But when I try to get no of columns and rows from the matrix of the same image I got
I=imread('D:\images\im.jpg');
[r1 c1]=size(I);
>> r1
r1 =
500
>> c1
c1 =
1500
I am getting 500 which is correct rows but 1500 value for column. Why? Is this for 500 * 3 for 3 different channels?
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 30 Sep. 2016
Try this:
[rows, columns, numberOfColorChannels] = size(rgbImage);
For more on this, see Steve's blog: http://blogs.mathworks.com/steve/2011/03/22/too-much-information-about-the-size-function/
Don't use capital I for a variable name. It looks too much like a 1 (one) and an l (lower case L), plus it's not very descriptive.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Denoising and Compression 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!