This paper is devoted to the study of the dynamic optimization of several controlled crowd motion models in the general planar settings, which is an application of a class of optimal control problems involving a general nonconvex sweeping process with perturbations. A set of necessary optimality conditions for such optimal control problems involving the crowd motion models with multiple agents and obstacles is obtained and analyzed. Several effective algorithms based on such necessary optimality conditions are proposed and various nontrivial illustrative examples together with their simulations are also presented.