Skip to content

Instantly share code, notes, and snippets.

View crackwitz's full-sized avatar

Christoph Rackwitz crackwitz

  • Aachen, Germany
  • 14:18 (UTC +02:00)
View GitHub Profile
#!/usr/bin/env python3
import os
import sys
import numpy as np
import cv2
if __name__ == '__main__':
def predicate(pixel):
B, G, R = pixel
#!/usr/bin/env python3
'''
based on the MOSSE tracking example from OpenCV
[1] David S. Bolme et al. "Visual Object Tracking using Adaptive Correlation Filters"
http://www.cs.colostate.edu/~bolme/publications/Bolme2010Tracking.pdf
'''
import numpy as np
@crackwitz
crackwitz / foo.py
Last active December 20, 2018 23:59
#!/usr/bin/env python3
import cv2
cv = cv2
assert cv2.__version__[0] >= '3', 'The fisheye module requires opencv version >= 3.0.0'
import numpy as np
np.set_printoptions(precision=4, linewidth=120)
import os
import glob
CHECKERBOARD = (6,9)
{
"bL9QycV.jpg": [
[
[
1547.485107421875,
485.5238342285156
]
],
[
[
// ==UserScript==
// @name Qt docs unsucked
// @match http://doc.qt.io/qt-5/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
$("head").append('<style type="text/css"></style>');
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@crackwitz
crackwitz / joblocks.py
Last active March 20, 2024 23:12
cosmetics
#!/usr/bin/env python3
import os
import sys
import time
from itertools import *
import pprint; pp = pprint.pprint
def inclusive_range(smallest, largest, step):
N = 1 + int(round((largest - smallest) / step))
return [smallest + k*step for k in range(N)]
#!/usr/bin/env python3
'''
always getting the most recent frame of a camera
================================================
Usage:
------
freshest_camera_frame.py
#!/usr/bin/env python3
import os
import sys
import time
import numpy as np
import cv2 as cv
import threading
# also acts (partly) like a cv.VideoCapture
class FreshestFrame(threading.Thread):