There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

Solve Sudoku puzzle from a screenshot (sudoku-solver-ocr in C, bash)

cross-posted from: lemmy.world/post/961924

A script in bash in combination with a script in C can help you solve a sudoku puzzle in a png file.

https://gitlab.com/christosangel/sudoku-solver-ocr

You can see the script in action in this video.

The main dependency is tesseract OCR, responsible for the oprical character recognition.

Another important dependency is imagemagick, responsible for the necessary image manipulation.

The file selection of the png image is done with zenity.

Feel free to give your feedback.

marswarrior ,
@marswarrior@lemmy.world avatar

Very cool! Is it possible to have imagemagick fill out the png after calculating the result?

Something like convert -background white -fill black -font Arial -pointsize 24 -size 300x caption:@output.txt output.png

christos OP ,
@christos@lemmy.world avatar

Thanks! It don’t see why not is not doable, writing out the found data from the C script to a file,parse the file to get the value of each square. From there, either create a label for each square and rewrite the whole puzzle with append, or fill with layers. This might work.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines