The end of the last post was very satisfying for me, I was very proud of myself. The problem is, we could have done a better job. If you check out the last video you can clearly see that between rounds, our algorithm takes multiple seconds to start making decisions. This is because the Imaging Analysis part has some inefficiencies. After thinking about it I came up with a following issues.
- We analyse the whole image even though the game grid is only a sub-part of it.
- We keep scanning for cells and we don’t take advantage of the fact that once a cell was discovered, it’s value cannot change.
- We calculate the centers each time even though cells are always in the same place.
- We are scanning over areas that previously were detected as other values
Lucky all of these things can be improve by rethinking our strategy a bit. There are some values we need to extract only once and never again, and there are some things that we need to do every time. Let me show you how does the beginning of our application look like.
Continue reading