Skip to content

Instantly share code, notes, and snippets.

# More on this file here: https://github.com/processing/processing/wiki/Library-Basics
# UTF-8 supported.
# The name of your library as you want it formatted.
name = PixelFlow
# List of authors. Links can be provided using the syntax [author name](url).
authors = [Thomas Diewald](http://www.thomasdiewald.com)
# A web page for your library, NOT a direct link to where to download it.
# https://coral.ai/docs/edgetpu/compiler/
sudo curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list
sudo apt-get update
sudo apt-get install edgetpu-compiler
import numpy as np
def getIntrinsics(name="generic", mode="default"):
name = name.lower()
mode = mode.lower()
# Generic
# https://en.wikipedia.org/wiki/Camera_resectioning
# https://docs.opencv.org/4.x/dc/d3a/classcv_1_1viz_1_1Camera.html#a753809aff611cdcc5a8a377126156b05
cx = 320 # principal point x
@n1ckfg
n1ckfg / encoding-video.md
Created February 13, 2022 02:14 — forked from glen-cheney/encoding-video.md
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@n1ckfg
n1ckfg / code-toolkit-2021-welcome.js
Last active December 29, 2021 22:16 — forked from rors/code-toolkit-2021-welcome.py
Homepage image for "Code Toolkit: Python", Fall 2021
let heights = [];
let moving_heights = [];
let r = 0;
function setup() {
createCanvas(800, 400, WEBGL);
for (let i=0; i<17; i++) {
heights.push([]);
moving_heights.push([]);
for (let j=0; j<17; j++) {
@n1ckfg
n1ckfg / map.glsl
Created December 8, 2021 05:12 — forked from companje/map.glsl
map() function for GLSL known from Processing & openFrameworks
float map(float value, float min1, float max1, float min2, float max2) {
return min2 + (value - min1) * (max2 - min2) / (max1 - min1);
}
import peasy.*;
PeasyCam cam;
void setup() {
size(800, 600, P3D);
cam = new PeasyCam(this, 400);
// https://github.com/jdf/peasycam/blob/master/src/peasy/PeasyCam.java
cam.setWheelScale(0.1);
}
// https://stackoverflow.com/questions/20165564/calculating-days-between-two-dates-with-java/29812532
import java.util.Calendar;
import java.util.Date;
import java.util.Scanner;
void setup() {
println(getDateDifference("04 03 2009", "12 06 2021", " "));
println(getDateDifference("04 11 1999", "05 11 1999", " "));
}
@n1ckfg
n1ckfg / PointCloud2Voxel.py
Created July 24, 2021 00:06 — forked from hzxie/PointCloud2Voxel.py
Convert Point Cloud to Voxels
import numpy as np
import pandas as pd
from pyntcloud import PyntCloud
import binvox_rw
cloud = PyntCloud.from_file("test/00000.txt",
sep=" ",
header=0,
#@title <b>MeshLab Resampler</b>
#@markdown <ol><li>Set these options:</li></ol>
# https://pymeshlab.readthedocs.io/en/latest/
# https://pymeshlab.readthedocs.io/en/latest/filter_list.html
# https://pymeshlab.readthedocs.io/en/latest/io_format_list.html
!pip install pymeshlab
import pymeshlab as ml