We have performed neutron diffraction measurement on a single crystal of parent compound of iron-based superconductor, BaFe$_2$As$_2$ at 12~K. In order to investigate in-plane anisotropy of magnetic form factor in the antiferromagnetic phase, the detwinned single crystal is used in the measurement. The magnetic structure factor and magnetic form factor are well explained by the spin densities consisting of $3d_{yz}$ electrons with a fraction of about 40~% and the electrons in the other four $3d$ orbitals with each fraction of about 15~%. Such anisotropic magnetic form factor is qualitatively consistent with the anisotropic magnetic behaviors observed in the antiferromagnetic phase of the parent compound of iron-based superconductor.