Info

この質問は閉じられています。 編集または回答するには再度開いてください。

image processing

1 回表示 (過去 30 日間)
Taleb Almajrbi
Taleb Almajrbi 2011 年 4 月 4 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
hi all
how can i convert 2-D matrix(image) into vector. please reply me.
many thanks

回答 (3 件)

Sean de Wolski
Sean de Wolski 2011 年 4 月 4 日
doc reshape
doc transpose
doc colon

Taleb Almajrbi
Taleb Almajrbi 2011 年 4 月 4 日
hi my answer is Sv1=reshape(F1,size(F1,1)* size(F1,2),1); So is this answer correct? please reply me.
thanks
  2 件のコメント
Sean de Wolski
Sean de Wolski 2011 年 4 月 4 日
Yes, this is correct. I would do it with numel since that's robust to higher dimensional matrices and faster:
Sv1=reshape(F1,numel(F1),1);
Sean de Wolski
Sean de Wolski 2011 年 4 月 4 日
Also:
Sv1 = F1(:); %works also.

Taleb Almajrbi
Taleb Almajrbi 2011 年 4 月 4 日
Hi All in fact i am doing project of image processing by using fourier trnsform where the 1step: apply the fft2 for the image z1. 2step convert the image into vector to discard half of fourier trnsformed image then show the last image of fourier trnsformed so this my code is it correct? please reply me/ thanks
Ft=fft2(Z1); %apply fourier trnsform function St=abs(Ft);
St1=reshape(Ft,size(Ft,1)* size(Ft,2),1);%convert fourier trnsformed image into vector St2=St1(1:floor(length(St1)/2)); %iscard half of Fourier spectrum
Fct=fftshift(Ft);
F11=log(1+abs(Fct));
subplot(236),imshow(F11, []),title('fft2 image for haning window image');

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by