This is the kind of image that I have:
I need a code to get the results similar to the ground truth algorithm, any idea and suggestion will help me because I don't even know where to start, thanks.
This is the kind of image that I have:
I need a code to get the results similar to the ground truth algorithm, any idea and suggestion will help me because I don't even know where to start, thanks.
import cv2 as cv
from matplotlib import pyplot as plt
# Load image in grayscale
img = cv.imread('coins.png',0)
# threshold the image
thresh = cv.threshold(img,0,255,cv.THRESH_BINARY_INV+cv.THRESH_OTSU)[1]
# display the image
plt.imshow(thresh, cmap = 'gray', interpolation = 'bicubic')
plt.xticks([]), plt.yticks([]) # to hide tick values on X and Y axis
plt.show()
refer this example