How to read time from a recorded video surveillance camera?

I have a problem when I have to read the recording time from the video recorded by the surveillance camera.

The time is displayed in the upper left part of the video. Below is a link to the capture screen area, which shows the time. In addition, the color of the mark (white / black) continues to change over the duration of the video.

alt text http://i55.tinypic.com/2j5gca8.png

Please direct me towards an approach to this problem. I am a Java programmer, so I would prefer an approach through Java.

EDIT: Thanks unhillbilly for the comment. I looked at the OCR Ron Cemer library and its performance is far below our requirement.

Since ocr performance is less than desired, I planned to create a character set using screen capture for all digits, and using some image / pixel comparison library to compare the frame time with the character set that will display the probabilistic result after comparison.

So, I was looking for a good image comparison library (I would be fine with a library other than java that I can run using the command line). Also any recommendations on the above approach would be really helpful.

+8
java image-processing computer-vision ocr video-processing
Dec 21 '10 at 20:14
source share
4 answers

It doesn't seem like you need a full blown OCR here.
I believe that the numbers are always in the same position on the image. You expect only the numbers 0-9 in each of the search positions (in black or white).
Simple matching patterns in each position with each of the numbers (you will have 20 patterns for 10 numbers in each color) is very fast (in real time) and should give you very accurate results.

+6
Dec 27 '10 at 12:08
source share

What format is the source (vhs, dvd, stills)? It is possible that the time stamp is encoded in the data.

Update details

As long as I fully understand the desire to have an automated end-to-end process (especially if you are selling this application, rather than creating your own tool), it would be more effective if someone manually entered the start time of each video (even if there are hundreds of them), and then spend a few weeks coding it to work automatically.

What would I do (without getting a simple, very fast, ultra-precise OCR solution that I don't think exists):

Create a pair of database tables, for example

video video_group ------- ----------- id id filename title start_time date_created group_id date_modified date_created date_deleted date_modified date_deleted 

video_group may contain

 id| title ----------- 1 | Unassigned 2 | 711 Mockingbird @ 75 3 | Kroger storage room 

video will be pre-populated with video file names using the import script. Initially assign all a group_id of 1 (unassigned)

Create a simple Winforms or WPF application (skip my ASCII art):

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | Group: [=========]\/ [New group...] | | | | File: [=========]\/ | | | | Preview | | |--------------------------------------| [Next Video] | | | (first frame of selected video here) | [Prev] | | | | | | | | | | | | | | |--------------------------------------| | | Start Time | | [(enter start time value here as displayed on preview frame)] | | | | [Update] | ------------------------------------------------------------------- 

User (anyone can do this - secretary, janitor, even a recent CS graduate). All they need to do is read the time from the preview frame, enter it in the Start Time field and click "Update" or "Next" to update the database and go to the next. Keep group selections from one video to the next unless the user changes it.

Assuming it takes the user 30 seconds to read, enter, and then click, they can complete 100-150 videos in an hour (call it 75 for a more realistic estimate). And, trainees are much cheaper than developers time.

If you really have β€œhundreds” of videos, it will still do it faster than trimming OCR. If OCR works for the most part, you will most likely need someone to manually examine everything to make sure the results are correct. who asks the question, why bother with OCR?

+1
Dec 23 '10 at 5:23
source share

Java OCR works great for your situation (here Ron Kemer). All you have to do is remove the background image or always make it less than 50% white so that the white characters are white and the background will be black when the image is converted to monochrome.

Point the JavaOCR to the font, extract this rectangular area from the image, remove the background, and you will leave and run.

I suggest an algorithm that looks at r, g, b and sets everything to black, where r, g, b are not exactly the same values. This will leave only pixels that are perfect shades of gray. Since the image is color and the numbers are monochrome, this will leave numbers and some dust.

JavaOCR wants to see black characters on a white background, so once you have done this, you will also need to invert the monochrome image (white = black and vice versa). Then run this through the JavaOCR library, passing it the reference patterns of all the characters that you expect from recognition, and your problem should be (at least basically) resolved.

+1
Sep 27 '11 at 6:16
source share

Try Google Tesseract , there are a couple of JNI wrappers. Make sure you read the FAQ only to draw numbers.

0
Dec 23 '10 at 5:32
source share



All Articles