問題描述
我有一個問題,我必須從監控攝像頭錄制的視頻中讀取錄制時間.
I have a problem where I have to read the time of recording from the video recorded by a surveillance camera.
時間顯示在視頻的左上角.下面是顯示時間的區域的屏幕抓取鏈接.此外,數字顏色(白色/黑色)在視頻播放期間不斷變化.
The time shows up on the top-left area of the video. Below is a link to screen grab of the area which shows the time. Also, the digit color(white/black) keeps changing during the duration of the video.
http://i55.tinypic.com/2j5gca8.png
請指導我解決這個問題的方向.我是一名 Java 程序員,所以更喜歡通過 Java 的方法.
Please guide me in the direction to approach this problem. I am a Java programmer so would prefer an approach through Java.
感謝 unhillbilly 的評論.我看過 Ron Cemer OCR 庫,它的性能遠低于我們的要求.
Thanks unhillbilly for the comment. I had looked at the Ron Cemer OCR library and its performance is much below our requirement.
由于 ocr 性能不如預期,我計劃使用屏幕抓取所有數字來構建一個字符集,并使用一些圖像/像素比較庫將幀時間與將顯示的字符集進行比較比較后的概率結果.
Since the ocr performance is less than desired, I was planning to build a character set using the screen grabs for all the digits, and using some image/pixel comparison library to compare the frame time with the character-set which will show a probabilistic result after comparison.
所以我一直在尋找一個好的圖像比較庫(我可以使用可以使用命令行運行的非 java 庫).此外,關于上述方法的任何建議都會非常有幫助.
So I was looking for a good image comparison library(I would be OK with a non-java library which I can run using the command-line). Also any advice on the above approach would be really helpful.
推薦答案
這里似乎不需要完整的 OCR.
我假設數字總是在圖像中的相同位置.您只希望每個已知位置的數字為 0-9(黑色或白色).
在每個位置與每個數字匹配的簡單模板(每種顏色的 10 位數字都有 20 個模板)非常快(實時),應該會給你非常準確的結果.
It doesn't seem like you need a full blown OCR here.
I presume that the numbers are always in the same position in the image. You only expect digits 0-9 at each of the know positions (in either black or white).
A simple template matching at each position with each of the digits (you'll have 20 templates for the 10 digits at each color) is very fast (real-time) and should give you very accurate results.
這篇關于如何從錄制的監控攝像頭視頻中讀取時間?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!