Rename size parameter in OSD write function.
Fix window title.
Decouple threshold calculation from postprocessing function.
Add comment to stopping pipeline.
Clarify deallocation, and move to end of program.
Overwrite input image instead of using separate output image.