fix some code to improve the performance.

- replace the meanfile
- fix the crop procedure in segmentation