Skip to content

Instantly share code, notes, and snippets.

View crackwitz's full-sized avatar

Christoph Rackwitz crackwitz

  • Aachen, Germany
  • 17:51 (UTC +02:00)
View GitHub Profile
#!/usr/bin/env python3
'''
always getting the most recent frame of a camera
================================================
Usage:
------
freshest_camera_frame.py
@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)]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@crackwitz
crackwitz / pystartup.py
Last active September 2, 2022 04:19
"imshow" shim for jupyter notebooks, kinda like google colab's cv_imshow
try:
# https://stackoverflow.com/questions/15411967/how-can-i-check-if-code-is-executed-in-the-ipython-notebook
get_ipython() # ipython/jupyter context?
from PIL import Image
from IPython.display import display # takes a while...
# IPython.display.clear_output(wait=True)
from matplotlib import pyplot as plt
def imshow(im):
if len(im.shape) == 3:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.