Code from the Image Processing and Pattern Recognition online course.