Searching an image for specified text

≯℡__Kan透↙ 提交于 2020-01-14 05:59:08

问题


I think I am going to ask very stupid Question here. In my current project i want to give search feature. I have an big image tutorial with lot of information about on a topic and i want to search feature in the image. Suppose use type like "Apple" it will show the Apple occurred how many times in the image and after clicking on of that the image scroll and go to the position where "Apple" is occurred.

Thanks for reading my stupid question but if it is possible let me know and put some sample code??


回答1:


Here is a broad overview of the approach I would take:

  1. Find a C/C++ based OCR library
  2. Get it to compile on the iPhone
  3. Create a UI to feed images to the OCR library
  4. Store output of OCR, including words found and their location in the image.
  5. Create a UI to allow users to enter a search.
  6. Search OCR output for matches and highlight the location of matches on the image.

I imagine step 2 is going to be the most difficult. Tesseract may work, it is C++ based but I don't know what dependencies it has.

UPDATE: Someone on GitHub has posted a demo iPhone App that uses Tesseract.




回答2:


Please try to do use WebView or Core Text to render you tutorial, in which search functionality comes pretty much for free. Use OCR for search is just not practical for your need.



来源:https://stackoverflow.com/questions/4539649/searching-an-image-for-specified-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!