Automatic segmentation of nanoparticles and determination of their shapes and sizes from transmission electron microscopy images are crucial for material analysis. Manual segmentation of nanoparticles produces subjective results and it is time-consuming. In this study, a new method is proposed for the automatic segmentation of the nanoparticles. First, background and foreground detection is employed with machine learning. Then, the nanoparticles are coarsely detected with connected component analysis and they are determined with Hough Transform. The method is tested on ten different images. The nanoparticles segmented with our method are similar to the nanoparticles segmented manually by experts and ImageJ software and the results are promising.