Make sure OpenCV and Numpy is downloaded.
Run the files as follows:
python k_means_thresholding.py e.g. python k_means_thresholding.py input_image_1.jpg output_binary.jpg
python filtered_k_means_thresholding.py e.g. python filtered_k_means_thresholding.py input_image_2.jpg output_binary2.jpg
python count_eggs_4.py e.g. python count_eggs_4.py output_binary2.jpg 20 output_eggs.jpg
python 2D_k_means_thresholding.py e.g. python 2D_k_means_thresholding.py input_image_1.jpg 20 output_binary.jpg