Warp Transform

Moderator: jsachs

Marpel
Posts: 692
Joined: September 13th, 2009, 3:19 pm
What is the make/model of your primary camera?: Nikon D810
Location: Port Coquitlam, British Columbia

Warp Transform

Post by Marpel »

Either I don't quite understand how to use this tool, or it can't do what I am trying.

Short version of a long explanation - I am trying to put a curve somewhere in the middle of a straight line. From part of the Help explanation of the Warp tool, I thought I could accomplish it through this tool. However, I can't seem to move anything beyond the 4 corners or edges and the grid lines remain as straight lines (albeit with an angle change). Figured I could click on a location(s) along the edge or within the body of the grid and move this/these points independently while the corners and rest of the edge remained constant.

If this is not possible and only the corners/edge can be moved (as straight lines), what is the purpose of being able to add more grid lines, hence making the grid sections smaller?

Thanks in advance,

Marv
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Warp Transform

Post by jsachs »

The warp tool just does perspective warping. What you need to use is the Composite transformation with multi-point alignment -- there is an example of using this to warp images in the white paper: Registering and Distorting Images.
Jonathan Sachs
Digital Light & Color
Dieter Mayr
Posts: 453
Joined: April 24th, 2009, 11:47 am
What is the make/model of your primary camera?: Nikon D700
Location: Salzburg / Austria

Re: Warp Transform

Post by Dieter Mayr »

Marv,

I use the "more gridlines" when I want to have a gridline just near an object that I wanted to be straight, let's say a collumn or a corner of a room.
I make a rough correction, add up the number of gridlines till i have a line exactly where I want it and fine adjust the grid.
On a smaller Monitor this might not be as important, but the bigger the monitor gets the bigger the distance between the lines are.
Even with my not too impressive 23" monitor it can beuseful.
Dieter Mayr
Marpel
Posts: 692
Joined: September 13th, 2009, 3:19 pm
What is the make/model of your primary camera?: Nikon D810
Location: Port Coquitlam, British Columbia

Re: Warp Transform

Post by Marpel »

Dieter,

Thanks for the reply. Useful info to know.

Jonathan,

Funny enough, I initially tried the Composite Transform with multi-points but it was clear I was not understanding some things so thought I would take a run at Warp to see if it was easier to accomplish what I was doing. Perhaps my longer explanation will result in sorting things out so I understand this tool better.

I have an image of a log, partially submerged in water that I wish to composite into another image. The log image was taken in flat light, so does not have a shadow/reflection. The input image is larger than the overlay (log) image. It is my intention to add a shadow/reflection to the log in the input image.

Compositing the log into the input image was simple enough with a single point and a mask of the log. To simulate a shadow, I have flipped the mask upside down and am using a third image of solid colour and will play with the blend modes to hopefully get a somewhat realistic result. Because the log is "bent" and not in a straight line, I need to distort the masked shadow to get the shadow to conform to the log.

I, initially moved the three corner points to get the shadow into fairly close alignment, then added 10 new points along the bottom edge of the input image log. I managed to satisfactorily align the two points at the left end of the log and it was my intention to just continue to the right, aligning each point as I progressed. However, when trying to move the remaining points, the shadow began warping way out of alignment and often in the opposite direction (regardless of whether I moved the point in the input image or overlay image).

To see how my progress was going (as I was zoomed in considerably), I decided to OK the result and the resultant image had a very weird shape in it that was not even close to the shadow (with a vey cool bunch of lines over the image).

Unfortunately, I figured, like the one point alignment, that I could simply redo the composite transform and continue to move the points, but when I did that, the input image points were as I left them, but the overlay image now has point 1 in lower left corner, point 2 in lower right, point 3 in upper left, point 4 upper right and point 5 dead centre, with no other points visible.

So, I obviously don't understand how the points interact with each other when aligning. I have read the article on using this transform but it does not seem to jive with my use.

Any help would be appreciated.

Marv
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Warp Transform

Post by jsachs »

Here is what I would do in this case. Since you don't really want to warp the overlay image but simply rotate it, you should be able to use 2-point alignment.

You might want to start by darkening the reflected log image a little, or this may not be necessary.

1) It sounds like you were able to composite in the part of the log above the water, so I would create a mask that is white below the line you want to reflect about and black above and use this as the mask for the base image. This will make sure you only composite the part of the reflection below the water line.

2) Reflect the log and its mask so both are now upside down. Select the upside down log as the overlay image and the upside down mask as the overlay mask image.

3) Set the operation to: Blend

4) Set alignment to: 2-point alignment (shift/rotate/scale)

Now, set the two alignment points in the base image to the endpoints of where you want the upside down log to be located and set the alignment points in the overlay image to the same points on the log.

Click Auto Preview and play with the overlay amount to get the effect you want.
Jonathan Sachs
Digital Light & Color
Marpel
Posts: 692
Joined: September 13th, 2009, 3:19 pm
What is the make/model of your primary camera?: Nikon D810
Location: Port Coquitlam, British Columbia

Re: Warp Transform

Post by Marpel »

Thanks Jonathan,

A few issues that prevent me from using all of your suggestion.

The log in the input image is not a straight line where it would join its shadow. It bends in a couple locations, so if I were to just marry up the two end points, there would be gaps between the log and shadow at a couple spots along the "border". That is predominantly why I thought multi-point would work better.

The overlay image is not of the log (so I can't just flip it and add points along its length). It is a solid colour (I actually should not have used the word "reflection" because it's more like the log lays down a shadow - my fault on that). Although this makes it more difficult placing points in the overlay image, I have devised a way to get them, at the start, within a close distance to where they should be if there was an inverted log in that image.

Third issue is, after I set up the 12 points in both images (which worked fine), when I try to move any of the points between the end points, even a minor amount, the "shadow" in the preview image skews crazily out of shape.

Fourth issue, I OK'd the operation and discarded the resultant image after confirming things were way out of kilter. Now, whenever I try to use the same input and overlay image and same mask in another multi-point composite, the points as they were left in the input image remain the same, but the points on the overlay image are - 1 is at lower left corner as it should be, 2 is at lower right corner, 3 is at upper left corner, 4 is at upper right corner and I now discover, all other points from 5 to 12 are stacked on top of each other in the exact middle of that image. If I pull them apart by clicking and moving, then OK the image, then try the same operation again, the points are back to the 4 corners with the rest stacked on top of each other in the centre. They don't remain where they were left, like they do in the input image. And without closing out PWP, I can't reset them so I may start again.

As I don't understand this specific transform enough (as I do the single point composite) I don't know if I am inadvertently causing these points to act haywire or if the program has a bug.

Regards,

Marv
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Warp Transform

Post by jsachs »

I can't do much about the positioning of the alignment points, but I forgot to mention that you should change the alignment method as mentioned in the white paper to Gaussian Method (via the Opt menu). This makes the effects of each pair of alignment points more localized.
Jonathan Sachs
Digital Light & Color
Marpel
Posts: 692
Joined: September 13th, 2009, 3:19 pm
What is the make/model of your primary camera?: Nikon D810
Location: Port Coquitlam, British Columbia

Re: Warp Transform

Post by Marpel »

Jonathan,

I just went back to the computer and, after saving the input image, overlay image and mask, I closed out the program and re-opened to start afresh and discovered the following:

I think my initial confusion was caused by - initially, I laid out 5 points along the bottom of the log in the input image and then lined up the corresponding points in the overlay image. However, when I realized the 5 points were insufficient, I added a few more points in the input image. These new corresponding points in the overlay image did not land where I expected and caused the preview shadow to go crazy (I just figured they would lay down in the overlay image relative to the other points as they were in the input image - they presumably line up in the overlay in some relation to the overlay images location on the input image and not to the other points). When I just re-tried the operation, I had to search the overlay image (I was in zoom view and couldn't see the entire image) and when I found the added points, I moved them to match the input image points. That brought the shadow into alignment - so that problem solved.

However, the thing that still seems weird is - when I OK the image, then try the transform again (I like to do the exact same transform with the mask and a full size blank black mask image to get the mask in the correct location should I wish to make further blend mode changes and to protect the shadow from any subsequent changes to the new image), the points in the overlay image again go to the locations I mentioned above (1 low left, 2 low right, 3 upper left, 4 upper right and the remaining stack on top of each other in the dead centre). The same points in the input image remain as left. How do I ensure the points, as left in the input image and overlay image stay in the locations from one operation to the next, if the input, overlay and mask remain the same sized images??

Thanks,

Marv
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Warp Transform

Post by jsachs »

Unfortunately, the overlay image and its alignment points are not saved.
Jonathan Sachs
Digital Light & Color
Marpel
Posts: 692
Joined: September 13th, 2009, 3:19 pm
What is the make/model of your primary camera?: Nikon D810
Location: Port Coquitlam, British Columbia

Re: Warp Transform

Post by Marpel »

Ahh,

Thanks Jonathan. Thought I was doing something wrong.
Post Reply