Is there a Python alternative for matlab cp2tform and imtransform?

the code:

pt1=[input_points(:,2) input_points(:,1)];
pt2=[base_points(:,2) base_points(:,1)];
[pt1 pt2]=preProcessPoints(pt1,pt2);
transPr = cp2tform(pt1,pt2,'piecewise linear');
res = imtransform(I,transPr,'Xdata',[1 texturesize(1)],'YData',[1 texturesize(2)],'XYscale',1);
+3
source share
1 answer

The short answer is yes. You can check scipy.ndimage . If some of the functionality does not exist there, it should still be fairly simple to implement them yourself.

Update:
Do not expect a one-to-one correspondence between features. Learn more map_coordinatesand geometric_transform, they should provide similar functionality.

0
source

Source: https://habr.com/ru/post/1793935/


All Articles