Skip to content

Instantly share code, notes, and snippets.


Simon-Martin Schröder moi90

  • Kiel, Germany
View GitHub Profile
moi90 /
Last active Nov 25, 2020
Process flowcam images using MorphoCut
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 import Enumerate, Unpack
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
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 / 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);
You can’t perform that action at this time.