Coder Social home page Coder Social logo

wrap_paper's Introduction

wrap_paper

书本或纸张照片的矫正

代码功能介绍

  • 读取原图im1,获取轮廓im2
  • 筛选出最大轮廓
  • 根据轮廓,来生成近似轮廓(四边形)
  • 如果近似轮廓的表述结构为四个点(即四边形的四个顶点),则计算最长的边长;否则图片不合格,退出程序
  • 组装透视变换的四个参考点
  • 组装透视变换的四个待变换的点,由于检测到的四个点的顺序可能是混乱的,需要整理它们的顺序,使之分别与四个参考点对应
  • 获取透视变换矩阵M,并根据M讲原图im1进行变换
  • 锐化

开发环境

python
opencv
numpy

执行效果

原图

提取轮廓

扭曲(wrap)后的效果图

把上一步结果,进行锐化后的效果图

wrap_paper's People

Contributors

mengxiangxiang414 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.