add toProcessing() function for convert Rect[] to Rectangle[] used in both detect() functions. Add a lot of documentation