Solar power is the process of conversion of sunlight energy to electrical energy. Photovoltaic cells present on the solar panels convert the sunlight energy to Direct current and then an inverter converts it to Alternative current source that is used in a household. Solar energy has several benefits ranging from habitat conservation to combat climate change. It is also the cheapest and reliable form of energy. Once installed, the solar panels can be sued up to 20-25 years with minimal maintenance. However, in India people hesitate to solar panels as they have to go through a lot of processes. The company will send their personnel and they will take each measurement and then build a report them. Sometimes, they have to take multiple visits too. It takes a lot amount of time and wastage of money too. It is also impossible for an industry to individually analyze an area by surveying the solar potential of every house. Technology like Image Processing and Computer Vision plays a pivotal role to overcome this challenge.
Many works have been done in foreign countries to automate the solar power analysis of an area. In the USA, Project Sunroof has been launched by Google to overcome this problem. They have used 3D mapping technology alongwith a high-quality satellite map that is available for the USA. Still, their technology is limited to forty-two cities of USA only. Therefore, there is a need to create a more generalized solution that can adapt well to many situations.
In this paper, we employ several algorithms to address the problem of rooftop detection. Our main contributions are:
We proposed an approach to segment out optimal rooftop area for solar panel placement in India where the image quality of satellite image is very low.
We considered several types of rooftop to learn the intra-class variations and to evaluate our method. Our final output provides an approximate analysis of area that can be used for solar panel placement. Our solution also layouts at which angles solar panels should be placed for maximum solar output.
2 Related Work
There are several recent papers that have addressed the problems of identification of building rooftops , , , , most of them are based on 3D reconstruction, which uses Fast Graph search , GIS maps and other topology based automatic modeling.  identified the rooftops using a single remote sensing image compared to a stereo-based approach. Markov Random Field and projective geometry were used to detect rooftops accurately.
Work has been done using LiDAR technology using Object-based  method to localize rooftops over an area. LiDAR technology automatically extracted building footprints and segment out the rooftop planes but this technology is very expensive and everyone could not afford to do that. Using Spectral Graph theory , automatic building detection has been done but that’s also done over the USA dataset. Moreover, the houses in the USA have slanted rooftops whereas in India the rooftops are planes. Many works have been done on building detection and its 3D modeling in the USA but our method automatically detects the optimal area in case of Indian rooftops. The above methods failed miserably in case of planar rooftops. We explored the area of obstacle identification in the rooftop area using Satellite imagery and thus marks out the area available for solar power generation.
3 Problem Formulation
Solar panels placement in case of India is very different as compared to the USA. In the USA, Google Satellite Maps can be zoomed up to level 21 and they also have a 3D mapping that helps to localize rooftops as well as obstacles(e.g. Water tanks, AC Condenser units, etc.) whereas in India the maps can be zoomed up to level 20 only with no 3D mapping. Example of Google Satellite map at highest zoom level in the USA and in India is shown in Fig.1 below. From the figure, we can see the quality of maps in the USA as compared to India. While we can visually mark out the optimal area for solar panel placement in the USA, in India we can’t even crop out the exact rooftop visually. Therefore, our solution focusses on detection of the usable rooftop area of a building as well as to maximize the solar power generation by orienting solar panels at a perfect angle.
The manually collected Indian aerial rooftop dataset consists of all types of variants. We considered all the possibilities of the types of rooftop obstacles and also different rooftop sizes. Currently, we have tested our algorithm on 50 different types of rooftops. Overview of the dataset is shown in the diagram Fig.2.
5 Proposed Approaches
In this section, we discuss the proposed framework that is used for optimal rooftop detection from the above rooftop images. The devised architecture used to solve the problem is described as follows:
5.1 Aerial Rooftop Detection
5.1.1 Watershed Segmentation
This algorithm is mainly applied when we want to segment out objects-of-interest that are close to each other, that is their edges touch. It is based on the marker-based algorithm. It labels the region sure as foreground and background and the region not sure of as zero. Then, it updates the labels as segmentation procedure proceeds. It is an interactive segmentation process. It was used to count the number of buildings and segment out rooftop locations from the map. The algorithm was giving many false positives as depicted in Fig. 3.
5.1.2 Gabor Filter
It analyzes the region of interest and detects whether there is any specific frequency content in a particular direction is present or not.
This procedure of segmentation is based on Gaussian distribution technique. Gaussian Mixture Models(GMM) assumes all data points are a combination of Gaussian distribution functions. Gabor filter enhances one region relative to another depending on the frequency and theta values. After applying this filter, two GMMs were fit in the image histogram to separate out foreground and background. The output after applying two models is shown in Fig.4.
5.1.3 Active Contours
It is an iterative flow of gradient vector from the point of initiation in all directions. It has a resistance of bending and stretching towards object boundaries. Hence, in our case it successfully detects the obstacles present inside the roof as well as mark the boundaries too. The result of Active Contour applied on edge sharpened image is shown in Fig.5.
5.1.4 Adaptive Canny Edge Detection
Based on the comparative analysis of edge detection algorithms, Canny edge detection algorithm outperforms others. Now, adaptive canny edge algorithm models itself based on the image.
The hysteresis threshold, in this case, is adaptive relevant to the image. The upper and lower threshold is calculated by using mean and variance of an image intensity. The output of the Canny Edge Detection algorithm also contains many false positives and it was also very haphazard as shown in Fig.6.
5.2 Polygon Shape Approximation
The shape of the polygon that we get from Active Contours as output is very much distorted. We devised the following procedure to obtain a perfect polygon.
5.2.1 1) Hough Transform
5.2.2 2) Region-based Polygon filling
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. If the mean intensity is greater than the threshold value, then that region is marked as a rooftop area and it is filled with black color on a different white image. The approximate shape of a rooftop after applying Region-based filling is shown in Fig.7.
5.3 Optimal Rooftop Area
Using single feature characteristic of an image is not much help to carve out the optimal rooftop area. It always leads to many false positives and it was not able to detect obstacles present inside the rooftops. Therefore, we employed two features at the same time to get the exact rooftop area. The two methods which we used to get the shape of the rooftop is as follows:
5.3.1 1) Harris Corners & Adaptive Canny
The locations at which Harris corners and Canny Edge detection feature points overlap, those features were selected. The problems occurred with Harris corners as they can’t be accessed in a localized manner. Therefore, to draw an exact polygon shape was not possible.
5.3.2 2) Adaptive Canny & Contours
The output of Contours and Canny Edge features are in a clockwise manner. We applied Contours on two images. One is Bilateral Edge sharpened and the other is the Canny Edge map. Contours in Bilateral Edge sharpened image provides us the rooftop boundaries and in canny edge map, it gives obstacle boundaries present on the rooftop. Combining both the results and plotting it on a white patch gives the exact rooftop optimal area for solar panel placement.
6 Experiments and Results Analysis
6.0.1 Edge Detection Algorithms
6.0.2 Solar Panel Placement
We considered solar panels patches of 5x1, 4x1, 3x1. We also took into account the orientation angle required for maximum solar power output at a certain longitude and latitude. After placing solar panels horizontally, the main challenge was to rotate the panels with a certain angle, because, it will go out of the rooftop. For rotation of patches, I took a region of interest then rotated it by the amount of angle required. Then, we iterated along the breadth and length and evaluated the mean intensity of the region of interest using line iterator. If the mean intensity is 255, then the area is available for solar panel placement. The experimental results on the rooftops dataset are shown in the Fig. 8.
7 Conclusion and Future Work
The paper presented several approaches on which comprehensive analysis was done to segment out optimal rooftop area and placement of solar panels too. In India, due to the low quality of satellite images, it is very hard to analyze any location whether an area has solar potential or not. Many people are also not aware of how much solar power their rooftop can generate. Our solution can provide an analysis of a rooftop remotely and it will motivate people to use more and more renewable energy rather totally dependent on the non-renewable sources of energy. We focused on the Adaptive Edge Detection and Contours to segment out rooftop boundaries and obstacles present inside them accurately. Our approach targets the placement of solar panels and provides an approximate analysis of the solar potential of a building or a house. Previous works done on solar panels placement was done mainly in foreign countries where they have 3D mapping too.
In the future, the authors aim to improve the approach by using Deep learning approaches to learn the substantial features. We are currently increasing our dataset for supervised classification of rooftop detection from Satellite images using Mask R-CNN.  We are also considering rendering 3D depth reconstruction from a single image to improvise our analysis. For improvement of edge detection and segmentation, we are currently exploring Gradient-based Edge-Aware filters  and Deep Active Contours respectively.
-  Dong-Min Woo, Dong-Chul Park, Seung-Soo Han, and Quoc-Dat Nguyen, ”Building Extraction Using Fast Graph Search”.
-  Ildiko SUVEG, George VOSSELMAN, ”3D RECONSTRUCTION OF BUILDING MODELS”, TU Delft, Netherlands.
-  Antonis Katartzis and Hichem Sahli, ”A Stochastic Framework for the Identification of Building Rooftops Using a Single Remote Sensing Image”, IEEE TRANSACTIONS ON GEOSCIENCE AND REMOTE SENSING, VOL. 46, NO. 1, JANUARY 2008,
-  Y. Huang, B. Yu, Z. Hu, J. Wu and B. Wu, ”Locating suitable roofs for utilization of solar energy in downtown area using airborne LiDAR data and object-based method: A case study of the Lujiazui region, Shanghai,” 2012 Second International Workshop on Earth Observation and Remote Sensing Applications, Shanghai, China, 2012, pp. 322-326. 10.1109/EORSA.2012.6261192
-  L. Zhang and X. Chen, ”Topology-based automatic 3D modeling from multiple images,” 2014 Sixth International Conference on Wireless Communications and Signal Processing (WCSP), Hefei, 2014, pp. 1-6. doi: 10.1109/WCSP.2014.6992055.
Gregoris Liasis, Stavros Stavrou, ”Satellite images analysis for shadow detection and building height estimation”, ISPRS Journal of Photogrammetry and Remote Sensing, Volume 119, September 2016, Pages 437-450. doi: 10.1016/j.isprsjprs.2016.07.006
-  K. Ni and Y. Wu, ”Active contours driven by novel fitting term for image segmentation,” in Electronics Letters, vol. 53, no. 13, pp. 854-856, 22 6 2017. doi: 10.1049/el.2017.1531.
-  Basu, S., Mukherjee, D.P., Acton, S.T.: Active contours and their utilization at image segmentation. In: Proceedings of Slovakian-Hungarian Joint Symposium on Applied Machine Intelligence and Informatics Poprad., pp. 313–317 (2007).
-  Airouche, M., Bentabet, L., & Zelmat, M. Image Segmentation Using Active Contour Model and Level Set Method Applied to Detect Oil Spills.Proceedings of the World Congress on Engineering 2009 Vol I WCE 2009, July 1 - 3, 2009, London, U.K.
-  Hossain, F., & Rahman, M.R. (2016). Dynamic Thresholding based Adaptive Canny Edge Detection. International Journal of Computer Applications (0975 – 8887) Volume 135 – No.4, February 2016. doi: 10.5120/ijca2016908337
-  E. Pakizeh and M. Palhang, ”Building detection from aerial images using Hough transform and intensity information,” 2010 18th Iranian Conference on Electrical Engineering, Isfahan, 2010, pp. 532-537. doi: 10.1109/IRANIANCEE.2010.5507013.
-  M. Wang, S. Yuan and J. Pan, ”Building detection in high resolution satellite urban image using segmentation, corner detection combined with adaptive windowed Hough Transform,” 2013 IEEE International Geoscience and Remote Sensing Symposium - IGARSS, Melbourne, VIC, 2013, pp. 508-511. doi: 10.1109/IGARSS.2013.6721204.
-  Katiyar and Arun, ”Comparative analysis of common edge detection techniques in context of object extraction,” IEEE Transactions of Geoscience and Remote Sensing, vol. 50, pp. pp.68 2014.
-  G.T Srivanshan and Dr. C. Chandrasekar “A Comparison of Various Edge Detection Techniques used in Image Processing” International Journal of Computer Science & I.T (IJCSIT),Vol9,No 1,Sep 2012.
-  Palvi Rani and Poonam Tanwar (2013),” A Nobel hybrid approach for edge detection,” International academic paper of Computer Science & manufacturing assessment Vol.8, 827-938.
-  D. K. Chaudhary, R. Lal, N. Kashyap and T. Choudhury, ”Hybrid edge detection technique for digital images,” 2016 International Conference on Computing, Communication and Automation (ICCCA), Noida, 2016, pp. 1116-1121. doi: 10.1109/CCAA.2016.7813883.
-  He, Kaiming et al. Mask R-CNN. 2017 IEEE International Conference on Computer Vision (ICCV) (2017): 2980-2988.
-  Ghaffarian, S., & Ghaffarian, S. (2014). Automatic Building Detection Based on Supervised Classification Using High Resolution Google Earth Images.
-  Ashutosh Saxena, Sung H. Chung, and Andrew Y. Ng. 2008. 3-D Depth Reconstruction from a Single Still Image. Int. J. Comput. Vision 76, 1 (January 2008), 53-69. DOI=http://dx.doi.org/10.1007/s11263-007-0071-y.
Xu, L., Ren, J., Yan, Q., Liao, R. and Jia, J.. (2015). Deep Edge-Aware Filters. Proceedings of the 32nd International Conference on Machine Learning, in PMLR 37:1669-1678.
-  Rupprecht, C., Huaroc, E., Baust, M., Navab, N.: Deep active contours. arXiv preprint arXiv:1607.05074 (2016).
-  A. Zakharov, A. Tuzhilkin and A. Zhiznyakov, ”Automatic building detection from satellite images using spectral graph theory,” 2015 International Conference on Mechanical Engineering, Automation and Control Systems (MEACS), Tomsk, 2015, pp. 1-5. doi: 10.1109/MEACS.2015.7414937.