This project aims to detect the position of the sun in images. The code uses OpenCV-Python-Utilities library to find the brightest point of an image (sun), displays the steps and returns the center coordinates of the brightest point found. The function uses two methods; the minMax method and the robust method to find the brightest point. They work differently but generally the minMax method is better. The robust method is returned in case it didn't find anything and the distance from the minMax center to the previous center is more than 50px. This avoids the center to be at an entirely different location than the previous center was, which would be wrong. The code also includes a function that writes data to an excel file.
The project can be used to detect the position of the sun in images.
The project requires Python 3.x and OpenCV-Python-Utilities library.
- Install Python 3.x.
- Install OpenCV-Python-Utilities library.
- Clone this repository.
- Run main.py.
- The program will read all images from a specified directory.
- The program will detect the position of the sun in each image.
- The program will write data to an excel file.
This project provides a simple way to detect the position of the sun in images using OpenCV-Python-Utilities library. It can be used for various applications such as solar panel tracking, weather forecasting, and more.
Following images show some steps the program performs on the images.