Hello Yulia,
This command reads a Radiance-formatted HDR image into Matlab:
Img = hdrread('Image.hdr');
The following 3 commands perform 2D fast Fourier filtering on the Red,
Green, and Blue image planes, respectively.
FRed = fft2(Img(:,:,1));
FGreen = fft2(Img(:,:,2));
FBlue = fft2(Img(:,:,3));
I'm not sure what you are planing to do, but you can also do the work
with luminance values by first preparing the image using Radiance
commands. For example, from the command line:
>> pvalue -o -b RGBImage.hdr > Luminance.dat
>> pvalue -o -b -r Luminance.dat > RedundantGrayscaleImage.hdr
Then in Matlab, strip off two redundant image planes, and you are left
with luminance.
A second, perhaps easier way to get luminance values is to rewrite this
famous equation in Matlab:
luminance = 179 * (0.265*R + 0.670*G + 0.065*B)
Modified for Matlab, this should do the trick:
Luminance = 179 .* (0.265.*Img(:,:,1) + 0.670.*Img(:,:,2) +
0.065.*Img(:,:,3));
No matter what you are doing, be sure all matrices remain high
resolution (i.e., 'double precision' and not 'uint8'), or you will get
8-bit aliasing, clipping, Matlab errors, and all kinds of problems.
In Chapter 4 of my dissertation, there are some image processing
techniques using Matlab and Photoshop, including Fourier filtering with
Matlab. It might be worth a look:
Evaluating Object Visibility with Simulated Visual Impairment Using Real
and Rendered Scenes. URL: http://purl.umn.edu/144216
One more thought: there are also ways to read the header information
into Matlab, if necessary. A bit of that is covered in my code snippets
of Chapter 4.
Have fun!
-Chris
On 2/27/13 1:46 PM, Yulia Tyukhova wrote:
Good afternoon everyone!
Is there a way to do a Fourier Transform of 2D HDRI in Matlab?
Thank you,
Yulia Tyukhova
_______________________________________________
HDRI mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/hdri
_______________________________________________
HDRI mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/hdri