Skip to content

Instantly share code, notes, and snippets.

int
motion_count(Mat I) {
const int size = motion_mask_size;
resize(I, I, Size(size, size), 0, 0, INTER_NEAREST);
int i = 0;
int count = 0;
Mat
hough(Mat src) {
Mat gray;
// cvtColor(src, gray, COLOR_RGB2GRAY);
cvtColor(src, src, COLOR_BGR2RGB);
cvtColor(src, gray, COLOR_RGB2GRAY);
morph_ellipse(gray);
map * :set hls<CR>:let @/ = '\<' . expand('<cword>') . '\>' <CR>:call histadd('/', @/)<CR>:echo @/<CR>
map g* :set hls<CR>:let @/ = expand('<cword>') <CR>:call histadd('/', @/)<CR>:echo @/<CR>
map # :set hls<CR>:let @/ = '\<' . expand('<cword>') . '\>' <CR>:call histadd('/', @/)<CR>:echo @/<CR>
map g# :set hls<CR>:let @/ = expand('<cword>') <CR>:call histadd('/', @/)<CR>:echo @/<CR>
@squm
squm / bitwise.cpp
Created February 16, 2017 08:15
Mat bitwise
void
bitwise() {
const uchar X = 0;
Mat mask = (Mat_<uchar>(1, 2) <<
1, X
);
threshold(mask, mask, X, 255, THRESH_BINARY);
do shell script "open -n -a \"MacVim\""
(*
run script "tell application \"MacVim\" to open \"/\""
*)
(*
do shell script "echo 1 | open -f -g -a MacVim"
*)
command! -complete=file -nargs=* FindArg call <SID>FindArgFunc(<q-args>)
function! s:FindArgFunc(args)
if a:args == ""
let t:argv = input("argv: ", "", "file")
else
let t:argv = a:args
endif
endfunction
sub identify {
my $file = shift;
return unless (-e $file);
$_ = `$I $file` if (-e $file);
# debug
# $_ = '1.JPG JPEG 2048x1536 2048x1536+2222+3333 8-bit sRGB 912KB 0.000u 0:00.000';
private CompositeSubscription composite;
// ...
@Override
protected void onCreate(Bundle savedInstanceState) {
composite = new CompositeSubscription();
}
@Override
protected void onDestroy() {
import java.util.AbstractMap.SimpleEntry;
import java.util.Collection;
import java.util.Arrays;
import java.util.Set;
import java.util.HashSet;
import java.util.Map;
class entry {
public static void NSLog(String format, Object... args) {
@squm
squm / IMP
Created January 8, 2015 06:12
typedef void (*IMP)(void);
typedef void (*IMP2);
void
ifc(int i, float f, char c) {
}
int
main() {
void *p = ifc;
void *(f1) = ifc;