Question about imresize?

Hi, I have this question:
I have a matrix whose pixel value represent a gaussian beam. For my experimental purpose I want to make it smaller in a matrix of equal dimensions and I have decided to do this:
Q=padarray(A, [1000*t 1000*t], 0);
SS=imresize(Q,[1000 1000]);
I encrease the matrix dimension then I resize it at the original dimension. Now what I am expecting is to see a smaller gaussian profile. But I see this:
The first matrix is the original one, the second one is the resized one. Why we dont see a gaussian.

12 件のコメント

Mathieu NOE
Mathieu NOE 2020 年 10 月 27 日
hello
the first image is related to Q or G ? - this is not clear
I ask because you resized G and not Q
Adam Danz
Adam Danz 2020 年 10 月 27 日
編集済み: Adam Danz 2020 年 10 月 27 日
What plotting commands are you using to produce each plot?
What's the outputs for
size(G)
size(SS)
Alberto Paniate
Alberto Paniate 2020 年 10 月 27 日
Sorry, i have edited question. The first image is A, the second one is SS
Adam Danz
Adam Danz 2020 年 10 月 27 日
Ok, but I have the same questions.
Alberto Paniate
Alberto Paniate 2020 年 10 月 28 日
Take the matrix A:
G=A.*conj(A);
figure,imagesc(G(:,:));
I have to do it because A is a complex matrix.
If I try with size(G) I have this error:
Array indices must be positive integers or logical values.
Rik
Rik 2020 年 10 月 28 日
Don't use size as a variable name.
Alberto Paniate
Alberto Paniate 2020 年 10 月 28 日
both 1000 1000
Adam Danz
Adam Danz 2020 年 10 月 28 日
Could you provide a mat file containing the variables A and t so we can reproduce this on our end?
Alberto Paniate
Alberto Paniate 2020 年 10 月 28 日
I have found that is a problem linked with the complexity of the matrix, if we consider a real matrix we dont have this problem.
Adam Danz
Adam Danz 2020 年 10 月 29 日
Thanks but it looks like there's at least 1 variable that's undefined.
Unrecognized function or variable 'E0'.
Error in ProvaSito (line 13)
A(k,j)=E0*exp(-0.5/(sigma^2)*((k-round(size2/2))^2+(j-round(size2/2))^2)); %gaussiana
>>
Alberto Paniate
Alberto Paniate 2020 年 10 月 29 日
put E0= 10; it is the same sorry
Adam Danz
Adam Danz 2020 年 10 月 29 日
Still more undefined vars.
Unrecognized function or variable 'gran'.
Error in ProvaSito (line 17)
for k=1:gran:(size2-gran)
Perhaps you could download your attachment and try to run it after clearning your workspace. Then you can find the missing vars and supply them.

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

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeConvert Image Type についてさらに検索

質問済み:

2020 年 10 月 27 日

コメント済み:

2020 年 10 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by