[Numpy-discussion] Help with interpolating missing values from a 3D scanner

David Bolme bolme1234@comcast....
Sun Jan 18 12:31:25 CST 2009

I have implemented an iterative gaussian smoothing approach that is  
working well for my purposes.  My approach uses a median filter to  
populate the initial values and then runs a few passes with gaussian  
smoothing.   This works very well for the missing values that I care  
about within the face region.

I also came across an error when I tried to use the Rbf class.  I was  
hoping that I could just input all of the data that I have and have a  
quick and easy solution.  I expect this would work if ran the Rbf on  
just a small image tile near the missing data region.  I am not sure  
if this is worthy of a bug report.

When I tried to create an RBF from the full image I got this error:

Traceback (most recent call last):
  File "/Users/bolme/Documents/workspace/pyvision/src/pyvision/types/ 
RangeImage.py", line 258, in <module>
  File "/Users/bolme/Documents/workspace/pyvision/src/pyvision/types/ 
RangeImage.py", line 184, in populateMissingData
  File "/Library/Python/2.5/site-packages/scipy-0.7.0.dev4645-py2.5- 
macosx-10.3-i386.egg/scipy/interpolate/rbf.py", line 129, in __init__
    r = self._call_norm(self.xi, self.xi)
  File "/Library/Python/2.5/site-packages/scipy-0.7.0.dev4645-py2.5- 
macosx-10.3-i386.egg/scipy/interpolate/rbf.py", line 144, in _call_norm
    return self.norm(x1, x2)
  File "/Library/Python/2.5/site-packages/scipy-0.7.0.dev4645-py2.5- 
macosx-10.3-i386.egg/scipy/interpolate/rbf.py", line 54, in  
    return sqrt( ((x1 - x2)**2).sum(axis=0) )
ValueError: broadcast dimensions too large.

This is probably because I tried to input the full 640X480 image.  Too  
much data.  x[mask], y[mask], and z[mask] are a one dimensional arrays  
with approximately 100,000 elements.  I am trying to predict z.  It  
would be nice to have a more descriptive error message.

More information about the Numpy-discussion mailing list