Skip to content

Instantly share code, notes, and snippets.

@wrtcoder
wrtcoder / opencv320.sh
Created January 2, 2019 16:03 — forked from dapperfu/opencv320.sh
Build .deb package for OpenCV 3 w/Python3 bindings.
#!/usr/bin/env bash
# Config
MAINTAINER="Jed Frey"
VERSION=3.2.0
# Adapted from http://www.pyimagesearch.com/2016/10/24/ubuntu-16-04-how-to-install-opencv/
apt-get install --yes libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev libavcodec-dev libavformat-dev \
libswscale-dev libxvidcore-dev libx264-dev libv4l-dev liblapacke-dev libgtk-3-dev \
libopenblas-dev libhdf5-dev libtesseract-dev libleptonica-dev \
@wrtcoder
wrtcoder / build_opencv_ARM_cross
Created January 1, 2019 18:52 — forked from manashmandal/build_opencv_ARM_cross
Cross compile opencv3.3.0 for your raspberry pi and similar ARM devices with python support
This is a note on how to cross compile opencv for pretty much any ARM device(HardFP supported in this case) and deploy. Native
compiling in ARM devices can be painfully slow and they seem to hang often during build(mine got stuck at 43%). So if you happen
to have a desktop/laptop/server running ubuntu or similar linux distro, u can build opencv in fractionth of the time taken for
native compiling without any issues.
Building opencv3 with TBB and NEON and VFP support can boost opencv performance. Thanks to Adrian at pyimagesearch for pointing that out.
Both my PC and target machine aka orange pi zero are running ubuntu 16.04 with python2.7 and python 3.5.
1.Run the following commands in both machines to install the necessary libraries etc.(mine worked with them,so they should be enough
hopefully)
sudo apt-get update && sudo apt-get upgrade
@wrtcoder
wrtcoder / YuvBytesToBpp24Bitmap.cs
Created September 4, 2018 16:34 — forked from rexxiang/YuvBytesToBpp24Bitmap.cs
yuv422 to bitmap (using OpenCV.net)
public static Bitmap YuvBytesToBpp24Bitmap(byte[] yuvBytes, int width, int height) {
if (yuvBytes == null || yuvBytes.Length == 0) {
return null;
}
const PixelFormat format = PixelFormat.Format24bppRgb;
var image = YuvBytesToIplImage(yuvBytes, width, height);
var bitmap = new Bitmap(image.Width, image.Height, image.WidthStep, format, image.ImageData);
return bitmap;
@wrtcoder
wrtcoder / ffmpeg-android
Created August 30, 2018 17:10 — forked from v3n3/ffmpeg-android
build ffmpeg for android in multiple CPU architecture
#!/bin/bash
# Don't forget to install yasm.
set -e
# Set your own NDK here
NDK=~/Library/Android/sdk/ndk-bundle
ARM_PLATFORM=$NDK/platforms/android-23/arch-arm/
@wrtcoder
wrtcoder / capture_raw_frames.c
Created August 4, 2018 04:57 — forked from maxlapshin/capture_raw_frames.c
v4l2 capture example
/*
* V4L2 video capture example
*
* This program can be used and distributed without restrictions.
*
* This program is provided with the V4L2 API
* see http://linuxtv.org/docs.php for more information
*/
#include <stdio.h>
@wrtcoder
wrtcoder / Makefile
Created April 23, 2018 06:52 — forked from llj098/Makefile
a sample tcp server runs in kernel
obj-m += tcp_svr_sample.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clea
@wrtcoder
wrtcoder / 2011.php
Created March 5, 2018 16:07 — forked from oott123/2011.php
phpspy 2011
<?php
error_reporting(7);
@set_magic_quotes_runtime(0);
ob_start();
$mtime = explode(' ', microtime());
$starttime = $mtime[1] + $mtime[0];
define('SA_ROOT', str_replace('\\', '/', dirname(__FILE__)).'/');
define('IS_WIN', DIRECTORY_SEPARATOR == '\\');
define('IS_COM', class_exists('COM') ? 1 : 0 );
define('IS_GPC', get_magic_quotes_gpc());
# from https://nyman.re/post/reading-and-sending-sms-with-gcom-and-huawei/
# send using this command:
# gcom -d /dev/ttyUSB0 -v -e -s sendsms.comgt
# Ensure you fill in your phone number below or it wont send!
opengt
# set the terminal settings
set com 115200n81
# echo commands
@wrtcoder
wrtcoder / dnsmasq-gfwlist.py
Created March 23, 2017 14:17 — forked from lanceliao/dnsmasq-gfwlist.py
将gfwlist转换成带ipset的dnsmasq规则,适用于OpenWrt智能上网
#!/usr/bin/env python
#coding=utf-8
#
# Generate a list of dnsmasq rules with ipset for gfwlist
#
# Copyright (C) 2014 http://www.shuyz.com
# Ref https://code.google.com/p/autoproxy-gfwlist/wiki/Rules
import urllib2
import re
@wrtcoder
wrtcoder / etc_firewall.ipv6net.sh
Created November 7, 2016 06:52 — forked from pklaus/etc_firewall.ipv6net.sh
Firewall Rules for IPv6 on OpenWrt via Tunnels
#!/bin/ash
# Found on https://forum.openwrt.org/viewtopic.php?pid=135197
#
# Some important definitions used by this script.
# Only edit these in case something has changed and if you know
# what you are doing.
#
# IPT6: path to the ip6tables binary