Skip to content

Instantly share code, notes, and snippets.

@mceoin
mceoin / whiteboardCleaner.md
Created October 29, 2022 21:24 — forked from lelandbatey/whiteboardCleaner.md
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

Verifying that "mceoin.id" is my Blockstack ID. https://onename.com/mceoin
var SUM pseudocode: add up all the numbers in an array
var MEAN pseudocode: divide the sum of an array by the length of that array.
Var MEDIAN pseudocode: use array.sort to order the numbers in our array from smallest to lartest
then (if array length is odd): find the midpoint of that array
or (if array length is even): find the two numbers that sit on either side of array.length/2
want to...
have SUM that is able to calculate the sum of all numbers in an Array
have MEAN that is able to calculate the average of all numbers in an Array
have MEDIAN that is able to calculate the median of all numbers in an Array
number of items in an Array can be both odd or even