Skip to content

Instantly share code, notes, and snippets.

@daz
daz / RightClick.applescript
Created Aug 23, 2020 — forked from vitorgalvao/RightClick.applescript
Make right-clicking on OSX accessible via a keyboard shortcut.
View RightClick.applescript
(*
Even though a [native solution][1] exists, it still suffers from a big flaw: it right-clicks the place you cursor is, not what you’re selecting. This addresses that limitation.
You can install this as a [Finder Service, and later asign it a keyboard shortcut][2].
[1]: http://stackoverflow.com/questions/9171613/right-click-shortcut-for-mac-lion-os
[2]: http://www.macosxautomation.com/services/learn/tut01/index.html
*)
@daz
daz / reduce_faces.py
Created Oct 31, 2019 — forked from tylerlindell/reduce_faces.py
script for reducing faces programmatically with Meshlab's api
View reduce_faces.py
#!/usr/bin/env python
import sys
import os
import subprocess
# Script taken from doing the needed operation
# (Filters > Remeshing, Simplification and Reconstruction >
# Quadric Edge Collapse Decimation, with parameters:
# 0.9 percentage reduction (10%), 0.3 Quality threshold (70%)
@daz
daz / openalpr_camera.py
Created Aug 15, 2018 — forked from jkjung-avt/openalpr_camera.py
Real-time license plate recognition with 'openalpr' using a video file as input
View openalpr_camera.py
# test_camera.py
#
# Open an RTSP stream and feed image frames to 'openalpr'
# for real-time license plate recognition.
import numpy as np
import cv2
from openalpr import Alpr
@daz
daz / ffmpeg-cheatsheet.md
Created Aug 4, 2018 — forked from nickkraakman/ffmpeg-cheatsheet.md
FFmpeg cheat sheet for 360 video
View ffmpeg-cheatsheet.md

FFmpeg Cheat Sheet for 360º video

Brought to you by Headjack

 
FFmpeg is one of the most powerful tools for video transcoding and manipulation, but it's fairly complex and confusing to use. That's why I decided to create this cheat sheet which shows some of the most often used commands.

 
Let's start with some basics:

  • ffmpeg calls the FFmpeg application in the command line window, could also be the full path to the FFmpeg binary or .exe file
@daz
daz / depth_sensor.ino
Created Jul 27, 2018 — forked from hephaestus9/depth_sensor.ino
Depth Sensor Code - modified j.brian
View depth_sensor.ino
/*
created August 2011
by SMStrauch and with help of robtillaart and ulrichard. Thanks!
Manufacturer: www.intersema.ch
Source: http://www.meas-spec.com/downloads/Using_SPI_Protocol_with_Pressure_Sensor_Modules.pdf
Source: http://forum.arduino.cc/index.php?topic=67188.0
Datasheet: http://media.digikey.com/pdf/Data%20Sheets/Measurement%20Specialties%20PDFs/MS5541-CM.pdf
Modified 2-10-2015 J.Brian
View depth_sensor.ino
/*
MS5541 Pressure Sensor calwords readout
This program will read your MS5441 or compatible pressure sensor every 5 seconds and show you the calibration words, the calibration factors,
the raw values and the compensated values of temperature and pressure.
Once you read out the calibration factors you can define them in the header of any sketch you write for the sensor.
Pins:
MS5541 sensor attached to pins 10 - 13:
MOSI: pin 11
@daz
daz / merge-geotiff.py
Last active Jul 18, 2018 — forked from philipn/gist:1148693
GeoTIFFs -> One Big GeoTIFF
View merge-geotiff.py
"""
Likely not useful to anyone else, but just putting it out there.
This script will take a directory of GeoTIFFs and merge them together without issues.
This script simply decompresses the files, runs nearblack to remove pseudo-black borders caused by compression, and then uses gdalwarp to stitch the files together.
The script is designed to use the minimal amount of disk space possible -- it cleans up each file after decompression and continually merges with a master image.
"""
import os
@daz
daz / DataShipper.cs
Created Feb 27, 2018 — forked from trishume/DataShipper.cs
Tobii EyeX UDP data shipper to VMWare VM host.
View DataShipper.cs
// Used to send data from a VMWare VM running the EyeX software
// with a Steelseries Sentry to a Mac OSX host over UDP.
namespace MinimalGazeDataStream
{
using EyeXFramework;
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
using Tobii.EyeX.Framework;
@daz
daz / FLIRjpg2HDF5.py
Created Sep 23, 2017 — forked from gilgeorges/FLIRjpg2HDF5.py
Extracts the raw thermal images from a set / sequence of FLIR JPG images and stores them as matrices in an HDF5 file. The actual extraction is done using Exiftool (available at http://www.sno.phy.queensu.ca/~phil/exiftool/ - may require you to install Perl, e.g. "Strawberryperl" for Windows).
View FLIRjpg2HDF5.py
""" FLIRjpg2HDF5
reads raw thermal images from a FLIR-camera JPG image series
and stores them in a HDF5 file - using exiftool """
import glob
import os
import subprocess
import PIL.Image
import numpy as np
@daz
daz / FLIR.pm
Created Sep 22, 2017 — forked from novolog/FLIR.pm
Exiftool FLIR.pm
View FLIR.pm
#------------------------------------------------------------------------------
# File: FLIR.pm
#
# Description: Read FLIR meta information
#
# Revisions: 2013/03/28 - P. Harvey Created
#
# References: 1) http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,4898.0.html
# 2) http://www.nuage.ch/site/flir-i7-some-analysis/
# 3) http://www.workswell.cz/manuals/flir/hardware/A3xx_and_A6xx_models/Streaming_format_ThermoVision.pdf