Data V1.0.0
As of Version 7/4/2019, the program supports 31 champions: (order corresponds to output position from CNN)
[‘ashe’, ‘blitzcrank’, ‘brand’, ‘caitlyn’, ‘cassiopeia’, ‘darius’, ‘drmundo’, ‘ezreal’, ‘fiddlestick’,’ garen’, ‘graves’, ‘jax’, ‘karthus’, ‘kayle’, ‘malphite’, ‘nasus’, ‘nidalee’, ‘renekton’, ‘ryze’, ‘shen’,’ sivir’, ‘soraka’, ‘tristana’, ‘trundle’, ‘udyr’, ‘vladimir’, ‘warwick’, ‘wukong’, ‘ziggs’, ‘zilean’, ‘zyra’]
https://drive.google.com/drive/folders/1Yg0pzLheTi2sPPF1HU7qiXxPSZyb3_th?usp=sharing(increasing).
I will keep updating the algorithm to support more champions and increase the accuracy :)
Required dependencies:
Opencv, Tensorflow, Numpy, PIL
-
Start Anaconda Navigator, select environments on the left-hand bar, and click the triangle next to the environment you wish to run this program on and click “open Terminal”
-
Type in the following code in terminal:
conda install -c conda-forge opencv conda install -c conda-forge numpy conda install -c conda-forge tensorflow conda install -c conda-forge pillow
-
Clone League Minimap Scanner v 1.0.0 from this repository, and run liveidentify.py once you finished downloading.
This Application aims to recognize League of Legends champions by examining the Minimap. The Algorithm takes an image of the minimap as input and returns the coordinates of enemy champions.
The Algorithm is composed of 2 parts:
1: Image Processing ( process.py , live.py )
2: Neural Network Evaluation ( image2numpy.py , cnn.py , evaluate.py )
A Diagram of the Algorithm
Data V1.0.0
As of Version 7/4/2019, the program supports 31 champions: (order corresponds to output position from CNN)
[‘
[‘ashe’’, ‘‘blitzcrank’’, ‘‘brand’’, ‘‘caitlyn’’, ‘‘cassiopeia’’, ‘‘darius’’, ‘‘drmundo’’, ‘‘ezreal’’, ‘‘fiddlestick’,’’,’ garen’’, ‘‘graves’’, ‘‘jax’’, ‘‘karthus’’, ‘‘kayle’’, ‘‘malphite’’, ‘‘nasus’’, ‘‘nidalee’’, ‘‘renekton’’, ‘‘ryze’’, ‘‘shen’,’’,’ sivir’’, ‘‘soraka’’, ‘‘tristana’’, ‘‘trundle’’, ‘‘udyr’’, ‘‘vladimir’’, ‘‘warwick’’, ‘‘wukong’’, ‘‘ziggs’’, ‘‘zilean’’, ‘'zyra’]
https://drive.google.com/drive/folders/1Yg0pzLheTi2sPPF1HU7qiXxPSZyb3_th?usp=sharing(increasing)">https://drive.google.com/drive/folders/1Yg0pzLheTi2sPPF1HU7qiXxPSZyb3_th?usp=sharing(increasing).
.
I will keep updating the algorithm to support more champions and increase the accuracy :)
Required dependencies:
Opencv, Tensorflow, Numpy, PIL
- Start Anaconda Navigator, select environments on the left-hand bar, and click the triangle next to the environment you wish to run this program on and click “open Terminal”
2. Type in the following code in terminal:
conda install -c conda-forge opencv conda install -c conda-forge numpy conda install -c conda-forge tensorflow conda install -c conda-forge pillow
Clone League Minimap Scanner v 1.0.0 from this repository, and run liveidentify.py once you finished downloading.
) from this repository, and run liveidentify.py once you finished downloading.
This Application aims to recognize League of Legends champions by examining the Minimap. The Algorithm takes an image of the minimap as input and returns the coordinates of enemy champions.
The Algorithm is composed of 2 parts:
1: Image Processing ( process.py , live.py )
2: Neural Network Evaluation ( image2numpy.py , cnn.py , evaluate.py )
2: Neural Network Evaluation ( image2numpy.py , cnn.py , evaluate.py )
The Image Processing component is responsible for preprocessing the minimap images before feeding it into the neural network. To reduce the computational cost of the neural network, the preprocessing component will cut out the minimap regions where a champion icon’'s ring is detected using Opencv, whose process is as follows:
- split 3-d image into b,g,r channels
- use inRange function to binarize the b,g,r channels
- deduct b and g from red channel to isolate the red channel (the color of enemy champions’’ rings)
- Run HoughCircles function to detect the red circles in red channel
- Cut out squares based on coordinates of the circles and output them
After processing the image, the only inputs to the Neural Network are five 24*24 numpy arrays, which is much more computationally efficient compared to running object detection NN over the entire minimap.
The neural network is trained on 31 champions with roughly 360 images each. The size of training images numpy is (19000+,24,24,3) and such for test images is (1000+,24,24,3). To collect the data, an AutoHotKey script was written. Once initiated, the script would start a training game from the League of Legends Client, select friendly champion and enemy champion and start the game with a python program constantly grabbing the [805:1080,1645:1920] pixels of the monitor. Then the script will process the images itself and cut out the champions’’ portraits automatically.
The advantage to this approach is a small training dataset size and fast training. The over 20,000
images only took up 35MB of space when saved as “".npy”" files. Training the NN for 10 epochs took less than 30 seconds on a gaming laptop.
A weakness of the data collecting method is the deficiency of champions to choose from in League of Legends’’ practicetool. To collect training samples of all champions, the screen-grabbing program would have to overlook actual games, and the champion portraits might need to be labeled manually. In future versions, this algorithm will learn to recognize more champions, and I will be able to justify playing League of Legends as ““researching”” :)
The training data are kept in /data/, train_images.npy (19000+,24,24,3), test_images.npy (1000+,24,24,3).
style="max-width: 841.34375px;" viewBox="0 0 841.34375 446">Data V1.0.0
As of Version 7/4/2019, the program supports 31 champions: (order corresponds to output position from CNN)
[‘
[‘ashe’’, ‘‘blitzcrank’’, ‘‘brand’’, ‘‘caitlyn’’, ‘‘cassiopeia’’, ‘‘darius’’, ‘‘drmundo’’, ‘‘ezreal’’, ‘‘fiddlestick’,’’,’ garen’’, ‘‘graves’’, ‘‘jax’’, ‘‘karthus’’, ‘‘kayle’’, ‘‘malphite’’, ‘‘nasus’’, ‘‘nidalee’’, ‘‘renekton’’, ‘‘ryze’’, ‘‘shen’,’’,’ sivir’’, ‘‘soraka’’, ‘‘tristana’’, ‘‘trundle’’, ‘‘udyr’’, ‘‘vladimir’’, ‘‘warwick’’, ‘‘wukong’’, ‘‘ziggs’’, ‘‘zilean’’, ‘'zyra’]
Data V1.0.0
As of Version 7/4/2019, the program supports 31 champions: (order corresponds to output position from CNN)
[‘
[‘ashe’’, ‘‘blitzcrank’’, ‘‘brand’’, ‘‘caitlyn’’, ‘‘cassiopeia’’, ‘‘darius’’, ‘‘drmundo’’, ‘‘ezreal’’, ‘‘fiddlestick’,’’,’ garen’’, ‘‘graves’’, ‘‘jax’’, ‘‘karthus’’, ‘‘kayle’’, ‘‘malphite’’, ‘‘nasus’’, ‘‘nidalee’’, ‘‘renekton’’, ‘‘ryze’’, ‘‘shen’,’’,’ sivir’’, ‘‘soraka’’, ‘‘tristana’’, ‘‘trundle’’, ‘‘udyr’’, ‘‘vladimir’’, ‘‘warwick’’, ‘‘wukong’’, ‘‘ziggs’’, ‘‘zilean’’, ‘'zyra’]
https://drive.google.com/drive/folders/1Yg0pzLheTi2sPPF1HU7qiXxPSZyb3_th?usp=sharing(increasing)">https://drive.google.com/drive/folders/1Yg0pzLheTi2sPPF1HU7qiXxPSZyb3_th?usp=sharing(increasing).
.
I will keep updating the algorithm to support more champions and increase the accuracy :)
Required dependencies:
Required dependencies:
Opencv, Tensorflow, Numpy, PIL
```mermaid
graph LR
A[Minimap] --> B((OPENCV Image Processing))
B --> D[Champion A]
B --> E[Champion B]
B --> F[Champion C]
B --> G[Champion D]
B --> H[Champion E]
D--> L{Neural Network}
E --> L{Neural Network}
F --> L{Neural Network}
G --> L{Neural Network}
H --> L{Neural Network}
L --> Q[Riven]
L --> R[Elise]
L --> S[Ryze]
L --> T[Kai'sa]
L --> U[Alistar]
```>MinimapMinimap
Data V1.0.0
As of Version 7/4/2019, the program supports 31 champions: (order corresponds to output position from CNN)
[‘
[‘ashe’’, ‘‘blitzcrank’’, ‘‘brand’’, ‘‘caitlyn’’, ‘‘cassiopeia’’, ‘‘darius’’, ‘‘drmundo’’, ‘‘ezreal’’, ‘‘fiddlestick’,’’,’ garen’’, ‘‘graves’’, ‘‘jax’’, ‘‘karthus’’, ‘‘kayle’’, ‘‘malphite’’, ‘‘nasus’’, ‘‘nidalee’’, ‘‘renekton’’, ‘‘ryze’’, ‘‘shen’,’’,’ sivir’’, ‘‘soraka’’, ‘‘tristana’’, ‘‘trundle’’, ‘‘udyr’’, ‘‘vladimir’’, ‘‘warwick’’, ‘‘wukong’’, ‘‘ziggs’’, ‘‘zilean’’, ‘'zyra’]
The Image Processing component is responsible for preprocessing the minimap images before feeding it into the neural network. To reduce the computational cost of the neural network, the preprocessing component will cut out the minimap regions where a champion icon’s ring is detected using Opencv, whose process is as follows:
-
split 3-d image into b,g,r channels
-
use inRange function to binarize the b,g,r channels
-
deduct b and g from red channel to isolate the red channel (the color of enemy champions’ rings)
-
Run HoughCircles function to detect the red circles in red channel
-
Cut out squares based on coordinates of the circles and output them
After processing the image, the only inputs to the Neural Network are five 24*24 numpy arrays, which is much more computationally efficient compared to running object detection NN over the entire minimap.
The neural network is trained on 31 champions with roughly 360 images each. The size of training images numpy is (19000+,24,24,3) and such for test images is (1000+,24,24,3). To collect the data, an AutoHotKey script was written. Once initiated, the script would start a training game from the League of Legends Client, select friendly champion and enemy champion and start the game with a python program constantly grabbing the [805:1080,1645:1920] pixels of the monitor. Then the script will process the images itself and cut out the champions’ portraits automatically.
The advantage to this approach is a small training dataset size and fast training. The over 20,000
images only took up 35MB of space when saved as “.npy” files. Training the NN for 10 epochs took less than 30 seconds on a gaming laptop.
A weakness of the data collecting method is the deficiency of champions to choose from in League of Legends’ practicetool. To collect training samples of all champions, the screen-grabbing program would have to overlook actual games, and the champion portraits might need to be labeled manually. In future versions, this algorithm will learn to recognize more champions, and I will be able to justify playing League of Legends as “researching” :)
The training data are kept in /data/, train_images.npy (19000+,24,24,3), test_images.npy (1000+,24,24,3).
# League Map Scanner (V 1.0.0)Data V1.0.0
Data V1.0.0 As of Version 7/4/2019, the program supports 31 champions: (order corresponds to output position from CNN)
[‘
['ashe’', ‘'blitzcrank’', ‘'brand’', ‘'caitlyn’', ‘'cassiopeia’', ‘'darius’', ‘'drmundo’', ‘'ezreal’', ‘'fiddlestick’,’',' garen’', ‘'graves’', ‘'jax’', ‘'karthus’', ‘'kayle’', ‘'malphite’', ‘'nasus’', ‘'nidalee’', ‘'renekton’', ‘'ryze’', ‘'shen’,’',' sivir’', ‘'soraka’', ‘'tristana’', ‘'trundle’', ‘'udyr’', ‘'vladimir’', ‘'warwick’', ‘'wukong’', ‘'ziggs’', ‘'zilean’', ‘'zyra’]
https://drive.google.com/drive/folders/1Yg0pzLheTi2sPPF1HU7qiXxPSZyb3_th?usp=sharing(increasing)">https://drive.google.com/drive/folders/1Yg0pzLheTi2sPPF1HU7qiXxPSZyb3_th?usp=sharing(increasing).
.
I will keep updating the algorithm to support more champions and increase the accuracy :)
Required dependencies:
Required dependencies:
Required dependencies:
Opencv, Tensorflow, Numpy, PIL
- Start Anaconda Navigator, select environments on the left-hand bar, and click the triangle next to the environment you wish to run this program on and click “open Terminal”
2. Type in the following code in terminal:
conda install -c conda-forge opencv conda install -c conda-forge numpy conda install -c conda-forge tensorflow conda install -c conda-forge pillow
Clone League Minimap Scanner v 1.0.0 from this repository, and run liveidentify.py once you finished downloading.
) from this repository, and run liveidentify.py once you finished downloading.
This Application aims to recognize League of Legends champions by examining the Minimap. The Algorithm takes an image of the minimap as input and returns the coordinates of enemy champions.
The Algorithm is composed of 2 parts:
1: Image Processing ( process.py , live.py )
2: Neural Network Evaluation ( image2numpy.py , cnn.py , evaluate.py )
The Image Processing component is responsible for preprocessing the minimap images before feeding it into the neural network. To reduce the computational cost of the neural network, the preprocessing component will cut out the minimap regions where a champion icon’'s ring is detected using Opencv, whose process is as follows:
-
split 3-d image into b,g,r channels
-
use inRange function to binarize the b,g,r channels
-
deduct b and g from red channel to isolate the red channel (the color of enemy champions’’ rings)
-
Run HoughCircles function to detect the red circles in red channel
-
Cut out squares based on coordinates of the circles and output them
After processing the image, the only inputs to the Neural Network are five 24*24 numpy arrays, which is much more computationally efficient compared to running object detection NN over the entire minimap.
The neural network is trained on 31 champions with roughly 360 images each. The size of training images numpy is (19000+,24,24,3) and such for test images is (1000+,24,24,3). To collect the data, an AutoHotKey script was written. Once initiated, the script would start a training game from the League of Legends Client, select friendly champion and enemy champion and start the game with a python program constantly grabbing the [805:1080,1645:1920] pixels of the monitor. Then the script will process the images itself and cut out the champions’’ portraits automatically.
The advantage to this approach is a small training dataset size and fast training. The over 20,000
images only took up 35MB of space when saved as “".npy”" files. Training the NN for 10 epochs took less than 30 seconds on a gaming laptop.
A weakness of the data collecting method is the deficiency of champions to choose from in League of Legends’’ practicetool. To collect training samples of all champions, the screen-grabbing program would have to overlook actual games, and the champion portraits might need to be labeled manually. In future versions, this algorithm will learn to recognize more champions, and I will be able to justify playing League of Legends as ““researching”” :)
The training data are kept in /data/, train_images.npy (19000+,24,24,3), test_images.npy (1000+,24,24,3).
> B((OPENCV Image Processing)) B --> D[Champion A] B --> E[Champion B] B --> F[Champion C] B --> G[Champion D] B --> H[Champion E] D--> L{Neural Network} E --> L{Neural Network} F --> L{Neural Network} G --> L{Neural Network} H --> L{Neural Network} L --> Q[Riven] L --> R[Elise] L --> S[Ryze] L --> T[Kai'sa] L --> U[Alistar] ```- Start Anaconda Navigator, select environments on the left-hand bar, and click the triangle next to the environment you wish to run this program on and click “open Terminal”
2. Type in the following code in terminal:
conda install -c conda-forge opencv
conda install -c conda-forge numpy
conda install -c conda-forge tensorflow
conda install -c conda-forge pillow
conda install -c anaconda pil
Clone League Minimap Scanner v 1.0.0 from this repository, and run liveidentify.py once you finished downloading.
) from this repository, and run liveidentify.py once you finished downloading.
This Application aims to recognize League of Legends champions by examining the Minimap. The Algorithm takes an image of the minimap as input and returns the coordinates of enemy champions.
The Algorithm is composed of 2 parts:
1: Image Processing ( process.py , live.py )
2: Neural Network Evaluation ( image2numpy.py , cnn.py , evaluate.py )
The Image Processing component is responsible for preprocessing the minimap images before feeding it into the neural network. To reduce the computational cost of the neural network, the preprocessing component will cut out the minimap regions where a champion icon’'s ring is detected using Opencv, whose process is as follows:
-
split 3-d image into b,g,r channels
-
use inRange function to binarize the b,g,r channels
-
deduct b and g from red channel to isolate the red channel (the color of enemy champions’’ rings)
-
Run HoughCircles function to detect the red circles in red channel
-
Cut out squares based on coordinates of the circles and output them
After processing the image, the only inputs to the Neural Network are five 24*24 numpy arrays, which is much more computationally efficient compared to running object detection NN over the entire minimap.
The neural network is trained on 31 champions with roughly 360 images each. The size of training images numpy is (19000+,24,24,3) and such for test images is (1000+,24,24,3). To collect the data, an AutoHotKey script was written. Once initiated, the script would start a training game from the League of Legends Client, select friendly champion and enemy champion and start the game with a python program constantly grabbing the [805:1080,1645:1920] pixels of the monitor. Then the script will process the images itself and cut out the champions’’ portraits automatically.
The advantage to this approach is a small training dataset size and fast training. The over 20,000
images only took up 35MB of space when saved as “".npy”" files. Training the NN for 10 epochs took less than 30 seconds on a gaming laptop.
A weakness of the data collecting method is the deficiency of champions to choose from in League of Legends’’ practicetool. To collect training samples of all champions, the screen-grabbing program would have to overlook actual games, and the champion portraits might need to be labeled manually. In future versions, this algorithm will learn to recognize more champions, and I will be able to justify playing League of Legends as ““researching”” :)
The training data are kept in /data/, train_images.npy (19000+,24,24,3), test_images.npy (1000+,24,24,3).
-
Start Anaconda Navigator, select environments on the left-hand bar, and click the triangle next to the environment you wish to run this program on and click “open Terminal”
-
Type in the following code in terminal:
conda install -c conda-forge opencv
conda install -c conda-forge numpy
conda install -c conda-forge tensorflow
conda install -c conda-forge pillow
conda install -c anaconda pil
Clone League Minimap Scanner v 1.0.0 from this repository, and run liveidentify.py once you finished downloading.
) from this repository, and run liveidentify.py once you finished downloading.
This Application aims to recognize League of Legends champions by examining the Minimap. The Algorithm takes an image of the minimap as input and returns the coordinates of enemy champions.
The Algorithm is composed of 2 parts:
1: Image Processing ( process.py , live.py )
2: Neural Network Evaluation ( image2numpy.py , cnn.py , evaluate.py )
The Image Processing component is responsible for preprocessing the minimap images before feeding it into the neural network. To reduce the computational cost of the neural network, the preprocessing component will cut out the minimap regions where a champion icon’'s ring is detected using Opencv, whose process is as follows:
-
split 3-d image into b,g,r channels
-
use inRange function to binarize the b,g,r channels
-
deduct b and g from red channel to isolate the red channel (the color of enemy champions’’ rings)
-
Run HoughCircles function to detect the red circles in red channel
-
Cut out squares based on coordinates of the circles and output them
After processing the image, the only inputs to the Neural Network are five 24*24 numpy arrays, which is much more computationally efficient compared to running object detection NN over the entire minimap.
The neural network is trained on 31 champions with roughly 360 images each. The size of training images numpy is (19000+,24,24,3) and such for test images is (1000+,24,24,3). To collect the data, an AutoHotKey script was written. Once initiated, the script would start a training game from the League of Legends Client, select friendly champion and enemy champion and start the game with a python program constantly grabbing the [805:1080,1645:1920] pixels of the monitor. Then the script will process the images itself and cut out the champions’’ portraits automatically.
The advantage to this approach is a small training dataset size and fast training. The over 20,000
images only took up 35MB of space when saved as “".npy”" files. Training the NN for 10 epochs took less than 30 seconds on a gaming laptop.
A weakness of the data collecting method is the deficiency of champions to choose from in League of Legends’’ practicetool. To collect training samples of all champions, the screen-grabbing program would have to overlook actual games, and the champion portraits might need to be labeled manually. In future versions, this algorithm will learn to recognize more champions, and I will be able to justify playing League of Legends as ““researching”” :)
The training data are kept in /data/, train_images.npy (19000+,24,24,3), test_images.npy (1000+,24,24,3).
### Preparing environment using Anaconda, same method for Windows and OSX:-
Start Anaconda Navigator, select environments on the left-hand bar, and click the triangle next to the environment you wish to run this program on and click “open Terminal”
-
Type in the following code in terminal:
conda install -c conda-forge opencv
conda install -c conda-forge numpy
conda install -c conda-forge tensorflow
conda install -c conda-forge pillow
conda install -c anaconda pil
Clone League Minimap Scanner v 1.0.0 from this repository, and run liveidentify.py once you finished downloading.
) from this repository, and run liveidentify.py once you finished downloading.
This Application aims to recognize League of Legends champions by examining the Minimap. The Algorithm takes an image of the minimap as input and returns the coordinates of enemy champions.
The Algorithm is composed of 2 parts:
1: Image Processing ( process.py , live.py )
2: Neural Network Evaluation ( image2numpy.py , cnn.py , evaluate.py )
The Image Processing component is responsible for preprocessing the minimap images before feeding it into the neural network. To reduce the computational cost of the neural network, the preprocessing component will cut out the minimap regions where a champion icon’'s ring is detected using Opencv, whose process is as follows:
-
split 3-d image into b,g,r channels
-
use inRange function to binarize the b,g,r channels
-
deduct b and g from red channel to isolate the red channel (the color of enemy champions’' rings)
-
Run HoughCircles function to detect the red circles in red channel
-
Cut out squares based on coordinates of the circles and output them
After processing the image, the only inputs to the Neural Network are five 24*24 numpy arrays, which is much more computationally efficient compared to running object detection NN over the entire minimap.
The neural network is trained on 31 champions with roughly 360 images each. The size of training images numpy is (19000+,24,24,3) and such for test images is (1000+,24,24,3). To collect the data, an AutoHotKey script was written. Once initiated, the script would start a training game from the League of Legends Client, select friendly champion and enemy champion and start the game with a python program constantly grabbing the [805:1080,1645:1920] pixels of the monitor. Then the script will process the images itself and cut out the champions’' portraits automatically.
The advantage to this approach is a small training dataset size and fast training. The over 20,000
images only took up 35MB of space when saved as “".npy”" files. Training the NN for 10 epochs took less than 30 seconds on a gaming laptop.
A weakness of the data collecting method is the deficiency of champions to choose from in League of Legends’' practicetool. To collect training samples of all champions, the screen-grabbing program would have to overlook actual games, and the champion portraits might need to be labeled manually. In future versions, this algorithm will learn to recognize more champions, and I will be able to justify playing League of Legends as “"researching”" :)
The training data are kept in /data/, train_images.npy (19000+,24,24,3), test_images.npy (1000+,24,24,3).