Added contrast and brightness scaling
Added ratio detection and ensured we do not get a divide by zero error. Made getting information from the rect a function.
Fixed target detection and optimised
Return values as OrderedDict to make referencing easier.