A robust OpenCV-based solver for slider captchas (Puzzle matching)
Project description
Puzzle Slider Captcha Solver
A robust, OpenCV-based library for solving "slider" style captchas (like GeeTest, Shopee, etc.) where a puzzle piece needs to be matched to a hole in the background.
Unlike AI-based solvers, this library uses advanced Template Matching and Image Processing techniques to find pixel-perfect matches, making it extremely fast and lightweight.
Features
- High Precision: Uses
cv2.TM_CCOEFF_NORMEDwith sub-pixel refinement for accurate coordinate detection. - Robust Transforms: Includes built-in image transformations (Edge Detection, Normalization) to handle various captcha styles.
- Lightweight: Only depends on
opencv-pythonandnumpy. - Easy Visualization: Built-in methods to debug and visualize the matching result.
Installation
pip install puzzle-slider-captcha
Usage
from puzzle_slider_captcha import PuzzleCaptchaSolver
# Initialize solver
solver = PuzzleCaptchaSolver()
# Solve from files
result = solver.handle_file("background.png", "puzzle_piece.png")
# Or solve from bytes
# result = solver.handle_bytes(bg_bytes, puzzle_bytes)
print(f"Target X: {result.x}, Target Y: {result.y}")
# Visualize debug result
result.visualize_and_save("debug_result.png")
Requirements
- Python 3.8+
- OpenCV
- Numpy
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file puzzle_slider_captcha-0.1.0.tar.gz.
File metadata
- Download URL: puzzle_slider_captcha-0.1.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37708d8ca8fcfe5d78721c8b367c0ffe40b5582da7e558155a5f58c2b6fa46d4
|
|
| MD5 |
0718bad431ffa10f92aaf519f90a2c42
|
|
| BLAKE2b-256 |
83a2da1ef12d2304aced7231ded1e24795e152d371a810fb3c8726f78a0fe68b
|
File details
Details for the file puzzle_slider_captcha-0.1.0-py3-none-any.whl.
File metadata
- Download URL: puzzle_slider_captcha-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6cd2aaa3d31250deafc4c4126abd0fbc245eb54acc5f865c9e61a14b10f9c8ec
|
|
| MD5 |
091c10ff19aaac6c1d18b94ae7ce5d4e
|
|
| BLAKE2b-256 |
684b250ecbdce759fa5c125829be1736ef096f506a3ac2377b65f4a1ba854214
|