Page 1 of 1

Warp Problem

Posted: November 3rd, 2020, 9:32 am
by jfoster
There seems to be a slight error showing up in the warp transformation. Attached is a workspace that illustrates the problem.

The result of the steps shown here were always spot-on in PWP7.

Briefly, using warp (in bilinear mode) to stretch a portion of an image (with the Shift-key held down to constrain the movement to 1-dimension) causes the right edge to not line up with the original image. See here:

warp prob.jpg
warp prob.jpg (26.21 KiB) Viewed 2526 times
Also of note is that the problem seemed to increase after saving the workspace and then reopening it - the misalignment seemed to be about double what it was originally.

Jeff

Re: Warp Problem

Posted: November 3rd, 2020, 11:04 am
by jsachs
The problem appears to be related to the output image height being greater than the input image height (800 pixels in this case). You can enter the height manually to correct the problem. The output image dimensions are by default computed so as to preserve the area and proportions of the selected quadrilateral, but there can be a little roundoff error in some cases.

If you reset the Warp transformation and carefully just move the left side of the overlay rectangle, the size does seem to stay pinned at 800. If you ever move the rectangle in some random direction without the shift key down, the Scale Factor can change and the output image dimensions drift away from their original values.

Re: Warp Problem

Posted: November 10th, 2020, 7:30 am
by jfoster
I've been away from this for a bit. Yeh, it looks like cockpit error on my part in coming up with the steps to reproduce the problem I saw. I will look back at the original workspace where I saw the issue when I get a chance. Thanks.

Jeff

Re: Warp Problem

Posted: November 16th, 2020, 9:50 am
by jfoster
I spent a little more time on this and what I found is that upon editing an existing Warp Transformation, the Transformation changes on its own with no user input. To reproduce:

1. Open PWP 8 (currently on rev 167).
2. Use the Test Pattern Transformation to create a Checkerboard (800 x 800 pixels).
3. Apply the Warp transformation to the Checkerboard. Using the Shift Key to constrain the Warp to only horizontal axis, drag the right edge of the Checkerboard in a bit.
4. Confirm that the resulting image maintains an 800 pixel height.
5. Click OK on the Warp transformation.
6. Right-Click on the Warp Transformation image and select Edit Transformation.
7. Without making any changes, click OK on Warp Transformation dialog box.
8. Note that now the resulting image size has changed to 801 pixels.

Also,
Perform steps 1 – 6 as above, and then change the Warp method to Bilinear and then cancel the Transformation edit. Note that the result of the Canceled Transformation is different than before the Edit was Canceled with the changes abandoned.

Jeff

Re: Warp Problem

Posted: November 17th, 2020, 11:43 am
by jsachs
I fixed the off-by-one problem for the next release.

Re: Warp Problem

Posted: November 24th, 2020, 8:55 am
by jfoster
Seems to still be a problem - the Warp transformation, with no user input or after a transformation reset, changes the output image size.
I checked rev 172 and 174.

Jeff

Re: Warp Problem

Posted: November 24th, 2020, 9:18 am
by jsachs
OK, I think I got it this time for the next release. It is possible that in some more obscure situations there might be a small roundoff error, but it seems to be working OK now in all the test cases I checked.