Code Monkey home page Code Monkey logo

fileclipper's Introduction

fileclipper

识别纸张边缘算法,运行clipper.py 可以达到以下的效果

识别前

识别前

识别后

识别后

票据识别前处理(深背景,找浅前景矩形并透视转换)

把XXXXXX_clipper.py中的两个全局变量进行修改: 目标图片大小 TARGET_H = 672 TARGET_W = 1369

skimage方式接口调用

from skimage_clipper import main_img_preprocess
from skimage import io

origin_img = io.imread('your_img_path')
crop_img = main_img_preprocess(origin_img)
# you can save img by below code
# io.imsave('croped.jpg', crop_img)

opencv方式接口调用(opencv python 4.X)

from opencv_clipper import main_img_preprocess
import cv2

origin_img = cv2.imread('your_img_path')
crop_img = main_img_preprocess(origin_img)
# you can save img by below code
# cv2.imwrite('croped.jpg', crop_img)

其他说明

同样的图片,opencv方式比skimage方式要快很多。 典型的(1400*700左右的图片): opencv方式:100 ms skimage方式:1000 ms

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.