this post was submitted on 02 Jul 2023
8 points (100.0% liked)

Linux

8866 readers
136 users here now

Welcome to c/linux!

Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!

Rules:

  1. Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.

  2. Be respectful: Treat fellow community members with respect and courtesy.

  3. Quality over quantity: Share informative and thought-provoking content.

  4. No spam or self-promotion: Avoid excessive self-promotion or spamming.

  5. No NSFW adult content

  6. Follow general lemmy guidelines.

founded 2 years ago
MODERATORS
 

cross-posted from: https://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.

top 2 comments
sorted by: hot top controversial new old
[โ€“] marswarrior 2 points 2 years ago* (last edited 2 years ago) (1 children)

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

If we remove the background with -background transparent -fill black

Then merge the output with the result with convert background.png overlay.png -composite output.png it might work

[โ€“] christos 2 points 2 years ago

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.