Skip to content

Instantly share code, notes, and snippets.

View douglasgoodwin's full-sized avatar

Doug Goodwin douglasgoodwin

View GitHub Profile
# WWF
# WWF
# Read about these projects:
# https://twistedsifter.com/2019/10/populations-of-endangered-species-depicted-by-the-number-of-pixels/
# https://mymodernmet.com/endangered-species-pixelated-photos-jjsmooth44/
# Bonobo: approx 10000 remain
# the squareroot of 10000 is 100
# width is 600, so sample the image every 6 pixels
# EX09 _ textual analysis of Jane Austen's book "Emma"
# questions
# + How many words are in the novel?
# + what's the longest word? the shortest word? the average word length?
# + what are the top 100 words by count?
from collections import Counter
# get the remote file
import urllib.request
@douglasgoodwin
douglasgoodwin / .block
Created July 2, 2022 06:04 — forked from mbostock/.block
Random Traversal III
license: gpl-3.0
@douglasgoodwin
douglasgoodwin / anselAdams_blackSun_400x299.jpg
Last active February 28, 2022 22:23
A couple of JPEG images
anselAdams_blackSun_400x299.jpg
0.2 1.4 5.1 3.5 Iris-setosa
0.2 1.4 4.9 3 Iris-setosa
0.2 1.3 4.7 3.2 Iris-setosa
0.2 1.5 4.6 3.1 Iris-setosa
0.2 1.4 5 3.6 Iris-setosa
0.4 1.7 5.4 3.9 Iris-setosa
0.3 1.4 4.6 3.4 Iris-setosa
0.2 1.5 5 3.4 Iris-setosa
0.2 1.4 4.4 2.9 Iris-setosa
0.1 1.5 4.9 3.1 Iris-setosa
h = 4
A = []
B = []
C = []
for i in range(1,h+1):
A.append(i)
A.reverse()
towers = {"A":A,"B":B,"C":C}
size(400,400)
# white background
background(255)
textAlign(CENTER, CENTER)
i=0
chunk=40
# use range to specify the start, end, and chunk for each loop
# some inspiration from Shiffman
for y in range(0,height,chunk):
size(400,400)
# white background
background(255)
textAlign(CENTER, CENTER)
# Extremely tedious sequence...
fill(100)
rect(0,0, 40,40)
fill(255)
from random import randrange
size(600,600)
background(255)
strokeWeight(2)
rowheight = height/7
colwidth = width/6
for y in range(0,height+rowheight,rowheight):

Simple image morphing - α-blending of two images using with a cross-dissolve from one image matrix to another.

This project is like the one on page 32 of your new book, "Hands-On Image Processing with Python".

The following code block shows how to start from one face image and end up with another image by using a linear combination of the two image numpy ndarrays.

PROCESS:

  1. Shoot two pictures (see below)
  2. Bring them into Colab