panel_segmentation.panel_detection.PanelDetection.cropPanels

PanelDetection.cropPanels(test_data, test_res)[source]

This function basically isolates regions with solar panels in a satellite image using the predicted mask. It zeros out other pixels that does not contain a panel. You can use this for a single test data or multiple test data.

Parameters
  • test_data (nparray float) – This is the input test data. This can be a single image or multiple image. Hence the dimension can be (640,640,3) or (a,640,640,3)

  • test_res (nparray float) – This is the predicted mask of the test images passed as an input and used to crop out the solar panels. Dimension is (640,640)

Returns

new_test_res – This returns images here the solar panels have been cropped out and the background zeroed. It has the same shape as test data. The dimension is [a,640,640,3] where a is the number of input images.

Return type

nparray uint8