简体   繁体   English

如何使用opencv检测图像中的文本样式?

[英]How to detect style of text in an image using opencv?

Currently i am working on opencv.目前我正在研究 opencv。 I have an image with a text.我有一个带有文本的图像。 And i want to find out the style(Bold, Italic) of the text.我想找出文本的样式(粗体、斜体)。 How can i achieve this?我怎样才能做到这一点? Thanks谢谢

What you can do is (assuming a letter by letter approach)你可以做的是(假设一个字母一个字母的方法)

  • Using segmentation techniques you first segment out the letters使用分段技术,您首先将字母分段
  • Using the segmented letters,compare against your owns data set of pre-segmented/pre-filtered letters to find the font style.使用分段字母,与您自己的预分段/预过滤字母数据集进行比较以找到字体样式。
  • Comparison can be done using various features, SIFT,SURF,BRISK,Harris corners, template matching, or your come up with something of your own.可以使用各种功能、SIFT、SURF、BRISK、Harris 角、模板匹配或您自己的东西来进行比较。 My best guess would be to go with HAAR-features and training.我最好的猜测是使用 HAAR 功能和培训。
  • Once you get a set of features for a letter, matching for closest candidate against your pre-filtered dataset can be achieved using different techniques such as KNN, euclidean distance, etc If you use HAAR features, OpenCV can help alot in retrieval.一旦获得了字母的一组特征,就可以使用不同的技术(例如 KNN、欧几里德距离等)将最接近的候选对象与预先过滤的数据集进行匹配。如果您使用 HAAR 特征,OpenCV 可以在检索中提供很多帮助。

Eventually you might ending doing some OCR which includes font style.最终你可能会结束做一些包含字体样式的 OCR。

OpenCV has a set of built in feature descriptors which you can read here OpenCV 有一组内置的特征描述符,你可以在这里阅读

Good Luck!祝你好运!

This might help you, I know it's not exact.这可能对你有帮助,我知道这并不准确。 But it will suffice for my similar project.但这对于我的类似项目就足够了。 "Typefont is an experimental library that detects the font of a text in a image." “Typefont 是一个实验性库,可以检测图像中文本的字体。” https://github.com/Vasile-Peste/Typefont https://github.com/Vasile-Peste/Typefont

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM