Metadata-Version: 2.4
Name: litecv
Version: 0.3.0
Summary: A lightweight, fast, and easy-to-use Python computer vision library
Home-page: https://github.com/dhaval-vedra/litecv
Author: VEDRA
Author-email: gametidhaval980@gmail.com
License: MIT
Project-URL: Documentation, https://github.com/dhaval-vedra/litecv/docs
Project-URL: Source, https://github.com/dhaval-bedra/litecv
Project-URL: Issues, https://github.com/dhaval-vedra/litecv/issues
Keywords: computer-vision image-processing real-time camera filters opencv-alternative raspberry-pi
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pygame>=2.6.1
Requires-Dist: Pillow>=10.0.0
Requires-Dist: numpy>=1.26.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=5.0.0; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=1.0.0; extra == "docs"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# LiteCV - Lightweight Computer Vision Library

<div align="center">

![Raspberry Pi Optimized](https://img.shields.io/badge/Raspberry%20Pi-Optimized-C51A4A?style=for-the-badge&logo=raspberrypi)
![Python 3.6+](https://img.shields.io/badge/Python-3.6%2B-blue?style=for-the-badge&logo=python)
![MIT License](https://img.shields.io/badge/License-MIT-green?style=for-the-badge)
![Active Development](https://img.shields.io/badge/Status-Active%20Development-orange?style=for-the-badge)

**A lightweight, fast, and easy-to-use Python computer vision library**

[Features](#features) • [Installation](#installation) • [Quick Start](#quick-start) • [Documentation](#documentation) • [Examples](#examples) • [Contributing](#contributing) • [License](#license)

</div>

---

## About

LiteCV is a lightweight Python computer vision library designed for simplicity and performance. Inspired by OpenCV, it provides essential image processing operations, real-time camera capture, and a collection of filters optimized for both desktop and mobile devices. Built on top of industry-standard libraries like Pillow, Pygame, and NumPy, LiteCV offers a clean, intuitive API for computer vision tasks.

### Why LiteCV?

- **Lightweight** - Minimal dependencies, fast imports
- **Easy to Learn** - Simple, intuitive API inspired by OpenCV
- **Fast** - Optimized for real-time processing
- **Mobile-Friendly** - Designed with mobile devices in mind
- **Well-Documented** - Comprehensive examples and API docs
- **Active Development** - Regularly maintained and updated

---

## Features

### Core Image Operations
- ✅ Image I/O (load, save, convert)
- ✅ Resizing (pixels/percentage with quality options)
- ✅ Color conversion (RGB, Grayscale)
- ✅ Enhancements (brightness, contrast, saturation, sharpness)

### Filters & Effects
- 🎨 Basic: Grayscale, Blur, Edges, Sepia
- 🎨 Advanced: Cartoon, Sketch, Thermal, Night Vision, Infrared
- 🎨 Motion detection for real-time tracking
- 🎨 Easy to extend with custom filters

### Drawing & Graphics
- 🖼️ Shapes (circles, rectangles, lines)
- 🖼️ Text rendering with custom fonts
- 🖼️ Image composition and blending

### Camera & Real-Time Processing
- 📹 Live camera feed capture
- 📹 Real-time filter application
- 📹 Built-in GUI controls
- 📹 Individual frame or stream processing

### Advanced Features
- 🔍 Object detection framework
- 🎬 Video frame extraction
- 📊 NumPy array integration
- ⚡ Smart caching for performance

---

## Installation

### From PyPI

```bash
pip install litecv
```

From Local Repository (Development)

```bash
git clone https://github.com/dhaval-vedra/litecv.git
cd litecv
pip install -e .
```

System Requirements

· Python: 3.10 or higher
· OS: Windows, macOS, Linux
· Camera (optional): For real-time features

Dependencies

· pygame>=2.6.1 - Camera capture and display
· Pillow>=10.0.0 - Image processing
· numpy>=1.26.0 - Array operations

Note: This project is intended for educational purposes and is not recommended for production use.

---

Quick Start

1. Create and Save an Image

```python
from litecv import new_image

# Create a 400x300 pixel image
img = new_image(400, 300, color='lightblue')

# Add text
img.draw_text('Hello LiteCV!', (50, 50), color='darkblue', size=24)

# Add shapes
img.draw_circle((200, 150), 50, color='red', fill='yellow')
img.draw_rectangle((100, 100), (300, 200), color='green', width=2)

# Save the image
img.save('my_image.jpg')
```

2. Apply Filters

```python
from litecv import open_image, FilterType, StreamingFilter

# Open an existing image
img = open_image('my_image.jpg')

# Apply a filter
filter_obj = StreamingFilter(FilterType.GRAYSCALE)
result = filter_obj.apply(img.copy())

# Save the result
result.save('my_image_grayscale.jpg')
```

3. Real-Time Camera

```python
from litecv import RealTimeCameraApp

# Create and start the camera app
app = RealTimeCameraApp(resolution=(800, 600), camera_resolution=(640, 480))
app.start()

# Keyboard controls:
# 1-9: Switch filters
# 0: Original (no filter)
# ESC: Exit
```

4. Image Manipulation

```python
from litecv import open_image, concatenate, blend_images

# Open images
img1 = open_image('image1.jpg')
img2 = open_image('image2.jpg')

# Resize
img1.resize(320, 240)

# Adjust properties
img1.brightness(1.2)  # 20% brighter
img1.contrast(0.9)    # 10% lower contrast
img1.saturation(1.5)  # 50% more colorful

# Concatenate images
combined = concatenate([img1, img2], direction='horizontal')
combined.save('combined.jpg')

# Blend images
blended = blend_images(img1, img2, alpha=0.5)
blended.save('blended.jpg')
```

---

Available Filters

Filter Description Use Case
GRAYSCALE Convert to grayscale B&W photography, preprocessing
EDGES Edge detection Object boundary detection
BLUR Gaussian blur Smoothing, privacy masking
SEPIA Vintage sepia tone Retro effects
CARTOON Cartoon effect Artistic rendering
SKETCH Pencil sketch Art simulation
THERMAL Thermal imaging Thermal effect
NIGHT_VISION Night vision effect Low-light simulation
INFRARED Infrared imaging IR effect
MOTION_DETECT Motion detection Movement tracking

---

Documentation

API Reference

See docs/api.md for complete API documentation including:

· AdvancedLiteImage class methods
· StreamingFilter usage
· CameraFeed real-time control
· Utility functions

Usage Guide

See docs/usage.md for:

· Detailed usage examples
· Best practices
· Performance optimization tips
· Common workflows

---

Examples

The examples/ folder contains ready-to-run demo scripts:

File Description
basic_image.py Create and draw on images
utilities.py Image concatenation and blending
filters_demo.py Apply all available filters
camera_app.py Interactive camera application
object_detection.py Object detection demo
video_demo.py Video frame processing
logo_demo.py Access logo assets programmatically

Running Examples

```bash
python examples/basic_image.py
python examples/filters_demo.py
python examples/camera_app.py
```

---

Project Structure

```
litecv/
├── litecv/
│   ├── __init__.py          # Package entry point
│   └── _litecv.py           # Core implementation
├── examples/                # Demo scripts
├── docs/                    # Documentation
│   ├── api.md
│   └── usage.md
├── logo/                    # Logo assets
├── tests/                   # Unit tests
├── README.md                # This file
├── LICENSE                  # MIT License
├── setup.cfg                # Package configuration
└── pyproject.toml           # Build configuration
```

---

Performance Tips

For Real-Time Applications

```python
# Use optimize_speed=True for mobile/real-time
img.resize(320, 240, optimize_speed=True)
img.blur(radius=2, optimize_speed=True)

# Cache numpy arrays to avoid repeated conversions
arr = img.to_numpy()  # Cached internally
```

Memory Optimization

```python
# Work with copies to preserve originals
filtered = img.copy()
filtered.blur(5)

# Load images in batches
images = [open_image(f) for f in file_list[:10]]
```

---

Troubleshooting

Camera Not Detected

```python
import pygame.camera
pygame.camera.init()
cameras = pygame.camera.list_cameras()
print("Available cameras:", cameras)
```

Import Errors

Ensure all dependencies are installed:

```bash
pip install pygame pillow numpy
```

Image Codec Issues

For WebP support:

```bash
pip install Pillow-webp
```

---

Related Projects

LowMind

LowMind is a companion project providing AI and machine learning utilities:

```bash
pip install lowmind
```

---

Contributing

We welcome contributions!

Development Setup

```bash
git clone https://github.com/dhaval-vedra/litecv.git
cd litecv
pip install -e .
python -m pytest tests/
```

Code Style

· Follow PEP 8
· Use type hints where possible
· Write docstrings for all public methods
· Add tests for new features

Contribution Process

1. Fork the repository
2. Create a feature branch (git checkout -b feature/amazing-feature)
3. Commit your changes (git commit -m 'Add amazing feature')
4. Push to the branch (git push origin feature/amazing-feature)
5. Open a Pull Request

---

Roadmap

· GPU acceleration with CUDA
· More object detection models
· Video file I/O
· Face detection and recognition
· Machine learning integration
· Mobile app support
· Web interface
· Performance benchmarks

---

License

MIT License - see LICENSE file for details.

```
MIT License

Copyright (c) 2026 LiteCV Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...
```

---

Changelog

Version 0.3.0 (2026-05-16)

· Initial release
· Core image operations
· 10+ built-in filters
· Real-time camera support
· Object detection framework
· Comprehensive documentation
· 8 example scripts

---

Support

· 📖 Documentation
· 💬 Issues
· 📧 Email: gametidhaval980@gmail.com

---

Acknowledgments

· Built with Pillow
· Camera support via Pygame
· Array operations with NumPy
· Inspired by OpenCV

---

Note: This project is intended for educational and learning purposes. It is not currently recommended for production-level use.

<div align="center">

Made with ❤️ by the LiteCV team

</div>
