Added max threshold to processInputFrame()