Skip to content

Instantly share code, notes, and snippets.

View davegreenwood's full-sized avatar

Dave Greenwood davegreenwood

  • University of East Anglia
View GitHub Profile
@davegreenwood
davegreenwood / mvs_array.py
Created August 4, 2018 08:39
Create a number of cameras in Maya.
import maya.cmds as cmds
import math
H_ANGLE = 150
V_ANGLE = 60
H_CAMS = 9
V_CAMS = 5
RADIUS = 10
@davegreenwood
davegreenwood / plot.py
Last active August 8, 2018 12:12
some plotting utils for displaying camera calibration results
import matplotlib.pyplot as plt
import numpy as np
import cv2
"""
Some utilities fr plotting camera calibrations:
Example:
fig = plt.figure(figsize=[10,10])
ax = fig.add_subplot(111, projection='3d')
"""
# ipython_exit.py
Allows exit() to work if script is invoked with IPython without
raising NameError Exception. Keeps kernel alive.
Use: import variable 'exit' in target script with
'from ipython_exit import exit'
"""
import sys
@davegreenwood
davegreenwood / stereo-bundle-adjustment.ipynb
Last active December 2, 2022 16:01
bundle adjustment of a stereo camera calibration
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@davegreenwood
davegreenwood / stereo_calibrate.py
Last active August 24, 2018 21:58
module to calibrate stereo cameras
""" module to calibrate stereo cameras. """
from __future__ import print_function
import numpy as np
import pickle
import cv2
import logging
from zipfile import ZipFile
logger = logging.getLogger(__name__)
@davegreenwood
davegreenwood / Dockerfile
Last active November 4, 2018 14:40 — forked from christian-lanius/Dockerfile
Docker file to run OpenPose
# ==================================================================
# module list
# ------------------------------------------------------------------
# python 3.5 (apt)
# tensorflow latest (pip)
# opencv latest (git)
# caffe latest (git)
# openpose latest (git)
# pyopenpose latest (git)
# custom_dependencies latest (apt)
@davegreenwood
davegreenwood / triangulation.py
Created September 16, 2018 10:18
Triangulate image points to world points comparing openCV to pure python.
from __future__ import print_function
import numpy as np
import cv2
import time
np.set_printoptions(formatter={'float': '{: 0.3f}'.format})
def triangulate_nviews(P, ip):
"""
@davegreenwood
davegreenwood / gradient-descent.ipynb
Created October 9, 2018 08:19
Simple gradient descent for fitting points
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@davegreenwood
davegreenwood / distort-undistort.ipynb
Created October 26, 2018 13:59
implement and compare the 'Exact formula for inverse radial distortion'
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@davegreenwood
davegreenwood / MDD.md
Created December 14, 2018 10:15
MDD file format

MDD file format

The MDD file format is very simple and here is a brief description for TD's and developers who are interested in adding tools to a pipeline built around MDD.

The first thing to note is that the MDD file format is Motorola Big Endian byte order as opposed to the Intel Little Endian standard. So however you implement the structure below, you must come up with an algorithm to flip the bytes during file IO.

The data structure is: