Cylinderize - Frontal view

A plethora of command-line scripts that perform geometric transforms, blurs, sharpens, edging, noise removal, and color manipulations.
Post Reply
marcospassos
Posts: 13
Joined: 2014-09-26T08:23:47-07:00
Authentication code: 6789

Cylinderize - Frontal view

Post by marcospassos »

I spent the last days trying to modify the Fred's cylinderize script to generate frontal views:

Image

Currently, we can displace upward, downward but not both simultaneously, which would produce the frontal view:

Image

I've tried a lot of approaches to achieve this result in the last days. The approach that gives me a result that is nearly successful is transpose the mask with it's inverse version using a gradient:

Image

The problem is that the result is not the one I expected (the red line is the expected curve, exactly as when displacing only the top or bottom areas):

Image

I also tried to adjust the gradient area to fit only the image area (x = image height), but although the curve is ok, the image gets completely distorted:
Image

Result:

Image

Does anyone have any idea how can I achieve such result?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Cylinderize - Frontal view

Post by fmw42 »

Please post links to your original cup and original image that is to be placed on the cup and in higher resolution for the cup if possible. The problem is likely that you have true perspective distortion in your frontal cup view and the cylinderize script is only generating an approximation for its up or down curvature.

How did you generate your first image of the cup with the overlay? It looks reasonable to me? What is wrong with it?
marcospassos
Posts: 13
Joined: 2014-09-26T08:23:47-07:00
Authentication code: 6789

Re: Cylinderize - Frontal view

Post by marcospassos »

The first one I generated using the transposition method (first approach) without the overlay (look at the edges, there is no perspective, seems to be only cropped off). When applying the overlay, it does not works as expected (the curve gets distorted).

Mug:
Image

Image:
Image

I'm looking forward for your considerations :).

Thanks in advance!
Post Reply