Metadata-Version: 2.4
Name: kachowvision
Version: 0.1.0
Summary: Bolivian license plate recognition and vehicle type classification with OpenCV and OCR
Author: Franco Senes
Project-URL: Homepage, https://github.com/Franco-Senes/kachowvision
Project-URL: Repository, https://github.com/Franco-Senes/kachowvision
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering :: Image Processing
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: opencv-python>=4.8.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: rapidocr-onnxruntime>=1.3.0
Requires-Dist: pytesseract>=0.3.10

# KachowVision
Bolivian license plate scanner using OpenCV and OCR.


## Features

- **License Number Detection**: Extracts the license plate automaticaly and in less than 1 second it recognizes the plaque.
- **Vehicle Type Classification**: 
Identifies the vehicle type using the license plate color.
  - **Electric**: Blue background (`vehicle_type: "electric"`, `is_electric: true`)
  - **Flex-Fuel**: Green background (`vehicle_type: "flexfuel"`, `is_electric: false`)
  - **Combustion**: White/metallic background (`vehicle_type: "combustion"`, `is_electric: false`)
- **Department Origin Detection**: 
Detects the cars department using the letter on the top right side.

## Installation

```bash
pip install kachowvision
```

## Usage

### Terminal

```bash
kachowvision path/to/license-plate.jpg
```

Output:
```json
{
  "license_number": "5463GBG",
  "vehicle_type": "combustion",
  "is_electric": false,
  "department_letter": "S",
  "department_name": "Santa Cruz",
  "analysis_time_seconds": 0.8421
}
```

The `license_number` field shows the image license plate number.
The `vehicle_type` field shows the vehicle type(electric,flex,combustion)
The `is_electric` field shows if the vehicle is electric.
The `department_letter` field shows the department letter on the top right of the screen
The `department_name` field shows the department name using the department name
The `analysis_time_seconds` field shows how long the image analysis took

### Python

```python
from kachowvision import analyze_plate

result = analyze_plate("path/to/license-plate.jpg")
print(result)
```

For development from a checkout, install the project in editable mode:

```bash
pip install -e .
```

The sample images in `testingimages/` are included in the repository for
development and testing; they are not required when using the installed
package.

## Testing

```bash
python3 testing.py
```
