The construction of a new structure requires that the soil be characterized in order to predict its future behaviour and judge its ability to host the building. This geotechnical characterization aims at describing the soil in a physical way (grain size distribution (GSD), water content, fine particle proportion, water sensibility. ..) as much as in a mechanical way (compaction degree, resistance. ..). At the present time, this characterization is done thanks to laboratory tests carried out on undisturbed or disturbed samples, and also to in situ tests used mainly because they are generally faster than the laboratory tests and because they test the soil in its natural environment. That's the reason why one of our main research goals is to develop new in situ characterization tools. Contrary to the wide range of in situ tests for a soil mechanical characterization (static and dynamic penetration tests, pressiometer, scissometer, ..), there are very few in situ tests for a physical description. That's why we have developed a new in situ characterization tool based on the use of endoscopy and image analysis techniques: Geoendoscopy.' Grain size distribution (GSD) is undoubtedly one of the most important feature of a soil or a granular material. As a matter of fact, the GSD of a material is one of the major parameters for the identification, the classification and the determination of the predictable behaviour of a granular material. This is the main reason why our first work item was to set a prior treatment and image analysis procedure on our endoscopic images, in order to prepare a future GSD routine. Given the field condition, water presence in soils can disturb the treatments and analyses. This article presents the images that we worked on, then the treatment procedure to improve them before applying particle disconnection methods.