This document contains code and explanations for image processing tasks involving edge detection, thresholding, and segmentation. It includes: 1) Code to perform spatial filtering of an image using a 3x3 mask and Sobel edge detection filters. 2) Application of the code to detect edges and segment a large blood vessel in a kidney image. 3) Implementation of Otsu's thresholding algorithm to automatically select a threshold for segmentation. 4) Comparison of Otsu's method to global thresholding on a polymersomes image, finding Otsu's performs better.