This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Override in your touch-enabled view (this can be differen than the view you use for displaying the cam preview) | |
@Override | |
public boolean onTouch(View view, MotionEvent motionEvent) { | |
final int actionMasked = motionEvent.getActionMasked(); | |
if (actionMasked != MotionEvent.ACTION_DOWN) { | |
return false; | |
} | |
if (mManualFocusEngaged) { | |
Log.d(TAG, "Manual focus already engaged"); | |
return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<meta charset="utf-8"> | |
<head> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.23.1/babel.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/d3/4.6.0/d3.min.js"></script> | |
<script src="http://unpkg.com/d3-radial-axis@1.5/dist/d3-radial-axis.min.js"></script> | |
<script src="https://npmcdn.com/d3fc-rebind@4.0.1/build/d3fc-rebind.js"></script> | |
<script src="https://npmcdn.com/d3fc-data-join@2.0.0/build/d3fc-data-join.js"></script> | |
<script src="https://npmcdn.com/d3fc-label-layout@4.0.0/build/d3fc-label-layout.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# adapted from http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_pyramids/py_pyramids.html | |
import cv2 | |
import numpy as np | |
def Laplacian_Pyramid_Blending_with_mask(A, B, m, num_levels = 6): | |
# assume mask is float32 [0,1] | |
# generate Gaussian pyramid for A,B and mask | |
GA = A.copy() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from skimage.segmentation import slic | |
from skimage.segmentation import mark_boundaries | |
from skimage.data import astronaut | |
from skimage.util import img_as_float | |
import maxflow | |
from scipy.spatial import Delaunay |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# First you must install the 4.4.0 kernel: | |
# $ sudo apt-get install linux-image-4.4.0-112-generic | |
# find all the other kernels and remove them: | |
# $ sudo apt-get purge linux-image-4.13.0-1008-gcp | |
# $ sudo update-grub | |
# $ sudo reboot | |
sudo apt-get update && sudo apt-get install -y \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package(default_visibility = ["//visibility:public"]) | |
cc_toolchain_suite( | |
name = "toolchain", | |
toolchains = { | |
"armeabi-v7a|compiler": ":cc-compiler-armeabi", | |
"k8|compiler": ":cc-compiler-local", | |
}, | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# inspired by a part of: https://github.com/cjweeks/tensorflow-cmake/blob/master/build.sh | |
# | |
# Assumes Tensorflow libraries libtensorflow_framework.so and libtensorflow_cc.so were built with Bazel, | |
# and the ${TF_ROOT}/tensorflow/contrib/makefile/download_dependencies.sh script was executed. | |
set -o nounset | |
set -o errexit | |
set -o pipefail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
def cylindricalWarp(img, K): | |
"""This function returns the cylindrical warp for a given image and intrinsics matrix K""" | |
h_,w_ = img.shape[:2] | |
# pixel coordinates | |
y_i, x_i = np.indices((h_,w_)) | |
X = np.stack([x_i,y_i,np.ones_like(x_i)],axis=-1).reshape(h_*w_,3) # to homog | |
Kinv = np.linalg.inv(K) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python3 | |
import argparse | |
import subprocess | |
import itertools | |
parser = argparse.ArgumentParser(description='Concatenate videos with FFMPEG, add "xfade" between segments.') | |
parser.add_argument('--segments_file', '-f', metavar='Segments file', type=str, nargs=1, | |
help='Segments text file for concatenating. e.g. "segments.txt"') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python3 | |
import os | |
import json | |
import sys | |
import argparse | |
import math | |
import subprocess | |
from tqdm import tqdm |