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 numpy as np | |
from os.path import basename | |
from glob import glob | |
from skimage.color import label2rgb | |
import matplotlib | |
matplotlib.use('TkAgg') | |
from matplotlib import pyplot as plt | |
from tomopy.misc.phantom import shepp3d | |
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 numpy as np | |
from os.path import basename | |
from glob import glob | |
from skimage.color import label2rgb | |
import matplotlib | |
matplotlib.use('TkAgg') | |
from matplotlib import pyplot as plt | |
from tomopy.misc.phantom import shepp3d | |
""" | |
TODO: |
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
from skimage.util import pad | |
from collections import OrderedDict | |
# FIXME: probably a little neater to return a 4d array of shape (n_tile_rows, n_tile_col, H, W) | |
def tile_image(im, tile_size, overlap=(0,0)): | |
""" | |
Divide an image or video into spatially overlapping tiles. | |
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
import shapely | |
html_template_part1 = """ | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>%s</title> | |
<style> |
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
from os.path import basename | |
from glob import glob | |
from matplotlib import pyplot as plt | |
class ImageLabeller(object): | |
""" | |
Labels can be basically any type that you can cast to str. | |
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
import numpy as np | |
from collections import OrderedDict | |
# im_fn = 'images/copperopolis_quarry_google_17_cropped.tif' | |
# im = plt.imread(im_fn) | |
def tile_image(im, tile_size, overlap=0): | |
""" | |
Partition a large image into equally-sized overlapping tiles. |
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 matplotlib.pyplot as plt | |
import inspect | |
from ipywidgets import * | |
from IPython.display import display | |
%matplotlib inline | |
plt.rcParams['image.cmap'] = 'gray' | |
plt.rcParams['image.interpolation'] = 'none' | |
# http://ipywidgets.readthedocs.io/en/latest/examples/Using%20Interact.html |
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
source /opt/ros/indigo/setup.bash | |
source /home/brian/robotics_code/ROS/workspace/devel/setup.bash | |
export ROS_IP=`ifconfig|grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}"|tail -n 3|head -n 1` | |
export ROS_MASTER_URI=http://$ROS_IP:11311/ | |
echo "ROS is now ready to run, with ROS_MASTER set to $ROS_MASTER_URI." |
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 | |
LOG_FOLDER=~/MineAnnotationsBackup/logs | |
BACKUP_FOLDER=~/MineAnnotationsBackup | |
# script from here: http://www.howtogeek.com/175008/the-non-beginners-guide-to-syncing-data-with-rsync/ | |
#copy old time.txt to time2.txt | |
yes | cp $LOG_FOLDER/time.txt $LOG_FOLDER/time2.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
def hist_match(im, ref_im): | |
if np.squeeze(im).ndim == 2: | |
im = np.expand_dims(im, axis=2) | |
ref_im = np.expand_dims(ref_im, axis=2) | |
out_im = np.empty_like(im) | |
for chan_num in range(im.shape[2]): | |
chan, ref_chan = im[...,chan_num], ref_im[...,chan_num] | |
NewerOlder