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
/* | |
* OGL_OCV_common.cpp | |
* Common interop between OpenCV and OpenGL | |
* | |
* Created by Roy Shilkrot on 2/16/2015 | |
* Copyright 2015 Roy Shilkrot. All rights reserved. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights |
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
/* | |
* SimpleARQGLViewer.cpp | |
* Creating an AR application with QGLViewer | |
* | |
* Created by Roy Shilkrot on 2/16/2015 | |
* Copyright 2015 Roy Shilkrot. All rights reserved. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights |
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
/* | |
* GLWidgetOpenGL4Example.h | |
* | |
* Created on: Apr 23, 2016 | |
* Author: roy_shilkrot | |
* | |
*/ | |
class GLWidgetOpenGL4Example : public QGLWidget { | |
public: |
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 |
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
# 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
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
/// 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) |