Skip to content

Instantly share code, notes, and snippets.

View Avnsx's full-sized avatar

Mika C. Avnsx

View GitHub Profile
For a more organised and more update list please visit https://github.com/RayZz-/LCU-Arguments
This list will no longer be updated please refer to the repo linked above
These are known command line arguments for the LCU(including helper) some maybe outdated
or overtime may become outdated or some information maybe incorrect
if you would like to contribute please comment with updated information.
Usage example:
--app-name=kappa
@NanoAi
NanoAi / LeagueListener.py
Last active April 3, 2022 08:08
A Python Script that uses League APIs to attempt to close the process when the game ends, without playing out the ending animation. Because alt+f4 is now disabled... READ THE FIRST COMMENT!
from lcu_driver import Connector
import requests, webbrowser, psutil, asyncio, re
# This will automatically open porofessor & League of Graphs in champ select.
# -- ALSO --
# This will poll the League In-Game API, and watch the GameFlow sockets
# to automatically end the process of your game when the game ends.
### Comment out as you see fit!
## However: I still think using autohotkey to just kill the process with a key
## press is better...
@rinogo
rinogo / optimal-resize.py
Created March 31, 2021 18:50
Optimally resize an image so that its line height is approximately 32 pixels (Keywords: OpenCV, Tesseract, OCR)
#Optimally resize `img` according to the bounding boxes specified in `boxes` (which is simply the (pruned) results from `pytesseract.image_to_data()`).
#Tesseract performs optimally when capital letters are ~32px tall (https://groups.google.com/g/tesseract-ocr/c/Wdh_JJwnw94/m/24JHDYQbBQAJ). Smaller text obviously can't be OCR'd as accurately, but weirdly enough, larger text causes problems as well. So, this function uses the bounding boxes we've found and resizes the image so that the median line height should be ~32px.
def optimal_resize(img, boxes):
median_height = np.median(boxes["height"])
target_height = 32 #See https://groups.google.com/g/tesseract-ocr/c/Wdh_JJwnw94/m/24JHDYQbBQAJ
scale_factor = target_height / median_height
print("Scale factor: " + str(scale_factor))
#If the image is already within `skip_percentage` percent of the target size, just return the original image (it's better to skip resizing if we can)
skip_percentage = 0.07