Skip to content

Instantly share code, notes, and snippets.

View stoermerjp's full-sized avatar

JP Stoermer stoermerjp

View GitHub Profile
<?xml version="1.0"?>
<opencv_storage>
<calibration_time>"Thu Apr 21 10:10:51 2016"</calibration_time>
<image_width>4000</image_width>
<image_height>3000</image_height>
<flags>4</flags>
<camera_matrix type_id="opencv-matrix">
<rows>3</rows>
<cols>3</cols>
<dt>d</dt>
@stoermerjp
stoermerjp / cc.py
Created January 17, 2014 20:37 — forked from shunsukeaihara/cc.py
# -*- coding: utf-8 -*-
import numpy as np
import Image
import sys
def from_pil(pimg):
pimg = pimg.convert(mode='RGB')
nimg = np.asarray(pimg)
nimg.flags.writeable = True
return nimg
@stoermerjp
stoermerjp / dronemapper_buildgdalmosaic.sh
Created July 12, 2012 13:30
DroneMapper.com: Basic Geo-referenced Mosaic Construction w/ GDAL (projection)
#!/bin/bash
###
### JP Stoermer
### DroneMapper.com
###
### Clean up
rm -rf ./*._tif
rm -rf ./mosaic.tif
@stoermerjp
stoermerjp / dronemapper_buildmosaic.sh
Created July 12, 2012 12:24
DroneMapper.com: Automated 2D Mosaic Construction using Hugin/Panotools
#!/bin/bash
###
### DroneMapper.com
### Jon-Pierre Stoermer 04-01-2012
###
### Cleanup
rm ./project_*.tif
rm ./project.pto
@stoermerjp
stoermerjp / DroneMapper_buildgpx.php
Created May 21, 2012 15:56
DroneMapper.com: GPX File Generation from UAV Flight Controller Logs
#!/usr/bin/php
<?php
/*
* Change date_default_timezone_set to your flight timezone, you will also
* need to add a -geosync offset for exiftool on the command line if the
* time (hour) field doesn't match.
*/
date_default_timezone_set('Europe/Berlin');
/*
@stoermerjp
stoermerjp / dronemapper_course.py
Created April 14, 2012 14:49
DroneMapper.com: Python Get Bearing From 2 Lat/Lon Points
#
# Python code found on web to convert LAT1 LON1 / LAT2 LON2 to a bearing/course.
#
from math import *
import sys
lat1 = float(sys.argv[1])
lat2 = float(sys.argv[2])
lon1 = float(sys.argv[3])
lon2 = float(sys.argv[4])
@stoermerjp
stoermerjp / dronemapper_usgselev.php
Created April 14, 2012 14:44
DroneMapper.com: USGS Elevation Web Service PHP Integration
<?php
/*
* Uses CURL to return the elevation of a point via USGS Elevation Web Service.
*/
$lat = 41.9816730;
$lon = -106.0949550;
function checkEle($lat, $lon) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://gisdata.usgs.gov/xmlwebservices2/elevation_service.asmx/getElevation?X_Value=" . $lon . "&Y_Value=" . $lat . "&Elevation_Units=METERS&Source_Layer=-1&Elevation_Only=true");
@stoermerjp
stoermerjp / dronemapper_ec2quick.php
Created April 14, 2012 14:18
DroneMapper.com: Amazon EC2 PHP Integration (start/stop/execute remote commands on instance)
#!/usr/bin/php
<?php
/*
* DroneMapper.com
* Quick EC2 Integration Script
* 2012-04-14
*
* This script works from the command line and allows you to spin up an AWS EC2
* instance that you have already created via the AWS console.
*