Hey there,
I am pretty new to Mathematica, but I want to implement my own interpolation algorithms.
To test them I built a rotate function.
inImage is a matrix containing the position of the Destination Image.
rot is the angle of rotation.
Offset just is an Offset to rotate around a specific Point.
rotate[inImage_, rot_,
Offset_] := {Offset[[1]] +
Sqrt[(inImage[[1]] - Offset[[1]])^2 + (inImage[[2]] -
Offset[[2]])^2]*
Cos[ArcTan[(inImage[[1]] - Offset[[1]]), (inImage[[2]] -
Offset[[2]])] - rot],
Offset[[2]] +
Sqrt[(inImage[[1]] - Offset[[1]])^2 + (inImage[[2]] -
Offset[[2]])^2]*
Sin[ArcTan[(inImage[[1]] - Offset[[1]]), (inImage[[2]] -
Offset[[2]])] - rot]}
As output i get an array containing the coordinates of the source Image.
Now i need a function to build up my destination Image.
I tried the following, but i don’t know why i cant use the output of my rotate function as part specification.
InImage is the SourceImage and NewPoints is the result of my first Image.
NeaNeigh[NewPoints_,
InImage_] := {InImage[[Round[NewPoints[[1]]],
Round[NewPoints[[2]]]]]};
Any advice how to fix this?