
Now we can begin thresholding and applying the median filter. The image to the left is what is produced at thresholds from 0.90 all the way down to 0.20 for our sample image. Even though, they're all the same, the program still runs through all the thresholds, because it can't be sure if the next threshold will be useful or not.
​
​

This is what is produced on the sample image being thresholded at 0.15 and have a median filter applied to it. This is the first threshold in our loop that gives us something besides a black square. Although we can easily make out the name and student ID, the OCR cannot. Rather, it just produces a string of random characters. Because this won't statisfy what the program is looking for - an 8 digit student ID with two lines of code above it, we go onto the next loop.