ITKeyword,专注技术干货聚合推荐

注册 | 登录

node.js - How to fix image perspective distortion and rotation with JavaScript?

itPublisher 分享于

2020腾讯云10周年活动,优惠非常大!(领取2860元代金券),
地址https://cloud.tencent.com/act/cps/redirect?redirect=1040

2020阿里云最低价产品入口,含代金券(新老用户有优惠),
地址https://www.aliyun.com/minisite/goods

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?

javascript node.js image-processing perspective distortion
|
  this question
asked Nov 2 '15 at 4:26 b24 877 6 20 36      canvas may have the tools required to manipulate an image - but wait, you flagged it node.js, so there is no browser goodness available - you'll need something pretty intelligent, it has to detect issues and fix them with no user interaction –  Jaromanda X Nov 2 '15 at 4:44      This is either wa-a-a-ay too broad for Stack Overflow, or you're asking for something already made that can do this which is off-topic for Stack Overflow. –  Tiny Giant Nov 2 '15 at 22:16      @JaromandaX , Yes I need a way that work without user interaction. –  b24 Nov 3 '15 at 12:13 1   Realize my algorithm on java . Calculate quaternion then rotate image. Any question - ask –  Ivan.s Jan 18 '16 at 21:17      I desperately need that too!!! Did you figure out how to do it? –  Diego Pamio Apr 19 '16 at 3:20

 | 

2 Answers
2

JSFeat can do that for you. There even is an example for perspective distortion. You'll have to add/compute the source and destination points yourself.


|
  this answer
answered Mar 24 '16 at 12:04 arminrosu 82 11

 | 

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

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


|
  this answer
answered Oct 16 '16 at 15:46 Adrien Gibrat 737 8 10

 | 


相关阅读排行


相关内容推荐

最新文章

×

×

请激活账号

为了能正常使用评论、编辑功能及以后陆续为用户提供的其他产品,请激活账号。

您的注册邮箱: 修改

重新发送激活邮件 进入我的邮箱

如果您没有收到激活邮件,请注意检查垃圾箱。