I have this image here with lots of small printer dots in the color cyan, magenta and yellow.
After separating the color channel (CMYK) I applied a threshold on the image.
Here for the color channel cyan.
Now I want to find a way to calculate the perimeter for each of these dots. So in the end I want to have a mean and standard deviation for the perimeter.
I already found a way (with the help from someone here on stackoverflow) to compute the mean and std dev for the sizes of the dots with:
def compute_mean_stddev(contours_of_images):
for contours_of_image in contours_of_images:
count = len(contours_of_image)
sum_list = []
for cntr in contours_of_image:
area = cv2.contourArea(cntr)
sum_list.append(area)
average = np.mean(sum_list)
standard_deviation = np.std(sum_list)
Instead now for the area, is there a way to get the perimeter?
