4-point transform images

后端 未结 4 842
误落风尘
误落风尘 2021-01-05 16:10

I need to transform bitmap images with their 4 corner points moved from one location to another.

Any code that can run on Windows, C#/VB.NET preferably, even help ho

4条回答
  •  执念已碎
    2021-01-05 16:13

    Disclaimer: I work at Atalasoft

    If you are willing to go commercial, DotImage Photo can do this with the QuadrilateralWarpCommand. Sample C# Code

    // Load an image.
    AtalaImage image = new AtalaImage("test-image.jpg");
    
    // Prepare the warp positions.
    Point bottomLeft = new Point(100, image.Height - 80);
    Point topLeft = new Point(130, 45);
    Point topRight = new Point(image.Width - 60, 140);
    Point bottomRight = new Point(image.Width - 20, image.Height);
    
    // Warp the image.
    QuadrilateralWarpCommand cmd = new QuadrilateralWarpCommand(bottomLeft,
       topLeft, topRight, bottomRight, InterpolationMode.BiLinear, Color.White);
    AtalaImage result = cmd.Apply(image).Image;
    

    http://www.atalasoft.com/products/dotimage

提交回复
热议问题