Skip to content

Instantly share code, notes, and snippets.

@kmuehlbauer
kmuehlbauer / color.py
Created August 18, 2015 15:46
Proof of concept spatial interpolation filter working on VisPy ImageVisual
_interpolation_template = """
#include "misc/spatial-filters.frag"
vec4 texture_lookup_filtered(vec2 texcoord) {
if(texcoord.x < 0.0 || texcoord.x > 1.0 ||
texcoord.y < 0.0 || texcoord.y > 1.0) {
discard;
}
return %s($texture, $shape, texcoord);
}"""
@kmuehlbauer
kmuehlbauer / contour.py
Created August 18, 2015 19:28
Isoline Filter with ImageVisual
import sys
from vispy import scene
from vispy import app
from vispy import visuals
from vispy.util.filter import gaussian_filter
from vispy.visuals.shaders import Function, FunctionChain
from vispy.color import Color
import numpy as np
from vispy.io import load_data_file, read_png
@kmuehlbauer
kmuehlbauer / bicubic-filter.frag
Last active August 29, 2015 14:27
bicubic filter straight forward approach
// coefficients for the cubic polynomial
vec4 c0 = vec4(-1.0, 3.0, -3.0, 1.0 ) / 6.0;
vec4 c1 = vec4( 3.0, -6.0, 0.0, 4.0 ) / 6.0;
vec4 c2 = vec4(-3.0, 3.0, 3.0, 1.0 ) / 6.0;
vec4 c3 = vec4( 1.0, 0.0, 0.0, 0.0 ) / 6.0;
vec4 cubic(vec4 var, vec4 p0, vec4 p1, vec4 p2, vec4 p3 ) {
// return cubic polynomial
return p0 * dot( c0, var) +
p1 * dot( c1, var) +
@kmuehlbauer
kmuehlbauer / lanczos-differentiator.ipynb
Last active November 3, 2016 14:48
Derivation via Lanczos Differentiators
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kmuehlbauer
kmuehlbauer / pr_gr.ipynb
Created November 24, 2016 15:29
PR bins in aer
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kmuehlbauer
kmuehlbauer / two_widgets.py
Created May 19, 2017 09:16
Two GL-Widgets with PyQt5
# !/usr/bin/env python
# used with examples from https://github.com/vispy
from PyQt5 import QtWidgets, QtCore
import sys
import time
import numpy as np
from vispy import app, gloo
from vispy.util.transforms import perspective, translate, rotate
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kmuehlbauer
kmuehlbauer / rossant_vispy.ipynb
Created May 29, 2017 05:58
Vispy Canvas Test in Notebook
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.
@kmuehlbauer
kmuehlbauer / vispy_raspi.md
Last active November 6, 2018 21:05
VisPy on Raspberry Pi 3 model B
  • 1. bought transcend microSDHC UHS-I class 10 16GB
  • 2. etched 2018-10-09-raspbian-stretch
  • 3. started raspbian
  • 4. perform first time startup section (language etc.)
  • 5. reboot PI
  • 6.start raspi_config at console
    • 7 Advanced Options
      • A1 Expand Filesystem - resize root partition to use all SD space
      • A7 GL Driver
  • G1 (Full KMS) OpenGL desktop driver with full KMS