Skip to content

Seyya/P3_semester_project

Repository files navigation

MTA18338 semester project

This is the GitHub repository of MTA18338's semester project for Autumn 2018. This project requires a camera to run. The program detects markers created for this project (use e.g. marker_test1.png for testing), so these have to be printed in order to experience the full functionality.

To run the program, first run server.py, then cv2Main.py, then place markers in front of the camera for detection and watch the displayed map update with the position of the markers.

The repository consists of Client.py (the file that adds client functionality), Server.py (adds Server functionality), folders of the map and template images, the marker generator (for creating new markers), alexandria.py (the library of basic iamge processing functions), this readme file and finally the cv2Main.py file (the main program/runnable python file).

The program works by loading the camera feed and then analyzing it using edge detection (Canny) and then finding contours for square objects (the markers generated by marker_generator). If it finds any, the program then warps the markers to make them quadratic using getPerspectiveTransform and warpPerspective and compares them to a database of saved templates (in the templates folder) using meanSquaredError. Each template gets rotated in 90 degree ingrements using warpAffine. If any match, the client sends the coordinates of the found marker(s) to the server, the server updates the map by drawing circles at the coordinates and sends it back to the client for display.

Instructions for running the program

  1. Run server.py
  2. Change directory in cv2Main.py on line 13 to where your Client folder is located
  3. Run cv2Main.py
  4. Input server IP address in console (server.py gives IP address in console)
  5. Put marker in front of camera so it can detect an object (needs to be printed out first, templates can be found in templates)

For the Programming of Complex Software Systems Course

The file contribution_by_group_members.txt references the server-client functionality and the file link_to_github.txt contains a link to the repository.

About

This be our project

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 5

Languages