Grayscale image to rgb image

2 ビュー (過去 30 日間)
Algorithms Analyst
Algorithms Analyst 2012 年 9 月 21 日
Can any one tranform the resultant inverse fourier transform image back to color because I am using the color image for FT.So when i apply IFT the resultant image should be color but I am seeing the gray image.Kindly help me my code is given below.
imageA=imread('lena.bmp');
figure,imshow(imageA)
title('Original Grayscale Lena Image');
imageA=double(rgb2gray(imageA));
fftA=fft2(imageA);
figure,imagesc(abs(fftshift(fftA)));
colormap gray;
imagesc(log(abs(fftshift(fftA))));
title('RGB lena Image Magnitude throught Fourier Transforms');
figure,imshow(angle(fftshift(fftA)),[-pi,pi]),colormap gray
title('RGB Lena Image Phase through fourier transform');
fftB = abs(fftA).*exp(i*angle(fftA));
imageB=ifft2(fftB);
cmin=min(min(abs(imageB)));
cmax=max(max(abs(imageB)));
figure,imshow(abs(imageB),[cmin cmax]); colormap in2rgb;
title('RGB Resultant Image Magnitude By inverse Fourier Transform');

回答 (2 件)

Dr. Deepak Kumar Rout
Dr. Deepak Kumar Rout 2012 年 9 月 21 日
You have to find DFT of RGB frames of the color image and then back in order to get color image or if u have converted the color image to gray before conversion then you simply use a pseudocolor image processing algorithm to it
  2 件のコメント
Algorithms Analyst
Algorithms Analyst 2012 年 9 月 21 日
can you send me the complete code please..?
Image Analyst
Image Analyst 2012 年 9 月 21 日
I don't agree with that. Pseudocoloring has nothing to do with it. You can fft each color plane, then filter, then inverse fft, and use cat(3,r,g,b) to recombine into a color image.

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


Dr. Deepak Kumar Rout
Dr. Deepak Kumar Rout 2012 年 9 月 21 日
  2 件のコメント
Algorithms Analyst
Algorithms Analyst 2012 年 9 月 21 日
i checked it out but no special feedback..my coding is totally diferrent...can u resend the code to me after implementing my code into ur computer. Thanks
Algorithms Analyst
Algorithms Analyst 2012 年 9 月 21 日
still no solution waiting..............

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

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by