Skip to content

Instantly share code, notes, and snippets.

# by pyimagesearch
# import the necessary packages
import numpy as np
import cv2
def order_points(pts):
# initialzie a list of coordinates that will be ordered
# such that the first entry in the list is the top-left,
# the second entry is the top-right, the third is the
# bottom-right, and the fourth is the bottom-left
#include <queue>
#include <iostream>
#include <opencv2/opencv.hpp>
#include "dirent.h"
using namespace std;
using namespace cv;
int main(int, char** argv)
{
var lt = document.getElementsByClassName("floatLeft");
for (var it of lt)
{
var link = it.lastElementChild.href;
var bkn = /bkn=([^&]*)&/.exec(link)[1];
var fn = /=([^.]*)\.pdf/.exec(link)[1];
it.lastElementChild.href= "/ebooks/"+bkn+"/"+fn+".pdf?bkn="+bkn+"&pdfType=chapter";
}
javascript:(function () {
var rl = document.getElementById("results-list");
var tl = rl.getElementsByClassName("text");
for (var t of tl)
{
var title = t.getElementsByClassName("title")[0];
var subtitle = t.getElementsByClassName("subtitle")[0];
var year = t.getElementsByClassName("year")[0];
title.innerHTML += " " + subtitle.innerHTML + (subtitle.innerHTML ? " " : "") + year.innerHTML;
title.href = title.href.replace(/\/book\//,"/content/pdf/") + ".pdf";
f=(*.jpg)
i=({01..37})
for ((j=0; j<=${#f[@]}; j++))
do
mv ${f[j]} ${i[j]}.jpg
done
VideoCapture cap(path + "/%d.jpg");
while(cap.isOpened())
{
Mat image;
cap >> image;
if(image.empty())
break;
/* image processing */
}
/*
histogram sort, from vlfeat/mser.c
*/
/* -----------------------------------------------------------------
* Sort pixels by intensity
* -------------------------------------------------------------- */
{
vl_uint buckets [ VL_MSER_PIX_MAXVAL ] ;
@gylns
gylns / subs.cpp
Last active November 23, 2016 00:29
/* from vlfeat/mser.c
print:
-1 -1 -1
0 -1 -1
1 -1 -1
.......
-1 1 1
0 1 1
1 1 1
*/