如何使用JavaScript修复图像透视失真和旋转? [英] How to fix image perspective distortion and rotation with JavaScript?

查看:177
本文介绍了如何使用JavaScript修复图像透视失真和旋转?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些使用手机拍摄的照片。是否有任何JavaScript库可以拉直纸张的照片并将其展平?例如,我想创建一个矩形图像,没有任何图像失真。



换句话说我想知道如何修复透视图使用JavaScript进行失真和旋转?



例如,我在



如何使用javascript修复此类图像?

解决方案

看起来像 https://www.npmjs.com/package/perspective-transform 是什么您正在寻找。


创建函数以将点从一个任意四边形映射到ano反之亦然,反之亦然



I have some images that takes using mobile phone. Is there any JavaScript library which can straighten the photo of a paper and flatten it? For example I want to create a rectangular image without any distortion from this image.

In the other words I want to know how to fix perspective distortion and rotation with JavaScript?

For example I found below sample image from this article:

How to fix this type of image with javascript?

解决方案

Looks like https://www.npmjs.com/package/perspective-transform is what you are looking for.

Create functions to map points from one arbitrary quadrilateral to another and vice versa with the inverse

这篇关于如何使用JavaScript修复图像透视失真和旋转?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆