The invention relates to the field of
machine vision, in particular to a building roof defect detection method and
system based on an unmanned aerial vehicle, and the method comprises the steps: obtaining a building roof gray image collected by the unmanned aerial vehicle; calculating
morphological gradient maps in multiple directions of the roof
grayscale image; calculating the variance of each pixel point in the gradient values in all directions, generating a
gradient direction consistency graph, and carrying out the weighted fusion of the
morphological gradient maps in all directions based on the
gradient direction consistency graph, and generating an edge
saliency map; in the neighborhood of each pixel point of the roof
grayscale image, according to the
Euclidean distance between a neighborhood pixel and a central pixel, performing attenuation weighting on the occurrence frequency of a
grayscale pair, and based on the weighted symbiotic probability, calculating a spatial position sensitive entropy, and generating a texture complexity map; further obtaining a defect response diagram; calculating a local
discrimination threshold value corresponding to the pixel point; and when the value of the pixel point in the defect response diagram is greater than the corresponding local
discrimination threshold, determining that the pixel point is a defect point.