A quick change leads to a surprising result - for me at least. Following the idea that I use
new Mat()
my calcPSF function with some logging is now telling me I have an empty Mat for the PSF, is this correct?
FYI, When I inspect the psf object just before the return I see
“Mat [ -1*-1*CV_8UC1, isCont=false, isSubmat=false, nativeObj=0x7f4adc004680, dataAddr=0x0 ]”
private Mat calcPSF(Size filterSize, int radius)
{Mat psf = new Mat();
Point centrePoint = new Point(filterSize.width / 2, filterSize.height / 2);Imgproc.circle(psf, centrePoint, radius, new Scalar(255), -1, 8);
Scalar summa = Core.sumElems(psf);Core.divide( summa.val[0], psf, psf);
SceneImageUtils.print("Empty PSF? : " + psf.empty() );
return psf;
}