openalea.eartrack.binarisation.mean_shift_hsv

openalea.eartrack.binarisation.mean_shift_hsv(image, mean_img, threshold=0.3, hsv_min=(30, 11, 0), hsv_max=(129, 254, 141), iterations_clean_noise=3, iterations=1, mask_mean_shift=None, mask_hsv=None, mask_clean_noise=None)[source]

Segmentation using mean shift method

Compute segmentation of an object in image using a combination of meanshift method and hsv threshold

Parameters:
  • image – numpy.ndarray of integers 3-D array
  • mean_img – numpy.ndarray of integers (same shape as ‘image’) 3-D array
  • threshold – float, optional Threshold value. Must between 0.0 and 1.0
  • hsv_min – tuple of 3 int, optional Minimum values to threshold hsv image. Values must be between 0 and 255
  • hsv_max – tuple of 3 int, optional Maximum values to threshold hsv image. Values must be between 0 and 255
  • iterations_clean_noise – int, optional Number of iterations to clean noise on binary result image under mask
  • iterations – int, optional Number of iterations to clean noise on binary result image
  • mask_mean_shift – numpy.ndarray, optional Array 2-D of same shape as image. Only points at which mask == True will be calculated in meanshift method.
  • mask_hsv – numpy.ndarray, optional Array 2-D of same shape as image. Only points at which mask == True will be calculated with hsv method.
  • mask_clean_noise – numpy.ndarray, optional Array 2-D of same shape as image. Only points at which mask == True will be cleaned
Returns:

result: numpy.ndarray 2-D of same shape as image

Binary image representing plant segmentation of ‘image’