semvec/pypi-packages huggingface dataset:
receipt-enhancer 0.1.8
This module is essential for preprocessing receipt images to improve visual quality and facilitate automatic analysis.
License: MIT
Requires Python: <4.0,>=3.8
Keywords: document, nfe, invoice, receipt

# Receipt Enhancer

Receipt Enhancer is a Python module designed to enhance and process images of receipts. It provides various functionalities for improving the quality of receipt images, including converting to grayscale, detecting lines using the Hough transform, enhancing local contrast, adaptive thresholding, and more.

## Features

- **Convert to Grayscale:** Converts the input image to grayscale for further processing.
- **Hough Line Detection:** Detects lines in the image using the Hough transform, useful for identifying borders and text regions.
- **Densest Region Detection:** Finds the densest region of lines in the image, often indicating the center of the receipt.
- **Image Rotation Correction:** Corrects the rotation of the image based on detected lines.
- **Adaptive Local Contrast Enhancement:** Enhances the local contrast of the image to improve visibility of text and details.
- **Adaptive Weighting:** Adjusts the intensity of image pixels based on local statistics to improve overall quality.
- **Adaptive Binary Thresholding:** Applies adaptive binary thresholding to segment the image into foreground and background regions.

## Installation

You can install Receipt Enhancer using pip:

```bash
pip install receipt-enhancer
```

## Usage

```python
from receipt_enhancer import ReceiptEnhancer
import cv2

# Initialize ReceiptEnhancer
enhancer = ReceiptEnhancer()

# Load an image
image = cv2.imread('receipt_image.jpg')

# Example Usage:
# Convert to grayscale
grey_image = enhancer.convert_to_greyscale(image)

# Detect lines using Hough transform
lines = enhancer.get_hough_lines(image, length=(50, 100), min_distance=(20, 50))

# Find densest region
densest_x, densest_y = enhancer.find_densest_region(image, lines)

# Correct rotation
corrected_image = enhancer.rotation_fix_hough_based(image, lines)

# Enhance local contrast
contrast_enhanced_image = enhancer.adaptive_local_contrast(image)

# Apply adaptive weighting
weighted_image = enhancer.adaptative_weight(image)

# Apply adaptive binary thresholding
binary_image = enhancer.adaptive_binary_threshold(image)
```

## Contributions

Contributions are welcome! If you have any suggestions, feature requests, or bug reports, please open an issue or submit a pull request on GitHub.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
docr 0.2.1
🛠️ Docr: A modular toolkit for intelligent document analysis and processing. Easy to expand and flexible to use, just like playing with building blocks!
License: MIT
Requires Python: <4.0,>=3.10

English | [中文](README_zh.md) | [日语]()
# Docr 🚀

## 1. Overview 🌟

🛠️ Component design with module-based functionality, allowing for on-demand feature acquisition, 🚀 easy to expand, and flexible to use, just like playing with building blocks!

Docr is a modular component-based toolkit for document analysis and processing. It's designed with flexibility and extensibility in mind, making it easy to expand and use various document processing functionalities as needed.

## 2. Features 🛠️

- 📄 Layout Analysis
- 🔢 Formula Detection and Recognition
- 📝 Optical Character Recognition (OCR)
- 📊 Table Structure Recognition
- 📚 Reading Order Analysis
- 🖼️ Image Processing Utilities

## 3. Installation and Usage 📦

### 3.1 Prerequisites

- Python 3.10 or higher
- Poetry (for dependency management)

### 3.2 Setup

1. Clone the repository:
   ```bash
   git clone https://github.com/yjmm10/docr.git
   cd docr
   git clone https://huggingface.co/liferecords/Telos.git docr/models
   ```

2. Install dependencies:
   ```bash
   poetry install -v
   ```

### 3.3 Usage

Here's a quick example of how to use Docr for OCR:

```python
from docr import OCR
import cv2

# Initialize the OCR model
ocr_model = OCR()

# Read an image
image = cv2.imread("path/to/your/image.png")

# Perform OCR
result = ocr_model(image)

print(result)
```

Docr comes with a Streamlit-based web UI for easy demonstration of its capabilities:

1. Run the demo:
   ```bash
   streamlit run webui/demo.py
   ```

2. Open your browser and navigate to the provided URL (usually http://localhost:8501)

3. Upload an image and select the model you want to use for processing

Docr also provides a FastAPI-based API service for integration into other applications:

1. Start the API server:
   ```bash
   uvicorn api.docr_api:app --host 0.0.0.0 --port 8000
   ```

2. The API documentation will be available at http://localhost:8000/docs

## 4. Development 🔬

For detailed information on development, please refer to the [development guide](./docs/development.md). This guide will help you set up your IDE for working with Docr, including SRC Layout configuration.

## 5. Contributing 🤝

We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for more details.

## 6. License 📄

Docr is released under the MIT License. See the [LICENSE](LICENSE) file for more details.

## 7. Contact 📧

For any questions or feedback, please contact the project maintainer:
liferecords <yjmm10@yeah.net>