SWT for OCR

Introduction

SWT stands for Stroke Width Transform which is an algorithm often used for text detection in an OCR application.

Resources

Primarily two online resources have been particularly appealing to me due to its open source nature. Both implementations are C/C++ based.

Algorithm Description

TextDetection

Overview

TextDetection is a direct implementation of the original SWT algorithm published in a CVPR paper Detecting text in natural scenes with stroke width transform 1

The related resources can be found in the following web page:
Text Detection on Nokia N900 Using Stroke Width Transform

Key steps

1). Extract the stroke width at every pixel

  • the key insight is that letters have roughly parallel side
  • the algorithm depends on the gradient pointing into the letters

Main differences from the original work

  • allowing the gradient directions to be up to 90 apart, instead of 30
  • cannot detect light-on-dark and dark-on-light text simultaneously. Run twice to achieve the effect
  • The original mentions some capacity for doing this, but it’s unclear how its done
  • considering two pixels as neighbouring if the ratio of their stroke widths is between 1/3 and 3.
  • Boost graph library is used
  • use some of the heuristic rules from [original work] for filtering.

Main difference

  • original work seems to do some kind of tracing of the rays formed in the first stage
  • height threshold of 300 pixels is discarded
  • the ratio of the diameter of a component to its SW mean

3). Chaining

  • Use heuristics to find eligible pair
  • the pairs are sorted by distance and then merged if they share an end (i.e. a component) and have a similar direction

Main difference

  • vastly different results from the paper!

VCC


  1. www.math.tau.ac.il/~turkel/imagepapers/text_detection.pdf
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值