Hello,

i am trying to read the time on an analogue clock. It's the same clock, black and white, clearly visible so no problems. Can someone give me some pointers how to read? I can only find code for an analogue gauge. I think I need - Detect circles - Detect hands and angles? - Detect difference between hours (short hand) and Minutes (Long hand)

edit retag close merge delete

1

what did you try? this is a forum for helping with your opencv related problems, not to solve your projects. see faq

( 2019-05-08 07:08:29 -0500 )edit
1

I found this already (https://github.com/basselhossam/clock...) but that's by using Matlab instead of opencv.I also found code to recognize 1 hand in for example a gauge. The Matlab code seems fine so I want to use that as the basic.

( 2019-05-08 07:41:06 -0500 )edit
2

Ok, then here's the algorithm: https://github.com/basselhossam/clock...

Good news: you have everything you need in OpenCV. But we won't solve it for you!

( 2019-05-09 05:07:18 -0500 )edit

Sort by ยป oldest newest most voted

Here is a different approach.

The image below shows several steps available in OpenCV.

1. Find the circle of the clock and use the warpPolar transformation.
Rotate this image by 180 to get the 2nd image.

2. Apply a dilation with a wide Rect kernal about 120 x 1 to get the 3rd image.

3. Do an inverse binary threshold to get the last image.

You can then filter the contours in this last image by area and center x position to leave only the contours that would be the hour, minute and second hand.

We know that 3:00 will be on top, 9:00 in the middle and 6:00 at the bottom so it shouldn't be too difficult to map the center y values of the remaining contours to their values on the clock.

more

You can use this blue print

1. Isolate the clock from the rest of the image 2.Apply edge detection on the image
2. Use Hough transform to isolate watch hands
3. Calculate line angles
4. Filter out irrelevant lines
5. Compute the time
( 2019-05-11 14:23:34 -0500 )edit

Official site

GitHub

Wiki

Documentation