PanelDetection.detectAzimuth(in_img, number_lines=5)[source]

This function uses canny edge detection to first extract the edges of the input image. To use this function, you have to first predict the mask of the test image using testSingle function. Then use the cropPanels function to extract the solar panels from the input image using the predicted mask. Hence the input image to this function is the cropped image of solar panels.

After edge detection, Hough transform is used to detect the most dominant lines in the input image and subsequently use that to predict the azimuth of a single image.

  • in_img (nparray uint8) – The image containing the extracted solar panels with other pixels zeroed off. Dimension is [1,640,640,3]

  • number_lines (int) – This variable tells the function the number of dominant lines it should examine. We currently inspect the top 5 lines.


azimuth – The azimuth of the panel in the image.

Return type