https://github.com/jboirazian/captchacv2
A simple proof of concept for beating outdated Captcha methods using only opencv and numpy
https://github.com/jboirazian/captchacv2
captcha computer-vision opencv-python termux
Last synced: 2 months ago
JSON representation
A simple proof of concept for beating outdated Captcha methods using only opencv and numpy
- Host: GitHub
- URL: https://github.com/jboirazian/captchacv2
- Owner: jboirazian
- Created: 2024-03-05T21:01:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-05T21:47:11.000Z (over 2 years ago)
- Last Synced: 2025-01-01T18:42:35.913Z (over 1 year ago)
- Topics: captcha, computer-vision, opencv-python, termux
- Language: Python
- Homepage:
- Size: 48.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CaptchaCV2
A simple proof of concept for beating outdated Captcha methods using only opencv and numpy
## Summery
Many outdated websites and mobile apps still use the following captcha method:

While you might think that it can be solved with your favorite OCR framework , the reality is that it can be solved by using only [Template matching](https://docs.opencv.org/4.x/d4/dc6/tutorial_py_template_matching.html)
### Method
In order to perform to perform Template matching... we are gonna need templates. In the folder **/selected_patterns** you will find the 3 pairs 0 to 9 diggits.
These images were reconstructed from 1000 digits of the same number and position in order to obtain the real number without that sky blue jitter :
  
## How to run it
+ Install numpy and cv2
+ git clone https://github.com/jboirazian/CaptchaCV2.git
+ python3 verify.py
### Example
```python3
import modules.digit_recogniton as dr
import cv2
if __name__ == "__main__":
img=cv2.imread('example.png', cv2.IMREAD_GRAYSCALE)
print(dr.predict_number(image=img))
```
## Performance
Without the need of a GPU and with the provided image example , the prediction was achived in less than 5 ms on my PC.
I was also able to run in on an really old Android table using [Termux](https://termux.dev/en/) and got around 50 ms