Optimal Multilevel Thresholding Using the Modified Adaptive Particle Swarm Optimization