Read The Analog Clock Image And Display The Time Using The Opencv Python
Solution 1:
Considering that your approach to retrieve the values of hours and minute is successful, here is a simple solution to find the value of seconds.
There are certain properties associated with the second-hand of your clock image which need a little preparation before estimating its value. The first one is the color. Because the hand is colored in red, you have a good leading point on separating it from the rest of the image. If you can mask the red color of the second-hand in the image using the cv2.inRange()
function (read more about it here), you'll be left with a clean image of only the second-hand. After that, you can convert it to black and white using cv2.cvtColor()
function. Now, the second problem might be the thin line of second-hand. You can solve that using Morphological Transformations. Using the Erosion_ function, you can grow the white area of the image and thicken the second-hand. After that, use whatever method you were using to find the value for minutes and hours hand and you are good to go.
Post a Comment for "Read The Analog Clock Image And Display The Time Using The Opencv Python"