Optimized function ScanImageFixedSize by pre-allocating detection matrix
Optimized function ApplyDetector2 by moving the classifier g inside the function