Images of 7 Compact groups of galaxies (CG) were obtained using the 2.1m telescope in San Pedro Martir (B.C. Mexico) equipped with the NIR camera CAMILA. The NIR images trace the mass of the galaxies, through the oldest and more evolved stellar populations. The goal of this project is to search for evidence of morphological perturbations correlated with the level of activity (AGN or star formation) of the galaxies. We find that the level of perturbation is well correlated with activity observed in optical spectrocopy (Coziol et al. 2004). Evidence for perturbations decreases from more active groups to less active groups, confirming the classification. Our analysis suggests that galaxies in more active groups are undergoing important transformations due to interaction and merging and that the whole groups is on a merger path. Galaxies in less active CG have gone through similar processes in the recent past and are either in a final merging phase or in equilibrium due to a more massive halo of dark matter.