Sick performance enhancements. Instead of working on the entire canvas, switched to only operating on a single horizontal line in the center of the canvas. The getImageData() call is super slow on mobile so it makes a big difference to get less data. It might be worth expanding that out to a few pixels in height but we'll see. Also not sure how the threshold algorithm will perform like this.
Working through optimization and improving the detection algorithm