panel_segmentation.panel_detection.PanelDetection.clusterPanels

PanelDetection.clusterPanels(test_mask, fig=False)[source]

This function uses connected component algorithm to cluster the panels

Parameters
  • test_mask (boolean or float) – The predicted mask. Dimension is (640,640) or can be converted to RGB (640,640,3)

  • fig (boolean) – shows the clustering image if fig = True

Returns

  • uint8

  • Masked image containing detected clusters each of

  • dimension (640,640,3)

  • uint8

  • The optimal number of clusters