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 tkinter as tk | |
from tkVideoPlayer import TkinterVideo | |
from ffmpeg import FFmpeg, Progress | |
import os | |
import sys | |
import argparse | |
parser = argparse.ArgumentParser(description="Crop a video") | |
parser.add_argument("video", metavar="video", type=str, help="video file to crop") | |
args = parser.parse_args() |
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
# - Try to find FFMPEG | |
# Once done this will define | |
# FFMPEG_FOUND - System has FFMPEG | |
# FFMPEG_INCLUDE_DIRS - The FFMPEG include directories | |
# FFMPEG_LIBRARIES - The libraries needed to use FFMPEG | |
# FFMPEG_LIBRARY_DIRS - The directory to find FFMPEG libraries | |
# | |
# written by Roy Shilkrot 2013 http://www.morethantechnical.com/ | |
# |
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 |
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/bin/env python | |
import numpy as np | |
import cv2 | |
import os | |
import v4l2capture | |
import select | |
if __name__ == '__main__': | |
#cap = cv2.VideoCapture(0) |
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
/// perform the Simplest Color Balancing algorithm | |
void SimplestCB(Mat& in, Mat& out, float percent) { | |
assert(in.channels() == 3); | |
assert(percent > 0 && percent < 100); | |
float half_percent = percent / 200.0f; | |
vector<Mat> tmpsplit; split(in,tmpsplit); | |
for(int i=0;i<3;i++) { | |
//find the low and high precentile values (based on the input percentile) |
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
# This is kind-of based off of this: http://stackoverflow.com/questions/5974595/download-all-the-linksrelated-documents-on-a-webpage-using-python | |
import cookielib | |
import urllib2 | |
import mechanize | |
from time import sleep | |
import os | |
import cgi | |
# A routine to download a file from a link, by simulating a click on it |
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
/* | |
* Simple 2D NURBS renderer for OpenCV, reading DXF files | |
* | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2013 Roy Shilkrot | |
* | |
* Updated: Nov 2016 | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy |