Metadata-Version: 2.4
Name: charsplit
Version: 0.1.0
Summary: Split handwritten text images into individual characters with bounding box detection.
Author: Siddharth Karn
License: MIT
Project-URL: Homepage, https://github.com/yourusername/charsplit
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# CharSplit

CharSplit is a lightweight Python library that segments an image containing text into individual character images. Each extracted character is returned as a NumPy matrix, making it easy to use in OCR, computer vision, and machine learning pipelines.

## Features

- Extracts individual characters from a text image
- Returns each character as a NumPy array
- Accepts both image paths and OpenCV images
- Characters are returned in left-to-right order
- Simple API
- Built with OpenCV and NumPy

## Installation

```bash
pip install charsplit
```

## Quick Start

```python
from charsplit.charsplit.main import splitCharsFromImage as split

characters:list[list[list[float]]] = split("text.png")

print(f"Detected {len(characters)} characters.")

for char in characters:
    print(char.shape)
```

## Example

Input image:

```
12345
```

```python
from charsplit import split

characters = split("digits.png")
```

Output:

```python
[
    array(...),  # 1
    array(...),  # 2
    array(...),  # 3
    array(...),  # 4
    array(...),  # 5
]
```

Each element is a NumPy matrix representing one segmented character.

## API

### `split(image)`

Segments an image into individual character matrices.

#### Parameters

| Name | Type | Description |
|------|------|-------------|
| image | `str` or `numpy.ndarray` | Image path or loaded OpenCV image |

#### Returns

```python
List[numpy.ndarray]
```

A list of character images ordered from left to right.

## Applications

- OCR preprocessing
- Handwritten character recognition
- Digit recognition
- CAPTCHA segmentation
- Character dataset generation
- Deep learning preprocessing

## Dependencies

- Python 3.9+
- NumPy
- OpenCV

## License

MIT License

## Author

**Siddharth Karna**
