For high-resolution retinal camera, we have developed an adaptive optics system using a membrane deformable mirror (DM) with electrostatic actuators. An aberration compensation algorithm is adopted in the system, which can generate appropriate control input by a linear combination of voltage templates prepared in advance, each of that forms a specific Zernike shape approximately. The nonlinear effect and strong coupling of control channels in continuous-surface DM make it difficult to form the desired mirror surface shapes. In this paper, we propose a computational method to obtain the voltage templates using genetic algorithm and grouping electrodes for reducing the number of independent voltage sources. The results show that the method can be used to obtain appropriate applied voltages for high-order Zernike shapes.