[Java] Deblur PSF and Wiener - all black result

In case anyone is ever interested, after much trial and error on-and-off over the year I got this to work: the culprit was wrong order parameters in a call to Imgproc.divide during PSF calculation. I had:

  Scalar summa = Core.sumElems(psf);
  Mat done = new Mat();
  Core.divide(summa.val[0], psf, done);

and I needed:

  Scalar summa = Core.sumElems(psf);
  Mat done = new Mat();
  Core.divide( psf, summa, done);