フィルターのクリア

Problem in resizing the image

1 回表示 (過去 30 日間)
anu
anu 2016 年 12 月 15 日
編集済み: Adam 2016 年 12 月 15 日
I resized the image to 300 * 300 using following code
im = imread('E:\flower1\img.jpg');
k=imresize(im,[300,300]);
imwrite(k,'E:/flower1/aa.jpg','jpg');
But when I read the image
>> x=imread('e:\flower1\aa.jpg');
[r1 c1]=size(x);
>> r1
r1 =
300
>> c1
c1 =
900
I am getting no of columns 900. Can anybody explain tell me why this is 900?
  1 件のコメント
KSSV
KSSV 2016 年 12 月 15 日
It should not happen...attach your image here..

サインインしてコメントする。

採用された回答

Adam
Adam 2016 年 12 月 15 日
編集済み: Adam 2016 年 12 月 15 日
At a guess, given the tell-tale factor of 3 difference, I would say this is because it is saved as a true RGB image and it has 3 dimensions, not 2. In your case its dimensions are actually
300 * 300 * 3;
The 3 being the RGB dimension.
[a, b, c] = size( x );
should show this, but if you do not give enough outputs for all dimensions to the size function it will just roll up the remaining dimensions into the last one you give as an output argument.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeRead, Write, and Modify Image についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by