[Numpy-discussion] numarray, nd_image transforms, and multi-channel images

Peter Verveer verveer at embl-heidelberg.de
Thu Apr 14 02:45:45 CDT 2005


Hi Alex,

It is correct that there is an amount of work duplicated, if you do an 
identical interpolation operation on several arrays. There is currently 
no way to avoid this. This can be fixed and I will have a look to see 
how easy that is to do. If it is not easy to factor out that part of 
the code, I will most likely not be able to spend the time to do it 
though...

You could at least use the map_coordinates function that will allow you 
to use a pre-calculated coordinate mapping. There will still be 
duplication of work, but al least you avoid the duplication of the 
calculation of the coordinate transformation.

Peter

> Hi all.
>  
> I've been looking at numarray to do some image processing. A lot of 
> the work I do deal with transforming images, either with affine 
> transformations, or vector field. Numarray seems somewhat well equiped 
> to address these issues, but I am concerned about one aspect. It seems 
> that the transformation code (affine_transforrm and 
> geometric_transform) computes input coordonates for every output 
> coordinate in the resulting array. If I have an RGB image for which 
> the transformation is the same for all 3 RGB channels, I would assume 
> that this will triple the workload unncessarily. It might have a 
> dramatic effect for the geometric transformation which will most often 
> be slower then affine. Is there any way around this, e.g. is it 
> possible to specify numarray to use the same interpolation 
> coefficients for the last "n" dimention of the array, or to tell 
> numarray to only compute interpolation coefficients and apply those 
> seperatly for each channel?
>  
> thx for any help / info.
>  
> alex.





More information about the Numpy-discussion mailing list