Neural network based algorithm for hand gesture detection in a low-cost microprocessor applications