During the thesis, the task was to extract individual grains from marble thin-chord images. The solution is implemented in the CV4Sensorhub framework developed by the department, under C# using the functions and classes from the open source OpenCV library. Highlighting all edges in the image, twin crystallization causes segments to split into smaller pieces. The task was to determine which pieces belong to the same grain in this over-segmented image. The lines caused by twin crystallization are mostly straight and parallel. The marble grains have their features, such as they are rather convex, more or less similar in size and extend out similarly in all directions. Classification was made using K nearest neighbor, normal Bayes classifier and support vector machines. Out of the three, support vector machines worked the best. This method classified several little parts into the right grain. However, it also made multiple mistakes. I further made experiments to automate segmentation. Its result was not adequate to organize into grains.