Metadata-Version: 2.1
Name: oakutils
Version: 1.0.1
Author-email: Justin Davis <davisjustin302@gmail.com>
Maintainer-email: Justin Davis <davisjustin302@gmail.com>
Project-URL: Homepage, https://github.com/justincdavis/oakutils
Project-URL: Bug Tracker, https://github.com/justincdavis/oakutils/issues
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Natural Language :: English
Classifier: Topic :: System :: Hardware
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Information Technology
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: depthai>=2.20
Requires-Dist: depthai-sdk>=1.11.0
Requires-Dist: numpy>=1.20
Requires-Dist: open3d>=0.16
Requires-Dist: opencv-contrib-python>=4.5
Requires-Dist: typing_extensions>=4.0.0
Provides-Extra: compiler
Requires-Dist: kornia; extra == "compiler"
Requires-Dist: torch; extra == "compiler"
Requires-Dist: onnx>=1.12.0; extra == "compiler"
Requires-Dist: onnxruntime; extra == "compiler"
Requires-Dist: onnxsim; extra == "compiler"
Requires-Dist: blobconverter==1.4.2; extra == "compiler"
Provides-Extra: dev
Requires-Dist: oakutils[compiler]; extra == "dev"
Requires-Dist: pyupgrade; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: wheel; extra == "dev"
Requires-Dist: bumpver; extra == "dev"
Requires-Dist: sphinx; extra == "dev"
Requires-Dist: sphinx-rtd-theme; extra == "dev"
Requires-Dist: pyclean; extra == "dev"

# OakUtils

A easy-to-use and robust library for interacting easily with OAK cameras and the DepthAI API. Aims to bridge the gap between DepthAI API and SDK allow with building in integration with OpenCV and Open3D "out-of-the-box".

---

## Documentation

https://oakutils.readthedocs.io/en/latest/

See Also:

https://pypi.org/project/oakutils/

## Installation

OakUtils is published on PyPi and which allows easy installation using pip:

`pip install oakutils`

The library can also be installed from source by first cloning and then building from source:

`git clone https://github.com/justincdavis/oakutils.git`

`pip install .`

### Dependencies

OakUtils requires a small subset of libraries in order to function: 

depthai
depthai-sdk
numpy
opencv-contrib-python
open3d
typing-extensions

## Motivation

Luxonis publishes two fantasic libraries in the form of `depthai` and `depthai-sdk`, but the level of abstraction difference between the two is large. For the average user `depthai-sdk` packages many common tools for use "out-of-the-box", but lacks the customization options. Meanwhile, `depthai` provides the lowest level access to their OAK cameras, but at the cost of verbosity. Thus, OakUtils was created to help bridge the gap between the two libraries.
An example could be the creation of the ever-present stereo depth nodes in `depthai`. The SDK allows creation in just a single line with some default parameters, but the API (`depthai`) requires up to hundreds of lines of code for all the possible customization options. The aim of OakUtils is to allow a single function call to create an object and pre-enumerate the options as parameters to the function. 

Advantages:

* Single line calls preserved similiar to the SDK
* All parameters can be easily viewed by an end user
* Full customizability available through a function call
* Since the function calls return `depthai.Pipline` objects they are interoperable with existing users code without the user being required to use the SDK's OakCamera class creation and build within a context manager
* No dependence of a specific device or pipeline context manager

Over time, not just the node creation steps, but also calibration, point clouds, pre-compiled cv functions (for the VPU), and algorithms from the depthai-experiments library will be added as easy to use functions and classes. 

## Implementations

Currently OakUtils provides the fulling funcionality:

* LegacyCamera: An easy to use abstraction over the entire camera covering the color camera, stereo depth, and the imu. This also includes integrations with the calibration and point cloud submodules.
* blobs: Pre-compiled models and tooling to compile your own
* calibration/CalibrationData: A submodule for quickly creating OpenCV compatible calibration information
* point_clouds: A submodule for easily generating and visualizing point clouds generated by from the OAK cameras data streams.
* nodes: Wrappers around DepthAI API calls to allow the easy creation of nodes.
* nodes.models: Easy to use functions for using packaged blobs.
* filters: Filters and utiltiies surrounding data at runtime.
* tools: General utilities for interacting with either the OAK or 

## Usage

```python
from oakutils import LegacyCamera
oak_cam = LegacyCamera(
    compute_point_cloud_on_demand=False,  # always compute point cloud on data recevied
    display_point_clouds=True,  # display point clouds in display thread
    display_depth=True,  # display the depth data
)
oak_cam.start(block=True)
# after this point the camera is running in a background thread
import time
time.sleep(10)  # this is a placeholder, your program would go here (as an example)
oak_cam.stop()
```
