Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CV detection handle high-freq gradients (like hatch), pass full res to model #42

Open
Elucidation opened this issue Jul 25, 2023 · 0 comments

Comments

@Elucidation
Copy link
Owner

Elucidation commented Jul 25, 2023

The chessboard detection routine looks for certain X and Y gradient patterns, and the hatched pattern often disrupts this at full resolution, but those gradients go away when blurred. Example image from Tomas original issue #41

image

Could be tackled by modifying the chessboard detection routine, either naively by blurring/reducing high frequency gradients like the hatch pattern, or something more sophisticated (probably unnecessary). And then once the board and tiles have been detected, use pass the the original image resolution tiles to the ML model.

secondary note is that the model is only trained on lichess/chess type images, so for these types of images the model will perform poorly. At some point consider retraining/fine tuning the model. Alternatively a simpler approach is since this style is common/uniform just do some simple CV-based approach and drop the ML

On Tue, Jul 25, 2023 at 9:30 AM Tomas Tillmann @.***>
wrote:

Yes, that seems to be the reason. Thanks.

Do you think it could be possible to do something about it though? I
experimted a bit, and if I blur the image, making the quality of the image
lower, it works correctly. But that feels like a hack ..., and it also
makes the work for the model harder, since the pieces are not as sharp as
they could be. Potentially leading to wrong piece prediction.

I think it would be very nice for the chessboard recognizer to understand
even if the black tiles are hatched and not fully black colored, where the
grid lines are. Do you think it could be done? Perhaps by feeding it boards
with hatched black tiles?

I feel like majority of chess pdf books are having black tiles hatched, so
it could be a really useful improvement.
To name some: The woodpecker method, Encyclopedia of chess tactics, ...


Reply to this email directly, view it on GitHub
#41 (comment),
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AADKF3ILYYFGFRWNGNJHIMDXR7YBFANCNFSM6AAAAAA2T2LIWQ
.
You are receiving this because you commented.Message ID:
@.***>

Originally posted by @Elucidation in #41 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant