Skip to main content

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:

pip install receipt-enhancer

Usage

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 file for details.

Metadata

Release files for receipt-enhancer 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for receipt-enhancer 0.1.8
File Size Uploaded Provenance Actions
receipt_enhancer-0.1.8.tar.gz 6.6 kB Without provenance Details for receipt_enhancer-0.1.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for receipt-enhancer 0.1.8
File Interpreter ABI Platform Actions
receipt_enhancer-0.1.8-py3-none-any.whl Python 3 none any Details for receipt_enhancer-0.1.8-py3-none-any.whl

Total release size: 13.9 kB

Release files / receipt_enhancer-0.1.8.tar.gz

Download URL receipt_enhancer-0.1.8.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
875974bf6ef5978a005e20acc7a59e6bde5d23e17ffab2ed07f16e8d51a52f6a
BLAKE2b-256 checksum
How to use checksums
cd55de5fceb8a5072207f1fa992f13d83271b2af085e7582216245c2cee0dfc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.2 Linux/6.1.0-23-amd64

Release files / receipt_enhancer-0.1.8-py3-none-any.whl

Download URL receipt_enhancer-0.1.8-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de6d5a99203050ae88e41e515aa009cae738f19bb88f557061370663f64f0644
BLAKE2b-256 checksum
How to use checksums
b32e863361b75ddd0041c8d91a7c6c8ee5bbcf5b4d4042a1d5fa79c37a572d3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.2 Linux/6.1.0-23-amd64

Security for receipt-enhancer 0.1.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page