I have identified a list of corresponding points on two different images manually. I have found the geometrical transformation between such sets of points using FindGeometricTransform
and I would now like to transform one of my images according to such transformation. When I do so, however, Mathematica gives me a completely black image and I don't understand how to get the first image transformed.
Here are the images:
I import them with:
i10 = Import["https://i.stack.imgur.com/cdx00.jpg"];
i15 = Import["https://i.stack.imgur.com/XApmx.jpg"];
The lists of corresponding points are:
pts10 = {{1934.77615025538`,
1576.1190734112033`}, {2058.4519305241565`,
1405.2746195470152`}, {1594.8656770702503`,
1522.0661370677385`}, {1717.5432392405596`,
1641.0491448965918`}};
pts15 = {{1821.159315341623`,
2432.200159743154`}, {1935.081765338483`,
2254.0263438834454`}, {1476.992138438835`,
2391.701747362471`}, {1604.3856168362227`, 2505.453543001129`}};
This command finds the transformation:
f = FindGeometricTransform[pts15, pts10, TransformationClass -> "Rigid"][[2]]
The following command, however, gives a black image:
ImageTransformation[i10, f]
Am I doing something wrong? Thanks
ImageTransformation
: "In 2D, the range of the coordinate system for the input image is assumed to be {{0,1},{0,a}}, where a is the aspect ratio. The bottom-left corner of the image corresponds to coordinates {0,0} by default." So while you found the transformation in pixel coordinates,ImageTransformation
works as if a squared image (of any size) is in[0,1]^2
. $\endgroup$