Skip to content

Instantly share code, notes, and snippets.

Avatar

Simon-Martin Schröder moi90

  • Kiel, Germany
View GitHub Profile
@moi90
moi90 / flowcam.py
Last active Nov 25, 2020
Process flowcam images using MorphoCut
View flowcam.py
import os.path
from morphocut import Call, Pipeline
from morphocut.contrib.ecotaxa import EcotaxaWriter
from morphocut.contrib.zooprocess import CalculateZooProcessFeatures
from morphocut.file import Glob
from morphocut.image import FindRegions, ImageReader, RGB2Gray
from morphocut.parallel import ParallelPipeline
from morphocut.str import Format
from morphocut.stream import Enumerate, Unpack
View scipy_vs_fastdist.py
import matplotlib.pyplot as plt
from scipy.spatial import distance
from fastdist import fastdist
import timeit
import numpy as np
import numba
from fastdist import __version__ as fastdist_version
import scipy
from cpuinfo import get_cpu_info
View recursion_test.py
'''
Created on 06.12.2017
@author: mschroeder
'''
def create_tree(depth, n_children):
if depth > 0:
return [create_tree(depth - 1, n_children) for _ in range(n_children)]
@moi90
moi90 / write_pgm.c
Created Nov 24, 2016
Save an image consisting of unsigned chars to a pgm file
View write_pgm.c
void write_pgm(unsigned short id, unsigned char *buf, int width, int height) {
char filename[1024];
sprintf(filename, "%simage_%d.pgm", destinationPrefix, id);
FILE *fp = fopen(filename, "wb");
if (fp) {
fprintf(fp, "P5\n%d %d\n%d\n", width, height, 0xFF);
fwrite(buf, width * height, 1, fp);
fclose(fp);
You can’t perform that action at this time.