Hot answers tagged geometric-transform
4
If the problem is that the transformation function is slow to compute, a simple way to create and use a look-up table is to memoize the function:
(* create an example image *)
image = RandomImage[1, {30, 20}, ColorSpace -> "RGB"] ~ ImageResize ~ Scaled[10]
(* define the transformation function with memoization *)
mem : func[{x_, y_}] := mem = {x + 0.01 ...
3
ImageTransformation works with functions, not tables. It should be straightforward to define a function that carries out the same transformation as the table, but you will need to be aware that the #[[1]] and #[[2]] arguments go from 0 to 1 (across the image) so you will need to design the function to handle this input range. For example, you might want a ...
2
I think you have to make sure that your transformation function always handles input cleanly. Here's a test you can do to see what goes into your function. (And I think you can use real coordinates if you use the DataRange option.)
i = ImageResize[ExampleData[{"TestImage", "Mandrill"}], {20, 20}];
The function:
f[pt_] := (Print[pt]; {pt[[1]], pt[[2]]});
...
Only top voted, non community-wiki answers of a minimum length are eligible
