Java Advanced Imaging and DFT

L

Lukasz Indyk

i want to write piece of code calculating discrete fourier transform of
image and then magnitude of transform. i use code that i've rewritten
from JAI programmer's guide:

// calculating DFT
ParameterBlock pb = new ParameterBlock();
pb.addSource(frame.getImage());
pb.add(DFTDescriptor.SCALING_NONE);
pb.add(DFTDescriptor.REAL_TO_COMPLEX);
PlanarImage dft = (PlanarImage)JAI.create("dft", pb, null);

// calculating the magnitude
pb = new ParameterBlock();
pb.addSource(dft);
PlanarImage magnitude = JAI.create("magnitude", pb, null);
// probowalem tez "Magnitude", z duzej litery, tez nie dziala

// displaying the magnitude in frame
createFrame(magnitude.getAsBufferedImage(), "", true);

but this code always produce completely white image (every pixel of
image is white). maybe the problem is that as a source to procedure
calculating DFT i use BufferedImage, not PlanarImage? if not, what is
the problem?
 
A

ak

i want to write piece of code calculating discrete fourier transform of
image and then magnitude of transform. i use code that i've rewritten
from JAI programmer's guide:

// calculating DFT
ParameterBlock pb = new ParameterBlock();
pb.addSource(frame.getImage());
pb.add(DFTDescriptor.SCALING_NONE);
pb.add(DFTDescriptor.REAL_TO_COMPLEX);
PlanarImage dft = (PlanarImage)JAI.create("dft", pb, null);

// calculating the magnitude
pb = new ParameterBlock();
pb.addSource(dft);
PlanarImage magnitude = JAI.create("magnitude", pb, null);
// probowalem tez "Magnitude", z duzej litery, tez nie dziala

// displaying the magnitude in frame
createFrame(magnitude.getAsBufferedImage(), "", true);

but this code always produce completely white image (every pixel of
image is white). maybe the problem is that as a source to procedure
calculating DFT i use BufferedImage, not PlanarImage? if not, what is
the problem?

all JAI questions and answers here:
http://swjscmail1.sun.com/archives/jai-interest.html

____________

http://reader.imagero.com the best java image reader.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top