Analysis of each house rooftop's solar power potential using Google Satellite Images.
AI-based technology to assess your Rooftop Solar potential
Individual rooftops of each and every house are identified and segmented out. If you really think that's an easy task, go have a look at the image quality and resolution of rooftop in Google Maps. India doesn't even have a 3D map. Project Sunroof would be very easy in India if we just have 3D map by Google or any map service provider like MapMyIndia, Open Street maps, etc.In US, the Google Map has a clear view at 22 zoom level whereas in India you can zoom upto only 20/21 zoom level. The image quality at 20 zoom level is so bad that you can't even figure out by yourself where the boundaries of each house lies. Examples of the dataset is as below on which this algorithms were implemented:
This repository includes:
- Aerial Rooftop Detection Methods:
- Hough Transforms
- Watershed Segmentation
- Adaptive Canny Edge Detection
- Foreground Background Separation (Gabor Filter)
- Building Rooftop Extraction Methods:
- Edge Sharpening
- Active Contours
- Rooftop Polygon Approximation
- Pixel-based Polygon Filling
- Region-based Polygon Filling
- Google Maps to Image Pixels
- Optimal Solar Panel Area on Rooftop
- Install the dependencies from requirements.txt file:
pip install -r requirements.txt
-
Edge Extraction:
- auto_canny.py - Auto-Canny Edge Detection Algorithm on Sharpened Image.
- edge Sharpen.py - Extarction of edges from an image using Auto Canny Edge detection & Histogram Equalization algorithm.
- watershed_pyrMeanShift.py - Watershed Segmentation to segment out rooftop images.
-
Gabor Filter:
- gabor_test.py - Gabor Filter to separate foreground rooftops from background of an image.
-
Active Contours:
- active_contours.py - Apply active contour on bilate sharpened image for improved rooftop area extraction. The sharpening helps to localize edges better in the image.
-
Polygons Approximation:
- poly_fill.py - Approximate the shape of Polygon oh house rooftop
- polygon_fill.py - Polygon filling pixelwise of rooftop
-
Google Maps to Image Pixels:
- lat_long_metre_pixel.py - Convert the number of pixels into square metre area by calculating the ratio of conversion using latitude and longitude of that area.
-
Solar Panels Placement:
- canny_corner.py - 1st approach to combine two features i.e. Canny Edge Detection and Harris Corners to localize optimal rooftop area
- canny_contours.py - 2nd approach to combine two features that are Canny Edge Detection and Contours to localize optimal rooftop area.
- panels_atlast.py - Final, Solar Panel placement in Optimal Rooftop Area. You can test with the test images provided.
It is used to localize shapes of different types of rooftops. When applied to the image, it gives very less true positives. The main problem was to set threshold parameter of Hough Transform. Windowed Hough Transform: Used to detect exact shapes like squares and rectangles. The main limitation of this method was that it won’t work for other structures if not perfectly square or a rectangle present in the image.
Applying auto canny on the low-quality image of rooftop results in exact edge detection of rooftops. Contour Area localization and then applied threshold to detect rooftop. It was also a failure.
Segmentation on the images from maps to count the number of buildings and to plot rooftop area of each building present in the image. It failed in the case of the densely populated area.
- Gabor Filter analyses whether there is any specific frequency content in the image in specific directions in a localized region around the point or region of analysis.
- Gaussian Mixture Model is a probabilistic model that assumes all the data points are generated from a mixture of a finite number of the Gaussian distribution.
- Gabor filter enhances one region relative to other depending on the frequency and theta values. After applying Gabor filter, two Gaussian Mixture models were fit in the histogram of the grayscale image. Two Gaussian Mixture Models separate the image into foreground that is rooftops and background.
Due to the poor quality of the image, to mark the rooftop area edge sharpening of the image is to be done. After that skimage morphological opening is done to fill the gaps in between edges.
Using the GitHub repository, Active Contour was applied on the rooftop area to extract the optimal area for the solar panel. Active Contours is divided into two, with edges and without edges. Without edges can’t be used in our case as it works on the region segmentation and due to the poor quality of image region, wise segmentation was not possible.
Hough Transform was initially used to analyse the shape of the rooftop. Using K-Means clustering the number of Hough lines were reduced to 4 to 6 to outline the rooftop and obstacle boundaries.
Applying Contour on the rooftop and moving around the contour in a clockwise direction each pixel and its surroundings was marked as rooftop area.
After applying Hough Transform in combination with K-Means clustering, the rooftop area was divided into different regions. Checking the intensity of different patches, the area was marked as a rooftop area or not.
- The whole region is on top of the pyramid (zoom=0) covered by 256x256 pixels tile,every lower zoom level resolution is always divided by two.
- At every zoom level, there is Meter per pixel value which gives distance in meters according to the difference in pixel values.
-
Corners and Canny: Where corners and Canny results were overlapping those corners were selected. The problems with corners that they can’t be accessed in a localized manner. To draw a polygon out of that was impossible.
-
Canny and Contours: Contours can be accessed in a clockwise manner. On two images, Canny was applied. One is edge sharpened image and the other is canny edge map image. Contours in Edge sharpened the image using threshold gives rooftop boundaries. Contours on canny edge map using threshold gives obstacle boundaries on the rooftop. Combining both the results and plotting it on a white patch gives the exact rooftop optimal area for solar panel placement.