The script finds you the edges (or corners) of the conveyors images. One can see the algorithm bellow:
- Get the Image from the user.
- Apply a Gaussian Filter that has big window size.
- Apply Otsu's Method to make the image binary.
- Firstly dilate, and then erode the binary image to remove unnecessary objects.
- Use Canny's Algorithm to detect the borders of the remaining objects.
- Use Hough transform to find line ones in that borders.
- Put the lines that is found using Hough transform to the original image.
As a first step, clone this repository into your host machine.
~$ cd ConvayorBandEdgeDetection # The directory of the repo in your host machine.
~$ virtualenv . # Create a virtual environment.
~$ source bin/activate # Activate the virtual environment. (if GNU/Linux)
(venv) ~$ pip install -r requirements.txt # Install the requirement modules.
# Installation has completed.
(venv) ~$ python detect_edges.py --inputFile file/path/to/image.jpg
# Since it is a OpenCV window, you can close it with pressing ESC.
(venv) ~$ deactivate # To deactivate the virtual environment.