  To explore the effect of environment on star-formation and morphological
transformation of high-redshift galaxies, we present a robust estimation of
localized galaxy overdensity using a density estimator within the Bayesian
probability framework.The maps of environmental overdensity at $0.5< z< 2.5$
are constructed for the five CANDELS fields. In general, the quiescent fraction
increases with overdensity and stellar mass. Stellar mass dominates the star
formation quenching for massive galaxies, while environmental quenching tends
to be more effective for the low-mass galaxies at $0.5< z < 1$. For the most
massive galaxies ($M_* > 10^{10.8} M_{\odot}$), the effect of environmental
quenching is still significant up to $z \sim 2.5$. No significant environmental
dependence is found in the distributions of S\'{e}rsic index and effective
radius for SFGs and QGs separately. The primary role of environment might be to
control the quiescent fraction. And the morphological parameters are primarily
connected with star formation status. The similarity in the trends of quiescent
fraction and S\'{e}rsic index along with stellar mass indicates that
morphological transformation is accompanied with star formation quenching.
