Skip to content

Instantly share code, notes, and snippets.

View austinbhale's full-sized avatar
😎
ah

Austin Hale austinbhale

😎
ah
View GitHub Profile
@austinbhale
austinbhale / ScaleModelSK.cs
Last active May 2, 2023 18:06
A workaround to get model scaling into StereoKit
public class Program
{
private static void Main(string[] _)
{
// Initialize StereoKit
SKSettings settings = new()
{
appName = "ModelScaleSK",
assetsFolder = "Assets",
};
@austinbhale
austinbhale / SKMediaCapture2AudioGraph.cs
Last active October 5, 2022 22:02
SK Media Capture to Audio Graph's device output on the HL2
namespace SKAudioGraph
{
using StereoKit;
using System;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using Windows.Foundation;
using Windows.Media;
namespace SKAudioGraph
{
using StereoKit;
using System;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Windows.Foundation;
using Windows.Media;
using Windows.Media.Audio;
using Windows.Media.MediaProperties;
// <copyright file="Program.cs" company="Nakamir, Inc.">
// Copyright (c) Nakamir, Inc. All rights reserved.
// </copyright>
namespace SK.AudioCapture.UWP;
using StereoKit;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
@austinbhale
austinbhale / resize-square-logos.py
Created May 18, 2022 22:04
Resize any image into a square logo using OpenCV & NumPy!
import cv2
import numpy as np
logo_name = "original-logo.png"
logo = cv2.imread(logo_name, cv2.IMREAD_UNCHANGED)
assert(logo.any())
h, w, s = logo.shape
if w > h:
out_img = np.zeros((w, w, s))
@austinbhale
austinbhale / psychedelic.py
Last active May 18, 2022 21:59
Generate Psychedelic Effects in OpenCV Python
import cv2
import numpy as np
def psycho(img, trippy_factor=1./3):
ris = img.astype(np.float32)
ris += cv2.randn(img.copy(), 0, 10)
kernel = np.zeros((3,3), dtype=np.float32)
kernel.fill(trippy_factor)
@austinbhale
austinbhale / gist:f62cc5e8fd1702a5317929004fa5f4c9
Last active October 30, 2021 22:45
Create an Aruco Board image with Python3
import cv2 as cv
import numpy as np
dictionary = cv.aruco.Dictionary_get(cv.aruco.DICT_6X6_50)
num_markers_x = 4
num_markers_y = 4
marker_length = 0.04
marker_separation = 0.01