Skip to content

Instantly share code, notes, and snippets.

library(feather)
R version 3.3.0 (2016-05-03) -- "Supposedly Educational"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin13.4.0 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
@bhive01
bhive01 / play.py
Last active August 27, 2016 21:25
import argparse
import trans #pip install trans
import time
import cv2
import math
import pandas as pd
import numpy as np
def distance(p, q):
return math.sqrt(math.pow(math.fabs(p[0]-q[0]),2)+math.pow(math.fabs(p[1]-q[1]),2))
import argparse
import cv2
import numpy as np
MIN_MATCH_COUNT = 10
ap = argparse.ArgumentParser()
ap.add_argument("-i1", "--trainimage", required = True, help = "Path to the image")
ap.add_argument("-i2", "--queryimage", required = True, help = "Path to the image")
args = vars(ap.parse_args())
---
title: "testforcarson"
author: "Brandon Hurr"
date: "September 15, 2016"
output: html_document
---
```{r setup, eval = TRUE, echo = FALSE, warning = FALSE, message = FALSE, results='asis', out.width = 1000, out.height = 1000}
library(ggplot2)
library(dplyr)
---
output:
html_document:
mathjax: null
theme: null
highlight: null
pandoc_args: [
"+RTS", "-K64m",
"-RTS"
]
library(tidyverse)
dt <- tibble(V1=c(1,2,4), V2=c("a","a","b"), V3=c(2,3,1))
swap_if<- function (condition, val1, val2, missing = NA)
{
if (!is.logical(condition)) {
stop("`condition` must be logical", call. = FALSE)
}
out1 <- val1[rep(NA_integer_, length(condition))]
import argparse
import trans #pip install trans
import time
import cv2
import math
import pandas as pd
import numpy as np
import zbar # sudo apt-get install libzbar-dev \ pip install zbar
from sklearn.neighbors import NearestNeighbors
from scipy.spatial.distance import squareform, pdist
@bhive01
bhive01 / play3.py
Last active November 6, 2018 22:21
# Brandon Hurr
# Assumptions
# 1. Color card is Xrite Passport
# 2. Card is not mirrored
# 3. Only color calibration half of card is visible
# 4. When remove edges is selected at command line, the card is not at the edge of the image.
# 3. The scale factor is based upon median width of found objects (contours) that should be xrite squares, but could not be
# could be problematic with lots of squares objects in image other than color card
import argparse
import sys
import os.path
import trans #pip install trans
import time
import datetime
import cv2
import math
import pandas as pd
import numpy as np