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
"""Usage: python matchcolors.py good.jpg bad.jpg save-corrected-as.jpg""" | |
from scipy.misc import imread, imsave | |
from scipy import mean, interp, ravel, array | |
from itertools import izip | |
import sys | |
def mkcurve(chan1,chan2): | |
"Calculate channel curve by averaging target values." | |
fst = lambda p: p[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
#include <stdio.h> | |
#include <time.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#define M_PI_2 1.57079632679489661923 /* pi/2 */ | |
#define M_PI_2_INV (1.0/M_PI_2) | |
#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */ | |
#define ERF_COEF (1.0/M_2_SQRTPI) |
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
include "/usr/share/X11/locale/en_US.UTF-8/Compose" | |
# Punctuation | |
# знаки препинания, необходимые в русском, которых нет в en_US.UTF-8/Compose | |
<Multi_key> <period> <minus> : "…" U2026 # HORIZONTAL ELLIPSIS, многоточие | |
<Multi_key> <period> <space> : "…" U2026 # HORIZONTAL ELLIPSIS, многоточие | |
<Multi_key> <?> <!> : "⁈" U2048 # QUESTION EXCLAMATION, ?! | |
<Multi_key> <period> <colon> : "…" # ELLIPSIS | |
# №: набирается в русской раскладке без ухищрений, |
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
// ==UserScript== | |
// @name Direct Links in Google Search | |
// @namespace https://github.com/astanin | |
// @description Remove indirections from Google search results on all TLDs. | |
// @include https://www.google.tld/*output=search* | |
// @include http://www.google.tld/*output=search* | |
// @include https://www.google.tld/search* | |
// @include http://www.google.tld/search* | |
// @include https://www.google.tld/#* | |
// @include http://www.google.tld/#* |
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 | |
"""Compare two aligned images of the same size. | |
Usage: python compare.py first-image second-image | |
""" | |
import sys | |
from scipy.misc import imread | |
from scipy.linalg import norm |
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
"""Counting objects without bias | |
http://blogs.mathworks.com/steve/2012/12/18/counting-objects-without-bias/ | |
""" | |
from scipy.misc import imread, imshow | |
from scipy.ndimage import label | |
from scipy import asarray, ones, vstack, hstack | |
from sys import stdout |
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 python2 | |
"""Delete tweets older than X days. | |
Usage: | |
rmtweets.py [at_least_days_old (default=365)] | |
""" | |
# Twitter gives access to only the last 3200 tweets, but if you delete | |
# more recent tweets, then after some time (a week? a month?) the |
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 python2 | |
""" | |
OpenCV example. Show webcam image and detect face. | |
""" | |
import cv2 | |
TRAINSET = "/usr/share/OpenCV/lbpcascades/lbpcascade_frontalface.xml" | |
DOWNSCALE = 4 |
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 python2 | |
# requires PIL (python-imaging) | |
import Image | |
import ImageStat | |
from sys import argv, exit | |
from os.path import basename, splitext |
NewerOlder