Skip to content

Instantly share code, notes, and snippets.

View caioiglesias's full-sized avatar
🦁
Focusing

Caio Iglesias caioiglesias

🦁
Focusing
View GitHub Profile
@ryangomba
ryangomba / optics.py
Last active May 6, 2024 07:19
OPTICS clustering in Python
# Copyright (c) 2012, Ryan Gomba
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
@markcoleman
markcoleman / gist:5300596
Created April 3, 2013 11:59
Revised scroll directive that supports IE8 Offset from http://stackoverflow.com/a/10286208/181776 Scroll from http://stackoverflow.com/a/14880862/181776
.directive("scroll", function ($window) {
return function (scope, element, attrs) {
function getScrollOffsets(w) {
// Use the specified window or the current window if no argument
w = w || window;
// This works for all browsers except IE versions 8 and before
if (w.pageXOffset != null) return {
@broady
broady / 1MarkerAnimation.java
Last active March 13, 2024 12:44
Animating Markers
/* Copyright 2013 Google Inc.
Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0.html */
package com.example.latlnginterpolation;
import android.animation.ObjectAnimator;
import android.animation.TypeEvaluator;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.os.Build;
@iandees
iandees / dlib_plus_osm.md
Last active May 30, 2018 19:07
Detecting Road Signs in Mapillary Images with dlib C++

image

I've been interested in computer vision for a long time, but I haven't had any free time to make any progress until this holiday season. Over Christmas and the New Years I experimented with various methodologies in OpenCV to detect road signs and other objects of interest to OpenStreetMap. After some failed experiments with thresholding and feature detection, the excellent /r/computervision suggested using the dlib C++ module because it has more consistently-good documentation and the pre-built tools are faster.

After a day or two figuring out how to compile the examples, I finally made some progress:

Compiling dlib C++ on a Mac with Homebrew

  1. Clone dlib from Github to your local machine:
@MateoV
MateoV / disconnect.js
Last active May 20, 2016 05:58
Use Tile Reduce and OSM QA Tiles to find gaps in road networks
//identify disconnected major roads
var turf = require('turf');
var tilebelt = require('tilebelt');
var flatten = require('geojson-flatten');
module.exports = function(tileLayers, tile, done){
var bbox = tilebelt.tileToBBOX(tile);
var minDistance = 50/5280; // 50 ft in miles
var disconnects = turf.featurecollection([]);
var caps = [];
@MateoV
MateoV / difference.js
Created August 4, 2015 19:18
Use Tile Reduce and OSM QA Tiles to find the difference between OSM roads and Tiger roads
var turf = require('turf'),
flatten = require('geojson-flatten'),
normalize = require('geojson-normalize'),
tilebelt = require('tilebelt');
module.exports = function(tileLayers, tile, done) {
// concat feature classes and normalize data
var tigerRoads = normalize(tileLayers.tiger.tiger20062014);
var osmData = normalize(tileLayers.osmdata.migeojson);