This repo is organized as a python package that contains utilities for various computer vision problems.
We mostly use opencv / numpy / scipy functionality to implement higher level utilities that are easier to use. The explicit implementation and software architecture in this repo are also a good reference for dedicated implementation (e.g. unique embedded systems).
This repo can be installed with pip as a python package.
-
clone / download this repo
-
setup your python env 3.11+ (virtual env recommended)
-
install this package into your python
pip install upgrade pip pip install '/local/path/to/cv_core'
-
install options:
some of the functionality in the
cv_core.geometry_2D
andcv_core.geometry_3D
subpackages had dual implementation:- explicit implementation using only numpy
- shapely implementation
Explicit implementation is good if you don't want to import shapely, and can also be used as a reference for embedded implementation. Shapely implementation is more reliable, and probably faster.
If you want to use the shapely implementation:
-
install with shaply extra:
pip install '/local/path/to/cv_core'[shapely]
-
set
use_shaply=True
when calling the relevant functions.
-
verify installation is OK:
pip install show cv_core
-
clone / download this repo
-
setup your python env 3.11+ (virtual env recommended)
-
install python packages according to requirements.txt
-
import cv_core to your python program by adding to python path
import sys sys.path.append('/local/path/to/cv_core')
import cv_core and use as a python package.
This repo contains useful functionality in various computer vision areas.
The cv_core.2D_geometry
module implements functionality that is related to basic 2D geometry.
major notations:
- 2D point is described by (x, y)
- 2D line is described by (a, b, c) where ax+by+c=0
Useful functionality:
- line parameters from two points
- point line parameterization
- intersect two lines
- intersect two line segments
- intersect line segment with polygon
The cv_core.3D_geometry
module implements functionality that is related to basic 3D geometry.
major notations:
- 3D plane is handled by
Plane3D
class - rigid 3D transform is handled by
Rigid3dTform
class
Useful functionality:
- 3D plane functionality:
- project points to plane (by normal direction or any axis)
- ray-plane intersection
- plot
- Rigid3dTform functionality:
- invert
- multiply
- transform points
The cv_core.pinhole_camera
module implements functionality that is related to camera geometry.
major notations:
- camera is handled by
PinholeCamera
class
Useful functionality:
- Camera Calibration:
- intrinsic calibration pinhole / fisheye
- stereo calibration
- visual - inertial calibration (based on Kalibr)
- PinholeCamera functionality:
- project world point to pixel
- back-project pixel to 3D world ray
- plot
- lens selector utility