You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New to libvips and first post, so start but saying "love the project!"
Managed to do almost everything I wanted with libvips except perspective transformation.
Thought I'd try by using vips_mapim()
Unfortunately I miss-read how the function works so the result was slightly off, see attachment.
The curve is due to the map image data being the coordinates of the source and not the destination (I miss understood)
Feature Request - Similar to vips_mapim() except have the map image data be the xy coordinates of the destination, not the source, kind of the opposite to vips_mapim().
My idea for a basic perspective transform was to create a 2 band 2x2 map image, fill the data with the four corner coordinates of the destination, then resize the map image to the same as the input image with _vips_affine(). The bilinear interpolation would calculate the coordinates so vips_mapim() would then work. Got close but because vips_mapim() uses the data for source pixels and not destination, I get a curve and not straight edge.
This discussion was converted from issue #1934 on February 17, 2021 11:44.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
New to libvips and first post, so start but saying "love the project!"
Managed to do almost everything I wanted with libvips except perspective transformation.
Thought I'd try by using vips_mapim()
Unfortunately I miss-read how the function works so the result was slightly off, see attachment.
The curve is due to the map image data being the coordinates of the source and not the destination (I miss understood)
Feature Request - Similar to vips_mapim() except have the map image data be the xy coordinates of the destination, not the source, kind of the opposite to vips_mapim().
My idea for a basic perspective transform was to create a 2 band 2x2 map image, fill the data with the four corner coordinates of the destination, then resize the map image to the same as the input image with _vips_affine(). The bilinear interpolation would calculate the coordinates so vips_mapim() would then work. Got close but because vips_mapim() uses the data for source pixels and not destination, I get a curve and not straight edge.
Many thanks,
Steve
Beta Was this translation helpful? Give feedback.
All reactions