Skip to content

Instantly share code, notes, and snippets.

View sepastian's full-sized avatar
💭
\_ . |‾‾‾| o-`o

Sebastian Gassner sepastian

💭
\_ . |‾‾‾| o-`o
View GitHub Profile
@ianmackinnon
ianmackinnon / Client code - receive and display stream
Created February 27, 2020 16:22
Capture Nikon D90 with `gphoto2` and stream from Raspberry Pi over RTP using GStreamer
port=5000
gst-launch-1.0 -e -v udpsrc port=${port} ! \
application/x-rtp, media=video, encoding-name=H264 ! \
rtph264depay ! \
queue ! \
avdec_h264 ! \
autovideosink sync=false
@MetroWind
MetroWind / convert.sh
Last active October 13, 2021 09:19
High-pass filter + binarize in Imagemagick
# convert -bias 50% -morphology Convolve DoG:0,0,10 -threshold 40% source.png result.png
convert input.jpg \( -clone 0 -blur 0x100 \) \( -clone 0 -clone 1 +swap -compose mathematics -set option:compose:args "0,1,-1,0.5" -composite \) -delete 0,1 -threshold 40% result.png
@panzerama
panzerama / hough_transform.py
Created January 4, 2017 01:52
Solution for correcting text skew in image with scipy, scikit
#image processing resources
from skimage.io import imread, imshow
from skimage.filters import gaussian, threshold_otsu
from skimage.feature import canny
from skimage.transform import probabilistic_hough_line, rotate
#testing
import numpy as np
import os
@pebbie
pebbie / su.py
Last active April 16, 2024 23:42
Implementation of document binarization algorithm by (Bolan Su et al, 2010)
"""
author: Peb Ruswono Aryan
Binarization Algorithm by Su et al.
@inproceedings{Su:2010:BHD:1815330.1815351,
author = {Su, Bolan and Lu, Shijian and Tan, Chew Lim},
title = {Binarization of Historical Document Images Using the Local Maximum and Minimum},
booktitle = {Proceedings of the 9th IAPR International Workshop on Document Analysis Systems},
series = {DAS '10},
@grodowski
grodowski / ffmpeg_mobile
Last active January 13, 2020 09:58
Mobile optimized HTML5 video encoding using FFMPEG
# webm
ffmpeg -y -i snp-inst3.mp4 \
-filter:v scale=640:360,setsar=1/1 -pix_fmt yuv420p \
-vpre libvpx-720p -b:v 500k -r:v 25/1 -force_fps \
-c:a libvorbis -b:a 80k -pass 1 out_inst.webm
# mp4
ffmpeg -y -i snp-inst3.mp4 \
-filter:v scale=640:360,setsar=1/1 -pix_fmt yuv420p \
-c:v libx264 -preset:v slow -profile:v baseline \
@maoueh
maoueh / gist:8260199
Last active March 31, 2022 12:30
OpenELEC (4.0.1) WIFI connection details using `connman`

Even though there is a nice XBMC add-on to configure your WIFI settings, sometimes, you may still want to setup the WIFI connection for many reasons or just for fur.

OpenELEC use connman for managing connection to the various available network.

Setuping connman to connect to your protected WIFI network is an easy requiring you only to create a config file and enter some commands in a shell.

@guifromrio
guifromrio / compress-pdf-with-gs.md
Created August 30, 2013 14:39
Compress PDF files with ghostscript

This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.

ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

Other options for PDFSETTINGS:

  • /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
  • /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
  • /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
  • /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.
@crazybyte
crazybyte / encrypt_openssl.txt
Created November 25, 2012 10:10
File encryption using OpenSSL
For symmetic encryption, you can use the following:
To encrypt:
openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt
To decrypt:
openssl aes-256-cbc -salt -a -d -in encrypted.txt -out plaintext.txt
For Asymmetric encryption you must first generate your private key and extract the public key.