diff --git a/docs/home/how-it-works.md b/docs/home/how-it-works.md index 58a88c8..374e444 100644 --- a/docs/home/how-it-works.md +++ b/docs/home/how-it-works.md @@ -11,7 +11,7 @@ After using "locate" function, coordinates and dimensions of the object are retu ## Transforming piece of images into data -Before understanding how small pieces of images are transformed into data, tibiapi uses a hash function to implement a [Cache](https://en.wikipedia.org/wiki/Cache_(computing)) mechanism to often avoid the [OpenCV](https://opencv.org) match template and excessive [CPU](https://en.wikipedia.org/wiki/Central_processing_unit) usage, this is why many functions have responses between [milliseconds](https://simple.wikipedia.org/wiki/Millisecond) and [nanoseconds](https://en.wikipedia.org/wiki/Nanosecond): +Before understanding how small pieces of images are transformed into data, tibiapi uses a hash function to implement a [Cache]() mechanism to often avoid the [OpenCV](https://opencv.org) match template and excessive [CPU](https://en.wikipedia.org/wiki/Central_processing_unit) usage, this is why many functions have responses between [microseconds](https://simple.wikipedia.org/wiki/Microsecond) and [nanoseconds](https://en.wikipedia.org/wiki/Nanosecond): ```python import numpy as np @@ -59,10 +59,10 @@ Not all the code is machine code, but it would be ideal, so all the typing would ### Cache mechanism -Many functions have a [Cache](https://en.wikipedia.org/wiki/Cache_(computing)) mechanism, since some pixels are read from a specific area and it doesn't change, it is not necessary to recalculate the function, just cut out a certain region and obtain the hash of this small image generated, if the hash of this image is the same as the previous one, the value is the same. +Many functions have a [Cache]() mechanism, since some pixels are read from a specific area and it doesn't change, it is not necessary to recalculate the function, just cut out a certain region and obtain the hash of this small image generated, if the hash of this image is the same as the previous one, the value is the same. Getting the hash from a image is possible using `#!python hashit` function provided in utils module. The response time should vary between 300 and 500 [nanoseconds](https://en.wikipedia.org/wiki/Nanosecond). ### Time magnitude -Small functions such as getting the level, getting the speed, etc., will respond in 5 [Microseconds](https://en.wikipedia.org/wiki/Microsecond), however, as they will be cached, the time will reduce by about 5 times and the response time will be 1 [Microseconds](https://en.wikipedia.org/wiki/Microsecond) if the content doesn't change. +Small functions such as getting the level, getting the speed, etc., will respond in 5 [microseconds](https://en.wikipedia.org/wiki/Microsecond), however, as they will be cached, the time will reduce by about 5 times and the response time will be 1 [microseconds](https://en.wikipedia.org/wiki/Microsecond) if the content doesn't change.