jeudi 19 février 2015

Transforming an image using a known displacement field with imwarp in matlab

I wish to transform an image using a known displacement field but am having issues using the imwarp function for this. Any help would be very very appreciated


I use a grid in order to project an image onto a known plane. By detecting the location of the grid points in the image and comparing them to the location in "real" space I am able to come up with a matrix, D_OH, of size [m, n, 2] which represents the x and y displacements required. I use the line:



OH_grid_avg_mapped = imwarp(OH_grid_avg_post, D_OH)



but get the following errors:



Error using imwarp Expected tform to be one of these types:


images.geotrans.internal.GeometricTransformation


Instead its type was double.


Error in imwarp>validateTform (line 367) validateattributes(t,{'images.geotrans.internal.GeometricTransformation'},{'scalar','nonempty'},'imwarp','tform');


Error in imwarp>preparseSpatialReferencingObjects (line 384) validateTform(tform);


Error in imwarp (line 136) [R_A, varargin] = preparseSpatialReferencingObjects(varargin{:});


Error in VizExpt_SchlierenOHAlign_v7 (line 261) OH_grid_avg_mapped = imwarp(OH_grid_avg_post, D_OH);"



Aucun commentaire:

Enregistrer un commentaire