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?
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?