# Source code
This folder stores the source code of my bachelor thesis based on implementation of 2 ellipse detection methods:
[arc adjacency matrix based method](https://ieeexplore.ieee.org/document/8972900)
and [arc-support line segment method](https://ieeexplore.ieee.org/document/8802276).
For more information about the source code see README files in their respective folders:
[Arc-matrix](Arc-matrix/README.md) and [Arc-support](Arc-support/README.md)



## setup

### Docker
This folder holds a Dockerfile for easy setup, by following these steps:
```
#following commands may require priviledged status.
docker build -t 'name_of_the_container' 'this_folder'
docker run -it 'name_of_the_container'
```
DISCLAIMER! if the docker doesn't build correctly, make sure that following files have Linux based line endings.: [arc-matrix-build](Arc-matrix/build/build.sh),[arc-matrix-run](Arc-matrix/build/run.sh), [arc-support-build](Arc-support/build/build.sh) and [arc-support-run](Arc-support/build/run.sh).

The dockerfile installs all the dependencies for the code and builds it.
The usage of the detectors can be found in the README files in their respective folders.

### Ubuntu 20.04
The implementation requires libraries OpenCV and Eigen3.
Both libraries can be installed using the commands used in the dockerfile:
```
#install OpenCV
RUN mkdir libraries && cd libraries && wget -O opencv.zip https://github.com/opencv/opencv/archive/4.x.zip \
	&& unzip opencv.zip \
	&& mv opencv-4.x opencv && mkdir -p build_OCV && cd build_OCV && cmake ../opencv && make -j4 && make install && cd ..

#install Eigen3
RUN git clone https://gitlab.com/libeigen/eigen.git && mkdir build_eigen && cd build_eigen && cmake ../eigen && make install
```

