I'm trying to run the code, but I keep getting this warning :
'Warning: chol failed, algorithm abandoned';
because the cholcov(Sigma(:,:,j),0); line always fails at the 2nd iteration (bn_noise='T') or 3rd iteration (bn_noise='F').
FYI, I have no NaN values in my data, and I get coherent results with kmeans() and emgm() [the submission that inspired this one]. Actually, no matter what data I feed into the function (e.g. squre matrix, rand(m,n), ...) this step always fails.
I'm wondering if there would be a way to exclude some NaNs from the interpolation (to keep them as NaNs). At the moment, I'm masking the results away, but I'd rather exclude them altogether. I thought about modifying nan_list and known_list, but it seems to me I'd run onto problems if the input matrix wasn't "full". Any help on this?
(I'm using inpaint-nans in a stereo vision application to interpolate holes in the disparity maps. However, the images from which I compute disparity maps may have very large regions of invalid pixels which I don't need/want to interpolate).
that is, for a 3x3 summing window, the filtering window must be 5x5 to implement the algorithm correclty (see http://en.wikipedia.org/wiki/Summed_area_table#The_algorithm and note that points A, B and C are outside the summing window)
I tested this with a simple matrix for validation. Otherwise, thanks for the useful code.