Тёмный

Decoding Chess Boards: Ten Years of Computer Vision & AI | Part 1 

Sam Does Leetcode
Подписаться 496
Просмотров 1,1 тыс.
50% 1

Hey Folks, I've built a series of chessboard detection algorithms over the last decade, and I think it's a good way to introduce several computer vision and AI concepts. I show several approaches to chessboard detection, from simpler contour detection to more advanced deep learning models, and explain the pros and cons of each approach.
If you have any questions about the algorithms, or ideas for other approaches, let me know in the comments! For those who are seeing this type of content for the first time, please enjoy!
00:00 - Intro
00:46 - The Plan
01:18 - Chessboard Outline Contour
02:57 - Tile Based Growing
03:56 - Hough Transform Lines
05:30 - Optimizing Hough with C++
06:26 - X-Corner
07:39 - Fit Grid to X-Corners
08:38 - Deep Neural Networks
10:21 - Convolutional Neural Networks
11:01 - Optical Flow
11:51 - YOLO & More
Outline:
- In general we use classic computer vision to load images/videos, build gradients and edges from them with techniques like the Sobel operator and Canny edge detection.
- From those we identify contours (grouping binary pixels), using OpenCV's libraries, try to find the largest quadrilateral which is the chessboard. This works for the simplest images, but real images with occlusions will fail.
- To improve on this, instead we look for tiles, and try to grow them out, warping the image (homographies) and scoring the warped image for 'chessboard-ness'. This is computationally expensive, but works, slowly, minutes.
- Then we look at Hough Transforms, a technique to find lines in images, several variations of increasing speeds are developed, including informed and OpenCV's probabilistic, as well as C++ optimized versions. This has potential, but hough resolution and cost makes it tough on most images alone.
- Next a mathematical oddity of the chessboard pattern makes identifying their x-corner intersections (Saddle points) a relatively fast computation, we use those to filter tiles before growing, with random sampling (RANSAC) to identify good groups. We're down to seconds an image now.
- Machine learning and Deep and Convolutional Neural Networks (DNN and CNNs) are taking off now (2014's), I look into building a labeled dataset of x-corners for training a small model for further filtering. This works, we're under tenths of seconds now.
- There are some C++ optimizations with Halide, an interesting tool for parallelizing matrix operations.
For those interested, all the (very rough and decade old) code is available on github.com/Elucidation/Chessb...
Looking back, I could have saved myself a lot of time, but making mistakes is part of the journey, and it's quite fun to explore computer vision and AI.

Наука

Опубликовано:

 

10 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 9   
@ATH42069
@ATH42069 3 дня назад
this explainer Chad-tuber is top notch.
@OMFGxIamxAxNinja
@OMFGxIamxAxNinja 10 дней назад
This was an interesting watch! It was cool to see how different ML techniques could be used to solve the problem you were trying to solve, and your explanation on their respective drawbacks and advantages is fascinating. Would love to see part two of this!
@samobot
@samobot 10 дней назад
Cheers thanks for watching and glad you liked it! Yes I love trying to convey that often there isn't one 'true' algorithm for any problem, but different tradeoffs depending on what we're doing, which does surprisingly apply to the leetcode tech interview process too haha. And definitely, I'm working on the 2nd part now, stay tuned!
@chakra6666
@chakra6666 7 дней назад
super awesome video, very cool to see all the different ways that you tried to solve the problem :)
@samobot
@samobot 6 дней назад
Cheers glad you enjoyed the process!
@stayqurious
@stayqurious 9 дней назад
still a learner but enjoyed every minute of this video!
@samobot
@samobot 9 дней назад
Happy to hear it!
@sirynka
@sirynka 9 дней назад
Have you implemented piece detection? If so I know who's job you're gonna take away (not really) There's russian channel that is reviewing chess games from various movies and cartoons. And he spends conciderable amount of time recreating the game from slivers of information.
@samobot
@samobot 8 дней назад
I've done some casual stuff in the past, but no real attempts yet! What's the channel? I think the step up from finding a chessboard to detecting pieces *accurately* is a pretty big one (I've seen some attempts at piece detection that work in very limited settings), part of the tough part is getting good data, synthetic data seems to have a lot of potential, so perhaps generating synthetic data with a comic-style rendering (perhaps even a stable diffusion Lora) may make this more possible. However, recreating games is a much larger problem than single image board or even piece detection. I appreciate the watch and comment, thanks!
Далее
I Made an AI with just Redstone!
17:23
Просмотров 725 тыс.
Transformer Neural Networks Derived from Scratch
18:08
Просмотров 128 тыс.
Would you help?!😳
00:32
Просмотров 4,8 млн
ОСКАР И ДЖОНИ БРОСИЛИ НАС 😭
01:00
10 weird algorithms
9:06
Просмотров 1,1 млн
How to Create a Chess Engine with TensorFlow (Python)
14:59
How to train simple AIs
12:59
Просмотров 65 тыс.
Why Computer Vision Is a Hard Problem for AI
8:39
Просмотров 123 тыс.
I wish every AI Engineer could watch this.
33:49
Просмотров 64 тыс.
I Built a Neural Network from Scratch
9:15
Просмотров 166 тыс.
Красиво, но телефон жаль
0:32
Просмотров 184 тыс.