Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ instance/

# Sphinx documentation
docs/_build/
docs/generated/

# PyBuilder
target/
Expand Down Expand Up @@ -128,4 +129,6 @@ dmypy.json
# Pyre type checker
.pyre/

.idea/
.idea/

.DS_Store
35 changes: 35 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-24.04
tools:
python: "3.12"
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,42 @@
# Changelog
## [1.3.0] - 2025-08-31

### Added
* Comprehensive documentation system with Sphinx
* Detailed API reference for all modules
* Introduction and features documentation
* Practical examples for common use cases
* Module-level documentation for all cv3 modules
* Function-level documentation with parameters, returns, and examples
* New drawing functions: arrowedLine (as arrow), ellipse, drawMarker (as marker), getTextSize
* EXPERIMENTAL flag in opt.py for new features
* Fill parameter for rectangle, rectangles, and circle functions
* Complete test suite for new drawing functions
* Restructured draw module with internal functions moved to _draw.py
* New transform module with internal functions in _transform.py
* Module-level documentation for all cv3 modules
* Read the Docs configuration files (readthedocs.yaml and docs/requirements.txt)
* Core concepts documentation page with detailed package features
* Project URLs in setup.py for documentation and source code

### Changed
* Improved documentation for all existing functions
* Restructured draw module implementation
* Moved internal transform functions to private module
* Enhanced docstrings with detailed parameter descriptions
* Updated project version to 1.3.0
* Updated installation instructions in documentation and README
* Updated README.md to match documentation content

### Deprecated

### Removed

### Fixed
* Documentation inconsistencies
* Module organization issues
* Error messages in draw.py experimental functions to use opt.set_exp() instead of "Set opt.EXPERIMENTAL = True"

## [1.2.1] - 2023-06-25

### Added
Expand Down
80 changes: 67 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,78 @@
# cv3: Pythonic OpenCV to speed up your computer vision research
# cv3: Pythonic OpenCV

cv3 is a Pythonic wrapper for OpenCV that simplifies computer vision tasks by providing
more intuitive interfaces and eliminating common boilerplate code.

## Principles
- Solve more important tasks than writing extra code
- You are programming in python, not C++
- OpenCV is not scary
1. Solve more important tasks than writing extra code
2. You are programming in Python, not C++
3. OpenCV is not scary

## Features
You can get acquainted with the features in [demo.ipynb](https://github.com/gorodion/pycv/blob/main/demo.ipynb)
- Forget to remember extra parameters. To draw a square you don't need to know color and thickness.
- Forget to type everything. You can pass float/pathlib.Path arguments where cv2 doesn't allow
- Forget to copy the same code over and over (like cv2.getRotationMatrix2D or cv2.VideoWriter_fourcc(*'MP4V'))
## Why cv3?

## Quick start
`pip install git+https://github.com/gorodion/pycv.git`
OpenCV is a powerful computer vision library, but its API can be verbose and unintuitive,
especially for Python developers. cv3 addresses these issues by:

[demo.ipynb](https://github.com/gorodion/pycv/blob/main/demo.ipynb)
- Providing sensible defaults for common parameters
- Accepting more flexible input types (e.g., float coordinates, pathlib.Path objects)
- Eliminating repetitive code patterns
- Adding Pythonic features like context managers and iterators
- Handling common error cases with better error messages

## Key Benefits

- **Simplified API**: Common operations require fewer parameters
- **Type Flexibility**: Accepts various input types where OpenCV is strict
- **Error Handling**: Better error messages and automatic handling of common issues
- **Pythonic Design**: Context managers, iterators, and other Python idioms
- **RGB by Default**: Works with RGB color format by default (configurable)

## Installation

You can install cv3 using either of the following methods:

1. From PyPI (recommended):

```bash
pip install cv3
```

2. From GitHub (latest development version):

```bash
pip install git+https://github.com/gorodion/cv3.git
```

## Quick Start

## Run tests
```python
import cv3

# Read an image (automatically handles RGB conversion)
img = cv3.imread('image.jpg')

# Draw a rectangle without specifying color or thickness
cv3.rectangle(img, 100, 50, 150, 100)

# Save the image (automatically creates directories if needed)
cv3.imwrite('output/image_result.jpg', img, mkdir=True)

# Display in a window with context manager
with cv3.Window('Result') as window:
window.imshow(img)
window.wait_key(0)
```

This is just a small example of what cv3 can do. Check out the [documentation](https://cv3.readthedocs.io/en/latest/)
for a comprehensive overview of all the improvements and additions that cv3 provides over raw OpenCV.

You can also get acquainted with the features in [demo.ipynb](https://github.com/gorodion/pycv/blob/main/demo.ipynb)

## Run tests

```bash
pytest -v
```

---
I hope this is helpful, please contribute 🙂
17 changes: 17 additions & 0 deletions cv3/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
"""cv3 - A simplified OpenCV wrapper library.

This package provides simplified interfaces for common OpenCV operations
including image creation, drawing, transformations, color space conversions,
and video processing.

Modules:
opt: Global configuration options for the library.
color_spaces: Functions for converting between color spaces.
io: Input/output operations for images and videos.
draw: Drawing functions for images.
transform: Image transformation functions.
processing: Basic image processing operations.
video: Video capture and writing utilities.
create: Functions for creating images with various initial values.
"""

from . import opt
from .color_spaces import *
from .io import *
Expand Down
Loading