Skip to content

Instantly share code, notes, and snippets.

@fehlfarbe
fehlfarbe / scanbd.conf
Created February 22, 2025 15:15
scanbd config for Canon DR-M140 scanner
/*
* $Id: scanbd.conf 241 2017-04-19 07:53:25Z wimalopaan $
*
* scanbd - KMUX scanner button daemon
*
* Copyright (C) 2008 - 2017 Wilhelm Meier (wilhelm.wm.meier@googlemail.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@fehlfarbe
fehlfarbe / delete_small.sh
Created October 28, 2024 16:55
Delete all jpg files smaller than 1000x1000
#!/bin/bash
find . -name "*.jpg" -type f -print0 | while read -d $'\0' file
do
#echo "$file"
# get resolution via jhead
res=$(jhead "$file" 2>/dev/null | grep Resolution)
# extract x and y resolution
x=$(echo $res | awk '{print $3}')
y=$(echo $res | awk '{print $5}')
@fehlfarbe
fehlfarbe / templatematching_ORB.py
Last active February 1, 2019 20:32
Some simple templatematching with ORB
import sys
import cv2
import numpy as np
from math import sqrt, acos
from optparse import OptionParser
#FULL = "full.jpg"
#CROP = "crop.jpg"
#FULL = "pleiades_hyades_50percent.jpg"
#CROP = "pleiades_hyades_50percent_crop.jpg"
@fehlfarbe
fehlfarbe / templatematching.py
Created July 19, 2018 17:54
Some simple templatematching
import sys
import cv2
import numpy as np
FULL = "full.jpg"
CROP = "crop.jpg"
def template_matching(full, template, start=0.1, stop=1.0, step=0.1):
crop_full = cv2.resize(template, tuple(np.roll(full.shape, 1)))