如何从录制的监控摄像头视频中读取时间?

我有一个问题,我必须从监控摄像头录制的视频中读取录制时间.

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.

相关文章