Reputation: 1
Here is a generalized example of the house photo's I am referring to. I’m using OpenCV to detect and outline the roof of a house in a set of images by drawing contours around the roof edges. The issue I’m facing is that the contour detection is inconsistent across the dataset of images. In some images, the contours align well with the roof edges, but in many others, they either include irrelevant parts (like trees, leaves, shadows, or nearby structures) or fail to outline the roof correctly. This is especially problematic when the background has similar pixel intensity to the roof. Despite trying various techniques (Gaussian blur, Canny edge detection, thresholding, and morphological transformations), the results are unreliable across the dataset. I’m looking for advice on how to achieve more consistent contour detection and better isolate the roof edges across the entire set of images.
I’ve tried several preprocessing techniques in OpenCV, such as Gaussian blur, Canny edge detection, thresholding, and morphological transformations (like dilation and erosion) to enhance the detection of roof edges. I expected these methods to consistently detect the contours around the roof edges across my set of 50 house images, even with variations in background and lighting. However, the results are inconsistent. In some images, the contours match the roof edges well, but in others, the algorithm either detects irrelevant areas or misses parts of the roof entirely. I was hoping to get reliable roof contours in every image.
I am working with street-level photographs of houses taken at various angles, where the roof is clearly visible, but the background often includes trees, power lines, other buildings, etc.
Upvotes: 0
Views: 93