image2d.t (PDL-2.081) | : | image2d.t (PDL-2.082) | ||
---|---|---|---|---|
skipping to change at line 323 | skipping to change at line 323 | |||
use PDL::NiceSlice; | use PDL::NiceSlice; | |||
# we try 1st-, 2nd-, and 3rd-order fits, with and without restrictions to shif t-and-scale-only | # we try 1st-, 2nd-, and 3rd-order fits, with and without restrictions to shif t-and-scale-only | |||
foreach my $deg(2,3,4){ | foreach my $deg(2,3,4){ | |||
my $fit = zeroes(byte,$deg,$deg,2); | my $fit = zeroes(byte,$deg,$deg,2); | |||
$fit(:,(0),(0)).=1; | $fit(:,(0),(0)).=1; | |||
$fit((0),:,(1)).=1; | $fit((0),:,(1)).=1; | |||
foreach my $restrict_fit(1,0){ | foreach my $restrict_fit(1,0){ | |||
my ($pxn,$pyn) = fitwarp2d($x,$y,$u,$v,$deg,$restrict_fit?{FIT=>$fit}:{ }); | my ($pxn,$pyn) = fitwarp2d($x,$y,$u,$v,$deg,$restrict_fit?{FIT=>$fit}:{ }); | |||
my $out = warp2d($shift,$pxn,$pyn); | my $out = warp2d($shift,$pxn,$pyn); | |||
ok(all(approx($out,$img,1e-3)),'warp2d ' . ($restrict_fit?'':'un') . "r estricted deg $deg values approx"); | ok(all(approx($out,$img,1e-3)),'warp2d ' . ($restrict_fit?'':'un') . "r estricted deg $deg values approx") or diag "got=$out\nexpected=$img"; | |||
ok(all($out->rint==$img),'warp2d ' . ($restrict_fit?'':'un') . "restric ted deg $deg rint exact"); | ok(all($out->rint==$img),'warp2d ' . ($restrict_fit?'':'un') . "restric ted deg $deg rint exact"); | |||
} | } | |||
} | } | |||
} | } | |||
done_testing; | done_testing; | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |