System.out.println("filtrage");
ArrayList<Raster> filteredImages = new ArrayList<Raster>();
BorderExtender extender = BorderExtender.createInstance(BorderExtender.BORDER_REFLECT);
for(int j = 0; j < kernelList.size(); j++){
KernelJAI kernel = kernelList.get(j);
ParameterBlock pb = new ParameterBlock();
pb.addSource(gray);
pb.add(kernel.getWidth()/2);
pb.add(kernel.getHeight()/2);
pb.add(kernel.getWidth()/2);
pb.add(kernel.getHeight()/2);
pb.add(extender);
PlanarImage temp = JAI.create("border", pb);
PlanarImage filtered = JAI.create("convolve", temp, kernel);
pb = new ParameterBlock();
pb.addSource(filtered);
pb.add(-kernel.getWidth()/2);
pb.add(-kernel.getHeight()/2);
pb.add(-kernel.getWidth()/2);
pb.add(-kernel.getHeight()/2);
pb.add(extender);
PlanarImage result = JAI.create("border", pb);
//absolute
result = AbsoluteDescriptor.create(result, null);