前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >OCR -- seamlessClone泊松融合

OCR -- seamlessClone泊松融合

作者头像
MachineLP
发布2019-05-26 15:29:24
1.5K0
发布2019-05-26 15:29:24
举报
文章被收录于专栏:小鹏的专栏小鹏的专栏

opencv:https://www.learnopencv.com/seamless-cloning-using-opencv-python-cpp/

OCR工程git:https://github.com/MachineLP/OCR_repo

看到这个题目是不是很突兀啊,OCR和泊松融合又有啥关系呢?

是这样的,因为在训练的时候需要生成训练字体,有时候需要融合不同的背景。

看一下效果:

python代码如下所示:

代码语言:javascript
复制
import cv2
import numpy as np

# Read images : src image will be cloned into dst
im = cv2.imread("bg.jpg")
obj= cv2.imread("lp.jpg")

# Create an all white mask
mask = 255 * np.ones(obj.shape, obj.dtype)

# The location of the center of the src in the dst
width, height, channels = im.shape
center = (height//2, width//2)

# Seamlessly clone src into dst and put the results in output
normal_clone = cv2.seamlessClone(obj, im, mask, center, cv2.NORMAL_CLONE)
mixed_clone = cv2.seamlessClone(obj, im, mask, center, cv2.MIXED_CLONE)

# Write results
cv2.imwrite("opencv-normal-clone-example.jpg", normal_clone)
cv2.imwrite("opencv-mixed-clone-example.jpg", mixed_clone)
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018年10月21日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
文字识别
文字识别(Optical Character Recognition,OCR)基于腾讯优图实验室的深度学习技术,将图片上的文字内容,智能识别成为可编辑的文本。OCR 支持身份证、名片等卡证类和票据类的印刷体识别,也支持运单等手写体识别,支持提供定制化服务,可以有效地代替人工录入信息。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档