Object segmentation using K-means clustering algorithm works only when the object in the image is differentiable quite well on the basis of either intensity or color, this are very high-level feature and we cannot generalize it to work on general images. Instead if you have access to segmentation map of some images (i.e. ground truth), try using semantic segmentation algorithm, I am attaching some example which may give you a good head start.
In case, if you don’t have access to ground truths, then there are recent work done Autoencoder, you can read upon them and try training Autoencoder and use the feature vector to segment it in to different classes. It is one of classical way of dealing with unsupervised Image segmentation.
I hope it helps you or at least give you an idea where to look for.