Request from the wife... Washing machine timer

Sorry to dig up this old thread, but yes it’s sort of possible to do this with seven_segments display, I’m been messing with trying to do this very thing.

Here’s my approach, though I’ve not been successful at the final result yet.

  1. start with a test picture as you’ve done
  2. crop it down to just the clock (eventually you can use convert or ssocr to crop it down, but easiest to start manually until you can get ssocr to recognize the input)
  3. run ssocr against it… in your case because you’re “white on black” instead of the passive “black on white” non-lit displays that ssocr normally reads from you’ll need to pass the invert command and -d -1
  4. if ssocr works, you’re done… though you’ll probably need to preprocess with ImageMagick convert… so for your image I did convert washer-simple.jpg -colorspace gray -threshold 97% -type bilevel washer-simple-out.jpg
    and that yielded a nice sharp clock image to pass to ssocr
    washer-simple-out
  5. pass it to ssocr ssocr -P -Ddebug-out.png -d -1 invert washer-simple-out.jpg # first do this and look at debug-out.png to see what ssocr is doing… in this case it comes back as 1003 because ssocr sees the : as a 0…
    debug-out
  6. finally putting it all together… you’ll need to replace ssocr_bin in seven_segments module with a script that first runs convert and then interprets ssocr’s 1003 as 1:03… SSOCR_TEXT=$(ssocr -d -1 invert washer-simple-out.jpg); if [ ${SSOCR_TEXT} -gt 1000 ]; then echo ${SSOCR_TEXT:0:1}:${SSOCR_TEXT:2:2}; fi

I think the approach would work… I still need to figure out how to get a bash script to launch from ssocr_bin and catch all the arguments…