Mikescher / HexSolver

An automatic solver (with image recognition) for Hexcells
MIT License
29 stars 3 forks source link

Example of failed OCR #6

Closed JWWolstenholme closed 15 hours ago

JWWolstenholme commented 2 years ago

Hey, nice project. This is really cool. Here's a screenshot that trips up the OCR. hexsolver_out

I think it's getting confused with the UI in the top right. HexSolver_2021-09-25_16-28-47

Clicking the OCR button gives this error. HexSolver_2021-09-25_16-32-18

JWWolstenholme commented 2 years ago

Also, setting the window to 1440x900 as recommended, it fails to generate the grid when clicking Show Grid or Calculate. Here's the exported image. hexsolver_out_smaller

Mikescher commented 2 years ago

Hmm yeah this is a pretty old project of mine, and the automatic OCR doesn't always work that great.

After toying a bit around with your two pictures I get this (you can import them again via "Load from file"):

Picture1:
You can click "Calculate" to auto-determine the Grid and then open the "HexGrid Parameter" and adjust the "BarTopRight" parameter (330 x 300 should work). But unfortunaly it seems the actual OCR still fails due to a bad grid alignment, you could try manually adjusting the Grid Parameter, but thats rather tiresome...
It's also the reason why I recommend 1440x900, all the default parameter just works best in that resolution

Picture2:
If you press "Show Binary Pattern" you can see that HS recognizes too few cells to determine the grid (aka only 2).
Under "Binary Pattern Parameter" you can enable "Use Active Cells in Pattern" and "Use inactive Cells in pattern", then Hs has enough information to find the grid and OCR etc also works (I then managed to find a single black cell for the next Solve step)

Regards
~ Mike