Open nanthony21 opened 3 years ago
According to the plugins.config the "Landmark Correspondences" plugin is implemented by the Transform_Roi class.
Looking into the Transform_Roi.java file at like 210, we read:
case 4:
IJ.error( "Perspective transformation is not yet supported for Moving Least Squares. Using Affine instead." );
//t.setModel( HomographyModel2D.class );
t.setModel( AffineModel2D.class );
break;
Looks like a perspective transform was never implemented for Moving Least Squares.
In line 284 we read that:
if ( showMatrix )
{
final double[] flatmatrix = new double[6];
( ( Affine2D< ? > )model ).toArray( flatmatrix );
IJ.log("Matrix: " + Arrays.toString(flatmatrix));
}
Note the Affine2D and not AffineModel2D is used. It's possible that's the error: above at line 213 perhaps it should have been t.setModel( Affine2D.class );
instead, or perhaps the opposite: the cast ought to be to AffineModel2D
.
Thankfully this error is easy to fix (submit a one-line fix from github itself), and also, note the error doesn't occur if one doesn't choose to show (print) the matrix.
This is what I get when trying to run the "Landmark Correspondences" plugin in "Perspective" mode.