Page 1 of 1

Skew image as if viewed from the side

Posted: 2017-04-26T11:31:24-07:00
by pmdpmd
I would like to skew/rotate an image as if I was viewing it from the side/top.

Given a horizontal and vertical angle and a distance of viewer from the image, I wonder if anyone could advise the correct API functions to call to achieve this.

The image is of a 2D object flat on to the camera, specifically a license plate which I would like to simulate being viewed from an observer/camera at the side of the road.

I found the rotate3D script in Fred's Scripts, which I think does what I require, but I am wanting to achieve this using the C# API rather than Unix command line calls.

Any help would be most appreciated.

Regards, Paul

Re: Skew image as if viewed from the side

Posted: 2017-04-26T11:50:52-07:00
by snibgo
What version of IM? Do you use MagickCore or MagickWand?

You need a perspective transformation (aka distortion), of course.

Re: Skew image as if viewed from the side

Posted: 2017-04-26T12:48:16-07:00
by fmw42
My better script is 3Drotate. But I do not know how to convert that to any of the APIs other than the command line. The basic IM command is +distort perspective.

Re: Skew image as if viewed from the side

Posted: 2017-04-28T05:04:10-07:00
by dlemstra
You could create an issue here https://github.com/dlemstra/FredsImageMagickScripts.NET and ask me to add this script.

Re: Skew image as if viewed from the side

Posted: 2017-05-04T04:52:56-07:00
by pmdpmd
Hi, I'm using Magick.NET-Q8-AnyCPU Nuget package 7.0.4.701

Thanks dlemstra, I will do that.